Skip to content

Conversation

@mattfoley8
Copy link
Contributor

@mattfoley8 mattfoley8 commented May 31, 2023


// Validate EndEpochNumber + StakeLockupEpochDuration <= CurrentEpochNumber.
if metadata.EndEpochNumber+bav.Params.StakeLockupEpochDuration > currentEpochNumber {
if metadata.EndEpochNumber+bav.GetStakeLockupEpochDuration(0) > currentEpochNumber {
Copy link
Member

Choose a reason for hiding this comment

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

Should we be fetching the StakeLockupEpochDuration based on a snapshot?

Copy link
Contributor Author

@mattfoley8 mattfoley8 Jun 1, 2023

Choose a reason for hiding this comment

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

Yes. We should be fetching those based on a snapshot. For now, I'm just keeping the existing behavior as before this PR. I'll update exactly which snapshot we should fetch once I know it. That'll just be swapping out the 0 for the correct EpochNumber relative to the CurrentEpochNumber.


// Validate sufficient epochs have elapsed for validator to be unjailed.
if validatorEntry.JailedAtEpochNumber+bav.Params.ValidatorJailEpochDuration > currentEpochNumber {
if validatorEntry.JailedAtEpochNumber+bav.GetValidatorJailEpochDuration(0) > currentEpochNumber {
Copy link
Member

Choose a reason for hiding this comment

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

same thing here about using a snapshot

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup, you are correct. Same response as above.

Copy link
Member

@lazynina lazynina left a comment

Choose a reason for hiding this comment

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

Just check that extra data isn't nil, but otherwise this looks good.

minFeeRateNanosPerKB uint64, mempool *DeSoMempool, additionalOutputs []*DeSoOutput) (
extraData map[string][]byte, minFeeRateNanosPerKB uint64, mempool *DeSoMempool, additionalOutputs []*DeSoOutput) (
_txn *MsgDeSoTxn, _totalInput uint64, _changeAmount uint64, _fees uint64, _err error) {

Copy link
Member

Choose a reason for hiding this comment

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

can we add a if extraData == nil { extraData := make(map[string][]byte) } please?

@lazynina lazynina merged commit 582da46 into feature/pos-txn-types Jun 5, 2023
@lazynina lazynina deleted the mf/param-updater-update-pos-global-params branch June 5, 2023 15:21
@mattfoley8 mattfoley8 restored the mf/param-updater-update-pos-global-params branch June 9, 2023 14:26
@mattfoley8 mattfoley8 deleted the mf/param-updater-update-pos-global-params branch June 9, 2023 15:05
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