Skip to content

echonet: chain parent hash from in-memory echonet blocks#13308

Merged
ron-starkware merged 1 commit intomainfrom
ron/echonet/parent-hash-from-last-saved
Mar 26, 2026
Merged

echonet: chain parent hash from in-memory echonet blocks#13308
ron-starkware merged 1 commit intomainfrom
ron/echonet/parent-hash-from-last-saved

Conversation

@ron-starkware
Copy link
Copy Markdown
Contributor

@ron-starkware ron-starkware commented Mar 17, 2026

Resolve parent_block_hash from the latest in-memory stored block and fall back to the initialization base hash only when no blocks are stored.

Made-with: Cursor


Note

Medium Risk
Changes block linkage (parent_block_hash) used by downstream consumers; incorrect resolution could break chain continuity in stored blocks, though the change is localized and has a clear fallback.

Overview
Echo Center now sets parent_block_hash for newly stored blocks by looking up the most recent in-memory block in SharedContext, instead of deriving it deterministically from the configured base.

This refactors DeterministicChain to expose compute_current_hash() (and base_block_hash_hex) and updates block/state_update transformations to use the new API, removing the prior combined current/previous-hash helper.

Written by Cursor Bugbot for commit cecc177. This will update automatically on new commits. Configure here.

@reviewable-StarkWare
Copy link
Copy Markdown

This change is Reviewable

Copy link
Copy Markdown
Contributor Author

ron-starkware commented Mar 17, 2026

@ron-starkware ron-starkware force-pushed the ron/echonet/parent-hash-from-last-saved branch from 8d3ecbb to adc1a80 Compare March 17, 2026 13:01
@ron-starkware ron-starkware marked this pull request as ready for review March 17, 2026 13:01
@ron-starkware ron-starkware self-assigned this Mar 17, 2026
Comment thread echonet/echo_center.py Outdated
Comment thread echonet/echo_center.py
@ron-starkware ron-starkware force-pushed the ron/echonet/block-fields-from-fgw branch from 1c03422 to de726bc Compare March 19, 2026 14:40
@ron-starkware ron-starkware force-pushed the ron/echonet/parent-hash-from-last-saved branch from adc1a80 to a43ba14 Compare March 19, 2026 14:40
Copy link
Copy Markdown
Contributor

@ayeletstarkware ayeletstarkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ayeletstarkware made 2 comments.
Reviewable status: 0 of 1 files reviewed, 2 unresolved discussions (waiting on ron-starkware).


echonet/echo_center.py line 371 at r1 (raw file):

        }

    def _resolve_parent_block_hash(self) -> str:

what's the difference between this and the original func compute_current_and_previous_hash?

Code quote:

def _resolve_parent_block_hash(self) -> str:

Comment thread echonet/echo_center.py Outdated
Copy link
Copy Markdown
Contributor Author

@ron-starkware ron-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ron-starkware made 2 comments.
Reviewable status: 0 of 1 files reviewed, 2 unresolved discussions (waiting on ayeletstarkware).


echonet/echo_center.py line 371 at r1 (raw file):

Previously, ayeletstarkware (Ayelet Zilber) wrote…

what's the difference between this and the original func compute_current_and_previous_hash?

In compute_current_and_previous_hash it calculated the parent hash by doing +1 to the previous parent hash. Here, it takes the hash by looking at the previous block's hash (or the base block hash if there isn't one in the echonet storage)

Comment thread echonet/echo_center.py Outdated
@ron-starkware ron-starkware force-pushed the ron/echonet/block-fields-from-fgw branch from de726bc to 3f5471f Compare March 24, 2026 10:53
@ron-starkware ron-starkware force-pushed the ron/echonet/parent-hash-from-last-saved branch 2 times, most recently from 34ac079 to df7b475 Compare March 24, 2026 10:54
Copy link
Copy Markdown
Contributor

@ayeletstarkware ayeletstarkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ayeletstarkware reviewed 1 file and all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on matanl-starkware).

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Comment thread echonet/echo_center.py
@ron-starkware ron-starkware force-pushed the ron/echonet/block-fields-from-fgw branch from 3f5471f to aced81c Compare March 24, 2026 19:28
@ron-starkware ron-starkware force-pushed the ron/echonet/parent-hash-from-last-saved branch from df7b475 to 3f5e0e3 Compare March 24, 2026 19:28
Copy link
Copy Markdown
Collaborator

@matanl-starkware matanl-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matanl-starkware reviewed 1 file and all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on ayeletstarkware).

@ron-starkware ron-starkware force-pushed the ron/echonet/block-fields-from-fgw branch from aced81c to e83e190 Compare March 25, 2026 20:15
@ron-starkware ron-starkware force-pushed the ron/echonet/parent-hash-from-last-saved branch from 3f5e0e3 to a7e97ba Compare March 25, 2026 20:15
@ron-starkware ron-starkware changed the base branch from ron/echonet/block-fields-from-fgw to graphite-base/13308 March 26, 2026 13:30
@ron-starkware ron-starkware force-pushed the ron/echonet/parent-hash-from-last-saved branch from a7e97ba to cecc177 Compare March 26, 2026 13:32
@ron-starkware ron-starkware changed the base branch from graphite-base/13308 to main March 26, 2026 13:32
@ron-starkware ron-starkware enabled auto-merge March 26, 2026 13:34
Copy link
Copy Markdown
Contributor Author

@ron-starkware ron-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ron-starkware resolved 1 discussion.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on ron-starkware).

@ron-starkware ron-starkware added this pull request to the merge queue Mar 26, 2026
Merged via the queue into main with commit 12fec5d Mar 26, 2026
26 of 49 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants