Skip to content

Fix for the p2p deadlock when remapping the database#5

Merged
AlexeyAkhunov merged 1 commit into
masterfrom
fix_p2p_deadlock
May 30, 2019
Merged

Fix for the p2p deadlock when remapping the database#5
AlexeyAkhunov merged 1 commit into
masterfrom
fix_p2p_deadlock

Conversation

@AlexeyAkhunov

Copy link
Copy Markdown
Contributor

No description provided.

@AlexeyAkhunov AlexeyAkhunov merged commit 0a22015 into master May 30, 2019
@AlexeyAkhunov AlexeyAkhunov deleted the fix_p2p_deadlock branch May 31, 2019 21:10
mandrigin pushed a commit that referenced this pull request Jan 29, 2020
* Add more functionality to the sim (#5)

* backends: implement more of ethclient in sim

* backends: add BlockByNumber to simulated backend

* backends: make simulated progress function agree with syncprogress interface for client

* backends: add more tests

* backends: add more comments

* backends: fix sim for index in tx and add tests

* backends: add lock back to estimategas

* backends: goimports

* backends: go ci lint

* Add more functionality to the sim (#5)

* backends: implement more of ethclient in sim

* backends: add BlockByNumber to simulated backend

* backends: make simulated progress function agree with syncprogress interface for client

* backends: add more tests

* backends: add more comments

* backends: fix sim for index in tx and add tests

* backends: add lock back to estimategas

* backends: goimports

* backends: go ci lint

* assert errs
mandrigin pushed a commit that referenced this pull request Jan 30, 2020
* Add more functionality to the sim (#5)

* backends: implement more of ethclient in sim

* backends: add BlockByNumber to simulated backend

* backends: make simulated progress function agree with syncprogress interface for client

* backends: add more tests

* backends: add more comments

* backends: fix sim for index in tx and add tests

* backends: add lock back to estimategas

* backends: goimports

* backends: go ci lint

* Add more functionality to the sim (#5)

* backends: implement more of ethclient in sim

* backends: add BlockByNumber to simulated backend

* backends: make simulated progress function agree with syncprogress interface for client

* backends: add more tests

* backends: add more comments

* backends: fix sim for index in tx and add tests

* backends: add lock back to estimategas

* backends: goimports

* backends: go ci lint

* assert errs
AlexeyAkhunov added a commit that referenced this pull request Feb 14, 2021
…into a separate stream (#5)

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
AlexeyAkhunov added a commit that referenced this pull request Feb 15, 2021
…#1497)

* Initial commit

* Add sentry gRPC interface

* p2psentry directory

* Update README.md

* Update README.md

* Update README.md

* Add go package

* Correct syntax

* add external downloader interface (#2)

* Add txpool (#3)

* Add private API (#4)

* Invert control.proto, add PeerMinBlock, Separare incoming Tx message into a separate stream (#5)

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>

* Use new p2psentry interface

* Remove

* Fix lint

* Fix lint

* Separate upload messages into its own stream (#6)

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>

* Add header upload

* Remove

* Add upload of block headers

* Add block bodies upload

* Fix lint

* Bugfix for blockBodies

* Fix for body upload logging

* Print peerId for GetBlockHeaders

* Invoke block hashes stage to enable block body upload

* Fix test

* Fix stuck bodies download

Co-authored-by: Artem Vorotnikov <artem@vorotnikov.me>
Co-authored-by: b00ris <b00ris@mail.ru>
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
AlexeyAkhunov added a commit that referenced this pull request Mar 19, 2021
* Initial commit

* Add sentry gRPC interface

* p2psentry directory

* Update README.md

* Update README.md

* Update README.md

* Add go package

* Correct syntax

* add external downloader interface (#2)

* Add txpool (#3)

* Add private API (#4)

* Invert control.proto, add PeerMinBlock, Separare incoming Tx message into a separate stream (#5)

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>

* Separate upload messages into its own stream (#6)

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>

* Only send changed accounts to listeners (#7)

* Txpool interface doc (#9)

* More additions

* More additions

* Fix locking

* Intermediate

* Fix separation of phases

* Intermediate

* Fix test

* More transformations

* New simplified way of downloading headers

* Fix hard-coded header sync

* Fixed syncing near the tip of the chain

* Add architecture diagram source and picture (#10)

* More fixes

* rename tip to link

* Use preverified hashes instead of preverified headers

* Fix preverified hashes generation

* more parametrisation

* Continue parametrisation

* Fix grpc data limit, interruption of headers stage

* Add ropsten preverified hashes

* Typed hashes (#11)

* Typed hashes

* Fix PeerId

* 64-bit tx nonce

* Disable penalties

* Add goerli settings, bootstrap nodes

* Try to fix goerly sync

* Remove interfaces

* Add proper golang packages, max_block into p2p sentry Status

* Prepare for proto overhaul

* Squashed 'interfaces/' content from commit ce36053

git-subtree-dir: interfaces
git-subtree-split: ce36053

* Change EtherReply to address

* Adaptations to new types

* Switch to new types

* Fixes

* Fix formatting

* Fix lint

* Lint fixes, reverse order in types

* Fix lint

* Fix lint

* Fix lint

* Fix test

* Not supporting eth/66 yet

* Fix shutdown

* Fix lint

* Fix lint

* Fix lint

* return stopped check

Co-authored-by: Artem Vorotnikov <artem@vorotnikov.me>
Co-authored-by: b00ris <b00ris@mail.ru>
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
Co-authored-by: lightclient <14004106+lightclient@users.noreply.github.com>
Co-authored-by: canepat <16927169+canepat@users.noreply.github.com>
sambacha referenced this pull request in contractshark/turbo-geth Apr 5, 2021
* Initial commit

* Add sentry gRPC interface

* p2psentry directory

* Update README.md

* Update README.md

* Update README.md

* Add go package

* Correct syntax

* add external downloader interface (#2)

* Add txpool (#3)

* Add private API (#4)

* Invert control.proto, add PeerMinBlock, Separare incoming Tx message into a separate stream (#5)

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>

* Separate upload messages into its own stream (erigontech#6)

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>

* Only send changed accounts to listeners (erigontech#7)

* Txpool interface doc (erigontech#9)

* More additions

* More additions

* Fix locking

* Intermediate

* Fix separation of phases

* Intermediate

* Fix test

* More transformations

* New simplified way of downloading headers

* Fix hard-coded header sync

* Fixed syncing near the tip of the chain

* Add architecture diagram source and picture (erigontech#10)

* More fixes

* rename tip to link

* Use preverified hashes instead of preverified headers

* Fix preverified hashes generation

* more parametrisation

* Continue parametrisation

* Fix grpc data limit, interruption of headers stage

* Add ropsten preverified hashes

* Typed hashes (erigontech#11)

* Typed hashes

* Fix PeerId

* 64-bit tx nonce

* Disable penalties

* Add goerli settings, bootstrap nodes

* Try to fix goerly sync

* Remove interfaces

* Add proper golang packages, max_block into p2p sentry Status

* Prepare for proto overhaul

* Squashed 'interfaces/' content from commit ce36053

git-subtree-dir: interfaces
git-subtree-split: ce36053

* Change EtherReply to address

* Adaptations to new types

* Switch to new types

* Fixes

* Fix formatting

* Fix lint

* Lint fixes, reverse order in types

* Fix lint

* Fix lint

* Fix lint

* Fix test

* Not supporting eth/66 yet

* Fix shutdown

* Fix lint

* Fix lint

* Fix lint

* return stopped check

Co-authored-by: Artem Vorotnikov <artem@vorotnikov.me>
Co-authored-by: b00ris <b00ris@mail.ru>
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
Co-authored-by: lightclient <14004106+lightclient@users.noreply.github.com>
Co-authored-by: canepat <16927169+canepat@users.noreply.github.com>
sambacha referenced this pull request in contractshark/turbo-geth Apr 5, 2021
* accounts/keystore: use github.com/google/uuid (#22217)

This replaces the github.com/pborman/uuid dependency with
github.com/google/uuid because the former is only a wrapper for
the latter (since v1.0.0).

Co-authored-by: Felix Lange <fjl@twurst.com>
# Conflicts:
#	accounts/keystore/key.go
#	accounts/keystore/passphrase.go
#	accounts/keystore/presale.go
#	cmd/ethkey/generate.go
#	go.mod
#	go.sum

* core/state: fix eta calculation on pruning (#22386)

* les: UDP pre-negotiation of available server capacity (#22183)

This PR implements the first one of the "lespay" UDP queries which
is already useful in itself: the capacity query. The server pool is making
use of this query by doing a cheap UDP query to determine whether it is
worth starting the more expensive TCP connection process.
# Conflicts:
#	les/client.go
#	les/clientpool.go
#	les/clientpool_test.go
#	les/enr_entry.go
#	les/server.go
#	les/vflux/client/serverpool.go
#	les/vflux/client/serverpool_test.go
#	les/vflux/server/balance.go
#	les/vflux/server/balance_test.go
#	les/vflux/server/prioritypool.go
#	les/vflux/server/prioritypool_test.go
#	p2p/nodestate/nodestate.go

* core/rawdb: fix the transaction indexer (#22395)

# Conflicts:
#	core/rawdb/chain_iterator.go

* core, eth: unship EIP 2315

# Conflicts:
#	core/vm/contract.go
#	core/vm/gen_structlog.go
#	core/vm/instructions.go
#	core/vm/instructions_test.go
#	core/vm/interpreter.go
#	core/vm/logger.go
#	core/vm/logger_json.go
#	core/vm/logger_test.go
#	core/vm/stack/stack.go
#	eth/tracers/tracer.go
#	eth/tracers/tracer_test.go

* core/vm/runtime: more unshipping

# Conflicts:
#	core/vm/runtime/runtime_test.go

* cmd/geth: put allowUnsecureTx flag in RPC section (#22412)

# Conflicts:
#	cmd/geth/usage.go

* params: update chts (#22418)

* cmd/utils: fix txlookuplimit for archive node (#22419)

* cmd/utils: fix exclusive check for archive node

* cmd/utils: set the txlookuplimit to 0
# Conflicts:
#	cmd/utils/flags.go

* core/forkid, params: unset Berlin fork number (#22413)

* les: fix nodiscover option on the client side (#22422)

# Conflicts:
#	les/client.go
#	les/vflux/client/serverpool.go
#	les/vflux/client/serverpool_test.go

* cmd: retire whisper flags (#22421)

* cmd: retire whisper flags

* cmd/geth: remove whisper configs
# Conflicts:
#	cmd/geth/config.go
#	cmd/geth/consolecmd.go
#	cmd/geth/main.go
#	cmd/geth/usage.go
#	cmd/utils/flags.go

* tests: update to latest tests (#22290)

This updates the consensus tests to commit 31d6630 and
adds support for access list transactions in the test runner.

Co-authored-by: Martin Holst Swende <martin@swende.se>
# Conflicts:
#	tests/block_test.go
#	tests/gen_sttransaction.go
#	tests/state_test_util.go

* params: release geth 1.10.0 stable

# Conflicts:
#	params/version.go

* params: begin v1.10.1 release cycle

# Conflicts:
#	params/version.go

* Revert "core/forkid, params: unset Berlin fork number (#22413)"

This reverts commit ba99910.

* build: fix PPA failure due to updated debsrc

# Conflicts:
#	build/ci.go

* build: add support for Ubuntu Hirsute Hippo

# Conflicts:
#	build/ci.go

* tests: update reference tests with 2315 removed from Berlin

# Conflicts:
#	tests/testdata

* params: release Geth v1.10.1

# Conflicts:
#	params/version.go

* Compilation fixes

* Fix rcpdaemon compilation

* Fix more compile errors

* Update testdata

* Fixes

* remove mentions of go-ethereum

* remove unneded les fuzzers

* remove rangeproof fuzzer

* Fixes

* Fixes

* Delete

* Fix tg crash again

* more compilation fixes

* Remove database files

* More compilation fixes

* fix compilation in blockchain_test.go

* fix compilation in runtime_fuzz

* fix consensus tests

* fixes to core tests (compilation)

* core tests compile now

* core/vm tests fixes

* fix core/rawdb

* cleanup runtime_test from the unimplemented EIP

* skip deadlock

* remove duplicate tests

* semi-fix graphql tests (compiles but 1 test fails)

* compile core/types (tests still fail)

* fix internal/guide tests

* fix eth/filters

* fix miner tests

* fix abi fuzzers

* ./test compiles

* ethclient tests compile

* eth/downloader compiles

* some fixes

* fix some eth handler tests

* ./eth tests builds

* skip downloader tests that hang

* For fox stage_senders

* Fixes

* fix rlp fuzzer issue

* change handler_test

* fixups to handler_test

* fix rawdb tests

* skip tx pool deadlock

* fix core state processor test

* fix DeriveFields test

* debug

* fixup core/types

* fix eth/downloader

* fix graphql tests

* less metrics performance impact

* less metrics performance impact

* use non-app metric to parse in grafana variables

* add periodical db statistic metrics (erigontech#1545)

* add periodical db statistic metrics (erigontech#1546)

* Grafana: add Btree metrics (erigontech#1547)

* table stat metrics

* add docker-compose udp port

* Trie: use APPEND when re-generating trie. Also including db-migration for PR#1535 (erigontech#1549)

* TxDb: Walk method - to reuse cursors (erigontech#1548)

* Trie: add invariant - first level of trie must be in DB (to ensure having 100% trie structure in trie_account table) (erigontech#1522)

* Add mdbx_drop cli tool (erigontech#1553)

* Fix Typo in Makefile (erigontech#1555)

stats -> state

* remove ethclient and checkpoint-admin (unused)

* semi-cleanup of eth/tracers

* fixups

* return testdata

* add tracer_test

* Fix cmd/rpcdaemon tests

* Remove files

* Fix eth/tracwers

* Fix eth/protocols/eth

* Fix for 1 test in eth

* Lint fixes

* fixme: skip tests for ZK (too slow on MDBX), recover later

* use lmdb for in-mem database and restore zk tests

* Fix lints

* fix one issue in TestEIP2718Transition

* Revert "fix one issue in TestEIP2718Transition"

This reverts commit b92995f.

* Fix lints

* Fix lints, fork split test

* Fix lints

* Fix lints

* Fix lints

* Fix lints

* unmark fixed tests

* workaround `./tests`

* fix `./eth`

* skip headerchain test

* linter fixups

* fix linter

* more linter fixes

* and more linter fixes

* and more lint fixes

* lint passes

* skip failing test 1

* fix ethash test

* Update skip analysis

* Fix TestEIP2718Transition

* begin 2021.03.02 release cycle

* Align Cursor API with LMDB/MDBX (erigontech#1558)

* go 1.16 support (erigontech#1509)

* Update instructions for Windows users (erigontech#1562)

WSL instructions

* Split header prefix bucket to headers, td and canonical (erigontech#1556)

* split headers prefix

* migration

* fix downloader bug

* test for migration

* fix lint

* uncomment t.Prallel

* fix postprocessing test

* Update config.yml (erigontech#1564)

* Try to fix multiple head subscriptions (erigontech#1565)

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>

* Adjust comments to Buckets after PR-1556 (erigontech#1566)

* More updates to downloader, new p2psentry protocol (erigontech#1559)

* Initial commit

* Add sentry gRPC interface

* p2psentry directory

* Update README.md

* Update README.md

* Update README.md

* Add go package

* Correct syntax

* add external downloader interface (#2)

* Add txpool (#3)

* Add private API (#4)

* Invert control.proto, add PeerMinBlock, Separare incoming Tx message into a separate stream (#5)

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>

* Separate upload messages into its own stream (erigontech#6)

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>

* Only send changed accounts to listeners (erigontech#7)

* Txpool interface doc (erigontech#9)

* More additions

* More additions

* Fix locking

* Intermediate

* Fix separation of phases

* Intermediate

* Fix test

* More transformations

* New simplified way of downloading headers

* Fix hard-coded header sync

* Fixed syncing near the tip of the chain

* Add architecture diagram source and picture (erigontech#10)

* More fixes

* rename tip to link

* Use preverified hashes instead of preverified headers

* Fix preverified hashes generation

* more parametrisation

* Continue parametrisation

* Fix grpc data limit, interruption of headers stage

* Add ropsten preverified hashes

* Typed hashes (erigontech#11)

* Typed hashes

* Fix PeerId

* 64-bit tx nonce

* Disable penalties

* Add goerli settings, bootstrap nodes

* Try to fix goerly sync

* Remove interfaces

* Add proper golang packages, max_block into p2p sentry Status

* Prepare for proto overhaul

* Squashed 'interfaces/' content from commit ce36053

git-subtree-dir: interfaces
git-subtree-split: ce36053

* Change EtherReply to address

* Adaptations to new types

* Switch to new types

* Fixes

* Fix formatting

* Fix lint

* Lint fixes, reverse order in types

* Fix lint

* Fix lint

* Fix lint

* Fix test

* Not supporting eth/66 yet

* Fix shutdown

* Fix lint

* Fix lint

* Fix lint

* return stopped check

Co-authored-by: Artem Vorotnikov <artem@vorotnikov.me>
Co-authored-by: b00ris <b00ris@mail.ru>
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
Co-authored-by: lightclient <14004106+lightclient@users.noreply.github.com>
Co-authored-by: canepat <16927169+canepat@users.noreply.github.com>

* move remote eth backend from ethdb to core package (erigontech#1567)

* KV: Remove reserve, putcurrent, cmp, dcmp (erigontech#1552)

* grpc version up (erigontech#1568)

* Simple test for layout of TrieOfAccountsBucket  (erigontech#1563)

* don't loose error in test

* KV: split Sequence into ReadSequence and MakeSequence (erigontech#1569)

* Update README.md (erigontech#1571)

* Update README.md (erigontech#1572)

* Update README.md (erigontech#1573)

* Tests: use transaction instead of db.MemCopy in chain_makers.go (erigontech#1570)

* mdbx tests speedup

* mdbx tests speedup

* devel up

* devel up

* devel up

* lint

* less db copy

* don't loose error in test

* clean

* devel up (erigontech#1574)

* Hide TxDb (erigontech#1575)

* Remove autogen from typedcursor (erigontech#1576)

* remove old flags

* remove old flags

* fix tests

* fix tests

* revert

* Revert "remove old flags"

This reverts commit 009c098.

* revert

* KV: Split RO and RW transactions (erigontech#1577)

* MDBX bindings: remove finalizers (write tx require to be closed from same thread) (erigontech#1579)

* Handshake in tests, correct ENR updates, etc. (erigontech#1578)

* Remove Blockchain dependency from forkID, fix ENR update

* Fix handshake_test

* Remove db access from handshake

* Undo

* Use StagedSync in test handlers

* Compile fix

* Debugging

* dependency fixes

* More info

* Print test name

* Increase timeout

* Disable checkpoint test

* Optimise RW message pipe

* Fix test

* Print handshake errors

* See where the pipe is closing

* Remove checkpoints

* Remove printouts

* Revert "Fix test"

This reverts commit d154e07.

* Revert "Optimise RW message pipe"

This reverts commit 6936111.

* Revert "Increase timeout"

This reverts commit 9dc0e23.

* Revert "See where the pipe is closing"

This reverts commit 3cf22af.

* Remove printing

* Relax peerEventCh

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>

* remove ideal batch size (erigontech#1582)

* Update Makefile (erigontech#1583)

* mining uncles (erigontech#1581)

* db commit - remove unused return param (erigontech#1584)

* no_panic_be_happy (erigontech#1586)

* no false alert (erigontech#1588)

* Senders table size regression: loadfunc preventing use of APPEND (erigontech#1585)

* Fix some conformance tests broken after rebase (erigontech#1587)

* Uncomment

* Try to fix

* Try again

* Compile fix

* Compile fix

* Compile fix

* Compile fix

* Compile fix

* fix lint

* Enable more tests

* Fix core tests

* Remove comment outs

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>

* RPCDaemon: increase throughput by allowing more parallel grpc streams and not lockthread for read tx (erigontech#1580)

* Mining stage (erigontech#1554)

* temporary return miner to avoid nil pointer

* remove_warning_when_mining_disabled (erigontech#1591)

* Kill cmd/state/stateless (erigontech#1592)

* Move stuff around

* Remove

* tidy

* Fix for writeReceipt printing

* fix lint typo

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>

* Update stages.go (erigontech#1593)

* Add debug_accountAt to rpcdaemon README (erigontech#1594)

* Mining - don't write changesets to batch (erigontech#1595)

* Correct forkID computation in sentry, use blocks prefetched by NewBlockPacket, Fix NaN delivery speed output (erigontech#1596)

* Use proper forkID

* Remove NaN from Write block bodies messages

* Move Prefetched blocks

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>

* Create TESTING.md (erigontech#1597)

* Fixes to new downloader (erigontech#1599)

* Fix for prefetched bodies

* Do not reset headers stage to 0

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>

* ObjectDatabase cleanup (erigontech#1598)

* ObjectDatabase cleanup

* Remove ObjectDatabase::WarmUp

* Mining: use noop writer when applyTx, pending logs subscription (erigontech#1600)

* Mining: to use correct ibs snapshot (erigontech#1601)

* Update skip_analysis (erigontech#1602)

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>

* begin release cycle 2021.03.03

* Mining test: set correct header.Timestamp and header.GasLimit (erigontech#1603)

* mdbx: switch to master branch

* Remove unused code (erigontech#1604)


* Remove graphql, legacy options

* Remove CODEOWNERS

* Remove EWASM and custom EVM interpreter

* Genesis: calculate root by common components (erigontech#1608)

* Update TESTING.md (erigontech#1609)

* Remove puppeth & account management (erigontech#1610)

* rpctest commands to support block ranges, integration tool to allow tx tracing into files (erigontech#1616)

* block range options for rpctest

* convert bench8 to fastjson

* Add txtrace to integration tool

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>

* Genesis.toBlock remove db from arguments (erigontech#1611)

* Remove blockchain object from some tests (erigontech#1612)

* Mining: remove local pow mining (from ethash), --miner.notify is required now, cycle is non-blocking now (erigontech#1617)

* metrics for header/body/exec stages (erigontech#1618)

* Lazy fix for eth_getLogs (erigontech#1620)

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>

* Fix lints and remove more unused code (erigontech#1621)

* Add Actions workflow (erigontech#1606)

* RPC: Pending transactions/blocks/logs  (erigontech#1625)

* Mining docs (erigontech#1628)

* Port rpcdaemon to KV interface (erigontech#1627)

* Add readAccount hack (erigontech#1629)

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>

* Fix compilation error in hack.go (erigontech#1633)

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>

* Add Docker step to Actions workflow (erigontech#1630)

* tests (erigontech#1631)

* context leak fix (erigontech#1632)

* increase tests timeout

* infinite gas cap for gas estimate (erigontech#1638)

* estimate_gas: to accept optional block or hash (erigontech#1639)

* set locals in tx pool constructor (erigontech#1637)

* old loader remove v1 (erigontech#1641)

* remove unused metrics (erigontech#1643)

* Remove old loader, part 2 (erigontech#1642)

* rpctest: Recording requests and responses and replay command (erigontech#1644)

* Record to file

* Add replay command

* Update doc

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>

* headers: remove with cancel (erigontech#1640)

* remove with cancel

* remove with cancel

* remove with cancel

* corner_case_return_null_when_block_not (erigontech#1646)

* Remove old loader, step 3 (remove some tds and blockchain objects in tests) (erigontech#1647)

* Remove blockchain object from simulated backend (erigontech#1648)

* bump version due to the month change

* Update skip_analysis.go (erigontech#1649)

* Add files via upload (erigontech#1650)

* begin 2021.04.02 release cycle

* Add files via upload (erigontech#1652)

* fixed win build (erigontech#1654)

* fixed win build (erigontech#1655)

* Remove tds in few tests (erigontech#1657)

* tx.RwCursor() to return err (first step of removing lazy cursors) (erigontech#1656)

* more (erigontech#1658)

* etl to use rwtx (erigontech#1660)

* Try windows build (take 2) (erigontech#1659)

* Update ci.yml

* Update ci.yml

* Update ci.yml

* Update ci.yml

* Update ci.yml

* Add files via upload (erigontech#1662)

* fix empty bucket name

* Nuke remnants of non-staged-sync modes (erigontech#1664)

* bitmapdb to use rwtx (erigontech#1661)

* Mdb no db size log (erigontech#1665)

* Remove ancients and some old skipped tests (erigontech#1668)

* Nuke old miner and mux (erigontech#1666)

* Stateless Tx interface (erigontech#1667)

* Harmonize DB APIs (erigontech#1669)

* KV: Unified Has (erigontech#1671)

* Fix readme links (erigontech#1672)

minor readme link fixes. The markdown was off.

* Add files via upload

* Add files via upload

* Add files via upload

* Add files via upload

* Add files via upload

* Delete find-tip.png

* Add files via upload

* Add files via upload

* Add files via upload

* Add files via upload

* Mutation: implement StatelessRwTx (erigontech#1670)

* remove blockchain.InsertChain call from downloader (erigontech#1674)

* clean (erigontech#1677)

* Remove ReadAllHashes (erigontech#1678)

* fix interfaces

* Squashed 'interfaces/' content from commit a013c31

git-subtree-dir: interfaces
git-subtree-split: a013c31

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Felföldi Zsolt <zsfelfoldi@gmail.com>
Co-authored-by: gary rong <garyrong0905@gmail.com>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
Co-authored-by: Igor Mandrigin <i@mandrigin.ru>
Co-authored-by: alex.sharov <AskAlexSharov@gmail.com>
Co-authored-by: Chase Wright <mysticryuujin@gmail.com>
Co-authored-by: Artem Vorotnikov <artem@vorotnikov.me>
Co-authored-by: Andrea Lanfranchi <andrea.lanfranchi@gmail.com>
Co-authored-by: b00ris <b00ris@mail.ru>
Co-authored-by: ledgerwatch <akhounov@gmail.com>
Co-authored-by: lightclient <14004106+lightclient@users.noreply.github.com>
Co-authored-by: canepat <16927169+canepat@users.noreply.github.com>
Co-authored-by: Andrew Ashikhmin <34320705+yperbasis@users.noreply.github.com>
Co-authored-by: Lefteris Karapetsas <lefteris@refu.co>
AlexeyAkhunov added a commit that referenced this pull request Apr 24, 2021
* Initial commit

* Add sentry gRPC interface

* p2psentry directory

* Update README.md

* Update README.md

* Update README.md

* Add go package

* Correct syntax

* add external downloader interface (#2)

* Add txpool (#3)

* Add private API (#4)

* Invert control.proto, add PeerMinBlock, Separare incoming Tx message into a separate stream (#5)

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>

* Separate upload messages into its own stream (#6)

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>

* Only send changed accounts to listeners (#7)

* Txpool interface doc (#9)

* Add architecture diagram source and picture (#10)

* Typed hashes (#11)

* Typed hashes

* Fix PeerId

* 64-bit tx nonce

* Add proper golang packages, max_block into p2p sentry Status (#12)

* Add proper golang packages, max_block into p2p sentry Status

* Change EtherReply to address

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>

* Add Rust infrastructure (#13)

* DB stats methods removed by #1665

* more p2p methods (#15)

* add mining methods (#16)

* First draft of Consensus gRPC interface (#14)

* Update Rust build

* Fix interfaces in architecture diagram (#17)

* Fix KV interface provider

* Fix Consensus interface provider

* drop java attributes (#18)

* tx pool remove unused import (#19)

* ethbackend: add protocol version and client version (#20)

* Add missing ethbackend I/F (#21)

* Add interface versioning mechanism (#23)

Add versioning in KV interface

Co-authored-by: Artem Vorotnikov <artem@vorotnikov.me>

* spec of tx pool method (#24)

* spec of tx pool method (#25)

* Update version.proto

* Refactor interface versioning

* Refactor interface versioning

* Testing interface

* Remove tree

* Fix

* Build testing protos

* Fix

* Fix

* Update to the newer interfaces

* Add ProtocolVersion and ClientVersion stubs

* Hook up ProtocolVersion and ClientVersion

* Remove service

* Add compatibility checks for RPC daemon

* Fix typos

* Properly update DB schema version

* Fix test

* Add test for KV compatibility|

* Info messages about compability for RPC daemon

* DB schema version to be one key

* Update release intructions

Co-authored-by: Artem Vorotnikov <artem@vorotnikov.me>
Co-authored-by: b00ris <b00ris@mail.ru>
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
Co-authored-by: lightclient <14004106+lightclient@users.noreply.github.com>
Co-authored-by: canepat <16927169+canepat@users.noreply.github.com>
Co-authored-by: Alex Sharov <AskAlexSharov@gmail.com>
Co-authored-by: canepat <tullio.canepa@gmail.com>
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
dmitry123 referenced this pull request in Ankr-network/erigon Dec 17, 2021
Hotfix for error check in Parlia consensus
pgebal pushed a commit to imapp-pl/erigon that referenced this pull request Jan 16, 2023
pcw109550 pushed a commit to sunnyside-io/erigon that referenced this pull request May 19, 2023
…storical-and-sequencer

Relay to historical and sequencer
battlmonstr pushed a commit that referenced this pull request Sep 14, 2023
revitteth referenced this pull request in 0xPolygon/cdk-erigon Dec 12, 2023
AskAlexSharov added a commit that referenced this pull request Jan 31, 2024
# This is the 1st commit message:

save

# This is the commit message #2:

save

# This is the commit message #3:

save

# This is the commit message #4:

save

# This is the commit message #5:

save
cffls added a commit to cffls/erigon that referenced this pull request Jul 15, 2024
Make read list in zero trace agnostic to opcodes
taratorio pushed a commit that referenced this pull request Jul 23, 2024
AskAlexSharov added a commit that referenced this pull request Apr 18, 2025
# This is the 1st commit message:

save

save

# This is the commit message #2:

save

# This is the commit message #3:

save

# This is the commit message #4:

save

# This is the commit message #5:

save

# This is the commit message #7:

save

# This is the commit message #9:

save

# This is the commit message #10:

save

# This is the commit message #11:

save

# This is the commit message #12:

save

# This is the commit message #13:

save

# This is the commit message #14:

save

# This is the commit message #15:

save

# This is the commit message #16:

save

# This is the commit message #18:

save

# This is the commit message #19:

save
AskAlexSharov added a commit that referenced this pull request Apr 20, 2025
# This is the 1st commit message:

# This is a combination of 19 commits.
# This is the 1st commit message:

save

save

# This is the commit message #2:

save

# This is the commit message #3:

save

# This is the commit message #4:

save

# This is the commit message #5:

save

# This is the commit message #7:

save

# This is the commit message #9:

save

# This is the commit message #10:

save

# This is the commit message #11:

save

# This is the commit message #12:

save

# This is the commit message #13:

save

# This is the commit message #14:

save

# This is the commit message #15:

save

# This is the commit message #16:

save

# This is the commit message #18:

save

# This is the commit message #19:

save

# This is the commit message #2:

save
AskAlexSharov added a commit that referenced this pull request Apr 21, 2025
# This is the 1st commit message:

save

# This is the commit message #2:

save

# This is the commit message #3:

save

# This is the commit message #4:

save

# This is the commit message #5:

save

# This is the commit message #6:

save

# This is the commit message #7:

save

# This is the commit message #8:

save
AskAlexSharov added a commit that referenced this pull request Jun 27, 2025
# This is the 1st commit message:

save

# This is the commit message #2:

save

# This is the commit message #3:

save

# This is the commit message #4:

save

# This is the commit message #5:

save

# This is the commit message #6:

save

# This is the commit message #7:

save

# This is the commit message #8:

save

# This is the commit message #9:

save

# This is the commit message #10:

BodyOnlyTxn: for when only TxCount and BaseDataID is needed from blocks (#15599)

issue: #15516
# This is the commit message #11:

save

# This is the commit message #12:

save

# This is the commit message #13:

save

# This is the commit message #14:

save

# This is the commit message #15:

save

# This is the commit message #16:

save

# This is the commit message #17:

save

# This is the commit message #18:

save
AskAlexSharov added a commit that referenced this pull request Mar 14, 2026
…repo detection

Add TestFindFilesBySearchVersion_VersionRangeFiltering: verify that when both V1.0
and V1.1 files exist, SearchVersion selects V1.1 (highest within supported range).
Wrong selection → reading data with wrong format.

Add TestFindFilesByStrictSearchVersion: verify that StrictSearchVersion succeeds
with exactly one file and errors when multiple files are present (ambiguous).
This is the validation path for controlled file rotation.

Add TestFilesWithMissedAccessors_LargeRepo: verify that with 5 complete + 2 partial
files, only the 2 partial files are detected as missing BTree accessors, and the
reported files are exactly those with incomplete creation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sahil-4555 pushed a commit to Sahil-4555/erigon that referenced this pull request May 9, 2026
…tyRemoval (erigontech#21032)

## Summary

Fixes a wrong trie-root in the parallel commitment calculator when
post-tx writesets are indistinguishable between two cases:

1. **SELFDESTRUCT of a pre-existing contract** — serial keeps the leaf
with `incarnation>0`, zero balance/nonce/empty codeHash. Parallel was
emitting `DeleteUpdate` and removing the leaf.
2. **EIP-161 emptyRemoval** of a touched-empty account (e.g. `0xff…fe`
after the EIP-4788 system call) — serial emits `DeleteUpdate`. Parallel
was emitting a zero-account UPDATE.

The discriminator is the **pre-block incarnation**, which the writeset
alone didn't carry. Fix wires it through `LightCollector.DeleteAccount`
→ `IncarnationPath` write → `calcAccountState.Incarnation` → 3-way
branch in `FlushToUpdates`.

## Dependency direction

This PR is a **precursor for erigontech#21017** (the CI matrix that runs every
test under both `serial` and `parallel` exec modes). Without this fix,
parallel-mode tests on hive `rpc-compat`, `engine
api/cancun/withdrawals`, and the eest selfdestruct sub-suites all fail
with wrong-trie-root errors at SD/empty-removal blocks. **erigontech#21017 cannot
land until this PR lands.**

The matrix in erigontech#21017 will validate this PR end-to-end via the hive
parallel sub-suites — meaning this PR's parallel-exec changes don't run
in *this* PR's own CI, only in erigontech#21017's. The rebased erigontech#21017 is the
meaningful go/no-go signal.

## Changes

* `LightCollector.DeleteAccount` now emits `IncarnationPath` alongside
`SelfDestructPath=true` when `original.Incarnation > 0`. Calc receives
the pre-deletion incarnation through the same channel as every other
write — no exec-side state leakage.
* `calc_state.ApplyWrites` consumes `IncarnationPath` into
`calcAccountState.Incarnation` via direct type-assertion (panic on
mismatch — see *Concern 3* below).
* `calc_state.FlushToUpdates` switches on a 3-way `Deleted` branch with
`isAllZero` defense-in-depth:
* `Deleted && Incarnation>0 && all-zero` → zero-account UPDATE (matches
serial's `DomainDel`-leaves-post-CREATE-encoding for SD'd contracts)
* `Deleted && all-zero && Incarnation==0` → `DeleteUpdate` (matches
serial's `DomainDel`-truly-empties for EIP-161 emptyRemoval)
* `Deleted` with retained non-zero values → regular UPDATE — defensive
coverage for OOG-CREATE2-with-retained-balance and any future
write-ordering race
* `SelfDestructPath` also marks all tracked storage slots dirty so
`FlushToUpdates` emits per-slot updates alongside the account reset.
Load-bearing invariant: `normalizeWriteSet`'s `vm.StorageKeys(addr)`
loop emits `StoragePath=0` entries that arrive in `ApplyWrites` after
`SelfDestructPath`, overwriting the marked slots' values to zero so they
emit `DeleteUpdate` not `StorageUpdate(pre-SD value)`. Inline comment in
`calc_state.go` spells this out — see *Concern 2* below.

## Earlier draft snags (resolved)

The first draft also added an `IncarnationPath > 0` exclusion to
`normalizeWriteSet`'s empty-account check. This was **redundant** (the
empty-check already requires `Nonce == 0`, which excludes successful
CREATE/CREATE2) and **broke OOG-during-CREATE2 cases** (which leave
`Nonce=0/Balance=0/Code=empty/Incarnation=1` and *must* still be
deleted). Removed in `9539998f14`. The `exec3_parallel.go` diff in this
PR is now comments-only.

## Reviewer concerns addressed

### erigontech#1 (yperbasis): PR description was stale

This body. ✓

### erigontech#2 (yperbasis + Copilot): SD storage-cascade load-bearing invariant

Inline comment in `calc_state.go`'s `SelfDestructPath` case now spells
out the dependency on `normalizeWriteSet`'s `vm.StorageKeys(addr)` loop.
✓

### erigontech#3 (yperbasis + Copilot): IncarnationPath guarded type-assertion

Changed to direct `w.Val.(uint64)` to match the other paths. Silent zero
would route a real SD into the EIP-161 branch and reproduce the very
wrong-root bug — better to panic at the source. ✓

### erigontech#4 (yperbasis):
`TestFlushToUpdates_DeletedWithRetainedBalance_EmitsRegularUpdate`
docstring

Updated to clarify: this is **defensive coverage** for the third
`FlushToUpdates` branch in isolation, NOT a direct repro of the
eest_devnet OOG path. The actual OOG fix is the removal of the redundant
`IncarnationPath > 0` clause from `normalizeWriteSet` (the OOG writeset
has `Nonce=0` → empty-account → `DeleteUpdate`, not
`Deleted+RetainedBalance`). End-to-end coverage of that path lives in
the eest_devnet suite, surfaced via erigontech#21017's matrix. ✓

### erigontech#5 (yperbasis): `versionedWriteCollector.DeleteAccount` asymmetry —
*intentional non-fix*

Decision: **keep the asymmetry, document why.** Inline comment added on
`versionedWriteCollector.DeleteAccount` explaining:

* It's wired only into `txResult.finalize` (fee calc + post-Cancun
system calls).
* Neither path SDs a pre-existing contract today, so the
SD-with-incarnation differentiator is unreachable from here.
* If a future caller ever does emit `DeleteAccount` on a pre-existing
contract through this collector, the comment flags that this code should
mirror `LightCollector.DeleteAccount`'s `IncarnationPath` emit.

Adding the emit speculatively was rejected because: (a) it changes the
writeset shape for paths that today don't need it, (b) any test
exercising the new emit would be vacuous since no production caller hits
the `original.Incarnation > 0` branch, and (c) the comment is enough to
attribute the bug at first sight if someone *does* reach that code path
in the future.

## Intentional non-fixes

* **Concern erigontech#5 above** — `versionedWriteCollector.DeleteAccount` left
without the `IncarnationPath` emit (rationale above).
* **Defensive `TestFlushToUpdates_DeletedWithRetainedBalance` test
kept** despite the state being unreachable from real LightCollector
writesets today — protects the FlushToUpdates branch in isolation
against future ApplyWrites refactors that might drop the
`BalancePath`-clears-`Deleted` invariant.

## Test plan

- [x] All 6 unit tests in `calc_state_test.go` pass
(`TestFlushToUpdates_DeletedWithIncarnation_EmitsZeroAccountUpdate`,
`TestFlushToUpdates_DeletedWithoutIncarnation_EmitsDelete`,
`TestFlushToUpdates_DeletedWithRetainedBalance_EmitsRegularUpdate`,
`TestFlushToUpdates_LiveAccount_EmitsFullUpdate`,
`TestApplyWrites_IncarnationPath`,
`TestApplyWrites_BalancePathClearsDeleted`)
- [x] eest_devnet
`for_amsterdam/constantinople/eip1052_extcodehash/extcodehash/extcodehash_subcall_create2_oog`
all 6 variants pass locally
- [x] Full `for_amsterdam/constantinople` eest_devnet suite passes
- [x] `make lint` clean
- [x] CI on `9539998f14` was green

End-to-end validation comes via erigontech#21017's CI matrix once it rebases on
top of this PR.
lystopad added a commit that referenced this pull request May 21, 2026
Findings from Copilot (3) and yperbasis (8). The Copilot findings on Peers
routing, empty NodeInfo, and close(statusReady) are real; yperbasis
identified the matching doc/code mismatches and a few polish items.

1. Peers() / message routing (Copilot #1). The multi-sentry client uses
   Peers() to decide which sentry owns each peer and routes SendMessageById
   via that sentry's gRPC. With the previous reporter-only gating, every
   peer mapped to Servers[0] (which is the *lowest* configured protocol,
   ETH69 in the default — yperbasis #1 noted the comment said "highest").
   Servers[0]'s goodPeers doesn't have eth/70 or eth/71 peers, so
   SendMessageById silently no-op'd.

   Fix: each GrpcServer.Peers() now reports its own goodPeers, filtered to
   skip entries where both protocol and witProtocol are zero. Each peer
   ends up in exactly one eth-sentry's goodPeers (the negotiated version)
   plus, at most, the sentry hosting the wit sideprotocol, so admin_peers
   aggregation is naturally non-duplicating and routing is correct.

2. NodeInfo() (Copilot #3). Non-reporters returning empty replies
   polluted admin_nodeInfo with blank entries that sorted first. With the
   shared p2p.Server every sentry has the same Node ID and the same enode,
   so they now return identical NodeInfo. node/eth.NodesInfo deduplicates
   by Enode before sorting.

3. SetStatus's close(ss.statusReady) (Copilot #2) panicked for callers
   that construct GrpcServer outside NewGrpcServer (existing
   TestSentryServerImpl_* does this). Guarded the close with a nil check;
   awaitStatus tolerates a nil channel via the select's other cases.

4. SetP2PServer returns an error instead of panicking on double-call
   (yperbasis #3). The "ownership decided up front" invariant is still
   enforced, just propagated up the Provider.Initialize path cleanly.

5. SimplePeerCount filters protocol=0 ghosts (yperbasis #4). With wit/0
   deduped to one sentry, peers that negotiate eth/N on a different sentry
   end up as protocol=0/witProtocol=0 ghosts on the wit-hosting sentry.
   Counting them would emit a bogus eth.ProtocolToString[0] bucket in the
   GoodPeers log. The Peers() filter already drops them from admin_peers;
   this aligns SimplePeerCount.

6. awaitStatus logs a Debug line when its timeout fires (yperbasis #5)
   so operators can tell "core didn't send status in time" from "core
   never tried" when the caller disconnects the peer with
   PeerErrorLocalStatusNeeded. Doc comment clarifies the ctx.Done case
   too (yperbasis #7).

Drops the reportsPeers flag and IsPeerReporter accessor — no longer needed
once per-sentry goodPeers replaces the reporter gating. SetP2PServer
signature loses its second argument.

Tests updated for the new shape; new TestGrpcServer_PeersReturnsPerSentryGoodPeers
(per-sentry view + ghost-entry filter) and TestGrpcServer_SetStatus_NilStatusReadyIsSafe
(close-nil guard).

Deferred to follow-up:
- BootstrapNodes/DNS resolution helper to dedupe logic between
  makeP2PServer and startSharedP2PServer (yperbasis #6).
- End-to-end Provider.Initialize test in local mode (yperbasis #8).
- [r3.4] backport PR (yperbasis #9).

Co-Authored-By: Claude
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant