This PR fixes an issue in traceChain, where the statedb Commit operation was performed asynchronously with dereference-operations agains the underlying trie.Database instance. Due to how the reference counting works within the trie database (where parent count is recursively updated when new parents are added), doing dereferencing in the middle of Commit can cause the refcount to become wrong, leading to an inconsistent state.
This was fixed by doing Commit/Deref from the same routine.
* core/types: rm extranous check in test
* core/rawdb: add lightweight types for block logs
* core/rawdb,eth: use lightweight accessor for log filtering
* core/rawdb: add bench for decoding into rlpLogs
This PR implements a new debug method, which I've talked briefly about to some other client developers. It allows the caller to obtain the intermediate state roots for a block (which might be either a canon block or a 'bad' block).
* internal: support optional filter expression for debug.stacks
* internal/debug: fix string regexp
* internal/debug: support searching for line numbers too
* ethclient/gethclient: fix flaky test (due to map key ordering)
* accounts/keystore: fix test failing due to rand collision due to low time resolution on windows
This change introduces 2 new optional methods; `enter()` and `exit()` for js tracers, and makes `step()` optiona. The two new methods are invoked when entering and exiting a call frame (but not invoked for the outermost scope, which has it's own methods). Currently these are the data fields passed to each of them:
enter: type (opcode), from, to, input, gas, value
exit: output, gasUsed, error
The PR also comes with a re-write of the callTracer. As a backup we keep the previous tracing script under the name `callTracerLegacy`. Behaviour of both tracers are equivalent for the most part, although there are some small differences (improvements), where the new tracer is more correct / has more information.
* cmd/devp2p/internal/ethtest: only use eth66 if eth66 is negotiated
* cmd/devp2p/internal/ethtest: switch on concrete type not pointer
* cmd/devp2p/internal/ethtest: switch on concrete type not pointer
This PR ensures that wiping all data associated with a node (apart from its nodekey)
will not generate already used sequence number for the ENRs, since all remote nodes
would reject them until they out-number the previously published largest one.
The big complication with this scheme is that every local update to the ENR can
potentially bump the sequence number by one. In order to ensure that local updates
do not outrun the clock, the sequence number is a millisecond-precision timestamp,
and updates are throttled to occur at most once per millisecond.
Co-authored-by: Felix Lange <fjl@twurst.com>
This change is a rewrite of the freezer code.
When writing ancient chain data to the freezer, the previous version first encoded each
individual item to a temporary buffer, then wrote the buffer. For small item sizes (for
example, in the block hash freezer table), this strategy causes a lot of system calls for
writing tiny chunks of data. It also allocated a lot of temporary []byte buffers.
In the new version, we instead encode multiple items into a re-useable batch buffer, which
is then written to the file all at once. This avoids performing a system call for every
inserted item.
To make the internal batching work, the ancient database API had to be changed. While
integrating this new API in BlockChain.InsertReceiptChain, additional optimizations were
also added there.
Co-authored-by: Felix Lange <fjl@twurst.com>
* remove rpc flags
* remove legacy rpc flags
* remove legacy rpc flags
* remove legacy rpc commands
* (hopefully) fix most of the build errors
* fix build errors
https://app.travis-ci.com/github/ethereum/go-ethereum/jobs/530318686
* cmd/utils: fix syntax error
* empty commit to unbreak travis ci
* fix syntax error
* syntax fixes
* syntax fixes
* fix
fixes "cmd/geth/usage.go:234:7: expected '(', found init (typecheck)"
* fix
* various fixes in usage.go
* various fixes in flags.go
* adds extra space
reverts the spacing to how it was before I resolved the merge conflict
* more fixes in usage.go
* fix
fix for cmd/geth/usage.go:243:17: expected operand, found ':=' (typecheck) in travis
* Update cmd/utils/flags.go
Co-authored-by: Martin Holst Swende <martin@swende.se>
* fix error
fixes these errors:
cmd/utils/flags_legacy.go:21:2: "strings" imported but not used (typecheck)
"strings"
^
cmd/utils/flags_legacy.go:24:2: "github.com/ethereum/go-ethereum/node" imported but not used (typecheck)
"github.com/ethereum/go-ethereum/node"
^
* goimports
Co-authored-by: Martin Holst Swende <martin@swende.se>
* internal/debug: remove deprecated flags
The removed flags are removed in the main portion of geth, this removes it internally too.
* internal/debug: remove legacy --debug and legacy --backtrace flag
* Update flags.go
Co-authored-by: Martin Holst Swende <martin@swende.se>