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

core: ensure txindex will be triggered at least once #27847

Merged
merged 7 commits into from
Aug 22, 2023

Conversation

jsvisa
Copy link
Contributor

@jsvisa jsvisa commented Aug 3, 2023

Currently, we trigger the logic to (un)index transactions when the node receives a new block. However, in some cases the node may not receive new blocks (eg, when the Geth node is configured with --nodiscovery, or when it acts as an RPC node for historical only data).
In these situations, the Geth node user may not have previously configured txlookuplimit (i.e. the default of around one year), but later he realizes they need to index all historical blocks. However, adding txlookuplimit=0 and restarting geth has no effect.

So in this case, I think if we start a timer, there would at least be one opportunity to run the indexing process.

Signed-off-by: jsvisa <delweng@gmail.com>
core/blockchain.go Outdated Show resolved Hide resolved
Signed-off-by: jsvisa <delweng@gmail.com>
core/blockchain.go Outdated Show resolved Hide resolved
Signed-off-by: jsvisa <delweng@gmail.com>
Signed-off-by: jsvisa <delweng@gmail.com>
@jsvisa
Copy link
Contributor Author

jsvisa commented Aug 10, 2023

@rjl493456442 please take another look, thanks

core/blockchain.go Outdated Show resolved Hide resolved
core/blockchain.go Outdated Show resolved Hide resolved
@fjl fjl removed the status:triage label Aug 15, 2023
Signed-off-by: jsvisa <delweng@gmail.com>
Signed-off-by: jsvisa <delweng@gmail.com>
core/blockchain.go Outdated Show resolved Hide resolved
Copy link
Contributor

@holiman holiman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@holiman holiman added this to the 1.13.0 milestone Aug 21, 2023
@fjl fjl merged commit 7c0d90c into ethereum:master Aug 22, 2023
1 check passed
@jsvisa jsvisa deleted the core-timer-txindex branch August 22, 2023 02:18
devopsbo3 pushed a commit to HorizenOfficial/go-ethereum that referenced this pull request Nov 10, 2023
Currently, we trigger the logic to (un)index transactions when the node receives a new
block. However, in some cases the node may not receive new blocks (eg, when the Geth node
is configured without peer discovery, or when it acts as an RPC node for historical-only
data).

In these situations, the Geth node user may not have previously configured txlookuplimit
(i.e. the default of around one year), but later realizes they need to index all
historical blocks. However, adding txlookuplimit=0 and restarting geth has no effect. This
change makes it check for required indexing work once, on startup, to fix the issue.

Co-authored-by: Martin Holst Swende <martin@swende.se>
devopsbo3 added a commit to HorizenOfficial/go-ethereum that referenced this pull request Nov 10, 2023
devopsbo3 added a commit to HorizenOfficial/go-ethereum that referenced this pull request Nov 10, 2023
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.

4 participants