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

Add zero tracer #137

Merged
merged 1 commit into from
Feb 16, 2024
Merged

Add zero tracer #137

merged 1 commit into from
Feb 16, 2024

Conversation

cffls
Copy link

@cffls cffls commented Feb 15, 2024

Zero tracer is a specific type of transaction tracer that records states read and written by a transaction.
The output of this tracer could be used together with block witness to generate intermediate block states in-between transactions.

Additional resources

Trace model class diagram

classDiagram
    class ContractCodeUsage {
        *Hash Read
        HexBytes Write
    }
    
    class TxnTrace {
        *uint256 Balance
        *uint256 Nonce
        Hash[] StorageRead
        map[Hash]*uint256 StorageWritten
        *ContractCodeUsage CodeUsage
        *bool SelfDestructed
        map[Hash]struct StorageReadMap
    }
    
    class TxnMeta {
        HexBytes ByteCode
        HexBytes NewTxnTrieNode
        HexBytes NewReceiptTrieNode
        uint64 GasUsed
    }
    
    class TxnInfo {
        map[Address]*TxnTrace Traces
        TxnMeta Meta
    }
    
    class CombinedPreImages {
        HexBytes Compact
    }
    
    class TriePreImage {
        CombinedPreImages Combined
    }
    
    class BlockTrace {
        TriePreImage TriePreImage
        TxnInfo[] TxnInfo
    }

    TxnTrace --> ContractCodeUsage
    TxnInfo o-- TxnTrace
    TxnInfo --> TxnMeta
    BlockTrace --> TriePreImage
    BlockTrace o-- TxnInfo
    TriePreImage --> CombinedPreImages
Loading

Zero tracer is a specific type of transaction tracer that records states read and written by a transaction.
@cla-bot cla-bot bot added the cla-signed label Feb 15, 2024
@mandrigin
Copy link
Collaborator

@cffls that is for the type-2 zero?

@cffls
Copy link
Author

cffls commented Feb 16, 2024

Yes, this is for type-2 zero.

@mandrigin mandrigin merged commit acb3c87 into 0xPolygonHermez:zkevm Feb 16, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants