This adds support for EIP-2718 typed transactions as well as EIP-2930
access list transactions (tx type 1). These EIPs are scheduled for the
Berlin fork.
There very few changes to existing APIs in core/types, and several new APIs
to deal with access list transactions. In particular, there are two new
constructor functions for transactions: types.NewTx and types.SignNewTx.
Since the canonical encoding of typed transactions is not RLP-compatible,
Transaction now has new methods for encoding and decoding: MarshalBinary
and UnmarshalBinary.
The existing EIP-155 signer does not support the new transaction types.
All code dealing with transaction signatures should be updated to use the
newer EIP-2930 signer. To make this easier for future updates, we have
added new constructor functions for types.Signer: types.LatestSigner and
types.LatestSignerForChainID.
This change also adds support for the YoloV3 testnet.
Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com>
# Conflicts:
# accounts/abi/bind/backends/simulated.go
# cmd/evm/internal/t8ntool/execution.go
# cmd/evm/internal/t8ntool/transition.go
# cmd/geth/main.go
# cmd/geth/usage.go
# core/bench_test.go
# core/state/statedb.go
# core/state_prefetcher.go
# core/state_processor.go
# core/state_transition.go
# core/tx_pool.go
# core/types/block.go
# core/types/derive_sha.go
# core/types/gen_tx_json.go
# core/types/receipt.go
# core/types/receipt_test.go
# core/types/transaction.go
# core/types/transaction_signing.go
# core/types/transaction_test.go
# ethclient/ethclient.go
# ethclient/signer.go
# graphql/graphql.go
# internal/ethapi/api.go
# internal/guide/guide_test.go
# les/benchmark.go
# les/odr_test.go
# light/odr_test.go
# light/txpool.go
# miner/worker.go
# miner/worker_test.go
# signer/core/api.go
# tests/state_test_util.go
# trie/stacktrie_test.go
# turbo/stages/blockchain_test.go
This moves the eth config definition into a separate package, eth/ethconfig.
Packages eth and les can now import this common package instead of
importing eth from les, reducing dependencies.
Co-authored-by: Felix Lange <fjl@twurst.com>
# Conflicts:
# cmd/faucet/faucet.go
# cmd/geth/config.go
# cmd/utils/cmd.go
# cmd/utils/flags.go
# cmd/utils/flags_legacy.go
# console/console_test.go
# eth/backend.go
# eth/bloombits.go
# eth/ethconfig/config.go
# ethclient/ethclient_test.go
# graphql/graphql_test.go
# les/api_test.go
# les/client.go
# les/commons.go
# les/costtracker.go
# les/server.go
# les/test_helper.go
# mobile/geth.go
fixes an issue where local transactions that were included in the chain before a SetHead were rejected if resubmitted, since the txpool had not reset the state to the current (older) state.
The PR makes use of the stacktrie, which is is more lenient on resource consumption, than the regular trie, in cases where we only need it for DeriveSha
# Conflicts:
# cmd/evm/internal/t8ntool/execution.go
# consensus/clique/clique.go
# consensus/ethash/consensus.go
# core/genesis.go
# core/tx_pool_test.go
# eth/fetcher/block_fetcher.go
# eth/fetcher/block_fetcher_test.go
# les/odr_requests.go
# miner/miner_test.go
# miner/worker.go
# turbo/stages/blockchain_test.go
Removes the yolov2 definition, adds yolov3, including EIP-2565. This PR also disables some of the erroneously generated blockchain and statetests, and adds the new genesis hash + alloc for yolov3.
This PR disables the CLI switches for yolo, since it's not complete until we merge support for 2930.
# Conflicts:
# cmd/evm/internal/t8ntool/execution.go
# cmd/geth/chaincmd.go
# cmd/geth/consolecmd.go
# cmd/geth/main.go
# cmd/geth/usage.go
# cmd/utils/flags.go
# core/state_processor.go
# core/vm/evm.go
# core/vm/interpreter.go
# tests/block_test.go
This PR implements the following modifications
- Don't shortcut check if block is present, thus avoid disk lookup
- Don't check hash ancestry in early-check (it's still done in parallel checker)
- Don't check time.Now for every single header
Charts and background info can be found here: https://github.com/holiman/headerimport/blob/main/README.md
With these changes, writing 1M headers goes down to from 80s to 62s.
# Conflicts:
# consensus/ethash/consensus.go
# core/rawdb/freezer_table.go
This PR implements unclean shutdown marker. Every time geth boots, it adds a timestamp to a list of timestamps in the database. This list is capped at 10. At a clean shutdown, the timestamp is removed again.
Thus, when geth exits unclean, the marker remains, and at boot up we show the most recent unclean shutdowns to the user, which makes it easier to diagnose root-causes to certain problems.
Co-authored-by: Nagy Salem <me@muhnagy.com>
# Conflicts:
# core/rawdb/accessors_metadata.go
# core/rawdb/database.go
# core/rawdb/schema.go
# eth/backend.go
# les/client.go
* core: add test for headerchain inserts
* core, light: write headerchains in batches
* core: change to one callback per batch of inserted headers + review concerns
* core: error-check on batch write
* core: unexport writeHeaders
* core: remove callback parameter in InsertHeaderChain
The semantics of InsertHeaderChain are now much simpler: it is now an
all-or-nothing operation. The new WriteStatus return value allows
callers to check for the canonicality of the insertion. This change
simplifies use of HeaderChain in package les, where the callback was
previously used to post chain events.
* core: skip some hashing when writing headers
* core: less hashing in header validation
* core: fix headerchain flaw regarding blacklisted hashes
Co-authored-by: Felix Lange <fjl@twurst.com>
# Conflicts:
# core/blockchain.go
# core/headerchain.go
# light/lightchain.go
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.
# Conflicts:
# core/state_processor.go
# core/state_transition.go
# core/tx_pool_test.go
# light/lightchain_test.go
# turbo/stages/blockchain_test.go
Changes:
Simplify nested complexity
If an if blocks ends with a return statement then remove the else nesting.
Most of the changes has also been reported in golint https://goreportcard.com/report/github.com/ethereum/go-ethereum#golint
# Conflicts:
# cmd/utils/flags.go
# console/bridge.go
# crypto/bls12381/g2.go
# les/benchmark.go
# les/lespay/server/balance.go
# les/lespay/server/balance_tracker.go
# les/lespay/server/prioritypool.go
# les/odr_requests.go
# les/serverpool.go
# les/serverpool_test.go
# p2p/nodestate/nodestate_test.go
# trie/committer.go
* squash
* squash
* squash
* squash
* squash
* squash
* squash
* squash
* squash
* squash
* squash
* squash
* squash
* squash
* squash
* squash
* squash
* squash
* squash
* squash
* squash
* SE
* SE
* SE
* SE
* SE
* SE
* SE
* SE
* SE
* SE
* SE
* SE
* SE
* SE
* SE
* Only insert hard-coded tips if both DB and files recovery failed
* Prevent deadlock
* Report some efficiency numbers
* Count properly unrequested bodies
* Initialise allRequests
* Increase timeout
* Fixes to scheduling
* Small fix
* Simplified scheduling
* Remove separate bodyLoop goroutine
* Update from DB at the beginnig of block bodies forward
* Timeout for repeating the request cycle
* Fix timeout
* Fix
* Increase timeout
* Increase timeout
* Try to make flow if possible
* Fix flow
* Lower timeout
* timeout for each blockNum
* Adjustable timeout
* Better log timing
* Track peers
* copy peerID
* fix scheduling
* Too much logging
* Print delivery speed
* Print committed blocks
* Fix race
* Sentry to only reset back-off timer when response to a request is received
* Print bytes/sec and wasted traffic
* Fix bandwidth accounting
* Less logging
* not to wake up on deliveries
* Spam every second
* Print peer map
* Fix npe, print requests
* Timestamps
* Improved logging
* Penalty for peers
* Log penalties only when disconnecting
* Try with smaller window
* window parameter
* Dealing with partially delivered requests
* Init bodyReq
* Fix array index
* More fix for NPE
* More NPE checks
* Print out body progress and header progress
* Fix ending condition
* Bring back waking up and penalties
* Fix duplicate tip
* Duplicate segment
* Fix lint
* Fix lint
* fix lint
* Fix lint
* Hard coded headers in the source files
* Fix lint
* Replace hix-sized header serialisation with rlp (to support clique)
* Remove anchor records from the files
* Fixeds for DB recovery
* Fix compilation
* Fix compile errors
* Fix formatting
* Fix lint
* Fix comments
* Remove headerLoop
* Properly terminate body download
* Support for StatusData p2p proto
* Fix forkid test
* Fix test
* Fix lint
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
* Remove hashed changesets
* try this
* oops
* simplify
* better diagnostics
* don't hash account key and use bitmap 64 to check history index
* update docs of bucket
Co-authored-by: alex.sharov <AskAlexSharov@gmail.com>
* Bad unwind of recreation of CREATE2 contract - unit test and potential fix
* Fix unit test
* Fix lint
* Fix lint
* Fixup hack
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
* trace_call initial
* Fix tests
* More tracing
* Add more fields to the action
* Completed first example query
* Add initial bench11 to compare trace_call with OpenEthereum
* Exclude precompile calls from call traces
* Add self-destruct, call types, more comparison in rpctest
* Support for execution errors
* Stack underflow error and delegatecall value
* Fix lint
* Fix suicide traceAddress, Bad instruction error
* Fix lint
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
* Cleanup and rpcdaemon unit tests
* Fix
* Fix
* Fix lint
* Test for debug_traceTransaction
* Add NoRefunds option
* Compile fix, test for no refunds
* Fix compile
* Add poly contract, fix compile errors
* No refunds now work
* Fix NPE in rpcdaemon
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
* State cache init
* More code
* Fix lint
* More tests
* More tests
* More tests
* Fix test
* Transformations
* remove writeQueue, before fixing the tests
* Fix tests
* Add more tests, incarnation to the code items
* Fix lint
* Fix lint
* Remove shards prototype, add incarnation to the state reader code
* Clean up and replace cache in call_traces stage
* fix flaky test
* Save changes
* Readers to use addrHash, writes - addresses
* Fix lint
* Fix lint
* More accurate tracking of size
* Optimise for smaller write batches
* Attempt to integrate state cache into Execution stage
* cacheSize to default flags
* Print correct cache sizes and batch sizes
* cacheSize in the integration
* Fix tests
* Fix lint
* Remove print
* Fix exec stage
* Fix test
* Refresh sequence on write
* No double increment
* heap.Remove
* Try to fix alignment
* Refactoring, adding hashItems
* More changes
* Fix compile errors
* Fix lint
* Wrapping cached reader
* Wrap writer into cached writer
* Turn state cache off by default
* Fix plain state writer
* Fix for code/storage mixup
* Fix tests
* Fix clique test
* Better fix for the tests
* Add test and fix some more
* Fix compile error|
* More functions
* Fixes
* Fix for the tests
* sepatate DeletedFlag and AbsentFlag
* Minor fixes
* Test refactoring
* More changes
* Fix some tests
* More test fixes
* More test fixes
* Fix lint
* Move blockchain_test to be able to use stagedsync
* More fixes
* Fixes and cleanup
* Fix tests in turbo/stages
* Fix lint
* Fix lint
* Intemediate
* Fix tests
* Intemediate
* More fixes
* Compilation fixes
* More fixes
* Fix compile errors
* More test fixes
* More fixes
* More test fixes
* Fix compile error
* Fixes
* Fix
* Fix
* More fixes
* Fixes
* More fixes and cleanup
* Further fix
* Check gas used and bloom with header
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
* core/state/snapshot: print warning if failed to resolve journal
* core/state/snapshot: fix snapshot recovery
When we meet the snapshot journal consisted with:
- disk layer generator with new-format
- diff layer journal with old-format
The base layer should be returned without error.
The broken diff layer can be reconstructed later
but we definitely don't want to reconstruct the
huge diff layer.
* core: add tests
# Conflicts:
# core/state/snapshot/journal.go
* more compact append implementation
* do appned for dupsort buckets
* do appned for dupsort buckets
* do appned for dupsort buckets
* do appned for dupsort buckets
* do appned for dupsort buckets
* fix tests
* fix tests
* fix `make grpc` on new checkouts
* update proto files
* add some stub
* prototype with fake events
* notifying about events
* pass events
* events are being sent
* transfer headers to filters
* create the “filters” struct
* implement new heads
* PoC of New Heads subscription
* fix keep alive
* fixups for the client
* add “type” to the event
* support header event type on client
* better stage refactor
* fixup for the eth backend
* fixups
* fix tests
* fix tests
* fix linters
* address comments
* remove unused log
* change_set_dup
* change_set_dup
* change_set_dup
* change_set_dup
* change_set_dup
* change_set_dup
* change_set_dup
* change_set_dup
* change_set_dup
* change_set_dup
* change_set_dup
* change_set_dup
* change_set_dup
* change_set_dup
* change_set_dup
* change_set_dup
* change_set_dup
* change_set_dup
* change_set_dup
* change_set_dup
* change_set_dup
* working version
* working version
* working version
* working version
* working version
* working version
* working version
* working version
* working version
* working version
* working version
* working version
* working version
* working version
* working version
* working version
* working version
* working version
* working version
* working version
* working version
* working version
* working version
* working version
* working version
* working version
* working version
* working version
* working version
* working version
* working version
* working version
* working version
* working version
* working version
* working version
* working version
* working version
* working version
* working version
* working version
* working version
* working version
* working version
* aa
* aa
* aa
* aa
* aa
* aa
* aa
* aa
* aa
* aa
* aa
* aa
* aa
* aa
* aa
* squash
* squash
* fix
* fix
* fix
* fix
* fix
* fix
* fix
* fix
* fix
* fix
* fix
* history_early_stop
* history_early_stop
* vmConfig with ReadOnly false
* auto_increment
* auto_increment
* rebase master
Co-authored-by: Alexey Akhunov <akhounov@gmail.com>
* First
* More on SA interpreter
* Fixup
* Add cfg action to hack binary that invokes the SaInterpreter. Added an operation handler for PUSH1
* refactor cfg tests into separate file
* Move cfg tests into separate file
* More refactoring into new file
* dataflow interpreter
* work on cfg0
* finish cfg0
* df works on base examples
* refactor into dataflow spec
* add bounded stack
* add harder example
* fix switch pass thru
* fix switch pass thru
* bug fix, and better printing
* manual merge
* restore call to test gencfg
* abstract interpretation based cfg analysis
* fix post signature
* use uint256 instead uint64, add post function
* preprocess stmts
* initial implementation of resolve
* fix resolve
* fix resolve
* print stmts for edges
* print stmts for edges
* print states
* print states
* bug fixes, debugging
* fix jumpi dest - first working impl
* reachability analysis to filter out dead edges
* add all transfer functions
* larger contract bytecodes from solc compiler
* simple solidity contract goes thru
* add deposit contract bytecode
* rename deposit contract test
* fix new contract arg
* Address non-determinism leading to imprecise results
* improve debugging output
* improve debugging output
* improve debugging output
* fix for bug causing incorrect analysis results
* fix for bug causing incorrect analysis results
* fix for bug causing incorrect analysis results
* add more test cases
* fix coverage bug
* debugging for non-termination
* fix bad fixpoint check
* fix data inference
* fix transfer function for halting stmts
* switch to deposit contract test, disable debugging
* add anly counter to viz, fix stmt.valid check
* show all preds, adjust anlycounter behavior
* dfs instead of bfs to fail earlier
* viz improvements
* add worklist size to viz
* add test case for private functions
* valueset analysis
* add more checks to fail earlier in the analysis to help debugging, improve debugging output, catch additional bad jumps
* delete old code
* delete old code
* delete old code
* fix up minor changes to jump table
* copy over comments from cgf-1 branch
* remove minor diffs
* add recompiled deposit contract
* graph viz
* cleanup/refactoring
* initial impl of viz
* script to run cfg anly and generate dot file
* div example
* accept bytecode from cmd line
* add minimal deposit contract example
* replace valueset analysis with stackset analysis
* get in sync with master
* sync with master
* fix linting
* fix linting
* fix linting
* reformatting
* fix linting
* fix linting
* fix linting
* fix linting
* fix linting
* fix linting
* fix linting
* harness for running over all contracts
* refactor anly, track coverage metrics
* breakdown unresolved into different types, fix bad opcode bug
* sort programs by frequency
* ingest used contracts from bigquery
* performance, concurrency, bug fixes
* more test cases, handle invalid jumps differently, remove duplicate edges, report analytics limit
* simplify concurrency
* correctly track short stack
* add new transfer function, fix stack len
* variable stack length, perf opts, inc anly count limit
* profiling
* test case for large state size
* use custom hash function for control
* timeouts
* cfg.sh
* increase to 5 min timeout
* track elpased time
* use ptr
* increase limits
* increase limits
* fix mem leak
* debug mem leak
* debug mem leak
* lower resource limits
* fix nil error
* add new lattice element
* re-enable
* cut down limits
* preliminary proof checker
* refactor batch mode to run cfg in subprocess,put memory limit
* remove hard wiring
* adjust limits
* update metrics tracking
* more succinct proof checker
* rewrite checker
* bug fixes on checker
* bug fix
* remove print stmts
* track proof size
* print proof size
* don't panic on process error
* compress proof
* go mody tidy
* code formatting
* fix capitalization
* fix linting
* fix linting
* fix linting
* fix linting
* fix linting
* remove unnecessary files
* fix typo
Co-authored-by: Alexey Akhunov <akhounov@gmail.com>
* ReadBlockByNumber and ReadChainConfig return error
* Let's make rawdb package to return error. But by small steps.
High-level methods need to move first:
ReadBlockByNumber
ReadChainConfig
ReadBlockByHash
ReadHeaderByHash
WriteChainConfig
WriteDatabaseVersion
WriteBlock
DeleteTd
WriteTd
ReadTd
* save progress
* save progress
* save progress
* save progress
* etl bimaps
* etl bimaps
* etl bimaps
* etl bimaps
* a
* a
* a
* a
* a
* a
* a
* save progress
* save progress
* save progress
* a
* fix_race_condition_on_zstd_build
* clean
* clean
* clean
* clean
* clean
* go mod tidy
* clean
* clean
* clean
* clean
* clean
* clean
* clean
* clean
* clean
* clean
* clean
* clean
* clean
* clean
* clean
* clean
* clean
* fix corner case
* commit every
* call traces etl
* call traces etl
* call traces etl
* return missed error
* go mod tidy
* go mod tidy
* go mod tidy
* rebase to master
* remove trash
* print full key if it has 8 leading zeroes
* Initial commit for CallTraces index
* Fix compilation
* fix lint, add comment
* Fix integration
* Add Close function to ethdb.Cursor, fix some compile errors
* Try to stop cursor leak in Get
* Fix compile errors in RPC daemon
* Fix compile errors
* fixing another way
* Some fixes
* More fixes
* More fixes
* More fixes
* Fixes to core/state
* Fix lint
* Fix lint
* Fixes
* Stage caching for call trace stage
* Add mem stats
* Try to stop the leak
* Turn off debug
* Chunks for 10k blocks
* Print
* Revert "Print"
This reverts commit 5ffada4828d61e00e5dad1ca12c98258dfbbad00.
* Revert "Chunks for 10k blocks"
This reverts commit cfb9d498e782e5583d41c30abf0e2137da27383e.
* Trying to fix the leak
* Don't compute receipts in re-tracing
* Not compose block
* Print speed, fix receipts, bigger caches
* Fix lint
* Utilise changeset info
* Counters
* Use NoReceipts and ReadOnly
* ReadOnly is incompatible with caching
* Skip test leaking transactions
* Fix block test
* Change disable message for call-traces stage
* Use block option for call traces integration
* Fix retracing due to incarnation
This change adds a test framework for the "eth" protocol and some basic
tests. The tests can be run using the './devp2p rlpx eth-test' command.
# Conflicts:
# core/forkid/forkid.go
# eth/discovery.go
# eth/handler.go
# eth/helper_test.go
# eth/protocol_test.go
* core/vm/testdata: add gascost expectations to testcases
* core/vm: verify expected gas in tests for precompiles
* core/vm: fix overflow flaw in gas/s calculation
* switch receipts to cbor
* switch receipts to cbor
* rpcdaemon to cache chainconfig
* rpcdaemon to cache chainconfig
* rpcdaemon to cache chainconfig
* rpcdaemon to cache chainconfig
* it compiles
* after recent master
* fix linters warnings
* grpcV7
* go mod tidy
* unmarshall adresses or adress
* fix linters
* after cr
* after cr
* after cr
* after cr
* fix tests
* remove dev version
* it compiles
* mod tidy
* fix bin deps
* use stable version of grpc
* switch back to master constructor
* switch back to master constructor
* add a bit docs
* add a bit docs
Co-authored-by: Alexey Akhunov <akhounov@gmail.com>
Co-authored-by: alex.sharov <AskAlexSharov@gmail.com>
* Use Append for changesets and receipts
* Fix lint
* Delete all receipts on unwind
* Fix lint
* Fix unwind keys for changeset
* Fix test
* Use writeReceipts flag
* Revert to Append
* Delete receipts too when resetting
* First algorithm
* Update doc
* Second algorithm implemented
* Prepend (unfinished)
* More on prepend
* More fixes
* Change CalcDifficulty interface
* fix make test
* Fix formatting
* Another test
* More on Preprend
* Another test for Prepend
* More tests for Prepend
* More tests for Prepend
* Move files to turbo
* Add another test for Prepend
* Started adding Append algorithm
* More work on Append
* Start changing the terminology
* Split trees into segments
* More fixes
* Fix compilation
* Connect
* FindAnchors, FindTip
* Tip has anchor and not anchorParent field
* Remove Prepend and Append
* Add Connect
* NewAnchor algorithm
* More to recovery from files
* Add more to AddAnchor
* Request more headers
* Header fix-sizes serialisation
* Upgrade CI to 1.15
* Fix lint
* Fix lint
* replace RLP with fixed-sized serialisation
* Fix lint
* More algos
* Fix lint
* First
* More on SA interpreter
* Fixup
* Add cfg action to hack binary that invokes the SaInterpreter. Added an operation handler for PUSH1
* refactor cfg tests into separate file
* Move cfg tests into separate file
* More refactoring into new file
* dataflow interpreter
* work on cfg0
* finish cfg0
* df works on base examples
* refactor into dataflow spec
* add bounded stack
* add harder example
* fix switch pass thru
* fix switch pass thru
* bug fix, and better printing
* manual merge
* restore call to test gencfg
* abstract interpretation based cfg analysis
* fix post signature
* use uint256 instead uint64, add post function
* preprocess stmts
* initial implementation of resolve
* fix resolve
* fix resolve
* print stmts for edges
* print stmts for edges
* print states
* print states
* bug fixes, debugging
* fix jumpi dest - first working impl
* reachability analysis to filter out dead edges
* add all transfer functions
* larger contract bytecodes from solc compiler
* simple solidity contract goes thru
* add deposit contract bytecode
* rename deposit contract test
* fix new contract arg
* Address non-determinism leading to imprecise results
* improve debugging output
* improve debugging output
* improve debugging output
* fix for bug causing incorrect analysis results
* fix for bug causing incorrect analysis results
* fix for bug causing incorrect analysis results
* add more test cases
* fix coverage bug
* debugging for non-termination
* fix bad fixpoint check
* fix data inference
* fix transfer function for halting stmts
* switch to deposit contract test, disable debugging
* add anly counter to viz, fix stmt.valid check
* show all preds, adjust anlycounter behavior
* dfs instead of bfs to fail earlier
* viz improvements
* add worklist size to viz
* add test case for private functions
* valueset analysis
* add more checks to fail earlier in the analysis to help debugging, improve debugging output, catch additional bad jumps
* delete old code
* delete old code
* delete old code
* fix up minor changes to jump table
* copy over comments from cgf-1 branch
* remove minor diffs
* add recompiled deposit contract
* graph viz
* cleanup/refactoring
* initial impl of viz
* script to run cfg anly and generate dot file
* div example
* accept bytecode from cmd line
* add minimal deposit contract example
* replace valueset analysis with stackset analysis
* get in sync with master
* sync with master
* fix linting
* fix linting
* fix linting
* reformatting
* fix linting
* fix linting
* fix linting
* fix linting
* fix linting
* fix linting
* fix linting
Co-authored-by: Alexey Akhunov <akhounov@gmail.com>
* v0
* more docs, less customization
* more docs, less customization
* more docs, less customization
* don't store db reference
* rely on fact that lmdb key/value valid until end of transaction
* clean
* clean
* v0
* v1
* v3
* v4
* clean
* temporary fix of txpool
* Add debug logs about tx start/commit
* Add debug logs about tx start/commit
* Add debug logs about tx start/commit
* add condition
* tx pool to not hold own db
* try to enable TxPool in integration
* exclude tx pool from tx
* exclude tx pool from integration
* reduce limit
* fix integration
* clean
* clean
* clean
* clean
* clean
* exclude tx pool unwind
* exclude tx pool unwind in integration
* fix integration tx pool
* fix commit
* fix current stage after unwind
* fix current stage after unwind
* fix linter
* move unwind of tx_pool after unwind of unwind of senders, then all stages from body to tx_pool will be inside tx.
* move body and headers unwind out of tx
* fix unwind order after reboot
* add support external tx to exec stage
* clean
* clean
* clean
* clean
* clean
* add logs
* better id check
* better id check
* timer-based logs
* timer-based logs
* delegate progress calculation to user
* delegate progress calculation to user
* delegate progress calculation to user
* clear
* add logs to senders recovery
* use default dir in integration
* more logs
* more logs
* add logging to loader
* use pure tx in etl loading, logs in mutation commit
* clean
* bletter logging and more cleanup
* bletter logging and more cleanup
* increase batch size to 500M
* better batch commit logging
* async fsync
* sync fsync
* sync fsync
* unify logging
* fix corner-case when etl can use empty bucket name
* fix tests
* better logging
* better logging
* rebase master
* remove lmdb.NoMetaSync flag for now
* consistent walk and multi-walk
* clean
* sub tx
* add consistent multi-put
* implement dupsort support in one new cursor method
* clear
* core: avoid modification of accountSet cache in tx_pool
when runReorg, we may copy the dirtyAccounts' accountSet cache to promoteAddrs
in which accounts will be promoted, however, if we have reset request at the
same time, we may reuse promoteAddrs and modify the cache content which is
against the original intention of accountSet cache. So, we need to make a new
slice here to avoid modify accountSet cache.
* core: fix flatten condition + comment
Co-authored-by: Felix Lange <fjl@twurst.com>
This replaces the two-stage shutdown scheme with the one we
use almost everywhere else: a single quit channel signalling
termination.
Co-authored-by: Felix Lange <fjl@twurst.com>
* eth/downloader: refactor downloader + queue
downloader, fetcher: throttle-metrics, fetcher filter improvements, standalone resultcache
downloader: more accurate deliverytime calculation, less mem overhead in state requests
downloader/queue: increase underlying buffer of results, new throttle mechanism
eth/downloader: updates to tests
eth/downloader: fix up some review concerns
eth/downloader/queue: minor fixes
eth/downloader: minor fixes after review call
eth/downloader: testcases for queue.go
eth/downloader: minor change, don't set progress unless progress...
eth/downloader: fix flaw which prevented useless peers from being dropped
eth/downloader: try to fix tests
eth/downloader: verify non-deliveries against advertised remote head
eth/downloader: fix flaw with checking closed-status causing hang
eth/downloader: hashing avoidance
eth/downloader: review concerns + simplify resultcache and queue
eth/downloader: add back some locks, address review concerns
downloader/queue: fix remaining lock flaw
* eth/downloader: nitpick fixes
* eth/downloader: remove the *2*3/4 throttling threshold dance
* eth/downloader: print correct throttle threshold in stats
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
# Conflicts:
# eth/downloader/downloader.go
# eth/downloader/downloader_test.go
# eth/downloader/queue.go
# eth/downloader/statesync.go
# eth/fetcher/block_fetcher.go
Solves issue#20582. Non-executable transactions should not be evicted on each tick if there are no promote transactions or if a pending/reset empties the pending list. Tests and logging expanded to handle these cases in the future.
core/tx_pool: use a ts for each tx in the queue, but only update the heartbeat on promotion or pending replaced
queuedTs proper naming
# Conflicts:
# core/tx_pool.go
* core: added local tx pool test case
* core, crypto: various allocation savings regarding tx handling
* core/txlist, txpool: save a reheap operation, avoid some bigint allocs
Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
Reverting because this change started handling account balances as
uint64 in the transaction pool, which is incorrect.
This reverts commit af5c97aebe1d37486635521ef553cb8bd4bada13.
# Conflicts:
# core/types/transaction.go
This change further improves the performance of RLP encoding by removing
allocations for big.Int and [...]byte types. I have added a new benchmark
that measures RLP encoding of types.Block to verify that performance is
improved.
# Conflicts:
# core/types/block_test.go
# rlp/encode.go
# rlp/encode_test.go
* core: use uint64 for total tx costs instead of big.Int
* core: added local tx pool test case
* core, crypto: various allocation savings regarding tx handling
* Update core/tx_list.go
* core: added tx.GasPriceIntCmp for comparison without allocation
adds a method to remove unneeded allocation in comparison to tx.gasPrice
* core: handle pools full of locals better
* core/tests: benchmark for tx_list
* core/txlist, txpool: save a reheap operation, avoid some bigint allocs
Co-authored-by: Martin Holst Swende <martin@swende.se>
# Conflicts:
# common/math/integer.go
# core/tx_list.go
# core/tx_pool.go
# core/types/transaction.go
* core, crypto: various allocation savings regarding tx handling
* core: reduce allocs for gas price comparison
This change reduces the allocations needed for comparing different transactions to each other.
A call to `tx.GasPrice()` copies the gas price as it has to be safe against modifications and
also needs to be threadsafe. For comparing and ordering different transactions we don't need
these guarantees
* core: added tx.GasPriceIntCmp for comparison without allocation
adds a method to remove unneeded allocation in comparison to tx.gasPrice
* core/types: pool legacykeccak256 objects in rlpHash
rlpHash is by far the most used function in core that allocates a legacyKeccak256 object on each call.
Since it is so widely used it makes sense to add pooling here so we relieve the GC.
On my machine these changes result in > 100 MILLION less allocations and > 30 GB less allocated memory.
* reverted some changes
* reverted some changes
* trie: use crypto.KeccakState instead of replicating code
Co-authored-by: Martin Holst Swende <martin@swende.se>
# Conflicts:
# core/tx_list.go
# core/tx_pool.go
# core/types/block.go
# core/types/transaction.go
# trie/committer.go
# trie/hasher.go
This PR implements the EVM state transition tool, which is intended
to be the replacement for our retesteth client implementation.
Documentation is present in the cmd/evm/README.md file.
Co-authored-by: Felix Lange <fjl@twurst.com>
# Conflicts:
# cmd/evm/main.go
# core/state/dump.go
# core/state/state_test.go
# tests/state_test_util.go
* core/vm: fix incorrect computation of discount
During testing on Yolov1 we found that the way geth calculates the discount
is not in line with the specification. Basically what we did is calculate
128 * Bls12381GXMulGas * discount / 1000 whenever we received more than 128 pairs
of values. Correct would be to calculate k * Bls12381... for k > 128.
* core/vm: better logic for discount calculation
* core/vm: better calculation logic, added worstcase benchmarks
* core/vm: better benchmarking logic
Once we detect an invalid transaction during recovering signatures, we should
directly exclude this transaction to avoid validating the signatures hereafter.
This should optimize the validations times of transactions with invalid signatures
to only one time.
* return error from rawdb
* squash
* v14
* improve performance of put
* clean
* clean
* hide feature behind ENV variable
* cleanup
* cleanup
* disable ipc and make Readme less confusing (people thought points are depend on each-other)
* fix test
* cleanup
* cleanup
* save state
* cleanup
* add walkasof test for storage with chunks
* fix lint
* fix lint
* remove useless comments
* fix dump test
* move accountRange test to plain state
* get last block fixes