Merge pull request #739 from gzliudan/fix-preCheck

core: fix preCheck for RandomizeSMC after EIP-1559
This commit is contained in:
Daniel Liu 2024-11-19 15:58:06 +08:00 committed by GitHub
commit 8e72c6dafb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -267,7 +267,7 @@ func (st *StateTransition) preCheck() error {
}
// This will panic if baseFee is nil, but basefee presence is verified
// as part of header validation.
if st.gasFeeCap.Cmp(st.evm.Context.BaseFee) < 0 {
if (msg.To() == nil || *msg.To() != common.RandomizeSMCBinary) && st.gasFeeCap.Cmp(st.evm.Context.BaseFee) < 0 {
return fmt.Errorf("%w: address %v, maxFeePerGas: %s baseFee: %s", ErrFeeCapTooLow,
msg.From().Hex(), st.gasFeeCap, st.evm.Context.BaseFee)
}