chore: miscellaneous nits (#46)

This commit is contained in:
Cal Bera 2025-08-04 17:44:47 -07:00 committed by GitHub
parent 0eb623e141
commit f1c9320cce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 13 deletions

View file

@ -122,16 +122,14 @@ func (b *BlockGen) addTx(bc *BlockChain, vmConfig vm.Config, tx *types.Transacti
var ( var (
blockContext = NewEVMBlockContext(b.header, bc, &b.header.Coinbase) blockContext = NewEVMBlockContext(b.header, bc, &b.header.Coinbase)
evm = vm.NewEVM(blockContext, b.statedb, b.cm.config, vmConfig) evm = vm.NewEVM(blockContext, b.statedb, b.cm.config, vmConfig)
gasPool = b.gasPool
gasUsed = &b.header.GasUsed gasUsed = &b.header.GasUsed
) )
// Berachain: PoL txs do not count towards block gas. // Berachain: PoL txs do not count towards block gas.
if tx.Type() == types.PoLTxType { if tx.Type() == types.PoLTxType {
gasPool = new(GasPool).AddGas(params.PoLTxGasLimit)
gasUsed = new(uint64) gasUsed = new(uint64)
} }
b.statedb.SetTxContext(tx.Hash(), len(b.txs)) b.statedb.SetTxContext(tx.Hash(), len(b.txs))
receipt, err := ApplyTransaction(evm, gasPool, b.statedb, b.header, tx, gasUsed) receipt, err := ApplyTransaction(evm, b.gasPool, b.statedb, b.header, tx, gasUsed)
if err != nil { if err != nil {
panic(err) panic(err)
} }

View file

@ -1249,11 +1249,7 @@ func AccessList(ctx context.Context, b Backend, blockNrOrHash rpc.BlockNumberOrH
if err != nil { if err != nil {
return nil, 0, nil, fmt.Errorf( return nil, 0, nil, fmt.Errorf(
"failed to apply transaction: %v err: %v", "failed to apply transaction: %v err: %v",
args.ToTransaction( args.ToTransaction(types.LegacyTxType, isPrague1, distributorAddress).Hash(),
types.LegacyTxType,
b.ChainConfig().IsPrague1(header.Number, header.Time),
b.ChainConfig().Berachain.Prague1.PoLDistributorAddress,
).Hash(),
err, err,
) )
} }

View file

@ -193,8 +193,8 @@ var (
}, },
Berachain: BerachainConfig{ Berachain: BerachainConfig{
Prague1: Prague1Config{ Prague1: Prague1Config{
Time: newUint64(17446744073709551614), Time: newUint64(17446744073709551614), // TODO: set mainnet timestamp.
MinimumBaseFeeWei: 1000000000, // 1 gwei MinimumBaseFeeWei: 10000000000, // 10 gwei
BaseFeeChangeDenominator: 48, // 6x increase from the default BaseFeeChangeDenominator: 48, // 6x increase from the default
}, },
}, },
@ -231,7 +231,7 @@ var (
Berachain: BerachainConfig{ Berachain: BerachainConfig{
Prague1: Prague1Config{ Prague1: Prague1Config{
Time: newUint64(1754496000), Time: newUint64(1754496000),
MinimumBaseFeeWei: 1000000000, // 1 gwei MinimumBaseFeeWei: 10000000000, // 10 gwei
BaseFeeChangeDenominator: 48, // 6x increase from the default BaseFeeChangeDenominator: 48, // 6x increase from the default
}, },
}, },