Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ignored SkipAnalysis in core/state_processor.go #4046

Merged
merged 1 commit into from
May 2, 2022
Merged

Fix ignored SkipAnalysis in core/state_processor.go #4046

merged 1 commit into from
May 2, 2022

Conversation

iAmGroute
Copy link
Contributor

cfg was not a pointer so cfg.SkipAnalysis was not saved properly and analysis was never skipped.

I have verified this patch on an older fork of the codebase (Aug 2021) but should also work with the latest version.

@AlexeyAkhunov AlexeyAkhunov merged commit cf44803 into erigontech:devel May 2, 2022
AlexeyAkhunov added a commit that referenced this pull request May 3, 2022
* Change version to alpha (#3926)

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>

* docs: update libmdbx links (#3929)

* Makefile: refactor build flags and fix 1.17 (#3930)

* Fix some cli flag descriptions (#3933)

* Fix some cli flag descriptions

* add node about verbosity

* min requirement to go 1.18 (#3934)

* save

* save

* save

* Added Ethstats service (#3931)

* somewhat there but not yet

* lol

* more efficient ethstats

* lint

* not die on no wifi

* Update bor mumbai config (#3937)

* Update ci.yml (#3936)

* Use heimdall url in integration bor consensus (#3940)

* Downloader: re-use flags defaults (#3941)

* torrent: print peers amount in logs (#3942)

* Observer - P2P network crawler (#3928)

Observer crawls the Ethereum network and collects information about the nodes.

* Torrent conns print (#3943)

* save

* save

* [erigon2] Fuzz tests for commitment (#3939)

* [erigon2] Fuzz tests for commitment

* Cleanup

* Update to erigon-lib main

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

* Introduce unlimited download rate (#3945)

* Introduce unlimited download rate

* More generous burst

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

* Replace ioutil with io and os (#3946)

* Sentry GRPC: rename Peers to PeerEvents (#3944)

* Sentry GRPC: rename Peers to PeerEvents

see erigontech/interfaces#101

* Update to erigon-lib main

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

* cleaned up forkchoices db insertions #3949

* fixed ethstats (#3951)

* bsc: disable snap sync (#3955)

* bsc: disable snap sync (#3956)

* Snapshots: support empty buf case (#3957)

* Snapshots: rare nil pointer at fresh start (#3958)

* got rid of the automatic usage of net api (#3952)

* got rid of the automatic usage of net api

* less confusing comment

* ops

* ops2

* important

* ops

* RPC: admin.peers() (#3960)

* RPC: admin.peers()

This RPC method returns information about the connected remote nodes.
https://geth.ethereum.org/docs/rpc/ns-admin#admin_peers

The peers are collected from all configured sentries.
See: erigontech/interfaces#102

Test with:
curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc": "2.0", "method": "admin_peers", "params": [], "id":1}' localhost:8545

* save

* liner fix

Co-authored-by: alex.sharov <AskAlexSharov@gmail.com>

* sentry: refactor flags, add maxpeers. (#3961)

* Experiment files 1 by 1 (#3959)

* Experiment files 1 by 1

* Remove check

* sort preverified snapshots

* docs: docker permissions

* sort preverified snapshots

* sort preverified snapshots

* sort preverified snapshots

* sort preverified snapshots

* sort preverified snapshots

* sort preverified snapshots

* save

* Fix speed log, remove file name

* Move timer out of the loop

* Calculate total size of downloaded files

* Fixes

* Fix

* Fix

* Fix

* Move downloadData

* Fix

* Revert "Fix"

This reverts commit 038e02b.

* Revert "Move downloadData"

This reverts commit 8130a4d.

* Revert "Fix"

This reverts commit 1dca25b.

* Revert "Fix"

This reverts commit ee5a1e8.

* Revert "Fix"

This reverts commit 8af7be7.

* Revert "Fixes"

This reverts commit 50509af.

* Revert "Calculate total size of downloaded files"

This reverts commit 64a26df.

* Remove progress

* Remove progress

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
Co-authored-by: alex.sharov <AskAlexSharov@gmail.com>

* Update stage_headers.go (#3966)

* Snapshots: open bittorrent udp port in docker (#3969)

* Snapshots: open torrent udp in docker-compose.yml

* Snapshots: open torrent udp in docker-compose.yml

* Delete blocks in [from, to) range (#3970)

* Snapshots: allow stage_headers --unwind behind available snapshots (#3971)

* save

* save

* save

* Integration: allow headers --reset (#3972)

* Bsc: enable syncmode=snap by default #3973

* rlp: add support for optional struct fields (#22832) (#3977)

This adds support for a new struct tag "optional". Using this tag, structs used
for RLP encoding/decoding can be extended in a backwards-compatible way,
by adding new fields at the end.

see geth commit ethereum/go-ethereum@700df14

Co-authored-by: Felix Lange <fjl@twurst.com>

* Forgot to check err status (#3978)

* Forgot to check err status

* Invalid header shouldn't fail the entire stage

* Potential fix for verification (#3962)

* Potential fix for verification

* multi verify

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>

* p2p/discover/v4wire: use optional RLP field for EIP-868 seq (#3963)

This changes the definitions of Ping and Pong, adding an optional field
for the sequence number. This field was previously encoded/decoded using
the "tail" struct tag, but using "optional" is much nicer.

see ethereum/go-ethereum#22842

Co-authored-by: Felix Lange <fjl@twurst.com>

* FullSync instead of FastSync (#3980)

* Update README.md (#3984)

* Update README.md (#3985)

* Update README.md (#3987)

* Update README.md (#3988)

* Update README.md (#3989)

* save (#3983)

* Update to erigon-lib main (#3992)

Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>

* TxLookup fix 2 (#3994)

* save

* save

* tolerate some fails

* tolerate some fails

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

* No NewBlock gossip after Merge (#3995)

* Check that safe & finalized blocks are canonical for no-op forkChoice (#3997)

* Place finishHandlingForkChoice after startHandlingForkChoice

* forkChoiceMessage -> forkChoice

* Check that safe & finalized blocks are canonical for no-op forkChoice

* Re-introduced cleanup of temporary table (#3999)

* Re-introduced cleanup of temporary table

* Fix sign

* Fix lint

* Fix lint

* Revert

Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>

* Update skip_analysis.go (#4003)

* Downloader: calc stat inside, add --torrent.download.slots and limit downloads inside (#3986)

* save

* save

* save

* save

* save

* save

* save

* save

* save

* p2p: speed-up TestUDPv4_LookupIterator (#4000)

The test was slow, because it was trying to find
predefined nodeIDs (lookupTestnet) by generating random keys
and trying to find their neighbours
until it hits all nodes of the lookupTestnet.
In addition each FindNode response was waited for 0.5 sec (respTimeout).
This could take up to 30 sec and fail the test suite.

A fake random key generator is now used during the test.
It issues the expected keys, and the lookup converges quickly.
The reply timeout is reduced for the test.
Now it normally takes less than.1 sec.

* p2p: refactor MaxPendingPeers handling (#3981)

* use semaphore instead of a chan struct{}
* move MaxPendingPeers default value to DefaultConfig.P2P
* log Error if Accept fails
* replace quit channel with context

* downloader stuck on 99.9% fix #4004

* Open only existing torrent files (#4007)

* save

* save

* save

* save

* save

* Open shorter logs #400

* Fix empty "Tables" log line (#4008)

* save

* save

* save

* Torrent: maxpeers flag were used incorrectly

* reduce downloader deps (#4010)

* reduce downloader deps

* reduce downloader deps

* reduce downloader deps (#4011)

* Handle system-txn in block_reader (#4012)

* reduce downloader deps

* reduce downloader deps

* save

* reduce downloader deps

* [integration tool] Clean BorReceipt when reset state (#4013)

* Update reset_state.go

* Update reset_state.go

* rename field "type" (#4015)

* save

* save

* save

* typed sender (#4016)

* save

* save

* Observer: fix panic on clean start (#4002) (#4017)

Problem: (nil, nil) from CountPingErrors was not handled.
This happens if the node is not in the db (a bootstrap node),
and was never crawled before.

* Add override.terminaltotaldifficulty flag (#4018)

* cmd/utils: initialize f.Value before setting variable

* override.terminaltotaldifficulty flag

* Add OverrideTerminalTotalDifficulty to default_flags

* p2p: fix flaky TestUDPv5_lookupE2E (#4020)

The test was flaky, because of the "endpoint prediction".
The test starts 5 nodes one by one.
Node 0 is used as a bootstrap node for nodes 1-4.
When it is about to add, say, node 3, nodes 0 and 1 might already have had a chance to communicate,
and updateEndpoints() deletes the node 0 UDP port, because fallbackUDP port was not configured.

In this case node 3 would get a bootstrap node 0 without a port and lead to an error:

    v5_udp_test.go:110: bad bootstrap node "enr:...": missing UDP port

The problem was reproducible by this command:

    go test ./p2p/discover -run TestUDPv5_lookupE2E -count 500

* Added Goerli Full Node Space Requirements (#4021)

* p2p: crawler-friendly handshake (#3982)

* exchange RLPx Hello even when maxpeers limit is reached
* bump MaxPendingPeers to increase the default handshake queue
  (and the likelyhood of Hello exchange)

* Add link about rqspbery po (#4022)

* More efficient header verification of headers for Parlia when snapshots are used (#3998)

* Update stageloop.go

* Print

* Consider snapshot headers as parlia checkpoints

* Not fail after not loading snapshot

* Lazy snapshots

* Print number of validators

* More printing

* Use epoch instead of checkpoint interval

* Reduce logging

* Fix compilation

* Remove trace jump dest

* Fix lint

* Not store snapshots every epoch

* Separate snapshot for verification and finalisation

Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>

* Docker build: make db-tools to depend on git-submodules (#4024)

* save

* save

* save

* save

* save

* More careful handle of sequences in stage_headers --reset (#4023)

* save

* save

* save

* save

* added ovveride merge fork block (#4027)

* Fix non-starting download (#4031)

* save

* save

* save

* save

* save (#4032)

* Truncate bor receipts on unwind (#4033)

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

* eth/filters: Fix filterLogs() (#4036)

* index segments by maximum by 2 workers #4041

* trace read parent header from snapshot and lru #4042

* make sure stage_headers --reset doesn't left garbage in bodies table #4043

* Fix for Bor (Polygon) (#4044)

* print branchHash

* Print state changes

* Print val

* Fix for author

* Remove prints

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

* Cleanup isBor (#4045)

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

* Speed up docker image build by use layer cache (#4038)

* speed up docker image build by use layer cache

* rearrenge Dockerfile

* enable docker layer cache in github action

* state_processor: fix ignored SkipAnalysis() result (#4046)

`cfg` is not a pointer

* p2p: improve test TestTable_findnodeByID (#4047)

* refactor test
* add a fast fixed examples test for the main suite
* split slow test for the integration suite

* Update skip_analysis.go (#4052)

* More relax inclusion of headers in the downloader (#4050)

* More relax inclusion of headers in the downloader

* Fix

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

* Revert "Speed up docker image build by use layer cache (#4038)" (#4054)

This reverts commit e758fb8.

* Increase max DB size to 8 Tb for chain data only (#4055)

* Update node.go

* Update node.go

* Point to erigon-lib alpha

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
Co-authored-by: battlmonstr <battlmonstr@users.noreply.github.com>
Co-authored-by: Chase Wright <mysticryuujin@protonmail.com>
Co-authored-by: Alex Sharov <AskAlexSharov@gmail.com>
Co-authored-by: Giulio rebuffo <giulio.rebuffo@gmail.com>
Co-authored-by: Krishna Upadhyaya <KRISHNAU1604@GMAIL.COM>
Co-authored-by: Håvard Anda Estensen <haavard.ae@gmail.com>
Co-authored-by: Enrique Jose  Avila Asapche <eavilaasapche@gmail.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Andrew Ashikhmin <34320705+yperbasis@users.noreply.github.com>
Co-authored-by: gaia <gaia@users.noreply.github.com>
Co-authored-by: EXEC <execvy@gmail.com>
Co-authored-by: Groute <iAmGroute@outlook.com>
@AskAlexSharov
Copy link
Collaborator

Befor this fix there was Warning on mainnet:

WARN[05-06|10:20:16.316] Code Bitmap used for detecting invalid jump tx=0x21ab7bf7245a87eae265124aaf180d91133377e47db2b1a4866493ec4b371150 block_num=13119520

After this fix error:

EROR[05-06|10:20:42.606] [6/16 Execution] Execution failed        block=13119520 hash=0x9d683102479c742b46e9647a8290615e86ecb92a83cdf2b8f2d6ed90c31c189b err="mismatched receipt headers for block 13119520"

Reverting this PR

AskAlexSharov added a commit that referenced this pull request May 6, 2022
@iAmGroute
Copy link
Contributor Author

As far as I can tell, the problem is not caused by this PR but by erigon/core/skip_analysis.go.
Block 13119520 should have been included in line 44 (see #2613):

	if blockNumber == 6426298 || blockNumber == 6426432 || blockNumber == 5800596 || blockNumber == 11079912 || blockNumber == 13140429 {

(there could be even more block numbers after that)

According to RELEASE_INSTRUCTIONS.md, these are generated automatically.

So maybe there is a problem with the script that updates this file?

@AskAlexSharov
Copy link
Collaborator

@iAmGroute feel free to investigate

AlexeyAkhunov added a commit that referenced this pull request May 10, 2022
* penalize naughty peers on PoS (#4060)

* penalize naughty peers

* lint

* Small performance optimization (hash already calculated) (#4053)

* speedup logIndex test  (#4068)

* Torrent: increase network request size  (#4067)

* save

* save

* CI: run integration tests on trunk after PR is merged (#4075)

Running on PR close event tests the PR commit, not the final merged commit.
The final commit is tested by "push" event, but it appears as "skipped" in the list of devel ccmmits,
because "push" event was skipped by "if".

* Update header_algos.go (#4078)

* p2p: TestUDPv4_LookupIterator failures workaround (#4079)

--- FAIL: TestUDPv4_LookupIterator (1.36s)
155
    v4_lookup_test.go:168: handlePacket error: "unsolicited reply"
156

* CI: run integration tests on Windows (#4076)

* [erigon2] Support for binary tree commitments (#4077)

* binary tree

* Binary commitment tree

* [erigon2] Bin tree support

* Point to latest erigon-lib

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

* CI: more caching (#4083)

Cache "go-build" containing cached build artifacts from the Go build system.
This saves up to:
  - 6 min on Linux (from 10 min to 4 min)
  - 3 min on macOS  (from 13 min to 10 min)
  - 7 min on Windows (from 27 min to 20 min)

Cache Windows deps (mingw, cmake).
This saves 6,5 min on Windows builds (from 20 min to 13,5 min)

* rpcdaemon: optimize tests (#4082)

* reuse the generated test blockchain across tests
* copy ChainPack to ensure test isolation

This improves the speed from 10s to 4s.

The package tests timeout can be reduced to 5s:

    go test ./cmd/rpcdaemon/commands -count 1 --timeout 5s

* Downloader atomic snapshot dir, step 1 (#4085)

* save

* save

* save

* [Docs] Add PoS downloader diagram (#4084)

* Extra comment for HeadersPOS

* Add PoS downloader diagram

* Revert "state_processor: fix ignored SkipAnalysis() result (#4046)" (#4087)

This reverts commit cf44803.

* Revert changes in decompressor (#4089)

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

* Remove preverified hashes (#4088)

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

* p2p: define DiscReason as uint8 (#4090)

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

* remove metrics package, step 1 (#4094)

* atomic snapshot dir, step 2 (#4093)

* atomic snapshot dir

* atomic snapshot dir

* switch toml lib to release version (#4095)

* save

* save

* save (#4096)

* Snapshots: restore logInterval #4098

* torrent not found fix (#4101)

* Torrent: increase network-request size to 2Mb (#4100)

* Amend description of override.mergeForkBlock flag (#4106)

* p2p: move v4_lookup_test to integration tests (#4107)

The test is flaky when the reply timeout is too low.
Increasing the timeout makes it slow.

Move the test to the integration suite.
Having a higher timeout is fine there.

* make: wmake refactoring (#4105)

* list "all" targets explicitly
* add missing targets
* add missing build flags
* add test-integration target
* show tests output
* use wmake test on CI
* update submodules for all targets (like Makefile)
* remove unused function Test-Administrator

* Snapshots: atomic dir, step 3 (#4103)

* up linter version (#4108)

* save

* save

* save

* Rename sentry.ControlServerImpl to sentry.MultyClient and sentry.SentryServerImpl to sentry.GrpcServer #444

* Simplify header downloader (#4104)

* Simplify header downloader

* Remove VerifyQueue

* Fix

* More fixes

* Fix

* Break out of the loop

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

* RPCDaemon: open snapshots on startup (because now snapshots dir is atomic), even if no Erigon available (#4110)

* save

* save

* save

* save

* save

* save

* Bumb alpha version

* Update to erigon-lib alpha

Co-authored-by: Giulio rebuffo <giulio.rebuffo@gmail.com>
Co-authored-by: Andrew Ashikhmin <34320705+yperbasis@users.noreply.github.com>
Co-authored-by: Alex Sharov <AskAlexSharov@gmail.com>
Co-authored-by: battlmonstr <battlmonstr@users.noreply.github.com>
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
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.

3 participants