mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-22 03:30:37 +00:00
fix(evm): fee and tip calc bug (#5252)
This commit is contained in:
parent
f379f6728c
commit
5c49726f53
@ -56,9 +56,7 @@ func stateTestCmd(ctx *cli.Context) error {
|
||||
return errors.New("path-to-test argument required")
|
||||
}
|
||||
// Configure the go-ethereum logger
|
||||
log.Root().SetHandler(log.LvlFilterHandler(log.LvlInfo, log.StderrHandler))
|
||||
//glogger := log.NewGlogHandler(log.StreamHandler(os.Stderr, log.TerminalFormat(false)))
|
||||
//glogger.Verbosity(log.Lvl(ctx.GlobalInt(VerbosityFlag.Name)))
|
||||
log.Root().SetHandler(log.LvlFilterHandler(log.LvlDebug, log.StderrHandler))
|
||||
|
||||
// Configure the EVM logger
|
||||
config := &vm.LogConfig{
|
||||
|
@ -67,10 +67,10 @@ type stJSON struct {
|
||||
}
|
||||
|
||||
type stPostState struct {
|
||||
Root common.Hash `json:"hash"`
|
||||
Logs common.Hash `json:"logs"`
|
||||
Tx hexutil.Bytes `json:"txbytes"`
|
||||
ExpectException string `json:"expectException"`
|
||||
Root common.UnprefixedHash `json:"hash"`
|
||||
Logs common.UnprefixedHash `json:"logs"`
|
||||
Tx hexutil.Bytes `json:"txbytes"`
|
||||
ExpectException string `json:"expectException"`
|
||||
Indexes struct {
|
||||
Data int `json:"data"`
|
||||
Gas int `json:"gas"`
|
||||
@ -172,10 +172,10 @@ func (t *StateTest) Run(rules *params.Rules, tx kv.RwTx, subtest StateSubtest, v
|
||||
post := t.json.Post[subtest.Fork][subtest.Index]
|
||||
// N.B: We need to do this in a two-step process, because the first Commit takes care
|
||||
// of suicides, and we need to touch the coinbase _after_ it has potentially suicided.
|
||||
if root != post.Root {
|
||||
if root != common.Hash(post.Root) {
|
||||
return state, fmt.Errorf("post state root mismatch: got %x, want %x", root, post.Root)
|
||||
}
|
||||
if logs := rlpHash(state.Logs()); logs != post.Logs {
|
||||
if logs := rlpHash(state.Logs()); logs != common.Hash(post.Logs) {
|
||||
return state, fmt.Errorf("post state logs hash mismatch: got %x, want %x", logs, post.Logs)
|
||||
}
|
||||
return state, nil
|
||||
@ -435,8 +435,8 @@ func toMessage(tx stTransactionMarshaling, ps stPostState, baseFee *big.Int) (co
|
||||
tx.MaxPriorityFeePerGas = tx.MaxFeePerGas
|
||||
}
|
||||
|
||||
feeCap := big.Int(*tx.MaxPriorityFeePerGas)
|
||||
tipCap := big.Int(*tx.MaxFeePerGas)
|
||||
feeCap = big.Int(*tx.MaxPriorityFeePerGas)
|
||||
tipCap = big.Int(*tx.MaxFeePerGas)
|
||||
|
||||
gp := math.BigMin(new(big.Int).Add(&feeCap, baseFee), &tipCap)
|
||||
gasPrice = math.NewHexOrDecimal256(gp.Int64())
|
||||
|
Loading…
Reference in New Issue
Block a user