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: handle error[BNB-16] #19

Merged
merged 2 commits into from
Jan 5, 2024

Conversation

welkin22
Copy link
Contributor

Description

  1. In core/state_prefetcher.go:Prefetch() function, the error of the precacheTransaction() call is not handled.
  2. The gopool/pool.go:Submit() function returns an error, but none of the callers handle it. Based on our analysis, since the
    defaultPool is not created with the Nonblocking flag, the underlying call defaultPool.Submit() does not expect an error. In this case, it is recommended to consider changing the function signature of pool.go:Submit() to not return an error and instead log an error message within the function.
  3. In core/blockchain.go:writeBlockWithState()#L1440 , the error is not handled in the call of bc.triedb.Commit() .
  4. In core/blockchain.go:writeBlockWithState()#L1421 function, the error is not handled in the call of bc.triedb.Cap().

Rationale

There are several places not handling returning error.

Example

none

Changes

Notable changes:

  • log the error of the precacheTransaction() call
  • pool.submit no longer returns an error, instead recording an error log
  • The two places where errors are not handled will directly return errors. This will cause the logic that continued when an error was encountered in the past to be directly interrupted. Need to confirm whether there is a problem.

@owen-reorg owen-reorg marked this pull request as draft November 23, 2023 09:18
@owen-reorg owen-reorg marked this pull request as ready for review November 23, 2023 09:18
@github-actions github-actions bot requested review from bnoieh and krish-nr November 23, 2023 09:18
@owen-reorg owen-reorg merged commit edd4395 into bnb-chain:develop Jan 5, 2024
2 checks passed
sunny2022da pushed a commit to sunny2022da/op-geth that referenced this pull request Aug 2, 2024
* txdag: opt some logic;

txdag: opt rw set collect logic;

* pevm: opt logs;

* txdag: opt txdag encoding, reduce rlp size;

---------

Co-authored-by: galaio <[email protected]>
sunny2022da pushed a commit to sunny2022da/op-geth that referenced this pull request Aug 7, 2024
* txdag: opt some logic;

txdag: opt rw set collect logic;

* pevm: opt logs;

* txdag: opt txdag encoding, reduce rlp size;

---------

Co-authored-by: galaio <[email protected]>
sunny2022da pushed a commit to sunny2022da/op-geth that referenced this pull request Aug 13, 2024
* txdag: opt some logic;

txdag: opt rw set collect logic;

* pevm: opt logs;

* txdag: opt txdag encoding, reduce rlp size;

---------

Co-authored-by: galaio <[email protected]>
sunny2022da pushed a commit to sunny2022da/op-geth that referenced this pull request Sep 25, 2024
* txdag: opt some logic;

txdag: opt rw set collect logic;

* pevm: opt logs;

* txdag: opt txdag encoding, reduce rlp size;

---------

Co-authored-by: galaio <[email protected]>
sunny2022da pushed a commit to sunny2022da/op-geth that referenced this pull request Oct 11, 2024
* txdag: opt some logic;

txdag: opt rw set collect logic;

* pevm: opt logs;

* txdag: opt txdag encoding, reduce rlp size;

---------

Co-authored-by: galaio <[email protected]>
welkin22 pushed a commit that referenced this pull request Oct 22, 2024
* txdag: opt some logic;

txdag: opt rw set collect logic;

* pevm: opt logs;

* txdag: opt txdag encoding, reduce rlp size;

---------

Co-authored-by: galaio <[email protected]>
sunny2022da pushed a commit to sunny2022da/op-geth that referenced this pull request Nov 14, 2024
* txdag: opt some logic;

txdag: opt rw set collect logic;

* pevm: opt logs;

* txdag: opt txdag encoding, reduce rlp size;

---------

Co-authored-by: galaio <[email protected]>
sunny2022da pushed a commit to sunny2022da/op-geth that referenced this pull request Dec 11, 2024
* txdag: opt some logic;

txdag: opt rw set collect logic;

* pevm: opt logs;

* txdag: opt txdag encoding, reduce rlp size;

---------

Co-authored-by: galaio <[email protected]>
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