Skip to content

Commit

Permalink
chore(ethereum): Release 1.0.2 (#174)
Browse files Browse the repository at this point in the history
* chore(ethereum): Release 1.0.2

* fix: Use `Box::pin` for large futures in ethereum's client binary (#177)

* chore: Add `large_futures` clippy lint to xclippy

* fix: Use `Box::pin` to heap allocate large futures

---------

Co-authored-by: wwared <[email protected]>

* chore: Update deny.toml for new defaults (#145)

Co-authored-by: wwared <[email protected]>

* feat: update .lock

* chore: Update deny.toml and fixture-generator lock

Re-adds the BUSL exceptions to deny.toml for the aptos-lc crates

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: wwared <[email protected]>
Co-authored-by: wwared <[email protected]>
Co-authored-by: Thomas Chataigner <[email protected]>
  • Loading branch information
5 people authored Aug 20, 2024
1 parent af8ff82 commit cf15026
Show file tree
Hide file tree
Showing 14 changed files with 59 additions and 89 deletions.
1 change: 1 addition & 0 deletions aptos/.cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ xclippy = [
"-Wclippy::implicit_clone",
"-Wclippy::inefficient_to_string",
"-Wclippy::invalid_upcast_comparisons",
"-Wclippy::large_futures",
"-Wclippy::large_stack_arrays",
"-Wclippy::large_types_passed_by_value",
"-Wclippy::macro_use_imports",
Expand Down
62 changes: 11 additions & 51 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

# Root options

[graph]
# If 1 or more target triples (and optionally, target_features) are specified,
# only the specified targets will be checked when running `cargo deny check`.
# This means, if a particular package is only ever used as a target specific
Expand Down Expand Up @@ -46,6 +47,8 @@ no-default-features = false
# If set, these feature will be enabled when collecting metadata. If `--features`
# is specified on the cmd line they will take precedence over this option.
#features = []

[output]
# When outputting inclusion graphs in diagnostics that include features, this
# option can be used to specify the depth at which feature edges will be added.
# This option is included since the graphs can be quite large and the addition
Expand All @@ -57,43 +60,23 @@ feature-depth = 1
# More documentation for the advisories section can be found here:
# https://embarkstudios.github.io/cargo-deny/checks/advisories/cfg.html
[advisories]
# Use the new defaults, see https://github.com/EmbarkStudios/cargo-deny/pull/611 for more info
version = 2
# The path where the advisory database is cloned/fetched into
db-path = "~/.cargo/advisory-db"
# The url(s) of the advisory databases to use
db-urls = ["https://github.com/rustsec/advisory-db"]
# The lint level for security vulnerabilities
vulnerability = "deny"
# The lint level for unmaintained crates
unmaintained = "warn"
# The lint level for crates that have been yanked from their source registry
yanked = "warn"
# The lint level for crates with security notices. Note that as of
# 2019-12-17 there are no security notice advisories in
# https://github.com/rustsec/advisory-db
notice = "warn"
# A list of advisory IDs to ignore. Note that ignored advisories will still
# output a note when they are encountered.
# These vulnerabilities are all from `aptos-lab/aptos-core` dependencies, which means we are unable to patch them here
ignore = [
# curve25519-dalek
"RUSTSEC-2024-0344",
# ed25519-dalek
"RUSTSEC-2022-0093",
# libgit2-sys
"RUSTSEC-2024-0013",
# rsa
# This vulnerability has not yet been patched
"RUSTSEC-2023-0071",
# ansi_term is unmaintained, used by tracing-forest, from sphinx
"RUSTSEC-2021-0139",
]
# Threshold for security vulnerabilities, any vulnerability with a CVSS score
# lower than the range specified will be ignored. Note that ignored advisories
# will still output a note when they are encountered.
# * None - CVSS Score 0.0
# * Low - CVSS Score 0.1 - 3.9
# * Medium - CVSS Score 4.0 - 6.9
# * High - CVSS Score 7.0 - 8.9
# * Critical - CVSS Score 9.0 - 10.0
#severity-threshold =

# If this is true, then cargo deny will use the git executable to fetch advisory database.
# If this is false, then it uses a built-in git library.
Expand All @@ -105,8 +88,8 @@ git-fetch-with-cli = true
# More documentation for the licenses section can be found here:
# https://embarkstudios.github.io/cargo-deny/checks/licenses/cfg.html
[licenses]
# The lint level for crates which do not have a detectable license
unlicensed = "deny"
# Use the new defaults, see https://github.com/EmbarkStudios/cargo-deny/pull/611 for more info
version = 2
# List of explicitly allowed licenses
# See https://spdx.org/licenses/ for list of possible licenses
# [possible values: any SPDX 3.11 short identifier (+ optional exception)].
Expand All @@ -128,26 +111,6 @@ allow = [
"CDDL-1.0",
"MIT-0",
]
# List of explicitly disallowed licenses
# See https://spdx.org/licenses/ for list of possible licenses
# [possible values: any SPDX 3.11 short identifier (+ optional exception)].
deny = [
#"Nokia",
]
# Lint level for licenses considered copyleft
copyleft = "deny"
# Blanket approval or denial for OSI-approved or FSF Free/Libre licenses
# * both - The license will be approved if it is both OSI-approved *AND* FSF
# * either - The license will be approved if it is either OSI-approved *OR* FSF
# * osi-only - The license will be approved if is OSI-approved *AND NOT* FSF
# * fsf-only - The license will be approved if is FSF *AND NOT* OSI-approved
# * neither - This predicate is ignored and the default lint level is used
allow-osi-fsf-free = "neither"
# Lint level used when no other predicates are matched
# 1. License isn't in the allow or deny lists
# 2. License isn't copyleft
# 3. License isn't OSI/FSF, or allow-osi-fsf-free = "neither"
default = "deny"
# The confidence threshold for detecting a license from license text.
# The higher the value, the more closely the license text must be to the
# canonical license text of a valid SPDX license file.
Expand All @@ -160,13 +123,10 @@ exceptions = [
{ allow = ["BUSL-1.1"], crate = "aptos-lc" },
{ allow = ["BUSL-1.1"], crate = "aptos-lc-core" },
{ allow = ["BUSL-1.1"], crate = "aptos-programs" },
{ allow = ["BUSL-1.1"], crate = "fixture-generator" },
{ allow = ["BUSL-1.1"], crate = "proof-server" },
{ allow = ["BUSL-1.1"], crate = "signature-verification-program" },
{ allow = ["BUSL-1.1"], crate = "epoch-change-program" },
{ allow = ["BUSL-1.1"], crate = "inclusion-program" },
# Remove as soon as https://github.com/aptos-labs/aptos-core/issues/13931 is fixed
{ allow = ["GPL-3.0"], crate = "number_range"},
]

# Some crates don't have (easily) machine readable licensing information,
Expand Down Expand Up @@ -305,7 +265,7 @@ deny = [
# is a direct dependency of the otherwise banned crate
#{ name = "ansi_term", version = "=0.11.0", wrappers = [] },
"dirs", # use https://crates.io/crates/home instead
"amcl", # use https://github.com/lurk-lab/bls12_381/ instead
"amcl", # use https://github.com/argumentcomputer/bls12_381/ instead
]

# List of features to allow/deny
Expand Down Expand Up @@ -362,7 +322,7 @@ allow-git = []
[sources.allow-org]
# 1 or more github.com organizations to allow git sources for
# TODO: Enforce the below?
# github = ["lurk-lab"]
# github = ["argumentcomputer"]
# 1 or more gitlab.com organizations to allow git sources for
# gitlab = [""]
# 1 or more bitbucket.org organizations to allow git sources for
Expand Down
1 change: 1 addition & 0 deletions ethereum/.cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ xclippy = [
"-Wclippy::implicit_clone",
"-Wclippy::inefficient_to_string",
"-Wclippy::invalid_upcast_comparisons",
"-Wclippy::large_futures",
"-Wclippy::large_stack_arrays",
"-Wclippy::large_types_passed_by_value",
"-Wclippy::macro_use_imports",
Expand Down
6 changes: 3 additions & 3 deletions ethereum/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 ethereum/core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ethereum-lc-core"
version = "1.0.1"
version = "1.0.2"
edition = { workspace = true }
repository = { workspace = true }
license = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion ethereum/ethereum-programs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ethereum-programs"
version = "1.0.1"
version = "1.0.2"
edition = { workspace = true }
repository = { workspace = true }
license = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion ethereum/light-client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ethereum-lc"
version = "1.0.1"
version = "1.0.2"
edition = { workspace = true }
repository = { workspace = true }
license = { workspace = true }
Expand Down
36 changes: 19 additions & 17 deletions ethereum/light-client/src/bin/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,13 @@ async fn main() -> Result<()> {
let rpc_provider_address = Arc::new(rpc_provider_address);

// Initialize the Light Client.
let (client, store, verifier_state) = initialize_light_client(
let (client, store, verifier_state) = Box::pin(initialize_light_client(
mode,
checkpoint_provider_address,
beacon_node_address,
proof_server_address,
rpc_provider_address,
)
))
.await
.expect("Failed to initialize light client");

Expand Down Expand Up @@ -203,14 +203,13 @@ async fn main() -> Result<()> {
let task = tokio::spawn(async move {
let store = store_clone.read().await.clone();
let update = Update::from(finality_update);
let proof = client_clone
.prove_storage_inclusion(
mode_clone,
store,
update.clone(),
light_client_internal,
)
.await?;
let proof = Box::pin(client_clone.prove_storage_inclusion(
mode_clone,
store,
update.clone(),
light_client_internal,
))
.await?;
info!("Proof of storage inclusion generated successfully");

Ok((update, proof))
Expand Down Expand Up @@ -238,9 +237,12 @@ async fn main() -> Result<()> {
let store = store_clone.read().await.clone();
let update = potential_update.unwrap();

let proof = client_clone
.prove_committee_change(mode_clone, store, update.clone())
.await?;
let proof = Box::pin(client_clone.prove_committee_change(
mode_clone,
store,
update.clone(),
))
.await?;
info!("Proof of committee change generated successfully");

Ok((update, proof))
Expand Down Expand Up @@ -341,10 +343,10 @@ async fn initialize_light_client(
info!("Sync period changed, updating store...");
}

let proof = client
.prove_committee_change(proving_mode, store.clone(), update.clone())
.await
.expect("Failed to prove committee change");
let proof =
Box::pin(client.prove_committee_change(proving_mode, store.clone(), update.clone()))
.await
.expect("Failed to prove committee change");

client
.verify_committee_change(proof.clone())
Expand Down
18 changes: 12 additions & 6 deletions ethereum/light-client/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,11 @@ impl Client {
store: LightClientStore,
update: Update,
) -> Result<ProofType, ClientError> {
self.proof_server_client
.prove_committee_change(proving_mode, store, update)
.await
Box::pin(
self.proof_server_client
.prove_committee_change(proving_mode, store, update),
)
.await
}

/// `verify_committee_change` makes a request to the Proof Server API to verify the proof of a committee change.
Expand Down Expand Up @@ -232,9 +234,13 @@ impl Client {
update: Update,
eip1186_proof: EIP1186Proof,
) -> Result<ProofType, ClientError> {
self.proof_server_client
.prove_storage_inclusion(proving_mode, store, update, eip1186_proof)
.await
Box::pin(self.proof_server_client.prove_storage_inclusion(
proving_mode,
store,
update,
eip1186_proof,
))
.await
}

/// `verify_storage_inclusion` makes a request to the Proof Server API to verify the proof of a storage inclusion.
Expand Down
4 changes: 2 additions & 2 deletions ethereum/programs/committee-change/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 ethereum/programs/committee-change/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[workspace]
[package]
name = "committee-change-program"
version = "1.0.1"
version = "1.0.2"
edition = "2021"
license = "Apache-2.0"

Expand Down
4 changes: 2 additions & 2 deletions ethereum/programs/inclusion/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 ethereum/programs/inclusion/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[workspace]
[package]
name = "inclusion-program"
version = "1.0.1"
version = "1.0.2"
edition = "2021"
license = "Apache-2.0"

Expand Down
6 changes: 3 additions & 3 deletions fixture-generator/Cargo.lock

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

0 comments on commit cf15026

Please sign in to comment.