Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New state root calculation using partial MPTs #91

Merged
merged 7 commits into from
Jun 26, 2024

Conversation

thedevbirb
Copy link
Contributor

@thedevbirb thedevbirb commented Jun 20, 2024

This PR allows to calculate the new state root for the fallback block using the approach described in this discussion. Some noteworthy things about it (I'm going to report them in the discussion as well, once everything is finalized):

  • the trace_callMany RPC endpoint does not show every touched account state and balance decreases due to gas payments. This has also been highlighted in a stackexchange question.
    As such we're falling back on iterative calls of debug_traceCall, supported by all clients, using state overrides. NOTE: at the moment not every client seems to support state overrides, like Nethermind and Besu
  • not every execution client has the same interface for state overrides. For example, Reth and Geth want 32 bytes for both keys and values of the state_diff hashmap, as shown here. Erigon instead requires values to be unsigned integers of 256 bits (as shown here which cannot be obtained by deserialisation of big-endian 32 bytes with leading zero, because of this check in the uint256 dependency library. Maybe there is a workaround for this but I haven't experimented a lot yet.

Update: in the end the approach adopted has been the one in #93, however this PR keeps some of the trace call functionality described above

@thedevbirb thedevbirb added C: bolt-sidecar Component: bolt-sidecar T: feature Type: Feature labels Jun 20, 2024
@merklefruit merklefruit force-pushed the feat/create-fallback-block branch from dbe07b2 to 9983438 Compare June 22, 2024 12:37
thedevbirb and others added 6 commits June 22, 2024 14:39
Co-authored-by: nicolas <merklefruit@users.noreply.github.com>
…t wip

Co-authored-by: nicolas <merklefruit@users.noreply.github.com>
Co-authored-by: nicolas <merklefruit@users.noreply.github.com>
Co-authored-by: nicolas <merklefruit@users.noreply.github.com>
Base automatically changed from feat/create-fallback-block to feat/sidecar/builder-api June 24, 2024 07:27
@merklefruit merklefruit marked this pull request as ready for review June 26, 2024 14:47
@mempirate mempirate merged commit 8127c0e into feat/sidecar/builder-api Jun 26, 2024
@mempirate mempirate deleted the feat/partial-mpt branch June 26, 2024 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: bolt-sidecar Component: bolt-sidecar T: feature Type: Feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants