From aa3cc051704749189608f5b8cb845b573e0bde72 Mon Sep 17 00:00:00 2001 From: linhaiyang <1183679527@qq.com> Date: Wed, 27 Oct 2021 13:28:01 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E9=A2=84=E6=89=A7=E8=A1=8C=E4=BA=A4?= =?UTF-8?q?=E6=98=93=E4=B8=8D=E6=89=A7=E8=A1=8C=20pre=20check=20part=20one?= =?UTF-8?q?=20=E5=B9=B6=E4=B8=94=20=E7=BB=95=E8=BF=87=E4=BB=A5=E5=A4=AA?= =?UTF-8?q?=E5=9D=8A=E5=9F=BA=E7=A1=80=E8=B4=B9=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/state_processor.go | 1 + eth/api_pre_exec.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/core/state_processor.go b/core/state_processor.go index 2ea61eafa7..d85da2aa02 100644 --- a/core/state_processor.go +++ b/core/state_processor.go @@ -155,5 +155,6 @@ func ApplyTransaction(config *params.ChainConfig, bc ChainContext, author *commo func ApplyTransactionForPreExec(config *params.ChainConfig, bc ChainContext, author *common.Address, gp *GasPool, statedb *state.StateDB, header *types.Header, tx *types.Transaction, msg types.Message, usedGas *uint64, cfg vm.Config) (*types.Receipt, error) { blockContext := NewEVMBlockContext(header, bc, author) vmenv := vm.NewEVM(blockContext, vm.TxContext{}, statedb, config, cfg) + vmenv.Context.BaseFee = big.NewInt(0) return applyTransaction(msg, config, bc, author, gp, statedb, header.Number, header.Hash(), tx, usedGas, vmenv) } diff --git a/eth/api_pre_exec.go b/eth/api_pre_exec.go index b28f88b032..365a387805 100644 --- a/eth/api_pre_exec.go +++ b/eth/api_pre_exec.go @@ -93,7 +93,7 @@ func (api *PreExecAPI) getBlockAndMsg(origin *PreExecTx, number *big.Int) (*type tx.GasFeeCap(), tx.GasTipCap(), hexutil.MustDecode(origin.Data), - nil, false, + nil, true, ) return block, msg From ac9cf04f62654b9ff1a82952a3f13ef036ad281d Mon Sep 17 00:00:00 2001 From: barryz Date: Wed, 27 Oct 2021 14:54:40 +0800 Subject: [PATCH 2/3] ci: add the missing gitDate build meta --- .github/workflows/lint.yml | 2 +- internal/build/env.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 1abf081e7e..95b0b34442 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -35,4 +35,4 @@ jobs: version: v1.42.1 only-new-issues: true skip-pkg-cache: true - skip-build-cache: true:w \ No newline at end of file + skip-build-cache: true \ No newline at end of file diff --git a/internal/build/env.go b/internal/build/env.go index d70c0d50a4..1be30e7e81 100644 --- a/internal/build/env.go +++ b/internal/build/env.go @@ -109,6 +109,7 @@ func LocalEnv() Environment { commitRe, _ := regexp.Compile("^([0-9a-f]{40})$") if commit := commitRe.FindString(head); commit != "" && env.Commit == "" { env.Commit = commit + env.Date = getDate(commit) } return env } From b3df9d66779c40ff94def8e9e00da6949636dc90 Mon Sep 17 00:00:00 2001 From: linhaiyang <1183679527@qq.com> Date: Wed, 27 Oct 2021 15:51:05 +0800 Subject: [PATCH 3/3] fix trace Transaction --- core/state_processor.go | 2 +- eth/api_pre_exec.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/core/state_processor.go b/core/state_processor.go index d85da2aa02..71ecaa6a2a 100644 --- a/core/state_processor.go +++ b/core/state_processor.go @@ -154,7 +154,7 @@ func ApplyTransaction(config *params.ChainConfig, bc ChainContext, author *commo func ApplyTransactionForPreExec(config *params.ChainConfig, bc ChainContext, author *common.Address, gp *GasPool, statedb *state.StateDB, header *types.Header, tx *types.Transaction, msg types.Message, usedGas *uint64, cfg vm.Config) (*types.Receipt, error) { blockContext := NewEVMBlockContext(header, bc, author) + blockContext.BaseFee = big.NewInt(0) vmenv := vm.NewEVM(blockContext, vm.TxContext{}, statedb, config, cfg) - vmenv.Context.BaseFee = big.NewInt(0) return applyTransaction(msg, config, bc, author, gp, statedb, header.Number, header.Hash(), tx, usedGas, vmenv) } diff --git a/eth/api_pre_exec.go b/eth/api_pre_exec.go index 365a387805..ab63e1ff16 100644 --- a/eth/api_pre_exec.go +++ b/eth/api_pre_exec.go @@ -188,6 +188,7 @@ func (api *PreExecAPI) TraceTransaction(ctx context.Context, origin *PreExecTx, } // Run the transaction with tracing enabled. vmenv := vm.NewEVM(core.NewEVMBlockContext(d.header, bc, nil), txContext, d.stateDb, bc.Config(), vm.Config{Debug: true, Tracer: tracer}) + vmenv.Context.BaseFee = big.NewInt(0) // Call Prepare to clear out the statedb access list d.stateDb.Prepare(d.tx.Hash(), txIndex)