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: erigon_getLatestLogs #7450

Merged

Conversation

nettijoe96
Copy link
Contributor

@nettijoe96 nettijoe96 commented May 5, 2023

When calling erigon_getLatestLogs, I was getting a crash in erigon_receipts.go. 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"

@nettijoe96 nettijoe96 changed the title fixes erigion_getLatestLogs fix: erigion_getLatestLogs May 5, 2023
@nettijoe96 nettijoe96 changed the title fix: erigion_getLatestLogs fix: erigon_getLatestLogs May 5, 2023
@AskAlexSharov AskAlexSharov merged commit 5a56b45 into erigontech:devel May 8, 2023
calmbeing pushed a commit to calmbeing/bsc-erigon that referenced this pull request Jul 12, 2023
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"
```
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.

2 participants