Skip to content

Commit 77fc9d8

Browse files
committed
Remove wsts from stackslib
Signed-off-by: Jacinta Ferrant <[email protected]>
1 parent 4f14f4e commit 77fc9d8

File tree

23 files changed

+115
-376
lines changed

23 files changed

+115
-376
lines changed

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

libsigner/src/events.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use std::time::SystemTime;
2525
use blockstack_lib::chainstate::nakamoto::NakamotoBlock;
2626
use blockstack_lib::chainstate::stacks::boot::{MINERS_NAME, SIGNERS_NAME};
2727
use blockstack_lib::chainstate::stacks::events::StackerDBChunksEvent;
28-
use blockstack_lib::chainstate::stacks::{StacksTransaction, ThresholdSignature};
28+
use blockstack_lib::chainstate::stacks::StacksTransaction;
2929
use blockstack_lib::net::api::postblock_proposal::{
3030
BlockValidateReject, BlockValidateResponse, ValidateRejectCode,
3131
};

libsigner/src/v0/messages.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -887,8 +887,8 @@ impl From<BlockResponse> for SignerMessage {
887887
mod test {
888888
use blockstack_lib::chainstate::nakamoto::NakamotoBlockHeader;
889889
use blockstack_lib::chainstate::stacks::{
890-
ThresholdSignature, TransactionAnchorMode, TransactionAuth, TransactionPayload,
891-
TransactionPostConditionMode, TransactionSmartContract, TransactionVersion,
890+
TransactionAnchorMode, TransactionAuth, TransactionPayload, TransactionPostConditionMode,
891+
TransactionSmartContract, TransactionVersion,
892892
};
893893
use blockstack_lib::util_lib::strings::StacksString;
894894
use clarity::consts::CHAIN_ID_MAINNET;

stackslib/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ stacks-common = { path = "../stacks-common" }
5656
pox-locking = { path = "../pox-locking" }
5757
libstackerdb = { path = "../libstackerdb" }
5858
siphasher = "0.3.7"
59-
wsts = { workspace = true }
6059
hashbrown = { workspace = true }
6160
rusqlite = { workspace = true }
6261

stackslib/src/chainstate/burn/operations/vote_for_aggregate_key.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ use stacks_common::deps_common::bitcoin::blockdata::script::Builder;
2121
use stacks_common::types::chainstate::{BurnchainHeaderHash, StacksAddress};
2222
use stacks_common::types::StacksPublicKeyBuffer;
2323
use stacks_common::util::secp256k1::Secp256k1PublicKey;
24-
use wsts::curve::point::{Compressed, Point};
2524

2625
use crate::burnchains::bitcoin::bits::parse_script;
2726
use crate::burnchains::bitcoin::{BitcoinTxInput, BitcoinTxInputStructured};
@@ -175,26 +174,18 @@ impl VoteForAggregateKeyOp {
175174

176175
/// Check the payload of a vote-for-aggregate-key burn op.
177176
/// Both `signer_key` and `aggregate_key` are checked for validity against
178-
/// `Secp256k1PublicKey` from `stacks_common` as well as `Point` from wsts.
177+
/// `Secp256k1PublicKey` from `stacks_common`
179178
pub fn check(&self) -> Result<(), op_error> {
180179
// Check to see if the aggregate key is valid
181180
let aggregate_key_bytes = self.aggregate_key.as_bytes();
182181
Secp256k1PublicKey::from_slice(aggregate_key_bytes)
183182
.map_err(|_| op_error::VoteForAggregateKeyInvalidKey)?;
184183

185-
let compressed = Compressed::try_from(aggregate_key_bytes.clone())
186-
.map_err(|_| op_error::VoteForAggregateKeyInvalidKey)?;
187-
Point::try_from(&compressed).map_err(|_| op_error::VoteForAggregateKeyInvalidKey)?;
188-
189184
// Check to see if the signer key is valid
190185
let signer_key_bytes = self.signer_key.as_bytes();
191186
Secp256k1PublicKey::from_slice(signer_key_bytes)
192187
.map_err(|_| op_error::VoteForAggregateKeyInvalidKey)?;
193188

194-
let compressed = Compressed::try_from(signer_key_bytes.clone())
195-
.map_err(|_| op_error::VoteForAggregateKeyInvalidKey)?;
196-
Point::try_from(&compressed).map_err(|_| op_error::VoteForAggregateKeyInvalidKey)?;
197-
198189
Ok(())
199190
}
200191
}

stackslib/src/chainstate/nakamoto/coordinator/tests.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ use stacks_common::types::{Address, StacksEpoch, StacksEpochId, StacksPublicKeyB
3434
use stacks_common::util::hash::Hash160;
3535
use stacks_common::util::secp256k1::Secp256k1PrivateKey;
3636
use stacks_common::util::vrf::VRFProof;
37-
use wsts::curve::point::Point;
3837

3938
use crate::burnchains::{PoxConstants, Txid};
4039
use crate::chainstate::burn::db::sortdb::{SortitionDB, SortitionHandle};

stackslib/src/chainstate/nakamoto/mod.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ use stacks_common::util::retry::BoundReader;
5353
use stacks_common::util::secp256k1::MessageSignature;
5454
use stacks_common::util::vrf::{VRFProof, VRFPublicKey, VRF};
5555
use stacks_common::util::{get_epoch_time_secs, sleep_ms};
56-
use wsts::curve::point::Point;
5756

5857
use self::signer_set::SignerCalculation;
5958
use super::burn::db::sortdb::{
@@ -74,7 +73,7 @@ use super::stacks::db::{
7473
use super::stacks::events::{StacksTransactionReceipt, TransactionOrigin};
7574
use super::stacks::{
7675
Error as ChainstateError, StacksBlock, StacksBlockHeader, StacksMicroblock, StacksTransaction,
77-
TenureChangeError, TenureChangePayload, ThresholdSignature, TransactionPayload,
76+
TenureChangeError, TenureChangePayload, TransactionPayload,
7877
};
7978
use crate::burnchains::{Burnchain, PoxConstants, Txid};
8079
use crate::chainstate::burn::db::sortdb::SortitionDB;
@@ -4499,8 +4498,8 @@ impl NakamotoChainState {
44994498
/// Boot code instantiation for the aggregate public key.
45004499
/// TODO: This should be removed once it's possible for stackers to vote on the aggregate
45014500
/// public key
4502-
pub fn aggregate_public_key_bootcode(clarity_tx: &mut ClarityTx, apk: &Point) {
4503-
let agg_pub_key = to_hex(&apk.compress().data);
4501+
pub fn aggregate_public_key_bootcode(clarity_tx: &mut ClarityTx, apk: Vec<u8>) {
4502+
let agg_pub_key = to_hex(&apk);
45044503
let contract_content = format!(
45054504
"(define-read-only ({}) 0x{})",
45064505
BOOT_TEST_POX_4_AGG_KEY_FNAME, agg_pub_key

stackslib/src/chainstate/nakamoto/signer_set.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ use stacks_common::util::hash::{to_hex, Hash160, MerkleHashFunc, MerkleTree, Sha
4747
use stacks_common::util::retry::BoundReader;
4848
use stacks_common::util::secp256k1::MessageSignature;
4949
use stacks_common::util::vrf::{VRFProof, VRFPublicKey, VRF};
50-
use wsts::curve::point::{Compressed, Point};
5150

5251
use crate::burnchains::{Burnchain, PoxConstants, Txid};
5352
use crate::chainstate::burn::db::sortdb::{
@@ -73,8 +72,8 @@ use crate::chainstate::stacks::db::{
7372
use crate::chainstate::stacks::events::{StacksTransactionReceipt, TransactionOrigin};
7473
use crate::chainstate::stacks::{
7574
Error as ChainstateError, StacksBlock, StacksBlockHeader, StacksMicroblock, StacksTransaction,
76-
TenureChangeCause, TenureChangeError, TenureChangePayload, ThresholdSignature,
77-
TransactionPayload, MINER_BLOCK_CONSENSUS_HASH, MINER_BLOCK_HEADER_HASH,
75+
TenureChangeCause, TenureChangeError, TenureChangePayload, TransactionPayload,
76+
MINER_BLOCK_CONSENSUS_HASH, MINER_BLOCK_HEADER_HASH,
7877
};
7978
use crate::clarity::vm::clarity::{ClarityConnection, TransactionConnection};
8079
use crate::clarity_vm::clarity::{
@@ -101,7 +100,7 @@ pub struct SignerCalculation {
101100

102101
pub struct AggregateKeyVoteParams {
103102
pub signer_index: u64,
104-
pub aggregate_key: Point,
103+
pub aggregate_key: Vec<u8>,
105104
pub voting_round: u64,
106105
pub reward_cycle: u64,
107106
}
@@ -547,10 +546,8 @@ impl NakamotoSigners {
547546
}
548547
let signer_index_value = payload.function_args.first()?;
549548
let signer_index = u64::try_from(signer_index_value.clone().expect_u128().ok()?).ok()?;
550-
let point_value = payload.function_args.get(1)?;
551-
let point_bytes = point_value.clone().expect_buff(33).ok()?;
552-
let compressed_data = Compressed::try_from(point_bytes.as_slice()).ok()?;
553-
let aggregate_key = Point::try_from(&compressed_data).ok()?;
549+
let aggregate_key_value = payload.function_args.get(1)?;
550+
let aggregate_key = aggregate_key_value.clone().expect_buff(33).ok()?;
554551
let round_value = payload.function_args.get(2)?;
555552
let voting_round = u64::try_from(round_value.clone().expect_u128().ok()?).ok()?;
556553
let reward_cycle =

stackslib/src/chainstate/nakamoto/tenure.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ use stacks_common::util::hash::{to_hex, Hash160, MerkleHashFunc, MerkleTree, Sha
8787
use stacks_common::util::retry::BoundReader;
8888
use stacks_common::util::secp256k1::MessageSignature;
8989
use stacks_common::util::vrf::{VRFProof, VRFPublicKey, VRF};
90-
use wsts::curve::point::Point;
9190

9291
use crate::burnchains::{PoxConstants, Txid};
9392
use crate::chainstate::burn::db::sortdb::{
@@ -108,8 +107,8 @@ use crate::chainstate::stacks::db::{
108107
use crate::chainstate::stacks::events::StacksTransactionReceipt;
109108
use crate::chainstate::stacks::{
110109
Error as ChainstateError, StacksBlock, StacksBlockHeader, StacksMicroblock, StacksTransaction,
111-
TenureChangeCause, TenureChangeError, TenureChangePayload, ThresholdSignature,
112-
TransactionPayload, MINER_BLOCK_CONSENSUS_HASH, MINER_BLOCK_HEADER_HASH,
110+
TenureChangeCause, TenureChangeError, TenureChangePayload, TransactionPayload,
111+
MINER_BLOCK_CONSENSUS_HASH, MINER_BLOCK_HEADER_HASH,
113112
};
114113
use crate::clarity_vm::clarity::{ClarityInstance, PreCommitClarityBlock};
115114
use crate::clarity_vm::database::SortitionDBRef;

0 commit comments

Comments
 (0)