Skip to content

Add StateExpiry hard forks and epoch logic #1

@0xbundler

Description

@0xbundler

There are two hard forks, the first hard fork support new tx, epoch0, epoch1, second hard fork support epoch rotate. we could delay state expiry, fix issues, and upgrade features between two hard forks.

STATE_EXPIRY_HARDFORK1_BLOCKNUM indicates start epoch1, STATE_EXPIRY_HARDFORK2_BLOCKNUM indicates start epoch2 and start epoch rotate by EpochPeriod.

Epoch definition, calculate block epoch by:

func getCurrentEpoch(block uint64) uint64 {
    if block < STATE_EXPIRY_HARDFORK1_BLOCKNUM {
        return 0
    } else if block < STATE_EXPIRY_HARDFORK2_BLOCKNUM {
        return 1
    } else {
        return (block - STATE_EXPIRY_HARDFORK2_BLOCKNUM) / EpochPeriod + 2
    }
}

EpochPeriod = 7,008,000.

When merge furture Verkle Tree, from N epoch for special upgrade.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions