-
Notifications
You must be signed in to change notification settings - Fork 204
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
Integration tests staking v4 #3951
Integration tests staking v4 #3951
Conversation
factory2 "github.com/ElrondNetwork/elrond-go/factory" | ||
"github.com/ElrondNetwork/elrond-go/integrationTests" | ||
mock2 "github.com/ElrondNetwork/elrond-go/integrationTests/mock" | ||
factory3 "github.com/ElrondNetwork/elrond-go/node/mock/factory" |
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.
rename factory 2, factory 3
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.
Renamed them
"github.com/ElrondNetwork/elrond-go/epochStart" | ||
"github.com/ElrondNetwork/elrond-go/epochStart/metachain" | ||
factory2 "github.com/ElrondNetwork/elrond-go/factory" | ||
mock2 "github.com/ElrondNetwork/elrond-go/integrationTests/mock" |
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.
rename mock2 and factory2
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.
Renamed them
"github.com/ElrondNetwork/elrond-go/common" | ||
"github.com/ElrondNetwork/elrond-go/config" | ||
factory2 "github.com/ElrondNetwork/elrond-go/factory" | ||
mock2 "github.com/ElrondNetwork/elrond-go/integrationTests/mock" |
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.
rename factory2 and mock2
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.
Renamed them
"github.com/ElrondNetwork/elrond-go/config" | ||
"github.com/ElrondNetwork/elrond-go/epochStart/metachain" | ||
mock3 "github.com/ElrondNetwork/elrond-go/epochStart/mock" | ||
factory2 "github.com/ElrondNetwork/elrond-go/factory" |
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.
rename factory2 mock3
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.
Renamed them
"github.com/ElrondNetwork/elrond-go/config" | ||
"github.com/ElrondNetwork/elrond-go/dataRetriever" | ||
"github.com/ElrondNetwork/elrond-go/epochStart/metachain" | ||
factory2 "github.com/ElrondNetwork/elrond-go/factory" |
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.
rename factory2
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.
Renamed them
…aking-v4 # Conflicts: # process/block/postprocess/feeHandler.go
Codecov Report
@@ Coverage Diff @@
## feat/liquid-staking #3951 +/- ##
====================================================
Coverage 75.38% 75.38%
====================================================
Files 622 622
Lines 83134 83177 +43
====================================================
+ Hits 62668 62701 +33
- Misses 15748 15756 +8
- Partials 4718 4720 +2
Continue to review full report at Codecov.
|
@@ -179,6 +203,14 @@ func (s *systemSCProcessor) selectNodesFromAuctionList(validatorsInfoMap state.S | |||
return nil | |||
} | |||
|
|||
// TODO: Move this in elrond-go-core | |||
func safeSub(a, b uint32) (uint32, error) { |
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.
we have this for Uint64
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, but I didn't want to cast to uint64, but have a separate function for it. Will move it in elrond-go-core in a separate task
What's new
StakingV4DistributeAuctionToWaitingEpoch
activation flag = epoch in which selected nodes from auction will be distributed to waiting list (used in node shuffler)MaxNodesChangeEnableEpoch
config, which will have enable epoch =StakingV4DistributeAuctionToWaitingEpoch
and will decrease the max nodes config with the number of shuffled out validators from all shards (e.g. from 3200 -> 2880, since we shuffle out 80 eligible validators per 4 shards)Integration tests
TestMetaProcessor
struct which will create a predefined nodes configuration with provided params:00address-0
->0address-50
)Process
n number of rounds by committing blocks in each of them and will display nodes config each time.TestStakingV4
which simulates a mainnet nodes configuration (400 meta nodes + 400 eligible and waiting/shard + 60 nodes in staking queue, each of them having the same topup per node) going through stakingV4Init, stakingV4Enable, stakingV4DistributeAuctionToWaiting epochs.TestStakingV4MetaProcessor_ProcessMultipleNodesWithSameSetupExpectSameRootHash
which simulates multipleTestMetaProcessor
starting to process n epochs with the same initial setup. It is expected that there is not root hash mismatch at any epochBugfixes
flagCorrectNumNodesToStake
flag inlegacySystemSCs.go
upon staking v4 enable epoch, since it used code related to staking queue (which is now obsolete)pubKey XOR randomness
, resulting in root hash mismatches between meta shard nodessetNodesPerShards
inindexHashedNodesCoordinatorLite.go
to also save shuffled out nodesprocess/block/displayMetaBlock.go
by adding a mutex forpeakTPS
Refactor
systemSCs_test.go
totestscommon/stakingCommon.go
to be used in stakingV4 integration testsNewFeeAccumulator
constructor to return directly a new instance of*feeHandler
instead of(*feeHandler, error)
, since it could have never returned an error