echonet: Add echonet only reverts to resync triggers#13027
echonet: Add echonet only reverts to resync triggers#13027ron-starkware wants to merge 1 commit intoron/echonet/sequencer-manager-revertfrom
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
8ac12a1 to
528d975
Compare
528d975 to
f7dea84
Compare
e8414d4 to
5b181ac
Compare
f7dea84 to
3cb9436
Compare
3cb9436 to
d4ff84a
Compare
734ce83 to
888c39c
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
ayeletstarkware
left a comment
There was a problem hiding this comment.
@ayeletstarkware reviewed 6 files and all commit messages, and made 3 comments.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on ron-starkware).
echonet/echonet_types.py line 51 at r4 (raw file):
tx_hash: str failing_block_number: int rollback_block_number: int
Suggestion:
// Contains the tx...
failure_block_number: int
revert_target_block_number: intechonet/reports.py line 185 at r4 (raw file):
): lines.append( f"{tx_hash}: failing_bn={meta['failing_block_number']} "
Suggestion:
block_number
ayeletstarkware
left a comment
There was a problem hiding this comment.
@ayeletstarkware made 2 comments.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on ron-starkware).
echonet/resync.py line 63 at r4 (raw file):
candidates, key=lambda item: item[1] ) rollback_block = failing_tx_block
consider move to a helper function or add a comment above
Code quote:
for tx_hash, error in gateway_errors.items():
candidates.append(
(tx_hash, error["block_number"], f"Gateway error: {error['response']}")
)
for tx_hash, info in echonet_only_reverts.items():
candidates.append(
(
tx_hash,
info["block_number"],
f"Echonet-only revert: {info['error']}",
)
)
for tx_hash, block_number in sent_tx_hashes.items():
if block_number <= threshold_block:
candidates.append(
(
tx_hash,
block_number,
f"Still pending after >= {self._blocks_to_wait_before_failing_tx} blocks",
)
)
if not candidates:
return None
tx_hash_trigger, failing_tx_block, reason_trigger = min(
candidates, key=lambda item: item[1]
)
rollback_block = failing_tx_blockechonet/resync.py line 65 at r4 (raw file):
rollback_block = failing_tx_block if pending_min_block is not None: rollback_block = min(rollback_block, pending_min_block)
Suggestion:
// did not reach cende...
pending_min_block = min(sent_tx_hashes.values(), default=None)
rollback_block = (
min(failing_tx_block, pending_min_block)
if pending_min_block is not None
else failing_tx_block
)Made-with: Cursor
888c39c to
39a8c8d
Compare
5b181ac to
30ba4b2
Compare
ron-starkware
left a comment
There was a problem hiding this comment.
@ron-starkware made 5 comments and resolved 3 discussions.
Reviewable status: 0 of 6 files reviewed, 1 unresolved discussion (waiting on ayeletstarkware).
echonet/resync.py line 63 at r4 (raw file):
Previously, ayeletstarkware (Ayelet Zilber) wrote…
consider move to a helper function or add a comment above
Added comments explaining the whole flow (since it's 90% of the function did not move it to a separate one)
echonet/echonet_types.py line 51 at r4 (raw file):
tx_hash: str failing_block_number: int rollback_block_number: int
Done
echonet/reports.py line 185 at r4 (raw file):
): lines.append( f"{tx_hash}: failing_bn={meta['failing_block_number']} "
Done
echonet/resync.py line 65 at r4 (raw file):
rollback_block = failing_tx_block if pending_min_block is not None: rollback_block = min(rollback_block, pending_min_block)
Done, thanks
ayeletstarkware
left a comment
There was a problem hiding this comment.
@ayeletstarkware reviewed 6 files and all commit messages, made 1 comment, and resolved 1 discussion.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on ron-starkware).

echonet: Add echonet only reverts to resync triggers
Made-with: Cursor
echonet: log failing and rollback blocks on resync trigger
Made-with: Cursor
Note
Medium Risk
Changes core resync trigger/rollback behavior and the persisted report schema, which could cause unexpected rewind points or increased resync frequency if the new candidate selection logic is off.
Overview
Resync triggers are expanded from a single
block_numberto two block markers:failure_block_number(where the earliest failure was observed) andrevert_target_block_number(where the resync should rewind to), and this new shape is propagated throughshared_context,resync,transaction_sender, text reports, and the HTML report UI.ResyncPolicynow evaluates Echonet-only reverts alongside gateway errors and stale pending txs when selecting the earliest failure, and resync execution uses the computed rollback target (with repeated triggers advancing past the failing block). Gateway errors are also made cumulative across resyncs for reporting instead of being reset each epoch.Written by Cursor Bugbot for commit 39a8c8d. This will update automatically on new commits. Configure here.