all: seperate consensus error and evm internal error (#20830)
* all: seperate consensus error and evm internal error There are actually two types of error will be returned when a tranaction/message call is executed: (a) consensus error (b) evm internal error. The former should be converted to a consensus issue, e.g. The sender doesn't enough asset to purchase the gas it specifies. The latter is allowed since evm itself is a blackbox and internal error is allowed to happen. This PR emphasizes the difference by introducing a executionResult structure. The evm error is embedded inside. So if any error returned, it indicates consensus issue happens. And also this PR improve the `EstimateGas` API to return the concrete revert reason if the transaction always fails * all: polish * accounts/abi/bind/backends: add tests * accounts/abi/bind/backends, internal: cleanup error message * all: address comments * core: fix lint * accounts, core, eth, internal: address comments * accounts, internal: resolve revert reason if possible * accounts, internal: address comments # Conflicts: # accounts/abi/abi.go # accounts/abi/bind/backends/simulated.go # cmd/geth/retesteth.go # core/state/snapshot/difflayer_test.go # core/state/snapshot/disklayer_test.go # core/state/snapshot/iterator_test.go # core/state_processor.go # core/state_transition.go # core/vm/evm.go # core/vm/instructions.go # core/vm/jump_table.go # eth/api_tracer.go # internal/ethapi/api.go # les/odr_test.go # light/odr_test.go # tests/state_test_util.go
Showing
- accounts/abi/abi.go 23 additions, 0 deletionsaccounts/abi/abi.go
- accounts/abi/abi_test.go 32 additions, 0 deletionsaccounts/abi/abi_test.go
- accounts/abi/bind/backends/simulated.go 51 additions, 15 deletionsaccounts/abi/bind/backends/simulated.go
- accounts/abi/bind/backends/simulated_test.go 104 additions, 16 deletionsaccounts/abi/bind/backends/simulated_test.go
- cmd/geth/retesteth.go 6 additions, 1 deletioncmd/geth/retesteth.go
- core/error.go 34 additions, 6 deletionscore/error.go
- core/state_prefetcher.go 1 addition, 1 deletioncore/state_prefetcher.go
- core/state_processor.go 5 additions, 5 deletionscore/state_processor.go
- core/state_transition.go 83 additions, 46 deletionscore/state_transition.go
- core/tx_pool.go 0 additions, 12 deletionscore/tx_pool.go
- core/vm/errors.go 40 additions, 4 deletionscore/vm/errors.go
- core/vm/evm.go 11 additions, 14 deletionscore/vm/evm.go
- core/vm/gas.go 1 addition, 1 deletioncore/vm/gas.go
- core/vm/gas_table.go 23 additions, 23 deletionscore/vm/gas_table.go
- core/vm/gas_table_test.go 2 additions, 2 deletionscore/vm/gas_table_test.go
- core/vm/instructions.go 12 additions, 9 deletionscore/vm/instructions.go
- core/vm/interpreter.go 8 additions, 9 deletionscore/vm/interpreter.go
- core/vm/jump_table.go 0 additions, 4 deletionscore/vm/jump_table.go
- core/vm/logger.go 4 additions, 1 deletioncore/vm/logger.go
- core/vm/opcodes.go 1 addition, 1 deletioncore/vm/opcodes.go
Loading
Please register or sign in to comment