core/vm: set basefee to 0 internally on eth_call (#28470)

* core/vm: set basefee to 0 internally on eth_call

* core: nicer 0-basefee, make it work for blob fees too

* internal/ethapi: make tests a bit more complex

* core: fix blob fee checker

* core: make code a bit more readable

* core: fix some test error strings

* core/vm: Get rid of weird comment

* core: dict wrong typo
This commit is contained in:
Péter Szilágyi
2023-11-08 11:22:08 +02:00
committed by GitHub
parent 4d9f3cd5d7
commit 470dba8fc1
7 changed files with 82 additions and 26 deletions
+1
View File
@@ -26,6 +26,7 @@ func NewEnv(cfg *Config) *vm.EVM {
Origin: cfg.Origin,
GasPrice: cfg.GasPrice,
BlobHashes: cfg.BlobHashes,
BlobFeeCap: cfg.BlobFeeCap,
}
blockContext := vm.BlockContext{
CanTransfer: core.CanTransfer,
+2 -1
View File
@@ -46,6 +46,7 @@ type Config struct {
BaseFee *big.Int
BlobBaseFee *big.Int
BlobHashes []common.Hash
BlobFeeCap *big.Int
Random *common.Hash
State *state.StateDB
@@ -97,7 +98,7 @@ func setDefaults(cfg *Config) {
cfg.BaseFee = big.NewInt(params.InitialBaseFee)
}
if cfg.BlobBaseFee == nil {
cfg.BlobBaseFee = new(big.Int)
cfg.BlobBaseFee = big.NewInt(params.BlobTxMinBlobGasprice)
}
}