mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-22 03:30:37 +00:00
Verify excessBlobGas (EIP-4844) (#8269)
This commit is contained in:
parent
75b0ba0c69
commit
e62e131a8e
@ -242,12 +242,18 @@ func (s *Merge) verifyHeader(chain consensus.ChainHeaderReader, header, parent *
|
||||
return consensus.ErrUnexpectedWithdrawals
|
||||
}
|
||||
|
||||
cancun := chain.Config().IsCancun(header.Time)
|
||||
if cancun {
|
||||
return misc.VerifyPresenceOfCancunHeaderFields(header)
|
||||
} else {
|
||||
if !chain.Config().IsCancun(header.Time) {
|
||||
return misc.VerifyAbsenceOfCancunHeaderFields(header)
|
||||
}
|
||||
|
||||
if err := misc.VerifyPresenceOfCancunHeaderFields(header); err != nil {
|
||||
return err
|
||||
}
|
||||
expectedExcessBlobGas := misc.CalcExcessBlobGas(parent)
|
||||
if *header.ExcessBlobGas != expectedExcessBlobGas {
|
||||
return fmt.Errorf("invalid excessBlobGas: have %d, want %d", *header.ExcessBlobGas, expectedExcessBlobGas)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *Merge) Seal(chain consensus.ChainHeaderReader, block *types.Block, results chan<- *types.Block, stop <-chan struct{}) error {
|
||||
|
@ -50,7 +50,7 @@ func VerifyEip1559Header(config *chain.Config, parent, header *types.Header, ski
|
||||
expectedBaseFee := CalcBaseFee(config, parent)
|
||||
if header.BaseFee.Cmp(expectedBaseFee) != 0 {
|
||||
return fmt.Errorf("invalid baseFee: have %s, want %s, parentBaseFee %s, parentGasUsed %d",
|
||||
expectedBaseFee, header.BaseFee, parent.BaseFee, parent.GasUsed)
|
||||
header.BaseFee, expectedBaseFee, parent.BaseFee, parent.GasUsed)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
@ -22,9 +22,6 @@ func TestExecutionSpec(t *testing.T) {
|
||||
|
||||
dir := filepath.Join(".", "execution-spec-tests")
|
||||
|
||||
// TODO(yperbasis): fix me
|
||||
bt.skipLoad(`^cancun/eip4844_blobs/excess_blob_gas/`)
|
||||
|
||||
checkStateRoot := true
|
||||
|
||||
bt.walk(t, dir, func(t *testing.T, name string, test *BlockTest) {
|
||||
|
Loading…
Reference in New Issue
Block a user