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

Create UtxoView Helper Function to Simulate Next Epoch Entry #850

Conversation

tholonious
Copy link
Contributor

No description provided.

@tholonious tholonious requested a review from lazynina December 5, 2023 00:14
@tholonious tholonious marked this pull request as ready for review December 5, 2023 00:14
@tholonious tholonious requested a review from a team as a code owner December 5, 2023 00:14
func (bav *UtxoView) computeNextEpochEntry(currentEpochNumber uint64, currentEpochFinalBlockHeight uint64, currentEpochFinalView uint64, nextEpochBlockTimestampNanoSecs uint64) (*EpochEntry, error) {
// Retrieve the SnapshotGlobalParamsEntry to determine the next epoch's final block height. We use the
// snapshot global params here because the next epoch begin immediately, and its length is used in the PoS
// consensus. The validator set for the next epoch needs to be in agreement on the length of the epoch
// before the epoch begins.
snapshotGlobalParamsEntry, err := bav.GetCurrentSnapshotGlobalParamsEntry()
snapshotAtEpochNumber, err := bav.ComputeSnapshotEpochNumberForEpoch(currentEpochNumber)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We shouldn't assume that the currentEpochNumber value passed in is the utxoView's current epoch value

@tholonious tholonious force-pushed the Sign_Random_Seed_Hash_in_PoS_Block_Proposal branch from bb5fe04 to e1d4829 Compare December 5, 2023 01:32
Base automatically changed from Sign_Random_Seed_Hash_in_PoS_Block_Proposal to feature/pos-networking-and-syncing December 5, 2023 01:38
@tholonious tholonious force-pushed the Create_UtxoView_Helper_Function_to_Simulate_Next_Epoch_Entry branch from 5065221 to a81d785 Compare December 5, 2023 01:38
@tholonious tholonious merged commit f66410a into feature/pos-networking-and-syncing Dec 5, 2023
@tholonious tholonious deleted the Create_UtxoView_Helper_Function_to_Simulate_Next_Epoch_Entry branch December 5, 2023 01:46
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.

2 participants