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
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 48 additions, 14 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 2 additions, 2 deletionscmd/geth/retesteth.go
- core/error.go 34 additions, 6 deletionscore/error.go
- core/state/snapshot/difflayer_test.go 2 additions, 2 deletionscore/state/snapshot/difflayer_test.go
- core/state/snapshot/disklayer_test.go 8 additions, 8 deletionscore/state/snapshot/disklayer_test.go
- core/state/snapshot/iterator_test.go 1 addition, 1 deletioncore/state/snapshot/iterator_test.go
- core/state_prefetcher.go 1 addition, 1 deletioncore/state_prefetcher.go
- core/state_processor.go 4 additions, 4 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 12 additions, 15 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 11 additions, 17 deletionscore/vm/instructions.go
- core/vm/interpreter.go 8 additions, 9 deletionscore/vm/interpreter.go
Loading
Please register or sign in to comment