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

[migration] add consensus reward to migration #226

Merged
merged 153 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from 148 commits
Commits
Show all changes
153 commits
Select commit Hold shift + click to select a range
26b4117
scaffold storage module
0o-de-lally Mar 18, 2024
63ab7ef
try to parse new metadata format
0o-de-lally Mar 18, 2024
4b97409
parse please
0o-de-lally Mar 19, 2024
782b5ee
get snapshot manifest loaded
0o-de-lally Mar 19, 2024
3ee1f4e
get snapshot reader
0o-de-lally Mar 19, 2024
b2c9a3e
unzip chunks
0o-de-lally Mar 19, 2024
2e41b32
first
coin1111 Mar 23, 2024
cd2373a
cleanup
coin1111 Mar 23, 2024
55e3256
cleanup
coin1111 Mar 23, 2024
8b2d7f8
pull resources
coin1111 Mar 23, 2024
3104b38
deserialize resources
coin1111 Mar 24, 2024
5840af4
deserialize resources
coin1111 Mar 24, 2024
5237a31
deserialize resources
coin1111 Mar 27, 2024
5f6a1a7
more user state
coin1111 Mar 28, 2024
6df923f
cleanup
coin1111 Mar 28, 2024
5114ea4
registry
coin1111 Mar 28, 2024
5787dce
add more resources
coin1111 Mar 28, 2024
1bd7e46
add test
coin1111 Mar 28, 2024
00dc4ef
Update Makefile (#216)
sirouk Mar 30, 2024
ddcf203
remove validator sanity check
0xzoz Mar 30, 2024
c8e5724
Sirouk patch 2 (#217)
sirouk Mar 30, 2024
3336e67
patches epoch boundary VM authorization
0o-de-lally Mar 30, 2024
6213249
improve swarm sanity test
0o-de-lally Mar 30, 2024
447e3e9
Makefile fix (#218)
sirouk Mar 31, 2024
d78ae8c
patch issue with pledge accounts garbage collection
0o-de-lally Apr 3, 2024
0e7255b
framework build and cleanup
0o-de-lally Apr 3, 2024
686df86
clippy
0o-de-lally Apr 3, 2024
b43de4b
get some prints out of last goodbye
0o-de-lally Apr 4, 2024
16e9756
snapshot digest
coin1111 Apr 4, 2024
c241af0
comm wallets
coin1111 Apr 4, 2024
cef9183
comm wallets
coin1111 Apr 4, 2024
0d2e069
balances
coin1111 Apr 4, 2024
6c3e479
Merge pull request #11 from coin1111/snapshot-parsing
0o-de-lally Apr 4, 2024
7083fe5
separate V5 legacy structs from v6
0o-de-lally Apr 4, 2024
9d74149
clippy
0o-de-lally Apr 4, 2024
9b7e5c6
rip out all v5 specific rust migration logic
0o-de-lally Apr 4, 2024
c271341
clippy
0o-de-lally Apr 4, 2024
b359abb
update diem deps
0o-de-lally Apr 4, 2024
0db5aa9
change all legacyv5 to legacyv6
0o-de-lally Apr 4, 2024
053a874
can parse single user
0o-de-lally Apr 4, 2024
33ab503
parsing tests passing
0o-de-lally Apr 4, 2024
cae27c8
add framework cli to libra tool. change default compile options. upda…
0o-de-lally Apr 4, 2024
1273d9b
update upgrade documentation
0o-de-lally Apr 4, 2024
29d8606
cleanup slow and dv migration apis
0o-de-lally Apr 4, 2024
2357005
single e2e working
0o-de-lally Apr 4, 2024
525c38d
genesis works
0o-de-lally Apr 4, 2024
2ac044f
patch audit tests
0o-de-lally Apr 4, 2024
153e076
arithmetic test
0o-de-lally Apr 5, 2024
1301ad6
audit outputs accounts without balance
0o-de-lally Apr 5, 2024
7529bba
clippy
0o-de-lally Apr 5, 2024
df6adce
script
0o-de-lally Apr 5, 2024
9bff149
Merge branch 'main' into v7-genesis
0o-de-lally Apr 5, 2024
2bbbe1d
Merge branch 'release-6.9.9' into v7-genesis
0o-de-lally Apr 5, 2024
c813589
build framework
0o-de-lally Apr 5, 2024
72635ca
add function for pledge migration
0o-de-lally Apr 5, 2024
b524d35
remove tower, vdf, libgmp. Praise be.
0o-de-lally Apr 5, 2024
0ca80c1
burn tracker
0o-de-lally Apr 5, 2024
e81e07c
Squashed commit of the following:
0o-de-lally Apr 5, 2024
b52575c
burn tracker
0o-de-lally Apr 5, 2024
3c56ae7
patch tests
0o-de-lally Apr 5, 2024
5cbbf1d
patch rescue tests
0o-de-lally Apr 5, 2024
64fceca
lippy kid
0o-de-lally Apr 5, 2024
6b90050
remove tower from ci
0o-de-lally Apr 5, 2024
67ec2d4
patch format
0o-de-lally Apr 5, 2024
a288b29
import genesis cli into libra cli
0o-de-lally Apr 5, 2024
d54cb81
update github token search
0o-de-lally Apr 5, 2024
8a618bc
cleanup cli subcommands
0o-de-lally Apr 5, 2024
d357797
adds ability to drop accounts from a migration list
0o-de-lally Apr 5, 2024
852966b
clippy
0o-de-lally Apr 5, 2024
716b397
add test and fixture for dropping
0o-de-lally Apr 5, 2024
14b3632
add drop fixture
0o-de-lally Apr 5, 2024
aa8beeb
add e2e test for dropped accounts.
0o-de-lally Apr 5, 2024
14c61af
nit
0o-de-lally Apr 5, 2024
8db0983
cleanup config tool
0o-de-lally Apr 5, 2024
1168e59
test locked supply
0o-de-lally Apr 6, 2024
7d8a37f
thorough testing of locked supply. remove some deprecated coin methods
0o-de-lally Apr 6, 2024
8631dd7
refactor pledge account to store registry of beneficiaries, for easy …
0o-de-lally Apr 6, 2024
30cc35e
add supply.move, utility to show coin supply breakdown
0o-de-lally Apr 6, 2024
0d4c69c
remove uneccesary migration functions in .move
0o-de-lally Apr 6, 2024
b33480d
clean
0o-de-lally Apr 6, 2024
dbda2e9
clean up burn tracker implementation
0o-de-lally Apr 6, 2024
0b2c1c8
patch burn tracker stats info logic
0o-de-lally Apr 6, 2024
57167e4
don't use musical chairs when network is below 21 nodes
0o-de-lally Apr 6, 2024
1dca881
default to TESTNET (chainid = 2)
0o-de-lally Apr 6, 2024
feffc01
prevent musical chairs from evaluating when the epochs are too short
0o-de-lally Apr 6, 2024
eb70e59
patch tests
0o-de-lally Apr 6, 2024
b51da3f
pof should grow the set with less than 18 validaors
0o-de-lally Apr 6, 2024
4582650
text
0o-de-lally Apr 6, 2024
36f4654
allow clippy::mutable
0o-de-lally Apr 7, 2024
5f38839
update fixtures
0o-de-lally Apr 7, 2024
281367f
drop accounts get a tombstone, authkey will not be valid
0o-de-lally Apr 7, 2024
fec9f3f
don't migrate burn tracker, allow to be recomputed
0o-de-lally Apr 7, 2024
47ba65d
fix libra cli preferences default chain id.
0o-de-lally Apr 7, 2024
0c0528c
rename cli config file to libra-cli-config.yaml
0o-de-lally Apr 7, 2024
5bd1d1e
forking upgrade doesn't need to check previous compatibility
0o-de-lally Apr 7, 2024
c19f5c8
framework build
0o-de-lally Apr 7, 2024
fdedd20
clippy
0o-de-lally Apr 7, 2024
45920ef
patch dropping of users
0o-de-lally Apr 7, 2024
453f6c8
consolidate version and print detailed build info
0o-de-lally Apr 7, 2024
894e9a5
cleanup grade.move
0o-de-lally Apr 7, 2024
1fed6a1
clean
0o-de-lally Apr 7, 2024
b3f6ca9
sad day. all tower code removed here. :(
0o-de-lally Apr 7, 2024
d24078a
remove all tower reward logic
0o-de-lally Apr 7, 2024
ad7b37c
remove deprecated files
0o-de-lally Apr 7, 2024
9123e1a
framework build
0o-de-lally Apr 7, 2024
3903ee6
remove deprecated v5 migration utils
0o-de-lally Apr 8, 2024
0017ac1
update maiinet.mrb fixture
0o-de-lally Apr 8, 2024
45df80b
removed last_goodbye, Move tests pass
0o-de-lally Apr 8, 2024
1134120
revert drop in account.move
0o-de-lally Apr 8, 2024
3babbfc
remove GC from jail
0o-de-lally Apr 8, 2024
e042c04
remove GC from match_index
0o-de-lally Apr 8, 2024
b7b8bcc
remove GC in slow wallet
0o-de-lally Apr 8, 2024
b36563c
remove GC in pledge
0o-de-lally Apr 8, 2024
c47bff6
remove GC from validator_universe
0o-de-lally Apr 8, 2024
7e6e46a
remove GC from vouch
0o-de-lally Apr 8, 2024
bbca864
framework build
0o-de-lally Apr 8, 2024
4746a38
remove last_goodbye test
0o-de-lally Apr 8, 2024
2ab16ae
renames
0o-de-lally Apr 8, 2024
22494b7
remove unecessary functions from stake.move
0o-de-lally Apr 8, 2024
b969ccb
cleaned stake.move
0o-de-lally Apr 8, 2024
b8cc6bf
clean diem_governance, Move tests pass.
0o-de-lally Apr 8, 2024
3feaec2
framework build
0o-de-lally Apr 8, 2024
a286f5b
cleanup error codes
0o-de-lally Apr 8, 2024
0fdeffa
remove stake_pool from state in governance
0o-de-lally Apr 8, 2024
bce7dad
removed stake references in governance
0o-de-lally Apr 8, 2024
a8d3516
reorganize directories
0o-de-lally Apr 8, 2024
208682a
patch issue with diem rust calling governance initialize
0o-de-lally Apr 8, 2024
27bc14e
add default firewall and port checker
0o-de-lally Apr 8, 2024
d9697e3
refactor genesis wizard to take path of github token, assumes no ~/.l…
0o-de-lally Apr 8, 2024
45a457d
clippy
0o-de-lally Apr 8, 2024
5b86903
Merge branch 'clean-vendor-files' into release-7.0.0
0o-de-lally Apr 8, 2024
a0987ac
text
0o-de-lally Apr 9, 2024
d8de8d8
make community wallet account checks a public view function
0o-de-lally Apr 9, 2024
a7010ef
docs
0o-de-lally Apr 9, 2024
f0e9a2a
make community wallet account checks a public view function
0o-de-lally Apr 9, 2024
1b3f2ab
Merge branch 'v7-genesis' into release-7.0.0
0o-de-lally Apr 9, 2024
d365625
add snapshot export to /storage
0o-de-lally Apr 9, 2024
e342497
clippy, and replace missing fixture
0o-de-lally Apr 15, 2024
f7b9a28
Merge branch 'main' into release-7.0.0
0xzoz Apr 15, 2024
9c4cd58
clippy and fmt
0xzoz Apr 16, 2024
671d361
extend tests for donor voice
0o-de-lally Apr 17, 2024
6b127cd
implement scheduled list splitting
0o-de-lally Apr 17, 2024
d857a4c
status enums were inconsistent with upstream dependencies
0o-de-lally Apr 17, 2024
cabc42f
cleanup key rotation api
0o-de-lally Apr 17, 2024
9f2db66
proof of fee migration
0o-de-lally Apr 17, 2024
ee13ff1
migration snapshot parsing was missing consensus reward
0o-de-lally Apr 17, 2024
09f022b
fmt
0o-de-lally Apr 17, 2024
6517682
needs migrate reward to be called by script
0o-de-lally Apr 17, 2024
1c7baf4
cleanup
0o-de-lally Apr 18, 2024
b05356c
patch genesis reward migration to use 0x1
0o-de-lally Apr 18, 2024
e3082ce
migrate consensus reward at genesis from file (not hard coded)
0o-de-lally Apr 18, 2024
d6d4eb7
update fixtures and cleanup
0o-de-lally Apr 18, 2024
cd64844
clippy
0o-de-lally Apr 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ module ol_framework::community_wallet_init {
/// qualify
public fun check_proposed_auths(initial_authorities: vector<address>, num_signers:
u64): bool {
// // enforce n/m multi auth

// TODO: enforce n/m multi auth such as:
// let n = if (len == 3) { 2 }
// else {
// (MINIMUM_SIGS * len) / MINIMUM_AUTH
Expand Down
10 changes: 7 additions & 3 deletions framework/libra-framework/sources/ol_sources/proof_of_fee.move
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,18 @@ module ol_framework::proof_of_fee {

// on a migration genesis for mainnet the genesis reward needs to be calculated
// from supply data.
fun genesis_migrate_reward(vm: &signer, nominal_reward: u64) acquires
public fun genesis_migrate_reward(framework: &signer, nominal_reward: u64) acquires
ConsensusReward {
system_addresses::assert_ol(vm); // either 0x1 or 0x0
system_addresses::assert_diem_framework(framework); // either 0x1 or 0x0

// Nominal reward at end of V6 was 178204815
if (nominal_reward > 178204815) return;


let state = borrow_global_mut<ConsensusReward>(@ol_framework);
state.nominal_reward = nominal_reward;
state.net_reward = nominal_reward; // just for info purposes. It gets calculated
// on first epoch change.
// on next epoch change.
}

fun init(account_sig: &signer) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

#[test_only]
module ol_framework::test_community_wallet{
use ol_framework::ballot;
use ol_framework::community_wallet;
use ol_framework::community_wallet_init;
use ol_framework::donor_voice_txs;
Expand Down Expand Up @@ -126,7 +127,7 @@
let (found, idx, status_enum, completed) = donor_voice_txs::get_multisig_proposal_state(alice_comm_wallet_addr, &uid);
assert!(found, 7357004);
assert!(idx == 0, 7357005);
assert!(status_enum == 1, 7357006);
assert!(status_enum == ballot::get_pending_enum(), 7357006);
assert!(!completed, 7357007);

// it is not yet scheduled, it's still only a proposal by an admin
Expand All @@ -136,7 +137,7 @@
let (found, idx, status_enum, completed) = donor_voice_txs::get_multisig_proposal_state(alice_comm_wallet_addr, &uid);
assert!(found, 7357004);
assert!(idx == 0, 7357005);
assert!(status_enum == 1, 7357006);
assert!(status_enum == ballot::get_approved_enum(), 7357006);
assert!(completed, 7357007); // now completed

// confirm it is scheduled
Expand Down Expand Up @@ -211,7 +212,7 @@
let (found, idx, status_enum, completed) = donor_voice_txs::get_multisig_proposal_state(alice_comm_wallet_addr, &uid);
assert!(found, 7357004);
assert!(idx == 0, 7357005);
assert!(status_enum == 1, 7357006);
assert!(status_enum == ballot::get_approved_enum(), 7357006);
assert!(completed, 7357007); // now completed

// confirm it is scheduled
Expand Down
309 changes: 292 additions & 17 deletions framework/libra-framework/sources/ol_sources/tests/donor_voice.test.move

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
const ENO_BALLOT_FOUND: u64 = 1;
/// Bad status enum
const EBAD_STATUS_ENUM: u64 = 2;
/// Already complete cannot change
const EALREADY_COMPLETE: u64 = 3;


// poor man's enum for the ballot status. Wen enum?
Expand Down Expand Up @@ -265,8 +267,10 @@
}

public fun complete_ballot<TallyType: drop + store>(
ballot: &mut Ballot<TallyType>,
ballot: &mut Ballot<TallyType>
) {
assert!(!is_completed(ballot), error::invalid_argument(EALREADY_COMPLETE));

ballot.completed = true;
}

Expand Down
Loading
Loading