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

[Merged by Bors] - prune old proposals after block is generated #4993

Closed

Conversation

countvonzero
Copy link
Contributor

Motivation

prune mesh data

Changes

after block is generated for layer N, prune proposals < N

@codecov
Copy link

codecov bot commented Sep 9, 2023

Codecov Report

Merging #4993 (df99f0f) into develop (900f5b5) will decrease coverage by 0.1%.
Report is 1 commits behind head on develop.
The diff coverage is 41.1%.

@@            Coverage Diff            @@
##           develop   #4993     +/-   ##
=========================================
- Coverage     77.1%   77.0%   -0.1%     
=========================================
  Files          254     254             
  Lines        30281   30295     +14     
=========================================
- Hits         23367   23357     -10     
- Misses        5399    5419     +20     
- Partials      1515    1519      +4     
Files Changed Coverage Δ
blocks/generator.go 88.6% <12.5%> (-2.4%) ⬇️
sql/proposals/proposals.go 79.7% <62.5%> (-1.0%) ⬇️
blocks/utils.go 88.1% <100.0%> (ø)

... and 7 files with indirect coverage changes

@@ -167,6 +167,12 @@ func (g *Generator) run() error {
if len(g.optimisticOutput) > 0 {
g.processOptimisticLayers(maxLayer)
}
if err := proposals.Delete(g.cdb, out.Layer); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

what about old proposals and transactions link? will it conflict with sync if someone will request proposals a bit later?

i thought that it may be better to prune old proposals & certs every 30m or so in separate goroutine, and run autovacuum there as well but every day instead

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i was thinking this can be shipped ASAP, as proposals is the major pain point and the db will stop growing at least.

later i will do something like you suggested and with vaccum because the timing to prune certificates and proposal_transactions are trickier.
one depends on hdist, and the other depends on mempool txs.

proposal syncing is only done during hare rounds. there it only prune up to layer N-1 at the end of hare for N.
so it's not likely that proposal sync will happen for old layers.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

btw, mempool never cross-referenced with the proposal tables so it's ok that proposals are deleted.

@countvonzero
Copy link
Contributor Author

merging in case we want to make a release this week.

bors merge

bors bot pushed a commit that referenced this pull request Sep 11, 2023
## Motivation
prune mesh data

## Changes
after block is generated for layer N, prune proposals < N
@bors
Copy link

bors bot commented Sep 11, 2023

Pull request successfully merged into develop.

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot changed the title prune old proposals after block is generated [Merged by Bors] - prune old proposals after block is generated Sep 11, 2023
@bors bors bot closed this Sep 11, 2023
bors bot pushed a commit that referenced this pull request Sep 16, 2023
## Motivation
there are a lot of old proposals floating in the gossip network.
deleting old proposals in #4993 forced the node to process/save these old proposals repeatedly

## Changes
- refuse proposals older than current layer
- add metrics/log for time it takes to delete proposals
bors bot pushed a commit that referenced this pull request Sep 16, 2023
## Motivation
there are a lot of old proposals floating in the gossip network.
deleting old proposals in #4993 forced the node to process/save these old proposals repeatedly

## Changes
- refuse proposals older than current layer
- add metrics/log for time it takes to delete proposals
bors bot pushed a commit that referenced this pull request Sep 16, 2023
## Motivation
there are a lot of old proposals floating in the gossip network.
deleting old proposals in #4993 forced the node to process/save these old proposals repeatedly

## Changes
- refuse proposals older than current layer
- add metrics/log for time it takes to delete proposals
countvonzero added a commit that referenced this pull request Sep 16, 2023
## Motivation
there are a lot of old proposals floating in the gossip network.
deleting old proposals in #4993 forced the node to process/save these old proposals repeatedly

## Changes
- refuse proposals older than current layer
- add metrics/log for time it takes to delete proposals
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.

None yet

2 participants