Skip to content

feat: align contract code storage cost with go-ethereum #821

@yihuang

Description

@yihuang

https://github.com/ethereum/go-ethereum/blob/master/core/state/statedb.go#L1328

go-ethereum store contract code in rawdb, the cost is smaller than store in iavl or MPT tree, and the default gas model is also designed according that assumption, the code storage charge 200 gas per byte, while SSTORE charge 20000 for 32bytes.

Proposal

Store contract code in rawdb rather than merkle state. We also need to implement a state sync extension to include it in state sync snapshot.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions