Skip to content

Misleading constant for EIP-2935 #32458

@0xMushow

Description

@0xMushow

Fixing misleading constant for EIP-2735 that's only used for testing in protocol_params.go.

HistoryServeWindow = 8192 // Number of blocks to serve historical block hashes for, EIP-2935.

This should be set to 8191. This constant is used in for verkle testing.

// getContractStoredBlockHash is a utility method which reads the stored parent blockhash for block 'number'
func getContractStoredBlockHash(statedb *state.StateDB, number uint64, isVerkle bool) common.Hash {
ringIndex := number % params.HistoryServeWindow
var key common.Hash
binary.BigEndian.PutUint64(key[24:], ringIndex)
if isVerkle {
return statedb.GetState(params.HistoryStorageAddress, key)
}
return statedb.GetState(params.HistoryStorageAddress, key)
}

This isn't used in the EIP-2735 implementation checks, because it uses the following bytecode, that indeed uses 0x1FFF here (8191)

HistoryStorageCode = common.FromHex("3373fffffffffffffffffffffffffffffffffffffffe14604657602036036042575f35600143038111604257611fff81430311604257611fff9006545f5260205ff35b5f5ffd5b5f35611fff60014303065500")

It was misleading when I was double checking this implementation.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions