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

ProposerVM Extend windows 2- extend windowing #2401

Merged
merged 145 commits into from
Dec 16, 2023

Conversation

abi87
Copy link
Contributor

@abi87 abi87 commented Nov 30, 2023

Why this should be merged

Change proposerVM windowing system, but extending the number of validators which can propose and allowing them a specific slot to do so

How this works

Based on #2404

How this was tested

@abi87 abi87 self-assigned this Nov 30, 2023
@abi87 abi87 force-pushed the proposervm-upgraded-windowing branch from 8d51f96 to 0d95f1b Compare November 30, 2023 12:40
@abi87 abi87 force-pushed the proposervm-upgraded-windowing branch from 0d95f1b to 86153c0 Compare November 30, 2023 14:50
vms/proposervm/proposer/windower.go Outdated Show resolved Hide resolved
vms/proposervm/vm.go Outdated Show resolved Hide resolved
vms/proposervm/post_fork_option.go Outdated Show resolved Hide resolved
@abi87 abi87 changed the base branch from dev to proposervm_config December 1, 2023 13:53
ctx,
parentHeight+1,
parentPChainHeight,
currentSlot+1, // We know we aren't the proposer for the current slot
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice catch

return nil
}

func (p *postForkCommonComponents) shouldBuildBlockPostDurango(
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I think scheduleBuildBlockPostDurango is a better name for what this actually is

shouldBuild* at least implies a bool is returned?

Copy link
Contributor

Choose a reason for hiding this comment

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

hmmm I don't know what to call this function... I don't like scheduleBuildBlockPostDurango - because it only schedules the build block if it returns an error...

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm going to add a TODO to restructure this function after durango activates... I think it'll be easier to clean up the code during that than now

if weight < uint64(numToSample) {
numToSample = int(weight)
}
source.Seed(w.chainSource ^ blockHeight)
Copy link
Contributor

Choose a reason for hiding this comment

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

Calling out that this was chainHeight ^ w.chainSource before

utils.Sort(validators)

weights := make([]uint64, len(validators))
for i, validator := range validators {
Copy link
Contributor

Choose a reason for hiding this comment

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

If we return totalWeight from this function, we can remove some additional logic from Proposers

Copy link
Contributor

Choose a reason for hiding this comment

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

We only need to calculate the total weight once in Proposers - so I don't really see a reason to do that for every call we make to this function

Copy link
Contributor

@patrick-ogrady patrick-ogrady left a comment

Choose a reason for hiding this comment

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

I left some nits but the code is sound AFAICT

@abi87 abi87 requested a review from danlaine as a code owner December 16, 2023 01:49
@StephenButtolph StephenButtolph self-assigned this Dec 16, 2023
@StephenButtolph StephenButtolph added this pull request to the merge queue Dec 16, 2023
Merged via the queue into dev with commit 83c95a5 Dec 16, 2023
17 checks passed
@StephenButtolph StephenButtolph deleted the proposervm-upgraded-windowing branch December 16, 2023 02:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Durango durango fork
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Extend proposerVMs windows
4 participants