Some fixes for bal-devnet-3 (#34090)

Rename `balHash` to `blockAccessListHash` in json encoding of block header.  Fix miner panic when attempting to create pre-amsterdam blocks.
This commit is contained in:
Josh Klopfenstein 2026-03-26 08:11:25 -05:00 committed by GitHub
parent 8f361e342c
commit 0253db6ce5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 10 additions and 6 deletions

View file

@ -102,7 +102,7 @@ type Header struct {
RequestsHash *common.Hash `json:"requestsHash" rlp:"optional"`
// BlockAccessListHash was added by EIP-7928 and is ignored in legacy headers.
BlockAccessListHash *common.Hash `json:"balHash" rlp:"optional"`
BlockAccessListHash *common.Hash `json:"blockAccessListHash" rlp:"optional"`
// SlotNumber was added by EIP-7843 and is ignored in legacy headers.
SlotNumber *uint64 `json:"slotNumber" rlp:"optional"`

View file

@ -37,7 +37,7 @@ func (h Header) MarshalJSON() ([]byte, error) {
ExcessBlobGas *hexutil.Uint64 `json:"excessBlobGas" rlp:"optional"`
ParentBeaconRoot *common.Hash `json:"parentBeaconBlockRoot" rlp:"optional"`
RequestsHash *common.Hash `json:"requestsHash" rlp:"optional"`
BlockAccessListHash *common.Hash `json:"balHash" rlp:"optional"`
BlockAccessListHash *common.Hash `json:"blockAccessListHash" rlp:"optional"`
SlotNumber *hexutil.Uint64 `json:"slotNumber" rlp:"optional"`
Hash common.Hash `json:"hash"`
}
@ -93,7 +93,7 @@ func (h *Header) UnmarshalJSON(input []byte) error {
ExcessBlobGas *hexutil.Uint64 `json:"excessBlobGas" rlp:"optional"`
ParentBeaconRoot *common.Hash `json:"parentBeaconBlockRoot" rlp:"optional"`
RequestsHash *common.Hash `json:"requestsHash" rlp:"optional"`
BlockAccessListHash *common.Hash `json:"balHash" rlp:"optional"`
BlockAccessListHash *common.Hash `json:"blockAccessListHash" rlp:"optional"`
SlotNumber *hexutil.Uint64 `json:"slotNumber" rlp:"optional"`
}
var dec Header

View file

@ -217,8 +217,10 @@ func (miner *Miner) generateWork(ctx context.Context, genParam *generateParams,
}
postMut.Merge(mut)
work.accessList.AccumulateMutations(postMut, uint16(work.tcount)+1)
work.accessList.AccumulateReads(work.state.Reader().(state.StateReaderTracker).GetStateAccessList())
if work.accessList != nil {
work.accessList.AccumulateMutations(postMut, uint16(work.tcount)+1)
work.accessList.AccumulateReads(work.state.Reader().(state.StateReaderTracker).GetStateAccessList())
}
}
if requests != nil {
reqHash := types.CalcRequestsHash(requests)
@ -348,7 +350,9 @@ func (miner *Miner) prepareWork(ctx context.Context, genParams *generateParams,
if miner.chainConfig.IsPrague(header.Number, header.Time) {
mut.Merge(core.ProcessParentBlockHash(header.ParentHash, env.evm))
}
env.accessList.AccumulateMutations(mut, 0)
if env.accessList != nil {
env.accessList.AccumulateMutations(mut, 0)
}
return env, nil
}