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

[Governance] VDF Proofs Performance: Longer Proofs #1244

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
120 changes: 0 additions & 120 deletions .github/workflows/ci.depr

This file was deleted.

1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion config/global-constants/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ repository = "https://github.com/diem/diem"
homepage = "https://diem.com"
license = "Apache-2.0"
publish = false
edition = "2018"
edition = "2018"
32 changes: 8 additions & 24 deletions config/global-constants/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
//! (and better allow these constants to be updated in a single location), we define them here.
#![forbid(unsafe_code)]

use std::env; //////// 0L ////////

/// Definitions of global cryptographic keys (e.g., as held in secure storage)
pub const CONSENSUS_KEY: &str = "consensus";
pub const EXECUTION_KEY: &str = "execution";
Expand All @@ -30,31 +28,17 @@ pub const GENESIS_WAYPOINT: &str = "genesis-waypoint";
pub const MOVE_MODULES: &str = "move-modules";

//////// 0L ////////
// Default filepaths for 0L configs
pub const NODE_HOME: &str = ".0L/";
pub const PROOF_OF_WORK_PREIMAGE: &str = "pow_preimage";
pub const PROOF_OF_WORK_PROOF: &str = "pow_proof";
pub const ACCOUNT_PROFILE: &str = "account_profile";
pub const SALT_0L: &str = "0L";
pub const CONFIG_FILE: &str = "0L.toml";
pub const SOURCE_DIR: &str = "libra/";
pub const GENESIS_VDF_SECURITY_PARAM: u64 = 512;

/// Filename for 0L configs
pub const CONFIG_FILE: &str = "0L.toml";
// Default ports for 0L nodes
pub const DEFAULT_VAL_PORT: u64 = 6180;
pub const DEFAULT_VFN_PORT: u64 = 6179;
pub const DEFAULT_PUB_PORT: u64 = 6178;

//////// 0L ////////
// TODO: make this lazy static.
/// Switch settings between production and testing
pub fn genesis_delay_difficulty() -> u64 {
let node_env = match env::var("NODE_ENV") {
Ok(val) => val,
_ => "prod".to_string() // default to "prod" if not set
};
// test settings need to be set explicitly
if node_env == "test" {
return 100 // difficulty for test suites and on local for debugging purposes.
}
return 120_000_000
}
// other
pub const PROOF_OF_WORK_PREIMAGE: &str = "pow_preimage";
pub const PROOF_OF_WORK_PROOF: &str = "pow_proof";
pub const ACCOUNT_PROFILE: &str = "account_profile";
pub const SALT_0L: &str = "0L";
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ compiled_package_info:
? address: "00000000000000000000000000000001"
name: Ancestry
: DiemFramework
? address: "00000000000000000000000000000001"
name: Audit
: DiemFramework
? address: "00000000000000000000000000000001"
name: Authenticator
: DiemFramework
Expand Down Expand Up @@ -178,6 +175,9 @@ compiled_package_info:
? address: "00000000000000000000000000000001"
name: Hash
: Std
? address: "00000000000000000000000000000001"
name: InfraEscrow
: DiemFramework
? address: "00000000000000000000000000000001"
name: Jail
: DiemFramework
Expand All @@ -199,6 +199,9 @@ compiled_package_info:
? address: "00000000000000000000000000000001"
name: MultiSigPayment
: DiemFramework
? address: "00000000000000000000000000000001"
name: MusicalChairs
: DiemFramework
? address: "00000000000000000000000000000001"
name: NetworkIdentity
: DiemFramework
Expand All @@ -223,6 +226,12 @@ compiled_package_info:
? address: "00000000000000000000000000000001"
name: PersistenceDemo
: DiemFramework
? address: "00000000000000000000000000000001"
name: PledgeAccounts
: DiemFramework
? address: "00000000000000000000000000000001"
name: ProofOfFee
: DiemFramework
? address: "00000000000000000000000000000001"
name: Receipts
: DiemFramework
Expand Down Expand Up @@ -346,7 +355,7 @@ compiled_package_info:
? address: "00000000000000000000000000000001"
name: XUS
: DiemFramework
source_digest: E73442AD7A1B65175ABE2ACCB60D6A59204FBFD1C63E20E767E29AAC56BD3285
source_digest: 2226FA5FD88DC80A0F235F2BCC96DDF3C5E63F99C6BD6F41798B8F45E614D1DB
build_flags:
dev_mode: false
test_mode: false
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@


<pre><code><b>use</b> <a href="CoreAddresses.md#0x1_CoreAddresses">0x1::CoreAddresses</a>;
<b>use</b> <a href="Debug.md#0x1_Debug">0x1::Debug</a>;
<b>use</b> <a href="../../../../../../../DPN/releases/artifacts/current/build/MoveStdlib/docs/Option.md#0x1_Option">0x1::Option</a>;
<b>use</b> <a href="../../../../../../../DPN/releases/artifacts/current/build/MoveStdlib/docs/Signer.md#0x1_Signer">0x1::Signer</a>;
<b>use</b> <a href="../../../../../../../DPN/releases/artifacts/current/build/MoveStdlib/docs/Vector.md#0x1_Vector">0x1::Vector</a>;
Expand Down Expand Up @@ -67,7 +66,7 @@


<pre><code><b>public</b> <b>fun</b> <a href="Ancestry.md#0x1_Ancestry_init">init</a>(new_account_sig: &signer, onboarder_sig: &signer ) <b>acquires</b> <a href="Ancestry.md#0x1_Ancestry">Ancestry</a>{
print(&100100);
// print(&100100);
<b>let</b> parent = <a href="../../../../../../../DPN/releases/artifacts/current/build/MoveStdlib/docs/Signer.md#0x1_Signer_address_of">Signer::address_of</a>(onboarder_sig);
<a href="Ancestry.md#0x1_Ancestry_set_tree">set_tree</a>(new_account_sig, parent);
}
Expand All @@ -94,7 +93,7 @@

<pre><code><b>fun</b> <a href="Ancestry.md#0x1_Ancestry_set_tree">set_tree</a>(new_account_sig: &signer, parent: <b>address</b> ) <b>acquires</b> <a href="Ancestry.md#0x1_Ancestry">Ancestry</a> {
<b>let</b> child = <a href="../../../../../../../DPN/releases/artifacts/current/build/MoveStdlib/docs/Signer.md#0x1_Signer_address_of">Signer::address_of</a>(new_account_sig);
print(&100200);
// print(&100200);
<b>let</b> new_tree = <a href="../../../../../../../DPN/releases/artifacts/current/build/MoveStdlib/docs/Vector.md#0x1_Vector_empty">Vector::empty</a>&lt;<b>address</b>&gt;();

// get the parent's ancestry <b>if</b> initialized.
Expand All @@ -103,31 +102,31 @@
<b>if</b> (<b>exists</b>&lt;<a href="Ancestry.md#0x1_Ancestry">Ancestry</a>&gt;(parent)) {
<b>let</b> parent_state = <b>borrow_global_mut</b>&lt;<a href="Ancestry.md#0x1_Ancestry">Ancestry</a>&gt;(parent);
<b>let</b> parent_tree = *&parent_state.tree;
print(&100210);
// print(&100210);
<b>if</b> (<a href="../../../../../../../DPN/releases/artifacts/current/build/MoveStdlib/docs/Vector.md#0x1_Vector_length">Vector::length</a>&lt;<b>address</b>&gt;(&parent_tree) &gt; 0) {
<a href="../../../../../../../DPN/releases/artifacts/current/build/MoveStdlib/docs/Vector.md#0x1_Vector_append">Vector::append</a>(&<b>mut</b> new_tree, parent_tree);
};
print(&100220);
// print(&100220);
};

// add the parent <b>to</b> the tree
<a href="../../../../../../../DPN/releases/artifacts/current/build/MoveStdlib/docs/Vector.md#0x1_Vector_push_back">Vector::push_back</a>(&<b>mut</b> new_tree, parent);
print(&100230);
// print(&100230);

<b>if</b> (!<b>exists</b>&lt;<a href="Ancestry.md#0x1_Ancestry">Ancestry</a>&gt;(child)) {
<b>move_to</b>&lt;<a href="Ancestry.md#0x1_Ancestry">Ancestry</a>&gt;(new_account_sig, <a href="Ancestry.md#0x1_Ancestry">Ancestry</a> {
tree: new_tree,
});
print(&100240);
// print(&100240);

} <b>else</b> {
// this is only for migration cases.
<b>let</b> child_ancestry = <b>borrow_global_mut</b>&lt;<a href="Ancestry.md#0x1_Ancestry">Ancestry</a>&gt;(child);
child_ancestry.tree = new_tree;
print(&100250);
// print(&100250);

};
print(&100260);
// print(&100260);

}
</code></pre>
Expand Down Expand Up @@ -183,40 +182,40 @@
<pre><code><b>public</b> <b>fun</b> <a href="Ancestry.md#0x1_Ancestry_is_family">is_family</a>(left: <b>address</b>, right: <b>address</b>): (bool, <b>address</b>) <b>acquires</b> <a href="Ancestry.md#0x1_Ancestry">Ancestry</a> {
<b>let</b> is_family = <b>false</b>;
<b>let</b> common_ancestor = @0x0;
print(&100300);
print(&<b>exists</b>&lt;<a href="Ancestry.md#0x1_Ancestry">Ancestry</a>&gt;(left));
print(&<b>exists</b>&lt;<a href="Ancestry.md#0x1_Ancestry">Ancestry</a>&gt;(right));
// // print(&100300);
// // print(&<b>exists</b>&lt;<a href="Ancestry.md#0x1_Ancestry">Ancestry</a>&gt;(left));
// // print(&<b>exists</b>&lt;<a href="Ancestry.md#0x1_Ancestry">Ancestry</a>&gt;(right));

// <b>if</b> (<b>exists</b>&lt;<a href="Ancestry.md#0x1_Ancestry">Ancestry</a>&gt;(left) && <b>exists</b>&lt;<a href="Ancestry.md#0x1_Ancestry">Ancestry</a>&gt;(right)) {
// <b>if</b> tree is empty it will still work.
print(&100310);
// // print(&100310);
<b>let</b> left_tree = <a href="Ancestry.md#0x1_Ancestry_get_tree">get_tree</a>(left);
print(&100311);
// // print(&100311);
<b>let</b> right_tree = <a href="Ancestry.md#0x1_Ancestry_get_tree">get_tree</a>(right);

print(&100320);
// // print(&100320);

// check for direct relationship.
<b>if</b> (<a href="../../../../../../../DPN/releases/artifacts/current/build/MoveStdlib/docs/Vector.md#0x1_Vector_contains">Vector::contains</a>(&left_tree, &right)) <b>return</b> (<b>true</b>, right);
<b>if</b> (<a href="../../../../../../../DPN/releases/artifacts/current/build/MoveStdlib/docs/Vector.md#0x1_Vector_contains">Vector::contains</a>(&right_tree, &left)) <b>return</b> (<b>true</b>, left);

print(&100330);
// // print(&100330);
<b>let</b> i = 0;
// check every <b>address</b> on the list <b>if</b> there are overlaps.
<b>while</b> (i &lt; <a href="../../../../../../../DPN/releases/artifacts/current/build/MoveStdlib/docs/Vector.md#0x1_Vector_length">Vector::length</a>&lt;<b>address</b>&gt;(&left_tree)) {
print(&100341);
// // print(&100341);
<b>let</b> family_addr = <a href="../../../../../../../DPN/releases/artifacts/current/build/MoveStdlib/docs/Vector.md#0x1_Vector_borrow">Vector::borrow</a>(&left_tree, i);
<b>if</b> (<a href="../../../../../../../DPN/releases/artifacts/current/build/MoveStdlib/docs/Vector.md#0x1_Vector_contains">Vector::contains</a>(&right_tree, family_addr)) {
is_family = <b>true</b>;
common_ancestor = *family_addr;
print(&100342);
// // print(&100342);
<b>break</b>
};
i = i + 1;
};
print(&100350);
// // print(&100350);
// };
print(&100360);
// // print(&100360);
(is_family, common_ancestor)
}
</code></pre>
Expand Down Expand Up @@ -322,13 +321,13 @@
<b>move_to</b>&lt;<a href="Ancestry.md#0x1_Ancestry">Ancestry</a>&gt;(child_sig, <a href="Ancestry.md#0x1_Ancestry">Ancestry</a> {
tree: migrate_tree,
});
print(&100240);
// print(&100240);

} <b>else</b> {
// this is only for migration cases.
<b>let</b> child_ancestry = <b>borrow_global_mut</b>&lt;<a href="Ancestry.md#0x1_Ancestry">Ancestry</a>&gt;(child);
child_ancestry.tree = migrate_tree;
print(&100250);
// print(&100250);

};
}
Expand Down
Loading