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

[release] 7.0.0 #223

Merged
merged 140 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
140 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
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
Binary file modified tools/genesis/tests/fixtures/genesis.blob
Binary file not shown.
29 changes: 29 additions & 0 deletions tools/storage/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,41 @@ use clap::Parser;
use diem_db_tool::DBTool;
use diem_logger::{Level, Logger};
use diem_push_metrics::MetricsPusher;
use std::path::PathBuf;
use storage::read_snapshot::manifest_to_json;

#[derive(Parser)]
#[clap(name = "libra storage", author, version)]
#[allow(clippy::large_enum_variant)]
enum StorageCli {
#[clap(subcommand)]
Db(DBTool),
ExportSnapshot {
#[clap(short, long)]
manifest_path: PathBuf,
#[clap(short, long)]
out_path: Option<PathBuf>,
},
}

#[tokio::main]
async fn main() -> Result<()> {
Logger::new().level(Level::Info).init();
let _mp = MetricsPusher::start(vec![]);

match StorageCli::parse() {
StorageCli::Db(tool) => {
tool.run().await?;
}
StorageCli::ExportSnapshot {
manifest_path,
out_path,
} => {
manifest_to_json(manifest_path, out_path).await;
}
}

DBTool::parse().run().await?;

Ok(())
}
44 changes: 32 additions & 12 deletions tools/storage/src/read_snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,18 @@ use diem_backup_cli::{
},
storage::{FileHandle, FileHandleRef},
};

use tokio::{fs::OpenOptions, io::AsyncRead};

use diem_types::account_address::AccountAddress;
use diem_types::account_state::AccountState;
use diem_types::state_store::state_key::{StateKey, StateKeyInner};
use diem_types::state_store::state_value::StateValue;

use libra_types::legacy_types::legacy_recovery_v6;
use serde_json::json;
use std::collections::HashMap;
use std::{
fs,
path::{Path, PathBuf},
};
use tokio::{fs::OpenOptions, io::AsyncRead};

#[cfg(test)]
use libra_types::legacy_types::legacy_recovery_v6::{get_legacy_recovery, AccountRole};
Expand Down Expand Up @@ -135,6 +134,34 @@ fn test_parse_manifest() {
// dbg!(&r.epoch);
}

pub async fn manifest_to_json(manifest_path: PathBuf, out_path: Option<PathBuf>) {
let snapshot_manifest = load_snapshot_manifest(&manifest_path).expect("parse manifest");
let archive_path = manifest_path.parent().unwrap();
let account_states = accounts_from_snapshot_backup(snapshot_manifest, archive_path)
.await
.expect("could not parse snapshot");
let mut legacy_recovery_vec = Vec::new();
for account_state in account_states.iter() {
let legacy_recovery = legacy_recovery_v6::get_legacy_recovery(account_state)
.expect("could not get legacy recovery");

legacy_recovery_vec.push(legacy_recovery);
}

let json = json!(&legacy_recovery_vec);
let out = out_path.unwrap_or(manifest_path.parent().unwrap().join("migration.json"));
fs::write(out, json.to_string()).expect("could not save file");
}

#[tokio::test]
async fn test_export() {
use std::str::FromStr;
let this_path = PathBuf::from_str(env!("CARGO_MANIFEST_DIR")).unwrap();
let manifest_path = this_path.join("fixtures/state_epoch_79_ver_33217173.795d/state.manifest");
let export_path = this_path.join("json/v6_migration.json");
manifest_to_json(manifest_path, Some(export_path)).await;
}

#[tokio::test]
async fn test_deserialize_account() {
use std::str::FromStr;
Expand All @@ -147,19 +174,12 @@ async fn test_deserialize_account() {
.expect("could not parse snapshot");
let mut legacy_recovery_vec = Vec::new();
for account_state in account_states.iter() {
// println!("----------------------------------------------------");
// println!("account_address: {:?}", account_state.get_account_address());
let legacy_recovery =
get_legacy_recovery(account_state).expect("could not get legacy recovery");
//println!("legacy_recovery: {:?}", legacy_recovery);

legacy_recovery_vec.push(legacy_recovery);
}

// let legacy_recovery_vec_json =
// serde_json::to_string(&legacy_recovery_vec).expect("could not create json for state");

// println!("{}", legacy_recovery_vec_json);

// basic validation of the account state
let account_count = 23634;
assert_eq!(account_states.len(), account_count);
Expand Down
Loading