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

STR-807: Rework on Inscription Structure #518

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
2 changes: 1 addition & 1 deletion .codespellrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[codespell]
skip = .git,target,Cargo.toml,Cargo.lock,mutants*
skip = .git,target,Cargo.toml,Cargo.lock,proofs,mutants*,_dd
ignore-words-list = crate,ser,ment
77 changes: 49 additions & 28 deletions Cargo.lock

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

6 changes: 4 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ members = [
"crates/reth/rpc",
"crates/rpc/api",
"crates/rpc/bridge-api",
"crates/rpc/btcio-types",
"crates/rpc/prover-client-api",
"crates/rpc/types",
"crates/rpc/utils",
Expand All @@ -41,7 +42,7 @@ members = [
"crates/sync",
"crates/tasks",
"crates/test-utils",
"crates/tx-parser",
"crates/btcio/transaction",
"crates/util/mmr",
"crates/util/shrex",
"crates/vtxjmt",
Expand Down Expand Up @@ -79,6 +80,8 @@ strata-bridge-rpc-api = { path = "crates/rpc/bridge-api" }
strata-bridge-sig-manager = { path = "crates/bridge-sig-manager" }
strata-bridge-tx-builder = { path = "crates/bridge-tx-builder" }
strata-btcio = { path = "crates/btcio" }
strata-btcio-rpc-types = { path = "crates/rpc/btcio-types" }
strata-btcio-tx = { path = "crates/btcio/transaction" }
strata-chaintsn = { path = "crates/chaintsn" }
strata-common = { path = "crates/common" }
strata-consensus-logic = { path = "crates/consensus-logic" }
Expand Down Expand Up @@ -115,7 +118,6 @@ strata-storage = { path = "crates/storage" }
strata-sync = { path = "crates/sync" }
strata-tasks = { path = "crates/tasks" }
strata-test-utils = { path = "crates/test-utils" }
strata-tx-parser = { path = "crates/tx-parser" }
strata-zkvm = { path = "crates/zkvm/zkvm" }
strata-zkvm-hosts = { path = "crates/zkvm/hosts" }

Expand Down
1 change: 1 addition & 0 deletions bin/bridge-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ strata-bridge-rpc-api.workspace = true
strata-bridge-sig-manager.workspace = true
strata-bridge-tx-builder.workspace = true
strata-btcio.workspace = true
strata-btcio-rpc-types.workspace = true
strata-common.workspace = true
strata-key-derivation.workspace = true
strata-primitives.workspace = true
Expand Down
3 changes: 2 additions & 1 deletion bin/bridge-client/src/modes/operator/bootstrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ use jsonrpsee::{core::client::async_client::Client as L2RpcClient, ws_client::Ws
use strata_bridge_exec::handler::ExecHandler;
use strata_bridge_sig_manager::prelude::SignatureManager;
use strata_bridge_tx_builder::prelude::TxBuildContext;
use strata_btcio::rpc::{traits::Reader, BitcoinClient};
use strata_btcio::rpc_client::BitcoinClient;
use strata_btcio_rpc_types::traits::Reader;
use strata_primitives::bridge::OperatorIdx;
use strata_rocksdb::{
bridge::db::{BridgeDutyIndexRocksDb, BridgeDutyRocksDb, BridgeTxRocksDb},
Expand Down
2 changes: 1 addition & 1 deletion bin/bridge-client/src/modes/operator/task_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use strata_bridge_exec::{
handler::ExecHandler,
};
use strata_bridge_tx_builder::{prelude::BuildContext, TxKind};
use strata_btcio::rpc::traits::Broadcaster;
use strata_btcio_rpc_types::traits::Broadcaster;
use strata_rpc_api::StrataApiClient;
use strata_rpc_types::RpcBridgeDuties;
use strata_state::bridge_duties::{BridgeDuty, BridgeDutyStatus};
Expand Down
25 changes: 25 additions & 0 deletions bin/datatool/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ pub(crate) struct Args {
pub(crate) subc: Subcommand,
}

#[allow(clippy::large_enum_variant)]
#[derive(FromArgs, PartialEq, Debug)]
#[argh(subcommand)]
pub(crate) enum Subcommand {
Expand Down Expand Up @@ -126,6 +127,18 @@ pub(crate) struct SubcParams {
)]
pub(crate) name: Option<String>,

#[argh(
option,
description = "DA tag, used in envelopes (default 'strata-da')"
)]
pub(crate) da_tag: Option<String>,

#[argh(
option,
description = "checkpoint tag, used in envelopes (default 'strata-ckpt')"
)]
pub(crate) checkpoint_tag: Option<String>,

#[argh(
option,
description = "sequencer pubkey (default unchecked)",
Expand Down Expand Up @@ -172,6 +185,18 @@ pub(crate) struct SubcParams {
description = "permit blank proofs after timeout in millis (default strict)"
)]
pub(crate) proof_timeout: Option<u32>,

#[argh(
option,
description = "fee in sats for reveal transactions. Will be determined dynamically if None"
)]
pub(crate) fixed_fee: Option<u64>,
voidash marked this conversation as resolved.
Show resolved Hide resolved

#[argh(option, description = "transaction writer poll duration")]
pub(crate) writer_poll_duration: Option<u64>,

#[argh(option, description = "amount to pay for reveal transaction")]
pub(crate) amount_for_reveal_tx: Option<u64>,
}

pub(crate) struct CmdContext {
Expand Down
31 changes: 30 additions & 1 deletion bin/datatool/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
buf::Buf32,
keys::ZeroizableXpriv,
operator::OperatorPubkeys,
params::{ProofPublishMode, RollupParams},
params::{FeePolicy, ProofPublishMode, RollupParams},
proof::RollupVerifyingKey,
};
use strata_sp1_guest_builder::GUEST_CHECKPOINT_VK_HASH_STR;
Expand Down Expand Up @@ -204,6 +204,13 @@
.parse()
.expect("invalid checkpoint verifier key hash");

// Determine the fee policy
let fee_policy = if let Some(fixed) = cmd.fixed_fee {
FeePolicy::Fixed(fixed)

Check warning on line 209 in bin/datatool/src/util.rs

View check run for this annotation

Codecov / codecov/patch

bin/datatool/src/util.rs#L208-L209

Added lines #L208 - L209 were not covered by tests
} else {
FeePolicy::Smart

Check warning on line 211 in bin/datatool/src/util.rs

View check run for this annotation

Codecov / codecov/patch

bin/datatool/src/util.rs#L211

Added line #L211 was not covered by tests
};

let config = ParamsConfig {
name: cmd.name.unwrap_or_else(|| "strata-testnet".to_string()),
bitcoin_network: ctx.bitcoin_network,
Expand All @@ -217,6 +224,13 @@
// TODO make a const
deposit_sats,
proof_timeout: cmd.proof_timeout,
da_tag: cmd.da_tag.unwrap_or_else(|| "strata-da".to_string()),
ckpt_tag: cmd
.checkpoint_tag
.unwrap_or_else(|| "strata-ckpt".to_string()),
fee_policy,
writer_poll_dur: cmd.writer_poll_duration.unwrap_or(1_000),
amt_for_reveal_tx: cmd.amount_for_reveal_tx.unwrap_or(1_000),

Check warning on line 233 in bin/datatool/src/util.rs

View check run for this annotation

Codecov / codecov/patch

bin/datatool/src/util.rs#L227-L233

Added lines #L227 - L233 were not covered by tests
};

let params = construct_params(config);
Expand Down Expand Up @@ -362,6 +376,16 @@
deposit_sats: u64,
/// Timeout for proofs.
proof_timeout: Option<u32>,
/// DA envelope tag
da_tag: String,
/// Checkpoint envelope tag
ckpt_tag: String,
/// Fee policy for transaction writer
fee_policy: FeePolicy,
/// Transaction writer poll duration
writer_poll_dur: u64,
/// Amount for reveal transaction
amt_for_reveal_tx: u64,
}

/// Constructs the parameters for a Strata network.
Expand Down Expand Up @@ -417,6 +441,11 @@
// TODO make configurable
max_deposits_in_block: 16,
network: config.bitcoin_network,
da_tag: config.da_tag,
ckpt_tag: config.ckpt_tag,
fee_policy: config.fee_policy,
writer_poll_dur: config.writer_poll_dur,
amt_for_reveal_tx: config.amt_for_reveal_tx,

Check warning on line 448 in bin/datatool/src/util.rs

View check run for this annotation

Codecov / codecov/patch

bin/datatool/src/util.rs#L444-L448

Added lines #L444 - L448 were not covered by tests
}
}

Expand Down
3 changes: 2 additions & 1 deletion bin/prover-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ path = "src/main.rs"

[dependencies]
strata-btcio.workspace = true
strata-btcio-rpc-types.workspace = true
strata-common.workspace = true
strata-db.workspace = true
strata-native-zkvm-adapter.workspace = true
Expand Down Expand Up @@ -40,7 +41,7 @@ rand.workspace = true
rayon = "1.8.0"
rockbound.workspace = true
serde.workspace = true
strata-tx-parser.workspace = true
strata-btcio-tx.workspace = true
thiserror.workspace = true
tokio.workspace = true
tracing.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion bin/prover-client/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use jsonrpsee::http_client::HttpClientBuilder;
use operators::ProofOperator;
use prover_manager::ProverManager;
use rpc_server::ProverClientRpc;
use strata_btcio::rpc::BitcoinClient;
use strata_btcio::rpc_client::BitcoinClient;
use strata_common::logging;
use strata_rocksdb::{prover::db::ProofDb, DbOpsConfig};
use task_tracker::TaskTracker;
Expand Down
3 changes: 2 additions & 1 deletion bin/prover-client/src/operators/btc.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use std::sync::Arc;

use strata_btcio::rpc::{traits::Reader, BitcoinClient};
use strata_btcio::rpc_client::BitcoinClient;
use strata_btcio_rpc_types::traits::Reader;
use strata_primitives::proof::{ProofContext, ProofKey};
use strata_proofimpl_btc_blockspace::{logic::BlockspaceProofInput, prover::BtcBlockspaceProver};
use strata_rocksdb::prover::db::ProofDb;
Expand Down
Loading
Loading