New state root calculation using partial MPTs #91
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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):
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 Besustate_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 theuint256
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