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

Chore/next to develop #4666

Merged
merged 37 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
6339452
Do not attempt to treat miner as a coordinator when updating DKG
jferrant Mar 25, 2024
8b49cfa
CRC: always use the signer get coordinator but pass the reward cycle …
jferrant Mar 27, 2024
c3cfa2a
CRC: create a dkg and sign coordiantor selector functions and use whe…
jferrant Mar 28, 2024
07db684
Clippy was driving me bananas
jferrant Mar 28, 2024
ee5c726
Remove unnecessary retries throughout code
jferrant Mar 22, 2024
7a970ac
Add get_medium_estimated_fee_ustx to get estimated fee from stacks node
jferrant Mar 22, 2024
abfc68a
Seperate unsigned and signed transaction building and update tests
jferrant Mar 22, 2024
00fd7db
Update stacks-signer to attempt to estimate the transaction fee if a …
jferrant Mar 22, 2024
a112bf5
CRC: remove dead path and update debug message to a warn
jferrant Mar 27, 2024
110d04e
CRC: add config tests and remove config log
jferrant Mar 28, 2024
ca71d95
Merge branch 'next' of https://github.com/stacks-network/stacks-core …
jferrant Apr 2, 2024
9aa8814
Merge branch 'next' of https://github.com/stacks-network/stacks-core …
jferrant Apr 2, 2024
ccfba63
CRC: do not pop the command until its executed
jferrant Apr 2, 2024
d29dde3
Merge branch 'next' of https://github.com/stacks-network/stacks-core …
jferrant Apr 2, 2024
3c4e124
Fix bad merge
jferrant Apr 2, 2024
53f2635
Consider nonce when checking for existing vote transactions in stacke…
jferrant Apr 2, 2024
0713b65
fix: dont warn about aggregate key in 2.5
hstove Apr 2, 2024
f9efc52
Reward cycle length was being incorrectly stored as reward phase length
jferrant Apr 3, 2024
803ab47
CRC: remove duplicate logging
jferrant Apr 3, 2024
929a9b8
Merge pull request #4621 from stacks-network/bugfix/resubmit-dkg-vote…
jferrant Apr 3, 2024
3e8e519
Add unit tests for is_in_prepare_phase and is_in_reward_cycle functions
jferrant Apr 3, 2024
4b26a2c
Merge branch 'next' of https://github.com/stacks-network/stacks-core …
jferrant Apr 3, 2024
21368aa
Merge branch 'next' of https://github.com/stacks-network/stacks-core …
jferrant Apr 3, 2024
1028135
CRC: change debug to info for pre epoch 3.0 cycles requiring a fee
jferrant Apr 3, 2024
9708368
Merge pull request #4591 from stacks-network/bugfix/enable-dkg-in-cur…
kantai Apr 3, 2024
d54b67c
Merge pull request #4629 from stacks-network/bugfix/signer-reward-cyc…
kantai Apr 4, 2024
972b631
Merge branch 'next' of https://github.com/stacks-network/stacks-core …
jferrant Apr 4, 2024
85eb351
Fix bad merge
jferrant Apr 4, 2024
76b610b
Fix bad merge 2
jferrant Apr 4, 2024
7f96d08
Bugfix: verify block transactions only when the upcoming signers appr…
jferrant Apr 4, 2024
1ec9458
Merge pull request #4640 from stacks-network/bugfix/check-next-approv…
jferrant Apr 5, 2024
8d4da57
Merge pull request #4583 from stacks-network/feat/stacks-signer-fee-e…
jferrant Apr 5, 2024
b12aea3
removing portable flag
wileyj Apr 5, 2024
e28fd65
update per 4638
wileyj Apr 5, 2024
5d2cbdd
Merge pull request #4626 from stacks-network/fix/aggregate-key-warning
obycode Apr 6, 2024
844a2a7
Merge pull request #4646 from stacks-network/fix/remove-portable
wileyj Apr 8, 2024
80f3e9a
Merge branch 'next' into chore/next-to-develop
obycode Apr 15, 2024
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: 2 additions & 3 deletions stacks-signer/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,17 +351,16 @@ mod tests {
}

fn clarity_tuple_version(pox_addr: &PoxAddress) -> u8 {
pox_addr
*pox_addr
.as_clarity_tuple()
.expect("Failed to generate clarity tuple for pox address")
.get("version")
.expect("Expected version in clarity tuple")
.clone()
.expect_buff(1)
.expect("Expected version to be a u128")
.get(0)
.first()
.expect("Expected version to be a uint")
.clone()
}

#[test]
Expand Down
40 changes: 40 additions & 0 deletions stacks-signer/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ pub(crate) mod tests {
use blockstack_lib::net::api::getpoxinfo::{
RPCPoxCurrentCycleInfo, RPCPoxEpoch, RPCPoxInfoData, RPCPoxNextCycleInfo,
};
use blockstack_lib::net::api::postfeerate::{RPCFeeEstimate, RPCFeeEstimateResponse};
use blockstack_lib::util_lib::boot::boot_code_id;
use clarity::vm::costs::ExecutionCost;
use clarity::vm::types::TupleData;
Expand Down Expand Up @@ -398,6 +399,44 @@ pub(crate) mod tests {
format!("HTTP/1.1 200 OK\n\n{{\"okay\":true,\"result\":\"{hex}\"}}")
}

/// Build a response for the get_medium_estimated_fee_ustx_response request with a specific medium estimate
pub fn build_get_medium_estimated_fee_ustx_response(
medium_estimate: u64,
) -> (String, RPCFeeEstimateResponse) {
// Generate some random info
let fee_response = RPCFeeEstimateResponse {
estimated_cost: ExecutionCost {
write_length: thread_rng().next_u64(),
write_count: thread_rng().next_u64(),
read_length: thread_rng().next_u64(),
read_count: thread_rng().next_u64(),
runtime: thread_rng().next_u64(),
},
estimated_cost_scalar: thread_rng().next_u64(),
cost_scalar_change_by_byte: thread_rng().next_u32() as f64,
estimations: vec![
RPCFeeEstimate {
fee_rate: thread_rng().next_u32() as f64,
fee: thread_rng().next_u64(),
},
RPCFeeEstimate {
fee_rate: thread_rng().next_u32() as f64,
fee: medium_estimate,
},
RPCFeeEstimate {
fee_rate: thread_rng().next_u32() as f64,
fee: thread_rng().next_u64(),
},
],
};
let fee_response_json = serde_json::to_string(&fee_response)
.expect("Failed to serialize fee estimate response");
(
format!("HTTP/1.1 200 OK\n\n{fee_response_json}"),
fee_response,
)
}

/// Generate a signer config with the given number of signers and keys where the first signer is
/// obtained from the provided global config
pub fn generate_signer_config(
Expand Down Expand Up @@ -515,6 +554,7 @@ pub(crate) mod tests {
nonce_timeout: config.nonce_timeout,
sign_timeout: config.sign_timeout,
tx_fee_ustx: config.tx_fee_ustx,
max_tx_fee_ustx: config.max_tx_fee_ustx,
db_path: config.db_path.clone(),
}
}
Expand Down
14 changes: 6 additions & 8 deletions stacks-signer/src/client/stackerdb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ impl StackerDB {
}

/// Sends message (as a raw msg ID and bytes) to the .signers stacker-db with an
/// exponential backoff retry
/// exponential backoff retry
pub fn send_message_bytes_with_retry(
&mut self,
msg_id: &MessageSlotID,
Expand Down Expand Up @@ -224,9 +224,7 @@ impl StackerDB {
}

/// Get this signer's latest transactions from stackerdb
pub fn get_current_transactions_with_retry(
&mut self,
) -> Result<Vec<StacksTransaction>, ClientError> {
pub fn get_current_transactions(&mut self) -> Result<Vec<StacksTransaction>, ClientError> {
let Some(transactions_session) = self
.signers_message_stackerdb_sessions
.get_mut(&MessageSlotID::Transactions)
Expand All @@ -237,7 +235,7 @@ impl StackerDB {
}

/// Get the latest signer transactions from signer ids for the next reward cycle
pub fn get_next_transactions_with_retry(
pub fn get_next_transactions(
&mut self,
signer_ids: &[SignerSlotID],
) -> Result<Vec<StacksTransaction>, ClientError> {
Expand Down Expand Up @@ -272,7 +270,7 @@ mod tests {
use crate::config::GlobalConfig;

#[test]
fn get_signer_transactions_with_retry_should_succeed() {
fn get_signer_transactions_should_succeed() {
let config = GlobalConfig::load_from_file("./src/tests/conf/signer-0.toml").unwrap();
let signer_config = generate_signer_config(&config, 5, 20);
let mut stackerdb = StackerDB::from(&signer_config);
Expand All @@ -297,7 +295,7 @@ mod tests {
let message = signer_message.serialize_to_vec();

let signer_slot_ids = vec![SignerSlotID(0), SignerSlotID(1)];
let h = spawn(move || stackerdb.get_next_transactions_with_retry(&signer_slot_ids));
let h = spawn(move || stackerdb.get_next_transactions(&signer_slot_ids));
let mut response_bytes = b"HTTP/1.1 200 OK\n\n".to_vec();
response_bytes.extend(message);
let mock_server = mock_server_from_config(&config);
Expand All @@ -315,7 +313,7 @@ mod tests {
}

#[test]
fn send_signer_message_with_retry_should_succeed() {
fn send_signer_message_should_succeed() {
let config = GlobalConfig::load_from_file("./src/tests/conf/signer-1.toml").unwrap();
let signer_config = generate_signer_config(&config, 5, 20);
let mut stackerdb = StackerDB::from(&signer_config);
Expand Down
Loading