plugeth/light
Martin Holst Swende 7770e41cb5
core: improve contextual information on core errors (#21869)
A lot of times when we hit 'core' errors, example: invalid tx, the information provided is
insufficient. We miss several pieces of information: what account has nonce too high,
and what transaction in that block was offending?

This PR adds that information, using the new type of wrapped errors.
It also adds a testcase which (partly) verifies the output from the errors.

The first commit changes all usage of direct equality-checks on core errors, into
using errors.Is. The second commit adds contextual information. This wraps most
of the core errors with more information, and also wraps it one more time in
stateprocessor, to further provide tx index and tx hash, if such a tx is encoutered in
a block. The third commit uses the chainmaker to try to generate chains with such
errors in them, thus triggering the errors and checking that the generated string meets
expectations.
2020-12-04 12:22:19 +01:00
..
lightchain_test.go core: improve contextual information on core errors (#21869) 2020-12-04 12:22:19 +01:00
lightchain.go les: historical data garbage collection (#19570) 2020-07-13 11:02:54 +02:00
nodeset.go all: integrate the freezer with fast sync 2019-05-16 10:39:32 +03:00
odr_test.go core, all: split vm.Context into BlockContext and TxContext (#21672) 2020-11-13 13:42:19 +01:00
odr_util.go les: historical data garbage collection (#19570) 2020-07-13 11:02:54 +02:00
odr.go light: fix wrong description in a comment (#21573) 2020-09-28 14:30:10 +02:00
postprocess.go all: disable recording preimage of trie keys (#21402) 2020-11-18 11:51:33 +02:00
trie_test.go cmd, core, eth: background transaction indexing (#20302) 2020-05-11 18:58:43 +03:00
trie.go core, eth, les, trie: add a prefix to contract code (#21080) 2020-08-21 15:10:40 +03:00
txpool_test.go cmd, core, eth: background transaction indexing (#20302) 2020-05-11 18:58:43 +03:00
txpool.go core/rawdb: single point of maintenance for writing and deleting tx lookup indexes (#21480) 2020-09-15 10:37:01 +02:00