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

e2: avoid do RestoreCodeHash twice #7706

Merged
merged 2 commits into from
Jun 11, 2023
Merged

Conversation

AskAlexSharov
Copy link
Collaborator

  • do it only once in HistoryStateReader

@AskAlexSharov AskAlexSharov merged commit 4766cd8 into devel Jun 11, 2023
@AskAlexSharov AskAlexSharov deleted the restore_code_hash_once branch June 11, 2023 05:28
calmbeing pushed a commit to calmbeing/bsc-erigon that referenced this pull request Jun 26, 2023
- do it only once in HistoryStateReader
calmbeing added a commit to node-real/bsc-erigon that referenced this pull request Jun 27, 2023
* e2: avoid do RestoreCodeHash twice (erigontech#7706)

- do it only once in HistoryStateReader

* fix system contract upgrade

* update

---------

Co-authored-by: Alex Sharov <AskAlexSharov@gmail.com>
avatarH added a commit to node-real/bsc-erigon-avatar that referenced this pull request Jul 3, 2023
add log

add log

fix bug?

fix bug?

update

fix bug?

fix bug?

fix bug?

add log

add log

add log

add log

add log

add log

fix

fix

add log

add log

fix bug

remove log

fix bug?

add log

fix bug

fix bug

add trace block diff by number

rlp encode to json marshal

update

update

storage key change to hex to test

revert

update

feature: Step by step sync (node-real#116)

Missed RPC calls implemented in BSC geth (node-real#83)

* Add rpc calls that implemented in BSC geth but not in erigon
* Register 'bsc' API module under 'eth' API namespace
* Several missed calls implementation

Fix bugs in trie hash computation

solve the mismatch validator bug with final solution (node-real#135)

update the version for bsc-erigon (node-real#136)

Port Herzt upgrade: London & Berlin (node-real#138)

optimization (node-real#131)

release: prepare for release v1.1.2 (node-real#142)

fix: log info

System contract upgrade fix and RPC refine (node-real#146)

* e2: avoid do RestoreCodeHash twice (erigontech#7706)

- do it only once in HistoryStateReader

* fix system contract upgrade

* update

---------

Co-authored-by: Alex Sharov <AskAlexSharov@gmail.com>

update the config

update the version

remove log

remove log

remove log

update diff layer return

update

update

update

update

new try

new try

update

update
calmbeing pushed a commit to calmbeing/bsc-erigon that referenced this pull request Jul 12, 2023
- do it only once in HistoryStateReader
calmbeing added a commit to node-real/bsc-erigon that referenced this pull request Jul 18, 2023
* fix build issue

* simplify the unwind

* Add additional trie proof testing (erigontech#7382)

This PR extends the function merged in erigontech#7337 to cover the proof
generation paths as well.

The first commit simply migrates the internal proof checking code from
the rpc `eth_getProof` test to be available externally exported under
`turbo/trie`. In the process, it translates the in place testing
assertions to return more normally as errors and adapts to use the
pre-existing trie node types which are defined slightly differently
(although this code is still intended only for testing purposes).

The second commit refactors the existing trie fuzzing tests from the
previous PR and adds new fuzzing tests for the proof generation. In
order to validate the proofs, these fuzzing tests fundamentally do two
things. Firstly, after bootstrapping the test (by seeding, and modifying
the db), for each key we compute the 'naive' proof utilizing the
existing code in `proof.go` and the in memory `trie.Trie` structure. The
`trie.Trie` code actually had a couple small bugs which are fixed in
this PR (not handling value nodes, and not honoring the `NewTestRLPTrie`
contract of pre-RLP encoded nodes in proof generation). Secondly, we
re-compute the same proof for the flatDB production variant, and verify
that it is exactly the same proof as computed by the naive
implementation.

This fuzzing has been run for ~72 hours locally with no errors. Although
this code hasn't identified any new bugs in the proof generation path,
it improves coverage and should help to prevent regressions. Additional
extensions will be provided in a subsequent PR.

---------

Co-authored-by: Jason Yellick <jason@enya.ai>

* e3: drain when no new tasks causing deadlock  (erigontech#7395)

* Enable negative Merkle proofs for eth_getProof (erigontech#7393)

This addresses the last known deficiency of the eth_getProof
implementation. The previous code would return an error in the event
that the element was not found in the trie. EIP-1186 allows for
'negative' proofs where a proof demonstrates that an element cannot be
in the trie, so this commit updates the logic to support that case.

Co-authored-by: Jason Yellick <jason@enya.ai>

* e3: dont fetch code hash in unwind (erigontech#7416)

* Caplin: Fixed sentinel deadlock (erigontech#7419)

* fix block rlp logging bug (erigontech#7441)

fixes a logging statement was logging the outer rpc proto instead of the
inner rlp of the block as intended

* fix: erigon_getLatestLogs (erigontech#7450)

When calling erigon_getLatestLogs, I was getting a crash in
[erigon_receipts.go](https://github.com/ledgerwatch/erigon/blob/beb97784d43ece5acde365a74efe8763692ebdba/cmd/rpcdaemon/commands/erigon_receipts.go#L254).
I think it is a simple indexing bug

```
[service.go:217 panic.go:884 panic.go:113 erigon_receipts.go:254 value.go:586 value.go:370 service.go:222 
handler.go:494 handler.go:444 handler.go:392 handler.go:223 handler.go:316 asm_amd64.s:1598]
[WARN] [05-05|21:13:59.749] Served                                   
conn=100.70.204.111:50141 method=erigon_getLatestLogs reqid=1 t=621.5936ms err="method handler crashed"
```

* LeakDetector:  use it to find which resource was created but not closed (leaked) (erigontech#7457)

* reduce default --db.size.limit from 7 to 3 Tb (to fit defaults of some systems) (erigontech#7478)

* Enode logging broke when NAT Parameter set in 2.43.0 (erigontech#7480)

for erigontech#7472

* erigon init: created db with wrong pageSize  (erigontech#7482)

* p2p: fix peer ID serialization (erigontech#7495)

The peer ID in sentry.proto is a H512 / 64 bytes value, and
MarshalPubkey creates it from a public key.

There's no need to cut the first byte, because MarshalPubkey already
does it.
Doing so results in a 63 bytes value that is incompatible with silkworm
sentry.

* Allow ephemeral ports for p2p (erigontech#7503)

Currently, the p2p ports require an explicit enumeration of ports to
pick. Sometimes, for instance when writing integration tests utilizing
an Erigon binary the particular p2p port does not matter and trying to
pick non-allocated port ranges is fragile.

This small PR simply checks to see if the enumerated port is '0', in
which case it disables the probing check which would otherwise cause
Erigon not to try binding to an ephemeral port.

Co-authored-by: Jason Yellick <jason@enya.ai>

* remove "db" log line from  (erigontech#7509)

* e2: self-heal after accidental blocks delete (download blocks eventually, then work as usual) (erigontech#7516)

* e2: ReadAhead of blocks, senders accounts, code (erigontech#7501)

It improves performance of initial sync (stage exec) by 5-20% when
blocks snapshots are mounted to high-latency drive and when chaindata is
on high-latency drive. And improving cold-start performance.

Current implementation using 2 goroutines for ReadAhead. It also
producing more garbage, can improve it later (here are dashboard with
impact).
```
mainnet2-1: with ReadAhead
mainnet2-3: no ReadAhead
```

<img width="949" alt="Screenshot 2023-05-12 at 09 24 31"
src="https://github.com/ledgerwatch/erigon/assets/46885206/b90b1fa8-9099-48ff-95b3-86e864a36d46">

<img width="845" alt="Screenshot 2023-05-12 at 09 24 13"
src="https://github.com/ledgerwatch/erigon/assets/46885206/39d90c0c-a9d5-4735-8c03-da1455b147aa">

* Fix trace_filter regression due to gasBailout argument (erigontech#7539) (erigontech#7540)

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

* Update t8n_test.go (erigontech#7550)

* e2: reduce StageSyncStep interface size (erigontech#7561)

* e2: avoid do RestoreCodeHash twice (erigontech#7706)

- do it only once in HistoryStateReader

* StagedSync:  fix canRunCycleInOneTransaction logic (erigontech#7712)

* Better version of libp2p where losing peers bug fixed (erigontech#7726)

Co-authored-by: Alex Sharov <AskAlexSharov@gmail.com>

* fix merge error

---------

Co-authored-by: Jason Yellick <7431583+jyellick@users.noreply.github.com>
Co-authored-by: Jason Yellick <jason@enya.ai>
Co-authored-by: Alex Sharov <AskAlexSharov@gmail.com>
Co-authored-by: Giulio rebuffo <giulio.rebuffo@gmail.com>
Co-authored-by: Roberto Bayardo <bayardo@alum.mit.edu>
Co-authored-by: Joe Netti <joe@netti.dev>
Co-authored-by: battlmonstr <battlmonstr@users.noreply.github.com>
Co-authored-by: ledgerwatch <akhounov@gmail.com>
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.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.

1 participant