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] - remove read/write for ballot.ActiveSet #5024

Closed
wants to merge 5 commits into from

Conversation

countvonzero
Copy link
Contributor

Motivation

Closes #4984

Changes

  • drop EmitEmptyActiveSet config
  • remove all access to Ballot.ActiveSet and look up from db instead
  • remove all writes of Ballot.ActiveSet

after this PR, miner will still accept proposal/ballot with non-empty active sets, but will save ballots without active set.

@codecov
Copy link

codecov bot commented Sep 17, 2023

Codecov Report

Merging #5024 (17c3c27) into develop (d3de17e) will decrease coverage by 0.1%.
Report is 1 commits behind head on develop.
The diff coverage is 55.5%.

@@            Coverage Diff            @@
##           develop   #5024     +/-   ##
=========================================
- Coverage     77.2%   77.1%   -0.1%     
=========================================
  Files          254     254             
  Lines        30102   30113     +11     
=========================================
- Hits         23247   23242      -5     
- Misses        5351    5362     +11     
- Partials      1504    1509      +5     
Files Changed Coverage Δ
common/types/ballot.go 51.8% <0.0%> (ø)
config/mainnet.go 95.7% <ø> (-0.1%) ⬇️
miner/proposal_builder.go 81.0% <ø> (+0.7%) ⬆️
node/node.go 63.2% <ø> (-0.1%) ⬇️
tortoise/algorithm.go 77.6% <ø> (ø)
proposals/util/util.go 73.2% <25.0%> (-3.8%) ⬇️
miner/oracle.go 73.5% <40.0%> (-1.0%) ⬇️
miner/util.go 66.6% <40.0%> (-7.3%) ⬇️
api/grpcserver/mesh_service.go 74.7% <50.0%> (-1.1%) ⬇️
hare/eligibility/oracle.go 73.8% <50.0%> (-1.3%) ⬇️
... and 2 more

... and 2 files with indirect coverage changes

@countvonzero
Copy link
Contributor Author

bors try

bors bot added a commit that referenced this pull request Sep 17, 2023
@bors
Copy link

bors bot commented Sep 17, 2023

try

Build failed:

@countvonzero
Copy link
Contributor Author

bors try

bors bot added a commit that referenced this pull request Sep 17, 2023
@bors
Copy link

bors bot commented Sep 17, 2023

try

Build failed:

@countvonzero
Copy link
Contributor Author

bors try

bors bot added a commit that referenced this pull request Sep 17, 2023
@bors
Copy link

bors bot commented Sep 17, 2023

try

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.

@@ -140,11 +141,15 @@ func (v *Validator) validateReference(ballot *types.Ballot, owned *types.Activat
if ballot.EpochData.Beacon == types.EmptyBeacon {
return nil, fmt.Errorf("%w: ref ballot %v", errMissingBeacon, ballot.ID())
}
if len(ballot.ActiveSet) == 0 {
activeSet, err := activesets.Get(v.cdb, ballot.EpochData.ActiveSetHash)
Copy link
Contributor

Choose a reason for hiding this comment

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

there should be a way to avoid this read. we should have loaded this data earlier, as we need to check data availability. and then we need to pass it together with the rest of the ballot for eligibility validation

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks. changed to pass it from the original lookup.

@countvonzero
Copy link
Contributor Author

bors merge

bors bot pushed a commit that referenced this pull request Sep 18, 2023
## Motivation
Closes #4984

## Changes
- drop EmitEmptyActiveSet config
- remove all access to Ballot.ActiveSet and look up from db instead
- remove all writes of Ballot.ActiveSet

after this PR, miner will still accept proposal/ballot with non-empty active sets, but will save ballots without active set.
@countvonzero
Copy link
Contributor Author

bors cancel

@bors
Copy link

bors bot commented Sep 18, 2023

Canceled.

@countvonzero
Copy link
Contributor Author

bors merge

bors bot pushed a commit that referenced this pull request Sep 18, 2023
## Motivation
Closes #4984

## Changes
- drop EmitEmptyActiveSet config
- remove all access to Ballot.ActiveSet and look up from db instead
- remove all writes of Ballot.ActiveSet

after this PR, miner will still accept proposal/ballot with non-empty active sets, but will save ballots without active set.
@bors
Copy link

bors bot commented Sep 18, 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 remove read/write for ballot.ActiveSet [Merged by Bors] - remove read/write for ballot.ActiveSet Sep 18, 2023
@bors bors bot closed this Sep 18, 2023
@bors bors bot deleted the assume-no-active-set branch September 18, 2023 23:33
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.

don't store activeset together with ballot object
2 participants