Skip to content

Use prestate mode cast run #12719

@mattsse

Description

@mattsse

Component

Cast

Describe the feature you would like

solution for #12711

currently we replay the entire block so that we get the proper state for a txs in a block

however, if the provider supports the prestate debug_traceTransaction then we get all the accessed state for that transaction which we can then commit into the db before executing the transaction.

this is similar to quick mode where we can bypass this entirely:

// Set the state to the moment right before the transaction
if !self.quick {

however not everyone has access to the debug_ api or maybe it's not supported by the chain's client

so we could do this optimistically if the trace request succeeds

we like need some helpers for this:

fn commit(&mut self, result: &mut RawCallResult) {

that operates just on the account->storage map (pre-state)

and ideally this is either opt-in or opt-out

Additional context

No response

Metadata

Metadata

Assignees

Labels

T-featureType: featureT-needs-triageType: this issue needs to be labelled

Type

No type

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions