From 710ffb03adf264a13c017d34004a7046750fdb27 Mon Sep 17 00:00:00 2001 From: Jared Wasinger Date: Sun, 5 Apr 2026 15:25:34 -0400 Subject: [PATCH] core: perform BAL validation against gas limit for blocks which come with access lists Co-authored-by: spencer --- core/block_validator.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/block_validator.go b/core/block_validator.go index c604238ef8..6d54f73446 100644 --- a/core/block_validator.go +++ b/core/block_validator.go @@ -117,14 +117,16 @@ func (v *BlockValidator) ValidateBody(block *types.Block) error { // TODO: verify that this check isn't also done elsewhere return fmt.Errorf("block access list hash not set in header") } + // if the block does not come with an access list, it will be recomputed + // as part of execution and validated against the header's acess list hash. if block.AccessList() != nil { if *block.Header().BlockAccessListHash != block.AccessList().Hash() { return fmt.Errorf("access list hash mismatch. local: %x. remote: %x\n", block.AccessList().Hash(), *block.Header().BlockAccessListHash) } else if err := block.AccessList().Validate(len(block.Transactions())); err != nil { return fmt.Errorf("invalid block access list: %v", err) + } else if err := block.AccessList().ValidateGasLimit(block.GasLimit()); err != nil { + return fmt.Errorf("invalid block access list: %v", err) } - } else { - //panic("TODO: implement local access list construction path if importing a block without an access list") } } else { // if experimental.bal is not enabled, block headers cannot have access list hash and bodies cannot have access lists.