Skip to content
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions Cargo.lock

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

3 changes: 0 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ bytes = "1"
celestia-tendermint = "0.32.1"
celestia-types = "0.1.1"
clap = "4.5.4"
ed25519-consensus = { version = "2.1.0", default-features = false, features = [
"std",
] }
ethers = "2.0.11"
futures = "0.3"
hex = "0.4"
Expand Down
1 change: 0 additions & 1 deletion crates/astria-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ color-eyre = "0.6"
astria-core = { path = "../astria-core" }

clap = { workspace = true, features = ["derive", "env"] }
ed25519-consensus = { workspace = true }
hex = { workspace = true }
rand = { workspace = true }
serde = { workspace = true, features = ["derive"] }
Expand Down
10 changes: 3 additions & 7 deletions crates/astria-cli/src/commands/sequencer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ use astria_core::{
use astria_sequencer_client::{
tendermint,
tendermint_rpc::endpoint,
Address,
Client,
HttpClient,
SequencerClientExt,
Expand All @@ -32,7 +31,6 @@ use color_eyre::{
Context,
},
};
use ed25519_consensus::VerificationKeyBytes;
use rand::rngs::OsRng;

use crate::cli::sequencer::{
Expand Down Expand Up @@ -67,7 +65,7 @@ fn get_private_key_pretty(signing_key: &SigningKey) -> String {

/// Get the address from the signing key
fn get_address_pretty(signing_key: &SigningKey) -> String {
let address = Address::from_verification_key(signing_key.verification_key());
let address = *signing_key.verification_key().address();
hex::encode(address.to_vec())
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're hex-encoding here and in a couple of functions above - maybe that should be changed to base64?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to change addresses to bech32 :/ addresses are annoying cause sometimes cometbft encodes them as hex (like when logging) and other times base64 (like in the json-rpc responses)

}

Expand Down Expand Up @@ -461,9 +459,7 @@ pub(crate) async fn sudo_address_change(args: &SudoAddressChangeArgs) -> eyre::R
pub(crate) async fn validator_update(args: &ValidatorUpdateArgs) -> eyre::Result<()> {
let public_key_raw = hex::decode(args.validator_public_key.as_str())
.wrap_err("failed to decode public key into bytes")?;
let public_key_bytes = VerificationKeyBytes::try_from(public_key_raw.as_slice())
.wrap_err("public key bytes were too long, must be 32 bytes")?;
let pub_key = tendermint::PublicKey::from_raw_ed25519(public_key_bytes.as_bytes())
let pub_key = tendermint::PublicKey::from_raw_ed25519(&public_key_raw)
.expect("failed to parse public key from parsed bytes");
let validator_update = tendermint::validator::Update {
pub_key,
Expand Down Expand Up @@ -500,7 +496,7 @@ async fn submit_transaction(
.map_err(|_| eyre!("invalid private key length; must be 32 bytes"))?;
let sequencer_key = SigningKey::from(private_key_bytes);

let from_address = Address::from_verification_key(sequencer_key.verification_key());
let from_address = *sequencer_key.verification_key().address();

let nonce_res = sequencer_client
.get_latest_nonce(from_address)
Expand Down
1 change: 0 additions & 1 deletion crates/astria-composer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ tonic-health = "0.10.2"

async-trait = { workspace = true }
axum = { workspace = true }
ed25519-consensus = { workspace = true }
ethers = { workspace = true, features = ["ws"] }
futures = { workspace = true }
humantime = { workspace = true }
Expand Down
3 changes: 1 addition & 2 deletions crates/astria-composer/src/executor/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use std::{

use astria_core::{
crypto::SigningKey,
primitive::v1::Address,
protocol::transaction::v1alpha1::action::SequenceAction,
};
use astria_eyre::eyre::{
Expand Down Expand Up @@ -51,7 +50,7 @@ impl Builder {
format!("failed reading signing key from file at path `{private_key_file}`")
})?;

let sequencer_address = Address::from_verification_key(sequencer_key.verification_key());
let sequencer_address = *sequencer_key.verification_key().address();

let (serialized_rollup_transaction_tx, serialized_rollup_transaction_rx) =
tokio::sync::mpsc::channel::<SequenceAction>(256);
Expand Down
1 change: 0 additions & 1 deletion crates/astria-conductor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ telemetry = { package = "astria-telemetry", path = "../astria-telemetry", featur

base64 = { workspace = true }
bytes = { workspace = true }
ed25519-consensus = { workspace = true }
futures = { workspace = true }
hex = { workspace = true }
humantime = { workspace = true }
Expand Down
10 changes: 5 additions & 5 deletions crates/astria-conductor/src/celestia/block_verifier.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::collections::HashMap;

use ed25519_consensus::{
use astria_core::crypto::{
Signature,
VerificationKey,
};
Expand Down Expand Up @@ -48,7 +48,7 @@ pub(super) enum QuorumError {
#[error(
"failed to recreate signature for validator from validator set to verify vote signature"
)]
Signature(#[source] ed25519_consensus::Error),
Signature(#[source] astria_core::crypto::Error),

#[error("total voting power overflowed u64")]
TotalVotingPowerOverflowed,
Expand All @@ -65,10 +65,10 @@ pub(super) enum QuorumError {
#[error(
"failed to recreate public key for validator from validator set to verify vote signature"
)]
VerificationKey(#[source] ed25519_consensus::Error),
VerificationKey(#[source] astria_core::crypto::Error),

#[error("failed to verify vote signature")]
VerifyVoteSignature(#[source] ed25519_consensus::Error),
VerifyVoteSignature(#[source] astria_core::crypto::Error),
}

/// This function ensures that the given Commit has quorum, ie that the Commit contains >2/3 voting
Expand Down Expand Up @@ -305,7 +305,7 @@ mod test {
signatures: vec![tendermint::block::CommitSig::BlockIdFlagCommit {
validator_address: address,
timestamp,
signature: Some(signature.into()),
signature: Some(signature.to_bytes().as_ref().try_into().unwrap()),
}],
..Default::default()
};
Expand Down
2 changes: 1 addition & 1 deletion crates/astria-conductor/tests/blackbox/helpers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ pub fn make_commit(height: u32) -> tendermint::block::Commit {
signatures: vec![tendermint::block::CommitSig::BlockIdFlagCommit {
validator_address: validator.address,
timestamp,
signature: Some(signature.into()),
signature: Some(signature.to_bytes().as_ref().try_into().unwrap()),
}],
}
}
Expand Down
4 changes: 3 additions & 1 deletion crates/astria-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ merkle = { package = "astria-merkle", path = "../astria-merkle" }

bytes = { workspace = true }
celestia-tendermint = { workspace = true }
ed25519-consensus = { workspace = true }
ed25519-consensus = { version = "2.1.0", default-features = false, features = [
"std",
] }
ibc-types = { workspace = true }
indexmap = { workspace = true }
pbjson-types = { workspace = true }
Expand Down
Loading