Skip to content

Comments

Bellatrix p2p changes#10072

Merged
nisdas merged 23 commits intodevelopfrom
bellatrix-p2p-changes
Jan 20, 2022
Merged

Bellatrix p2p changes#10072
nisdas merged 23 commits intodevelopfrom
bellatrix-p2p-changes

Conversation

@terencechain
Copy link
Collaborator

Bringing down Bellatrix p2p changes from kintsugi to develop branch. Credit to original author: @jmozah

@terencechain terencechain marked this pull request as ready for review January 17, 2022 16:06
@terencechain terencechain requested a review from a team as a code owner January 17, 2022 16:06
Copy link
Contributor

@nisdas nisdas left a comment

Choose a reason for hiding this comment

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

Looks good but had a few questions


// MaxGossipSize allowed for gossip messages.
var MaxGossipSize = params.BeaconNetworkConfig().GossipMaxSize // 1 Mib
var MaxGossipSize = params.BeaconNetworkConfig().GossipMaxSize // 1 Mib.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use a proper setter method here to modify this ? Rather than setting a global var that we have. It is cleaner to understand that way and we do not expose a global variable from this package.

return false
}
if parts[2] != fmt.Sprintf("%x", fd) && parts[2] != fmt.Sprintf("%x", digest) {
mergeForkDigest, err := forks.ForkDigestFromEpoch(params.BeaconConfig().BellatrixForkEpoch, s.genesisValidatorsRoot)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
mergeForkDigest, err := forks.ForkDigestFromEpoch(params.BeaconConfig().BellatrixForkEpoch, s.genesisValidatorsRoot)
bellatrixForkDigest, err := forks.ForkDigestFromEpoch(params.BeaconConfig().BellatrixForkEpoch, s.genesisValidatorsRoot)

}

// from Bellatrix Epoch, the MaxGossipSize and the MaxChunkSize is changed to 10MB.
if currEpoch == params.BeaconConfig().BellatrixForkEpoch {
Copy link
Contributor

Choose a reason for hiding this comment

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

While it is fine to change this via the forkwatcher, how does this work when prysm starts up after the bellatrix fork epoch ? Prysm will revert to the old gossip max size and chunk size values and will be incompatible with the networking spec again.


// MaxGossipSize allowed for gossip messages.
var MaxGossipSize = params.BeaconNetworkConfig().GossipMaxSize // 1 Mib
var MaxGossipSize = params.BeaconNetworkConfig().GossipMaxSize // 1 Mib.
Copy link
Contributor

Choose a reason for hiding this comment

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

Lets unexport these vars and keep their scope in this package.

Copy link
Contributor

Choose a reason for hiding this comment

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

as discussed in discord, its hard to do this since we use the global var in test cases (with a different package)

log.WithError(err).Error("Could not determine merge fork digest")
return false
}
if parts[2] != fmt.Sprintf("%x", phase0ForkDigest) &&
Copy link
Contributor

@nisdas nisdas Jan 20, 2022

Choose a reason for hiding this comment

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

maybe we can do a a switch and case here ?

switch parts[2] {
case fmt.Sprintf("%x", phase0ForkDigest) :
// do nothing 
case fmt.Sprintf("%x", altairForkDigest) :
// do nothing
case fmt.Sprintf("%x", mergeForkDigest) :
// do nothing
default:
return false
}

@nisdas nisdas merged commit 288b38b into develop Jan 20, 2022
@delete-merged-branch delete-merged-branch bot deleted the bellatrix-p2p-changes branch January 20, 2022 14:12
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.

3 participants