bsc/core/state/snapshot
gary rong b9df7ecdc3
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
2020-04-22 11:25:36 +03:00
..
account.go core: initial version of state snapshots 2020-02-25 12:51:04 +02:00
conversion.go snapshotter/tests: verify snapdb post-state against trie (#20812) 2020-03-31 10:25:41 +02:00
difflayer_test.go all: seperate consensus error and evm internal error (#20830) 2020-04-22 11:25:36 +03:00
difflayer.go core/state/snapshot: fix various iteration issues due to destruct set 2020-03-04 15:06:04 +02:00
disklayer_test.go all: seperate consensus error and evm internal error (#20830) 2020-04-22 11:25:36 +03:00
disklayer.go core/state: extend snapshotter to handle account resurrections 2020-03-03 15:52:00 +02:00
generate.go core/state/snapshot, tests: sync snap gen + snaps in consensus tests 2020-03-03 09:17:13 +02:00
iterator_binary.go core: fix broken tests due to API changes + linter 2020-02-25 12:51:16 +02:00
iterator_fast.go core/state/snapshot: handle deleted accounts in fast iterator 2020-03-04 14:38:55 +02:00
iterator_test.go all: seperate consensus error and evm internal error (#20830) 2020-04-22 11:25:36 +03:00
iterator.go core/state/snapshot: make difflayer account iterator seek operation inclusive 2020-04-21 16:26:02 +02:00
journal.go core/state: extend snapshotter to handle account resurrections 2020-03-03 15:52:00 +02:00
snapshot_test.go core/state: extend snapshotter to handle account resurrections 2020-03-03 15:52:00 +02:00
snapshot.go core/state: extend snapshotter to handle account resurrections 2020-03-03 15:52:00 +02:00
sort.go core: fix broken tests due to API changes + linter 2020-02-25 12:51:16 +02:00
wipe_test.go all: simplify and fix database iteration with prefix/start (#20808) 2020-04-15 14:08:53 +03:00
wipe.go all: simplify and fix database iteration with prefix/start (#20808) 2020-04-15 14:08:53 +03:00