Skip to content

execution: share prune timeout budget#20860

Open
JkLondon wants to merge 2 commits intomainfrom
jklondon/prune-features/quickprunetocondfixes
Open

execution: share prune timeout budget#20860
JkLondon wants to merge 2 commits intomainfrom
jklondon/prune-features/quickprunetocondfixes

Conversation

@JkLondon
Copy link
Copy Markdown
Member

closes #20854
Simplifies execution prune timeout handling by using one shared stage-level budget across changeset pruning, block access list pruning, and small-batch pruning.

On chain tip, the quick timeout is no longer refreshed per prune step, so Ethereum execution prune uses one shared 2s budget instead of up to 2s per operation. Initial-cycle pruning keeps the long aggressive budget.

if pruneTimeout := remainingPruneTimeout(); pruneTimeout > 0 {
if _, err := tx.(kv.TemporalRwTx).PruneSmallBatches(ctx, pruneTimeout); err != nil {
return err
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

how removing

if s.CurrentSyncCycle.IsInitialCycle {
		pruneTimeout = 12 * time.Hour
	}

will work on non-chain-tip (i mean when re-exec from 0)?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think you miss-understand issue. problem is not prune > 2s problem is prune has 12 hours timeout if existing synced node restart (because s.CurrentSyncCycle.IsInitialCycle) is true. And it has 12 hours timeout because - how else we can prune data on non-chain-tip (when executing from 0)

Copy link
Copy Markdown
Member Author

@JkLondon JkLondon Apr 28, 2026

Choose a reason for hiding this comment

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

how else we can prune data on non-chain-tip (when executing from 0)

After some creating and merging changeset and other files why not? Also, you've mixed here 2 different situations (sync from 0 and restart on synced node), so I don't get what we're discussing. However, on exec prune u shared I saw spike to 9s after restart (on ottersync it was ~1min)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

how removing

if s.CurrentSyncCycle.IsInitialCycle {
		pruneTimeout = 12 * time.Hour
	}

will work on non-chain-tip (i mean when re-exec from 0)?

It will attempt to prune "small batch" in a time every time we will enter the exec function (in exec prune) same for all stages, eventually it will prune all

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ou've mixed here 2 different situations (sync from 0 and restart on synced node).
We don't have in Erigon code separation of this 2 cases.
And this is a problem.
s.CurrentSyncCycle.IsInitialCycle is true in both cases.

if your PR remove

if s.CurrentSyncCycle.IsInitialCycle {
		pruneTimeout = 12 * time.Hour
	}

it also will affect 2 cases.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

But my PR don't remove this cond anyway.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Synced node hasn't InitialSync true as I saw, no?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

test it

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Oke, will sync to tip and check var after restart

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.

fix prune t/o >2s after restart on ottersync and exec stages

2 participants