mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-17 10:20:44 +00:00
internal/ethapi: fix panic in accesslist creation (#23225)
This commit is contained in:
parent
7500b0ac95
commit
62a70f0cde
2 changed files with 12 additions and 1 deletions
|
|
@ -861,3 +861,7 @@ func (m *Message) SetBalanceTokenFeeForCall() {
|
||||||
m.balanceTokenFee = new(big.Int).SetUint64(m.gasLimit)
|
m.balanceTokenFee = new(big.Int).SetUint64(m.gasLimit)
|
||||||
m.balanceTokenFee.Mul(m.balanceTokenFee, m.gasPrice)
|
m.balanceTokenFee.Mul(m.balanceTokenFee, m.gasPrice)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *Message) SetBalanceTokenFee(balanceTokenFee *big.Int) {
|
||||||
|
m.balanceTokenFee = balanceTokenFee
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -2063,12 +2063,19 @@ func AccessList(ctx context.Context, b Backend, blockNrOrHash rpc.BlockNumberOrH
|
||||||
}
|
}
|
||||||
// Copy the original db so we don't modify it
|
// Copy the original db so we don't modify it
|
||||||
statedb := db.Copy()
|
statedb := db.Copy()
|
||||||
|
// Set the accesslist to the last al
|
||||||
|
args.AccessList = &accessList
|
||||||
|
msg, err := args.ToMessage(b, block.Number(), b.RPCGasCap(), header.BaseFee)
|
||||||
|
if err != nil {
|
||||||
|
return nil, 0, nil, err
|
||||||
|
}
|
||||||
|
|
||||||
feeCapacity := state.GetTRC21FeeCapacityFromState(statedb)
|
feeCapacity := state.GetTRC21FeeCapacityFromState(statedb)
|
||||||
var balanceTokenFee *big.Int
|
var balanceTokenFee *big.Int
|
||||||
if value, ok := feeCapacity[to]; ok {
|
if value, ok := feeCapacity[to]; ok {
|
||||||
balanceTokenFee = value
|
balanceTokenFee = value
|
||||||
}
|
}
|
||||||
msg := types.NewMessage(args.from(), args.To, uint64(*args.Nonce), args.Value.ToInt(), uint64(*args.Gas), args.GasPrice.ToInt(), big.NewInt(0), big.NewInt(0), args.data(), accessList, false, balanceTokenFee, header.Number)
|
msg.SetBalanceTokenFee(balanceTokenFee)
|
||||||
|
|
||||||
// Apply the transaction with the access list tracer
|
// Apply the transaction with the access list tracer
|
||||||
tracer := vm.NewAccessListTracer(accessList, args.from(), to, precompiles)
|
tracer := vm.NewAccessListTracer(accessList, args.from(), to, precompiles)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue