1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-02-22 20:42:03 +00:00

TEMP: remove ACK sending, message retransmission and message sequence bit checks

- for tests of THP speed
[no changelog]
This commit is contained in:
M1nd3r 2024-08-23 11:12:12 +02:00
parent d45491b57b
commit e1f17dd576
2 changed files with 10 additions and 10 deletions

View File

@ -93,16 +93,16 @@ async def handle_received_message(
raise ThpError("Message is not encrypted. Ignoring")
# 2: Handle message with unexpected sequential bit
if seq_bit != ABP.get_expected_receive_seq_bit(ctx.channel_cache):
if __debug__:
log.debug(__name__, "Received message with an unexpected sequential bit")
await _send_ack(ctx, ack_bit=seq_bit)
raise ThpError("Received message with an unexpected sequential bit")
# if seq_bit != ABP.get_expected_receive_seq_bit(ctx.channel_cache):
# if __debug__:
# log.debug(__name__, "Received message with an unexpected sequential bit")
# await _send_ack(ctx, ack_bit=seq_bit)
# raise ThpError("Received message with an unexpected sequential bit")
# 3: Send ACK in response
await _send_ack(ctx, ack_bit=seq_bit)
# # 3: Send ACK in response
# await _send_ack(ctx, ack_bit=seq_bit)
ABP.set_expected_receive_seq_bit(ctx.channel_cache, 1 - seq_bit)
# ABP.set_expected_receive_seq_bit(ctx.channel_cache, 1 - seq_bit)
try:
await _handle_message_to_app_or_channel(

View File

@ -8,8 +8,8 @@ from trezor.wire.thp.writer import write_payload_to_wire_and_add_checksum
if TYPE_CHECKING:
from trezor.wire.thp.channel import Channel
MAX_RETRANSMISSION_COUNT = const(50)
MIN_RETRANSMISSION_COUNT = const(2)
MAX_RETRANSMISSION_COUNT = const(1)
MIN_RETRANSMISSION_COUNT = const(1)
class TransmissionLoop: