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

Feat/staking delegation v2 #2370

Merged
merged 366 commits into from Dec 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
366 commits
Select commit Hold shift + click to select a range
8eb38e5
fixes and tests
sasurobert Oct 23, 2020
81dc936
Merge pull request #2397 from ElrondNetwork/EN-7777/delegation-integr…
sasurobert Oct 23, 2020
053d948
fix unit test
sasurobert Oct 23, 2020
2322139
fix unit test
sasurobert Oct 23, 2020
ea04929
fix after review
sasurobert Oct 26, 2020
5454178
fixing some staff.
sasurobert Oct 26, 2020
3b96ff6
added prefix for fund keys
sasurobert Oct 26, 2020
4b34388
rename
sasurobert Oct 26, 2020
d52adb3
Merge pull request #2392 from ElrondNetwork/EN-7776/Delegation-SC-rew…
sasurobert Oct 26, 2020
0e52eb4
new address func
sasurobert Oct 26, 2020
74e801f
- added unit test for createNewAddress function
iulianpascalau Oct 26, 2020
817eaa0
Merge branch 'feat/staking-delegation-v2' into EN-7744-top-up-nodes-i…
iulianpascalau Oct 26, 2020
9643632
- fix after merge
iulianpascalau Oct 26, 2020
b072a2b
- fix after review: renaming, added TODOs
iulianpascalau Oct 26, 2020
79964f5
Merge pull request #2405 from ElrondNetwork/delegation-new-address
sasurobert Oct 26, 2020
23141cd
Merge branch 'feat/staking-delegation-v2' into EN-7744-top-up-nodes-i…
sasurobert Oct 26, 2020
5738687
- fix after review: renaming
iulianpascalau Oct 26, 2020
f17c672
Merge pull request #2393 from ElrondNetwork/EN-7744-top-up-nodes-inte…
sasurobert Oct 27, 2020
c86ae86
added transfer of deposit funds to the auction smart contract
sasurobert Oct 27, 2020
3bf32cc
Merge pull request #2410 from ElrondNetwork/send-stake-at-delegation-…
sasurobert Oct 28, 2020
ca75e64
implemented view functions for delegation system smart contract
sasurobert Oct 29, 2020
592d2b6
fix after review
sasurobert Oct 30, 2020
8eb313f
cmd, epochStart: add extra functionality for end of epoch rewards to …
AdoAdoAdo Oct 30, 2020
f1abdea
added integration tests for delegation sc
BeniaminDrasovean Oct 30, 2020
c94def0
epochStart: process staking data
AdoAdoAdo Oct 30, 2020
cb45ab8
Merge pull request #2418 from ElrondNetwork/view-funcs-delegation
sasurobert Oct 31, 2020
460089f
Merge branch 'feat/staking-delegation-v2' into delegation-SC-integrat…
sasurobert Oct 31, 2020
4ff4ac0
Merge pull request #2423 from ElrondNetwork/delegation-SC-integration…
sasurobert Oct 31, 2020
b4ea67c
epochStart, integrationTests: additional functionality to StakingData…
AdoAdoAdo Nov 2, 2020
7edb777
add unit tests for delegation system sc view functions
BeniaminDrasovean Nov 2, 2020
cea106b
cmd, config, epochStart, integrationTests, process: bring topUp confi…
AdoAdoAdo Nov 2, 2020
7c88840
fix rewards computation and add integration test
BeniaminDrasovean Nov 3, 2020
98b28a6
Merge pull request #2429 from ElrondNetwork/fix-delegation-rewards-co…
sasurobert Nov 3, 2020
45486b3
Merge branch 'feat/staking-delegation-v2' into delegation-SC-view-fun…
BeniaminDrasovean Nov 3, 2020
3a640a5
cmd, epochStart, integrationTests: add economics data provider
AdoAdoAdo Nov 4, 2020
5e32a29
Merge pull request #2427 from ElrondNetwork/delegation-SC-view-func-test
BeniaminDrasovean Nov 4, 2020
a653f03
Merge remote-tracking branch 'origin/development' into change-max-nod…
AdoAdoAdo Nov 4, 2020
3917592
cmd: change config for testnets
AdoAdoAdo Nov 4, 2020
bb84da8
cmd: update comment
AdoAdoAdo Nov 4, 2020
0e7a662
cmd: updated testnet enable epoch for changing max nb nodes
AdoAdoAdo Nov 4, 2020
e9457ee
epochStart: split rewardsCreator into baseRewardsCreator and rewardsC…
AdoAdoAdo Nov 4, 2020
094eb68
epochStart, cmd, integrationTests: refactor rewards computation and u…
AdoAdoAdo Nov 5, 2020
627c531
epochStart: implement rewards computation that take into account topU…
AdoAdoAdo Nov 5, 2020
c639465
Merge branch 'feat/staking-delegation-v2' into top-up-rewards
AdoAdoAdo Nov 5, 2020
7645ba0
epochStart: fixes tests missing economicsDataProvider
AdoAdoAdo Nov 6, 2020
ecee092
* Internal audit done
SebastianMarian Nov 6, 2020
6b59532
Merge pull request #2440 from ElrondNetwork/feat/staking-delegation-v…
SebastianMarian Nov 6, 2020
8615ffd
Merge branch 'development' into feat/staking-delegation-v2
sasurobert Nov 6, 2020
a336cce
fix after merge
sasurobert Nov 6, 2020
173e5a2
Merge pull request #2443 from ElrondNetwork/dev-to-staking-nov6
sasurobert Nov 6, 2020
7e3cf1d
epochStart: add unit tests baseRewards
AdoAdoAdo Nov 9, 2020
972e93a
small fixes
BeniaminDrasovean Nov 9, 2020
d0cb33a
Merge branch 'development' into change-max-nodes-waiting-list
AdoAdoAdo Nov 9, 2020
f9a714a
Merge branch 'development' into change-max-nodes-waiting-list
LucianMincu Nov 9, 2020
9c05f5f
epochStart: increase coverage baseRewards
AdoAdoAdo Nov 10, 2020
7c08e51
fix after review
BeniaminDrasovean Nov 10, 2020
1899e61
epochStart, cmd: rewards with topUp stake unit tests
AdoAdoAdo Nov 10, 2020
56c7c30
epochStart: increase code coverage topUp rewards computation
AdoAdoAdo Nov 11, 2020
779bae9
epochStart: further increase code coverage
AdoAdoAdo Nov 11, 2020
3f22906
fix tests
BeniaminDrasovean Nov 11, 2020
48739f1
Merge pull request #2451 from ElrondNetwork/EN-8137-delegation-bughunt
BeniaminDrasovean Nov 11, 2020
7ce600c
epochStart: finalize unit tests for v2 rewards computation
AdoAdoAdo Nov 11, 2020
a903df2
cmd, epochStart, integrationTests: reward creator proxy for backwards…
AdoAdoAdo Nov 11, 2020
6977d8c
Merge branch 'feat/staking-delegation-v2' into top-up-rewards
AdoAdoAdo Nov 11, 2020
e042f77
cmd: use the stake enableEpoch instead for the top up rewards activation
AdoAdoAdo Nov 11, 2020
6962e77
small fixes
BeniaminDrasovean Nov 12, 2020
4a7f2d0
remove duplicated code from init and delegate
BeniaminDrasovean Nov 12, 2020
67951f9
small fix
BeniaminDrasovean Nov 12, 2020
0e797fe
- optimized getValidatorData in stakingDataProvider.go to call only o…
iulianpascalau Nov 13, 2020
15004d3
cmd, epochStart: fixes after review
AdoAdoAdo Nov 13, 2020
70a1087
cmd, epochStart, integrationTests: integration tests fixes
AdoAdoAdo Nov 13, 2020
6027723
epochStart: fix condition
AdoAdoAdo Nov 13, 2020
23828f8
cmd: stakingV2 enabled in epoch 4
AdoAdoAdo Nov 13, 2020
850436e
rename some functions
BeniaminDrasovean Nov 16, 2020
e9bb529
fix renaming
BeniaminDrasovean Nov 16, 2020
011c63e
Merge pull request #2463 from ElrondNetwork/EN-8063-fix-after-RV-audit
sasurobert Nov 16, 2020
1fe6957
epochStart: fix unit test
AdoAdoAdo Nov 16, 2020
de71637
Merge branch 'feat/staking-delegation-v2' into top-up-rewards
AdoAdoAdo Nov 16, 2020
189e863
Merge pull request #2438 from ElrondNetwork/top-up-rewards
AdoAdoAdo Nov 17, 2020
9aa1047
epochStart: fix missing economicsDataProvider updates
AdoAdoAdo Nov 17, 2020
2ed0582
epochStart: add nodeRewardsData structure for easy debugging economic…
AdoAdoAdo Nov 17, 2020
1b8c64b
Merge branch 'feat/staking-delegation-v2' into top-up-rewards-optimiz…
iulianpascalau Nov 17, 2020
2b8a9d7
epochStart: adapt tests after rewards v2 changes
AdoAdoAdo Nov 17, 2020
575fd4b
epochStart: fix failing unit test
AdoAdoAdo Nov 17, 2020
5bbd5af
Merge branch 'feat/staking-delegation-v2' into top-up-rewards-enhance…
AdoAdoAdo Nov 17, 2020
c5cef36
Merge pull request #2466 from ElrondNetwork/top-up-rewards-optimizations
iulianpascalau Nov 17, 2020
b5e9d6c
epochStart: add unit tests for rewardsCreatorProxy
AdoAdoAdo Nov 17, 2020
bb46a58
epochStart: add debug logs for rewards data
AdoAdoAdo Nov 17, 2020
0755313
Merge branch 'feat/staking-delegation-v2' into top-up-rewards-enhance…
AdoAdoAdo Nov 17, 2020
997b9bb
epochStart: temp fix for protocol rewards mismatch
AdoAdoAdo Nov 18, 2020
8b8db7a
epochStart: fix after review
AdoAdoAdo Nov 18, 2020
cc2bfec
Merge branch 'development' into change-max-nodes-waiting-list
AdoAdoAdo Nov 19, 2020
506fe00
Merge branch 'change-max-nodes-waiting-list' of github.com:ElrondNetw…
AdoAdoAdo Nov 19, 2020
9da871c
Merge branch 'development' into staking-delegation-v2-merge-from-dev
AdoAdoAdo Nov 19, 2020
2d12b7f
epochStart: fix after merge
AdoAdoAdo Nov 19, 2020
1165675
Merge pull request #2484 from ElrondNetwork/staking-delegation-v2-mer…
sasurobert Nov 19, 2020
140a365
Merge branch 'feat/staking-delegation-v2' into change-max-nodes-waiti…
AdoAdoAdo Nov 19, 2020
95127f5
epochStart: fix after merge
AdoAdoAdo Nov 19, 2020
af50201
Merge pull request #2389 from ElrondNetwork/change-max-nodes-waiting-…
AdoAdoAdo Nov 19, 2020
76a649f
staking nodes from waiting queue
sasurobert Nov 19, 2020
708a391
Merge branch 'development' into update-dev-staking-v2-2020.11.19
iulianpascalau Nov 19, 2020
9149354
update waiting list after staking nodes
sasurobert Nov 19, 2020
5bf96b6
Merge pull request #2487 from ElrondNetwork/update-dev-staking-v2-202…
iulianpascalau Nov 19, 2020
d32148a
config to test
sasurobert Nov 19, 2020
cbc6040
Merge remote-tracking branch 'origin/top-up-rewards-enhancements' int…
sasurobert Nov 19, 2020
9424e55
config to test
sasurobert Nov 19, 2020
012e7db
read only sc container
sasurobert Nov 20, 2020
5d9ecd6
fix blocking tokens when no node was yet deployed.
sasurobert Nov 20, 2020
eedcfb7
added unit test verification for reward address save
sasurobert Nov 20, 2020
b987a22
implemented setting to new validators in the validators statistics trie
sasurobert Nov 20, 2020
c54c6db
Merge branch 'feat/staking-delegation-v2' into EN-8306/stake-nodes-fr…
sasurobert Nov 20, 2020
fc650fa
no need to set code
sasurobert Nov 20, 2020
06d9f4c
added a set of unit/integration tests
sasurobert Nov 20, 2020
267bc2b
fix after review
sasurobert Nov 20, 2020
e66072e
Merge pull request #2491 from ElrondNetwork/EN-8306/stake-nodes-from-…
sasurobert Nov 20, 2020
340d745
implemented protection against owner taking out initial owner funds
sasurobert Nov 20, 2020
87304e3
Merge branch 'feat/staking-delegation-v2' into delegation-system-sc-test
sasurobert Nov 20, 2020
d763933
Merge branch 'feat/staking-delegation-v2' into top-up-rewards-enhance…
sasurobert Nov 20, 2020
79ac80e
container should use code instead of address in order to work properl…
sasurobert Nov 23, 2020
8077db0
Merge remote-tracking branch 'origin/delegation-system-sc-test' into …
sasurobert Nov 23, 2020
7a0ed88
container should use code instead of address in order to work properl…
sasurobert Nov 23, 2020
727b6dd
fixing tests
sasurobert Nov 23, 2020
a68a733
automatic activation feature
sasurobert Nov 23, 2020
7017163
added unit tests and small fixes
sasurobert Nov 23, 2020
7f47a16
Merge branch 'top-up-rewards-enhancements' into delegation-system-sc-…
sasurobert Nov 23, 2020
e8ee58e
Merge pull request #2477 from ElrondNetwork/top-up-rewards-enhancements
sasurobert Nov 24, 2020
7e2546a
fix after review
sasurobert Nov 24, 2020
3b49fe8
added a TODO
sasurobert Nov 24, 2020
4f321a7
fix api requests on metachain.
sasurobert Nov 24, 2020
825e1cb
fix after review
sasurobert Nov 24, 2020
8b945a3
Merge pull request #2492 from ElrondNetwork/delegation-system-sc-test
sasurobert Nov 24, 2020
680c2e0
epochStart, process, integrationTests: compute end of epoch economics…
AdoAdoAdo Nov 24, 2020
f87bf7d
epochStart, integrationTests, process: use own computed economics for…
AdoAdoAdo Nov 25, 2020
2334e5e
epochStart: reject negative adjustment values
AdoAdoAdo Nov 25, 2020
e2c94d2
Merge branch 'feat/staking-delegation-v2' into fixes-top-up-rewards
AdoAdoAdo Nov 25, 2020
0fb7236
cmd: revert hardcoded value for epoch enable
AdoAdoAdo Nov 25, 2020
41f982c
epochStart: reactivate unit test, cleanup test files
AdoAdoAdo Nov 25, 2020
714f200
started implementation
sasurobert Nov 25, 2020
a245ea4
unbond nodes only implementation.
sasurobert Nov 25, 2020
f8c38a7
fixing unstaking and unbonding nodes in delegation sc
sasurobert Nov 25, 2020
ed5cd8c
Merge pull request #2504 from ElrondNetwork/fixes-top-up-rewards
AdoAdoAdo Nov 26, 2020
f077016
not much
sasurobert Nov 26, 2020
3fa8d6f
Merge branch 'development' into feat/staking-delegation-v2
sasurobert Nov 26, 2020
c93bfd7
fixes after merge
sasurobert Nov 26, 2020
930b145
fixes after merge
sasurobert Nov 26, 2020
6553cbb
more test fixes
sasurobert Nov 26, 2020
abcb603
fix after merge
sasurobert Nov 27, 2020
42f86d3
Merge pull request #2516 from ElrondNetwork/dev-to-staking-26nov
sasurobert Nov 27, 2020
199a377
Merge branch 'feat/staking-delegation-v2' into unDelegate-from-unstak…
sasurobert Nov 27, 2020
be3b3b0
simplify auction and delegation contracts
sasurobert Nov 27, 2020
2368c34
simplify auction and delegation contracts
sasurobert Nov 27, 2020
050c291
renaming of auction sc to validator sc
sasurobert Nov 27, 2020
cbbca32
renaming of auction sc to validator sc
sasurobert Nov 27, 2020
c956ec5
renaming of auction sc to validator sc
sasurobert Nov 27, 2020
576c4fa
fixing unit tests
sasurobert Nov 27, 2020
4f27184
fix after review
sasurobert Nov 27, 2020
bce9fb8
fix after review
sasurobert Nov 27, 2020
18e1261
Merge pull request #2523 from ElrondNetwork/unDelegate-from-unstakedF…
sasurobert Nov 27, 2020
5223a63
Merge branch 'feat/staking-delegation-v2' into EN-8336/Rename-auction-sc
sasurobert Nov 27, 2020
27bc850
fix after runtime verification audit
sasurobert Nov 30, 2020
bcab198
only file rename
sasurobert Nov 30, 2020
30fac0e
started implementation
sasurobert Nov 30, 2020
56cb558
fix after review
sasurobert Nov 30, 2020
2b63f38
Merge pull request #2525 from ElrondNetwork/EN-8336/Rename-auction-sc
sasurobert Nov 30, 2020
d9aed38
started implementing new unstake - unbond
sasurobert Nov 30, 2020
bf4cac6
only file rename
sasurobert Nov 30, 2020
3616901
Merge branch 'feat/staking-delegation-v2' into rename-file-to-validator
sasurobert Nov 30, 2020
f4db700
Merge branch 'feat/staking-delegation-v2' into EN-8336/RV-delegation-…
sasurobert Nov 30, 2020
032cb8c
Merge pull request #2530 from ElrondNetwork/rename-file-to-validator
sasurobert Nov 30, 2020
d58f208
Merge branch 'feat/staking-delegation-v2' into EN-8336/RV-delegation-…
sasurobert Nov 30, 2020
92e19cb
Merge pull request #2528 from ElrondNetwork/EN-8336/RV-delegation-fixes
sasurobert Nov 30, 2020
ce4133f
unstake/unbond nodes and value
sasurobert Nov 30, 2020
3708646
Merge branch 'feat/staking-delegation-v2' into EN-8339/Validator-unst…
sasurobert Nov 30, 2020
88b9484
fix after review - unBondV1 created.
sasurobert Dec 2, 2020
8aa8b28
Merge pull request #2531 from ElrondNetwork/EN-8339/Validator-unstake…
sasurobert Dec 2, 2020
521fb9d
started implementation of end of epoch selection
sasurobert Dec 2, 2020
c5c3fd1
implementation of staking provider, filling data, compute unqualified…
sasurobert Dec 2, 2020
808a53d
unstaking nodes
sasurobert Dec 2, 2020
a818358
unstaking at end of epoch
sasurobert Dec 2, 2020
90306c4
staking from waiting list only those keys which have enough funds
sasurobert Dec 2, 2020
17743d9
staking from waiting list only those keys which have enough funds
sasurobert Dec 2, 2020
ba2becf
Merge branch 'feat/staking-delegation-v2' into EN-8340/Selection-at-e…
sasurobert Dec 2, 2020
8ddec91
fixing tests
sasurobert Dec 3, 2020
9f26b9d
Merge remote-tracking branch 'origin/EN-8340/Selection-at-end-of-epoc…
sasurobert Dec 3, 2020
e2a1bb5
fixing tests
sasurobert Dec 3, 2020
8a911ef
fixing tests
sasurobert Dec 3, 2020
6034440
added unit tests of new functions
sasurobert Dec 3, 2020
e64bb2e
check owners fix and test
sasurobert Dec 3, 2020
2e3e912
fix after reivew
sasurobert Dec 3, 2020
06d1522
added tests and small fixes
sasurobert Dec 3, 2020
cdb3a8b
fix after reivew
sasurobert Dec 4, 2020
05eabab
pause and unpause unstake,unbond
sasurobert Dec 4, 2020
faf45b2
compute if node was forced to remain after shuffling
sasurobert Dec 4, 2020
9fb2526
call execution on systemSCs.go
sasurobert Dec 4, 2020
5e15225
Merge pull request #2541 from ElrondNetwork/EN-8340/Selection-at-end-…
sasurobert Dec 4, 2020
c6676f0
Merge branch 'feat/staking-delegation-v2' into EN-8341/Protection-aga…
sasurobert Dec 4, 2020
8445c55
added test to validator system sc
sasurobert Dec 4, 2020
8219e96
Merge remote-tracking branch 'origin/EN-8341/Protection-agains-mass-u…
sasurobert Dec 4, 2020
d3ae376
added test to system sc at end of epoch
sasurobert Dec 4, 2020
c48bb3c
added test for validator statistics and metachain
sasurobert Dec 4, 2020
72e4c94
Merge branch 'development' into merge-dev-staking-v2
AdoAdoAdo Dec 4, 2020
4659950
vm: fix after merge
AdoAdoAdo Dec 4, 2020
c7561f9
vm: fix test
AdoAdoAdo Dec 4, 2020
21025c4
Merge pull request #2554 from ElrondNetwork/merge-dev-staking-v2
sasurobert Dec 7, 2020
c1c0b12
Merge branch 'feat/staking-delegation-v2' into EN-8341/Protection-aga…
sasurobert Dec 7, 2020
73afd39
Merge pull request #2548 from ElrondNetwork/EN-8341/Protection-agains…
sasurobert Dec 7, 2020
c46b65b
Merge branch 'development' into merge-dev-economics-v2-08dec
AdoAdoAdo Dec 8, 2020
7f5a3c3
Merge pull request #2564 from ElrondNetwork/merge-dev-economics-v2-08dec
AdoAdoAdo Dec 8, 2020
8dddfe2
for tests change enable epoch
AdoAdoAdo Dec 8, 2020
b06ac77
process: fix order accountsDB dirty check
AdoAdoAdo Dec 9, 2020
c5b84ef
process: formatting
AdoAdoAdo Dec 9, 2020
4a1916c
epochStart: fix computation unqualified nodes to ignore also inactive…
AdoAdoAdo Dec 10, 2020
956c09f
Merge branch 'development' into merge-dev-stakingv2-11dec
AdoAdoAdo Dec 11, 2020
87b4b3c
Merge branch 'development' into merge-dev-stakingv2-11dec
AdoAdoAdo Dec 11, 2020
02c6ecd
Merge pull request #2580 from ElrondNetwork/merge-dev-stakingv2-11dec
iulianpascalau Dec 11, 2020
5c4655a
Merge branch 'feat/staking-delegation-v2' into staking-delegation-v2-…
AdoAdoAdo Dec 11, 2020
850cee6
cleanup unused function and create returnmessage and returncode as it…
sasurobert Dec 11, 2020
0176bb2
fix unit test
sasurobert Dec 14, 2020
ea32498
Merge pull request #2586 from ElrondNetwork/delegation-fix-stakeNodes
sasurobert Dec 14, 2020
e2e8e47
fixing merging of output accounts and data
sasurobert Dec 14, 2020
cd79a17
small fixes
sasurobert Dec 14, 2020
07b81b0
Merge branch 'feat/staking-delegation-v2' into staking-delegation-v2-…
sasurobert Dec 14, 2020
ff824a4
cmd: set enable epoch flags as in mainnet
AdoAdoAdo Dec 14, 2020
a93cc28
fix after review
sasurobert Dec 14, 2020
6df372e
Merge pull request #2569 from ElrondNetwork/staking-delegation-v2-TES…
AdoAdoAdo Dec 14, 2020
44326ba
Merge branch 'feat/staking-delegation-v2' into fix/merging-of-output-…
sasurobert Dec 14, 2020
07ca8f2
Merge pull request #2589 from ElrondNetwork/fix/merging-of-output-accs
sasurobert Dec 14, 2020
b09131a
try fix forced unstake at end of epoch
sasurobert Dec 15, 2020
0d6bfd4
try fix forced unstake at end of epoch
sasurobert Dec 15, 2020
154ad62
add more complicated tests
sasurobert Dec 15, 2020
1fc0716
add more complicated tests
sasurobert Dec 15, 2020
56158a0
Merge pull request #2591 from ElrondNetwork/fix/forced-unstaked-end-o…
sasurobert Dec 15, 2020
a613622
Merge branch 'development' into merge-dev-staking-v2-2020.12.16
iulianpascalau Dec 16, 2020
5d8ef6c
- fixes after merge
iulianpascalau Dec 16, 2020
8c5efca
Merge branch 'development' into merge-dev-staking-v2-2020.12.16
iulianpascalau Dec 16, 2020
2d25446
- fixed system SC processing at end of epoch
iulianpascalau Dec 17, 2020
495ddcf
Merge pull request #2597 from ElrondNetwork/merge-dev-staking-v2-2020…
iulianpascalau Dec 17, 2020
d0b2885
Merge branch 'feat/staking-delegation-v2' into fix-eoe-sc-prints
iulianpascalau Dec 17, 2020
9e5809e
Merge pull request #2599 from ElrondNetwork/fix-eoe-sc-prints
iulianpascalau Dec 17, 2020
3525ab9
Merge branch 'development' into merge-dev-feat-staking-v2-2020.12.17
iulianpascalau Dec 17, 2020
bbedfb7
Merge pull request #2601 from ElrondNetwork/merge-dev-feat-staking-v2…
iulianpascalau Dec 17, 2020
8a39e56
- fixed configs
iulianpascalau Dec 17, 2020
aeaaaab
Merge pull request #2602 from ElrondNetwork/fixed-enable-epochs-in-co…
iulianpascalau Dec 17, 2020
e29736f
EN-8508: unit tests for economics
bogdan-rosianu Dec 17, 2020
62a4737
rename test
bogdan-rosianu Dec 17, 2020
15034cd
Merge branch 'feat/staking-delegation-v2' into EN-8508-unit-tests
bogdan-rosianu Dec 17, 2020
8279292
fixing tests
sasurobert Dec 17, 2020
d9aff45
Merge pull request #2603 from ElrondNetwork/EN-8508-unit-tests
sasurobert Dec 17, 2020
22ca29d
Merge branch 'feat/staking-delegation-v2' into fix-tests-after-merge
sasurobert Dec 17, 2020
f62e989
Merge pull request #2606 from ElrondNetwork/fix-tests-after-merge
LucianMincu Dec 17, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 15 additions & 8 deletions cmd/node/config/config.toml
Expand Up @@ -12,13 +12,13 @@
StartInEpochEnabled = true

# SCDeployEnableEpoch represents the epoch when the deployment of smart contracts will be enabled
SCDeployEnableEpoch = 2
SCDeployEnableEpoch = 3

# BuiltInFunctionsEnableEpoch represents the epoch when the built in functions will be enabled
BuiltInFunctionsEnableEpoch = 2
BuiltInFunctionsEnableEpoch = 3

# RelayedTransactionsEnableEpoch represents the epoch when the relayed transactions will be enabled
RelayedTransactionsEnableEpoch = 2
RelayedTransactionsEnableEpoch = 3

# PenalizedTooMuchGasEnableEpoch represents the epoch when the penalization for using too much gas will be enabled
PenalizedTooMuchGasEnableEpoch = 2
Expand All @@ -35,16 +35,23 @@

# TransactionSignedWithTxHashEnableEpoch represents the epoch when the node will also accept transactions that are
# signed with the hash of transaction
TransactionSignedWithTxHashEnableEpoch = 2
TransactionSignedWithTxHashEnableEpoch = 3

# MetaProtectionEnableEpoch represents the epoch when the transactions to the metachain are checked to have enough gas
MetaProtectionEnableEpoch = 2
MetaProtectionEnableEpoch = 3

# AheadOfTimeGasUsageEnableEpoch represents the epoch when the cost of smart contract prepare changes from compiler per byte to ahead of time prepare per byte
AheadOfTimeGasUsageEnableEpoch = 2
AheadOfTimeGasUsageEnableEpoch = 3

# GasPriceModifierEnableEpoch represents the epoch when the gas price modifier in fee computation is enabled
GasPriceModifierEnableEpoch = 2
GasPriceModifierEnableEpoch = 3

# TO BE CHANGED IN MAINNET AND PUBLIC TESTNET CONFIGS
# MaxNodesChangeEnableEpoch holds configuration for changing the maximum number of nodes and the enabling epoch
MaxNodesChangeEnableEpoch = [
{ EpochEnable = 0, MaxNumNodes = 36, NodesToShufflePerShard = 4 },
{ EpochEnable = 3, MaxNumNodes = 56, NodesToShufflePerShard = 2 }
]

# GenesisString represents the encoded string for the genesis block
GenesisString = "67656E65736973"
Expand All @@ -65,7 +72,7 @@
[GasSchedule]
GasScheduleByEpochs = [
{ StartEpoch = 0, FileName = "gasScheduleV1.toml" },
{ StartEpoch = 2, FileName = "gasScheduleV2.toml" },
{ StartEpoch = 3, FileName = "gasScheduleV2.toml" },
]

[StoragePruning]
Expand Down
6 changes: 4 additions & 2 deletions cmd/node/config/economics.toml
Expand Up @@ -18,10 +18,12 @@
Denomination = 18 # represents the smallest eGLD subdivision (10^-X eGLD for a denomination of X)

[RewardsSettings]
LeaderPercentage = 0.1 #fraction of value 1 - 10%
DeveloperPercentage = 0.3 #fraction of value 1 - 30%
LeaderPercentage = 0.1 #fraction of value 0.1 - 10%
DeveloperPercentage = 0.3 #fraction of value 0.3 - 30%
ProtocolSustainabilityPercentage = 0.1 #fraction of value 0.1 - 10%
ProtocolSustainabilityAddress = "erd1j25xk97yf820rgdp3mj5scavhjkn6tjyn0t63pmv5qyjj7wxlcfqqe2rw5"
TopUpGradientPoint = "3000000000000000000000000" # 3MIL eGLD
TopUpFactor = 0.25 # fraction of value 0.25 - 25%

[FeeSettings]
MaxGasLimitPerBlock = "1500000000"
Expand Down
4 changes: 4 additions & 0 deletions cmd/node/config/gasSchedules/gasScheduleV1.toml
Expand Up @@ -22,6 +22,10 @@
DelegateVote = 1000000
RevokeVote = 500000
CloseProposal = 1000000
DelegationOps = 1000000
UnstakeTokens = 5000000
UnbondTokens = 5000000
DelegationMgrOps = 50000000

[BaseOperationCost]
StorePerByte = 50000
Expand Down
2 changes: 2 additions & 0 deletions cmd/node/config/gasSchedules/gasScheduleV2.toml
Expand Up @@ -15,6 +15,8 @@
ChangeRewardAddress = 5000000
ChangeValidatorKeys = 5000000
UnJail = 5000000
DelegationOps = 1000000
DelegationMgrOps = 50000000
ESDTIssue = 50000000
ESDTOperations = 50000000
Proposal = 5000000
Expand Down
2 changes: 1 addition & 1 deletion cmd/node/config/genesisSmartContracts.json
Expand Up @@ -3,7 +3,7 @@
"owner": "erd1vxy22x0fj4zv6hktmydg8vpfh6euv02cz4yg0aaws6rrad5a5awqgqky80",
"filename": "./config/genesisContracts/delegation.wasm",
"vm-type": "0500",
"init-parameters": "%auction_sc_address%@03E8@00@030D40@030D40",
"init-parameters": "%validator_sc_address%@03E8@00@030D40@030D40",
"type": "delegation",
"version": "0.4.*"
},
Expand Down
21 changes: 16 additions & 5 deletions cmd/node/config/systemSmartContractsConfig.toml
@@ -1,28 +1,39 @@
[StakingSystemSCConfig]
GenesisNodePrice = "2500000000000000000000" #2.5K eGLD
MinStakeValue = "100000000000000000000" #100 eGLD
MinUnstakeTokensValue = "10000000000000000000" #10eGLD
UnBondPeriod = 250
MinStepValue = "100000000000000000000"
AuctionEnableEpoch = 100000
StakeEnableEpoch = 2
DoubleKeyProtectionEnableEpoch = 2
StakingV2Epoch = 3
DoubleKeyProtectionEnableEpoch = 3
NumRoundsWithoutBleed = 100
MaximumPercentageToBleed = 0.5
BleedPercentagePerRound = 0.00001
MaxNumberOfNodesForStake = 36
NodesToSelectInAuction = 36
UnJailValue = "2500000000000000000" #0.1% of genesis node price
ActivateBLSPubKeyMessageVerification = false

[ESDTSystemSCConfig]
BaseIssuingCost = "5000000000000000000" #5 eGLD
OwnerAddress = "erd1fpkcgel4gcmh8zqqdt043yfcn5tyx8373kg6q2qmkxzu4dqamc0swts65c"
EnabledEpoch = 2
EnabledEpoch = 3

[GovernanceSystemSCConfig]
ProposalCost = "5000000000000000000" #5 eGLD
NumNodes = 500
MinQuorum = 400
MinPassThreshold = 300
MinVetoThreshold = 50
EnabledEpoch = 2
EnabledEpoch = 3

[DelegationManagerSystemSCConfig]
BaseIssuingCost = "0" #0 eGLD
MinCreationDeposit = "1250000000000000000000" #1.25K eGLD
EnabledEpoch = 3

[DelegationSystemSCConfig]
MinStakeAmount = "10000000000000000000" #10 eGLD
EnabledEpoch = 3
MinServiceFee = 0
MaxServiceFee = 10000
102 changes: 64 additions & 38 deletions cmd/node/factory/structs.go
Expand Up @@ -1869,19 +1869,20 @@ func newMetaBlockProcessor(
WorkingDir: workingDir,
NilCompiledSCStore: false,
}
vmFactory, err := metachain.NewVMContainerFactory(
argsHook,
economicsData,
messageSignVerifier,
gasSchedule,
nodesSetup,
core.Hasher,
core.InternalMarshalizer,
systemSCConfig,
stateComponents.PeerAccounts,
rater,
epochNotifier,
)
argsNewVMContainer := metachain.ArgsNewVMContainerFactory{
ArgBlockChainHook: argsHook,
Economics: economicsData,
MessageSignVerifier: messageSignVerifier,
GasSchedule: gasSchedule,
NodesConfigProvider: nodesSetup,
Hasher: core.Hasher,
Marshalizer: core.InternalMarshalizer,
SystemSCConfig: systemSCConfig,
ValidatorAccountsDB: stateComponents.PeerAccounts,
ChanceComputer: rater,
EpochNotifier: epochNotifier,
}
vmFactory, err := metachain.NewVMContainerFactory(argsNewVMContainer)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -2094,37 +2095,61 @@ func newMetaBlockProcessor(
return nil, err
}

economicsDataProvider := metachainEpochStart.NewEpochEconomicsStatistics()
argsEpochEconomics := metachainEpochStart.ArgsNewEpochEconomics{
Marshalizer: core.InternalMarshalizer,
Hasher: core.Hasher,
Store: data.Store,
ShardCoordinator: shardCoordinator,
RewardsHandler: economicsData,
RoundTime: rounder,
GenesisNonce: genesisHdr.GetNonce(),
GenesisEpoch: genesisHdr.GetEpoch(),
GenesisTotalSupply: economicsData.GenesisTotalSupply(),
Marshalizer: core.InternalMarshalizer,
Hasher: core.Hasher,
Store: data.Store,
ShardCoordinator: shardCoordinator,
RewardsHandler: economicsData,
RoundTime: rounder,
GenesisNonce: genesisHdr.GetNonce(),
GenesisEpoch: genesisHdr.GetEpoch(),
GenesisTotalSupply: economicsData.GenesisTotalSupply(),
EconomicsDataNotified: economicsDataProvider,
}
epochEconomics, err := metachainEpochStart.NewEndOfEpochEconomicsDataCreator(argsEpochEconomics)
if err != nil {
return nil, err
}

systemVM, err := vmContainer.Get(factory.SystemVirtualMachine)
if err != nil {
return nil, err
}

// TODO: in case of changing the minimum node price, make sure to update the staking data provider
stakingDataProvider, err := metachainEpochStart.NewStakingDataProvider(systemVM, systemSCConfig.StakingSystemSCConfig.GenesisNodePrice)
if err != nil {
return nil, err
}

rewardsStorage := data.Store.GetStorer(dataRetriever.RewardTransactionUnit)
miniBlockStorage := data.Store.GetStorer(dataRetriever.MiniBlockUnit)
argsEpochRewards := metachainEpochStart.ArgsNewRewardsCreator{
ShardCoordinator: shardCoordinator,
PubkeyConverter: stateComponents.AddressPubkeyConverter,
RewardsStorage: rewardsStorage,
MiniBlockStorage: miniBlockStorage,
Hasher: core.Hasher,
Marshalizer: core.InternalMarshalizer,
DataPool: data.Datapool,
ProtocolSustainabilityAddress: economicsData.ProtocolSustainabilityAddress(),
NodesConfigProvider: nodesCoordinator,
RewardsFix1EpochEnable: generalConfig.GeneralSettings.SwitchJailWaitingEnableEpoch,
argsEpochRewards := metachainEpochStart.RewardsCreatorProxyArgs{
BaseRewardsCreatorArgs: metachainEpochStart.BaseRewardsCreatorArgs{
ShardCoordinator: shardCoordinator,
PubkeyConverter: stateComponents.AddressPubkeyConverter,
RewardsStorage: rewardsStorage,
MiniBlockStorage: miniBlockStorage,
Hasher: core.Hasher,
Marshalizer: core.InternalMarshalizer,
DataPool: data.Datapool,
ProtocolSustainabilityAddress: economicsData.ProtocolSustainabilityAddress(),
NodesConfigProvider: nodesCoordinator,
UserAccountsDB: stateComponents.AccountsAdapter,
RewardsFix1EpochEnable: generalConfig.GeneralSettings.SwitchJailWaitingEnableEpoch,
DelegationSystemSCEnableEpoch: systemSCConfig.DelegationSystemSCConfig.EnabledEpoch,
},

StakingDataProvider: stakingDataProvider,
TopUpRewardFactor: economicsData.RewardsTopUpFactor(),
TopUpGradientPoint: economicsData.RewardsTopUpGradientPoint(),
EconomicsDataProvider: economicsDataProvider,
EpochEnableV2: systemSCConfig.StakingSystemSCConfig.StakingV2Epoch,
}
epochRewards, err := metachainEpochStart.NewEpochStartRewardsCreator(argsEpochRewards)

epochRewards, err := metachainEpochStart.NewRewardsCreatorProxy(argsEpochRewards)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -2174,10 +2199,6 @@ func newMetaBlockProcessor(
EpochNotifier: epochNotifier,
}

systemVM, err := vmContainer.Get(factory.SystemVirtualMachine)
if err != nil {
return nil, err
}
argsEpochSystemSC := metachainEpochStart.ArgsNewEpochStartSystemSCProcessing{
SystemVM: systemVM,
UserAccountsDB: stateComponents.AccountsAdapter,
Expand All @@ -2191,7 +2212,12 @@ func newMetaBlockProcessor(
EpochNotifier: epochNotifier,
SwitchJailWaitingEnableEpoch: generalConfig.GeneralSettings.SwitchJailWaitingEnableEpoch,
SwitchHysteresisForMinNodesEnableEpoch: generalConfig.GeneralSettings.SwitchHysteresisForMinNodesEnableEpoch,
DelegationEnableEpoch: systemSCConfig.DelegationManagerSystemSCConfig.EnabledEpoch,
StakingV2EnableEpoch: systemSCConfig.StakingSystemSCConfig.StakingV2Epoch,
GenesisNodesConfig: nodesSetup,
MaxNodesEnableConfig: generalConfig.GeneralSettings.MaxNodesChangeEnableEpoch,
StakingDataProvider: stakingDataProvider,
NodesConfigProvider: nodesCoordinator,
}
epochStartSystemSCProcessor, err := metachainEpochStart.NewSystemSCProcessor(argsEpochSystemSC)
if err != nil {
Expand Down
47 changes: 27 additions & 20 deletions cmd/node/main.go
Expand Up @@ -861,13 +861,19 @@ func startNode(ctx *cli.Context, log logger.Logger, version string) error {
return err
}

nodesShuffler := sharding.NewHashValidatorsShuffler(
genesisNodesConfig.MinNodesPerShard,
genesisNodesConfig.MetaChainMinNodes,
genesisNodesConfig.Hysteresis,
genesisNodesConfig.Adaptivity,
true,
)
argsNodesShuffler := &sharding.NodesShufflerArgs{
NodesShard: genesisNodesConfig.MinNodesPerShard,
NodesMeta: genesisNodesConfig.MetaChainMinNodes,
Hysteresis: genesisNodesConfig.Hysteresis,
Adaptivity: genesisNodesConfig.Adaptivity,
ShuffleBetweenShards: true,
MaxNodesEnableConfig: generalConfig.GeneralSettings.MaxNodesChangeEnableEpoch,
}

nodesShuffler, err := sharding.NewHashValidatorsShuffler(argsNodesShuffler)
if err != nil {
return err
}

destShardIdAsObserver, err := processDestinationShardAsObserver(preferencesConfig.Preferences)
if err != nil {
Expand Down Expand Up @@ -2470,19 +2476,20 @@ func createApiResolver(
}

if shardCoordinator.SelfId() == core.MetachainShardId {
vmFactory, err = metachain.NewVMContainerFactory(
argsHook,
economics,
messageSigVerifier,
gasScheduleNotifier,
nodesSetup,
hasher,
marshalizer,
systemSCConfig,
validatorAccounts,
rater,
epochNotifier,
)
argsNewVmFactory := metachain.ArgsNewVMContainerFactory{
ArgBlockChainHook: argsHook,
Economics: economics,
MessageSignVerifier: messageSigVerifier,
GasSchedule: gasScheduleNotifier,
NodesConfigProvider: nodesSetup,
Hasher: hasher,
Marshalizer: marshalizer,
SystemSCConfig: systemSCConfig,
ValidatorAccountsDB: validatorAccounts,
ChanceComputer: rater,
EpochNotifier: epochNotifier,
}
vmFactory, err = metachain.NewVMContainerFactory(argsNewVmFactory)
if err != nil {
return nil, err
}
Expand Down
8 changes: 8 additions & 0 deletions config/config.go
Expand Up @@ -205,6 +205,13 @@ type ValidatorStatisticsConfig struct {
CacheRefreshIntervalInSec uint32
}

// ChangeMaxNodesConfig defines a config change tuple, with a maximum number enabled in a certain epoch number
type MaxNodesChangeConfig struct {
EpochEnable uint32
MaxNumNodes uint32
NodesToShufflePerShard uint32
}

// GeneralSettingsConfig will hold the general settings for a node
type GeneralSettingsConfig struct {
StatusPollingIntervalSec int
Expand All @@ -221,6 +228,7 @@ type GeneralSettingsConfig struct {
MetaProtectionEnableEpoch uint32
AheadOfTimeGasUsageEnableEpoch uint32
GasPriceModifierEnableEpoch uint32
MaxNodesChangeEnableEpoch []MaxNodesChangeConfig
GenesisString string
GenesisMaxNumberOfShards uint32
}
Expand Down
2 changes: 2 additions & 0 deletions config/economicsConfig.go
Expand Up @@ -20,6 +20,8 @@ type RewardsSettings struct {
DeveloperPercentage float64
ProtocolSustainabilityPercentage float64
ProtocolSustainabilityAddress string
TopUpGradientPoint string
TopUpFactor float64
}

// FeeSettings will hold economics fee settings
Expand Down