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

[Feature] Trim an SMT based on a read list #1370

Open
cffls opened this issue Oct 28, 2024 · 0 comments
Open

[Feature] Trim an SMT based on a read list #1370

cffls opened this issue Oct 28, 2024 · 0 comments
Labels
enhancement New feature or request zero zkEVM Ticket specific to Polygon Zero zkEVM

Comments

@cffls
Copy link

cffls commented Oct 28, 2024

Create a function that, given a read list, trims off irrelevant trie nodes (the ones not in the list) from a SMT by turning them into hash nodes. The signature will be something like below:

func TrimSMTWithReadList(s *SMT, readList TxnInfo) (s *SMT, error)

TxnInfo:

type TxnInfo struct {
Traces map[libcommon.Address]*TxnTrace `json:"traces,omitempty"`
Meta TxnMeta `json:"meta,omitempty"`
}

The implementation will be similar to:

func BuildSMTfromWitness(w *trie.Witness) (*SMT, error) {

To verify the correctness of the implementation, the state root of the trimmed SMT should match to that of original SMT.

@cffls cffls added enhancement New feature or request zero zkEVM Ticket specific to Polygon Zero zkEVM labels Oct 28, 2024
@mandrigin mandrigin added this to the v2.61.x (zero prover) milestone Oct 30, 2024
@mandrigin mandrigin removed this from the v2.61.x (forkid.13) milestone Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request zero zkEVM Ticket specific to Polygon Zero zkEVM
Projects
None yet
Development

No branches or pull requests

2 participants