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
Ignore staking queue #3861
Ignore staking queue #3861
Conversation
vm/systemSmartContracts/staking.go
Outdated
s.eei.AddReturnMessage(vm.ErrWaitingListDisabled.Error()) | ||
s.eei.Finish([]byte{0}) | ||
|
||
return vmcommon.Ok |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you have return message than return vmcommon.UserError, and do not add to Finish anything. as it is ignored
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for heads up, refactored it
vm/systemSmartContracts/staking.go
Outdated
@@ -1353,6 +1381,13 @@ func (s *stakingSC) getWaitingListIndex(args *vmcommon.ContractCallInput) vmcomm | |||
} | |||
|
|||
func (s *stakingSC) getWaitingListSize(args *vmcommon.ContractCallInput) vmcommon.ReturnCode { | |||
if s.flagStakingV4.IsSet() { | |||
s.eei.AddReturnMessage(vm.ErrWaitingListDisabled.Error()) | |||
s.eei.Finish([]byte{0}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you have return message than return vmcommon.UserError, and do not add to Finish anything. as it is ignored
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for heads up, refactored it
…e-v1 # Conflicts: # epochStart/metachain/systemSCs.go
stakingSmartContract.EpochConfirmed(args.EpochConfig.EnableEpochs.StakingV4EnableEpoch, 0) | ||
|
||
arguments := CreateVmContractCallInput() | ||
arguments.Arguments = [][]byte{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this needed? i think it can be removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, can be removed. I've put it there so I don't pass nil pointers
doStake(t, stakingSmartContract, stakingAccessAddress, addr, addr) | ||
checkIsStaked(t, stakingSmartContract, addr, addr, vmcommon.Ok) | ||
} | ||
requireRegisteredNodes(t, stakingSmartContract, eei, 14, 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here we have 14
staked nodes, but we MaxNumberOfNodesForStake = 4
, or we are not taking this into account in this test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the expected behavior. Once staking v4 is enabled, we can stake any number of nodes, without limit.
On L1007
you can see that after trying to stake 10 nodes, we expect to have: 4 staked nodes + 6 waiting. (because MaxNumberOfNodesForStake = 4
)
Here, on L1026
after flagStakingV4
is enabled, waiting queue is removed => all 14 nodes are staked
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok 👍 thanks
Codecov Report
@@ Coverage Diff @@
## feat/liquid-staking #3861 +/- ##
=======================================================
- Coverage 74.99% 74.49% -0.50%
=======================================================
Files 614 606 -8
Lines 81639 80533 -1106
=======================================================
- Hits 61223 59991 -1232
- Misses 15755 15933 +178
+ Partials 4661 4609 -52
Continue to review full report at Codecov.
|
8badd35
to
779733d
Compare
s.eei.AddReturnMessage(err.Error()) | ||
return vmcommon.UserError | ||
if !s.flagStakingV4.IsSet() { | ||
addOneFromQueue := !s.flagCorrectLastUnjailed.IsSet() || s.canStakeIfOneRemoved() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this file will need one big cleanup - like stakingV2 separate file and stakingV4 separate. Add a task in JIRA and we will see later.
staking.go
which has been used to deactivate functions which will be obsolete since staking v4 is enabled. It has been mostly used to "inhibit" staking queue/ waiting list.