Skip to content

Commit aa98342

Browse files
authored
Merge branch 'develop' into feat/hot-reload-miner-spend
2 parents 690bb17 + 3a935b5 commit aa98342

File tree

12 files changed

+191
-33
lines changed

12 files changed

+191
-33
lines changed

CHANGELOG.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,29 @@ and this project adheres to the versioning scheme outlined in the [README.md](RE
99

1010
## Added
1111

12+
- Add `disable_retries` mode for events_observer disabling automatic retry on error
13+
14+
## Changed
15+
16+
- Implement faster cost tracker for default cost functions in Clarity
17+
- By default, miners will wait for a new tenure to start for a configurable amount of time after receiving a burn block before
18+
submitting a block commit. This will reduce the amount of RBF transactions miners are expected to need.
19+
- Add weight threshold and percentages to `StackerDBListener` logs
20+
21+
## [3.1.0.0.6]
22+
23+
## Added
24+
1225
- The `BlockProposal` StackerDB message serialization struct now includes a `server_version` string, which represents the version of the node that the miner is using. ([#5803](https://github.com/stacks-network/stacks-core/pull/5803))
1326
- Add `vrf_seed` to the `/v3/sortitions` rpc endpoint
1427
- Added hot-reloading of `burnchain.burn_fee_cap` from a miner's config file ([#5857](https://github.com/stacks-network/stacks-core/pull/5857))
1528

1629
### Changed
1730

18-
- Implement faster cost tracker for default cost functions in Clarity
1931
- Miner will stop waiting for signatures on a block if the Stacks tip advances (causing the block it had proposed to be invalid).
20-
- By default, miners will wait for a new tenure to start for a configurable amount of time after receiving a burn block before
21-
submitting a block commit. This will reduce the amount of RBF transactions miners are expected to need.
2232
- Logging improvements:
2333
- P2P logs now includes a reason for dropping a peer or neighbor
2434
- Improvements to how a PeerAddress is logged (human readable format vs hex)
25-
- Add weight threshold and percentages to `StackerDBListener` logs
2635

2736
### Fixed
2837

clarity/src/vm/costs/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,7 @@ impl DefaultVersion {
217217
};
218218

219219
CostErrors::CostComputationFailed(format!(
220-
"Error evaluating result of cost function {}: {e}",
221-
&cost_function_ref.function_name
220+
"Error evaluating result of cost function {cost_function_ref}: {e}",
222221
))
223222
})
224223
}

libsigner/src/v0/messages.rs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1330,7 +1330,9 @@ impl StacksMessageCodec for RejectReason {
13301330
}
13311331

13321332
fn consensus_deserialize<R: Read>(fd: &mut R) -> Result<Self, CodecError> {
1333-
let type_prefix_byte = read_next::<u8, _>(fd)?;
1333+
let Ok(type_prefix_byte) = read_next::<u8, _>(fd) else {
1334+
return Ok(RejectReason::Unknown(RejectReasonPrefix::Unknown as u8));
1335+
};
13341336
let type_prefix = RejectReasonPrefix::from(type_prefix_byte);
13351337
let code = match type_prefix {
13361338
RejectReasonPrefix::ValidationFailed => RejectReason::ValidationFailed(
@@ -1963,4 +1965,20 @@ mod test {
19631965
assert_eq!(block_accepted.signature, block_accepted_old.signature);
19641966
assert_eq!(block_accepted.metadata, block_accepted_old.metadata);
19651967
}
1968+
1969+
#[test]
1970+
fn test_deserialize_old_block_response() {
1971+
// Fixture of an older version of a block response that has a tenure_extend_timestamp
1972+
// but _not_ a reject_reason.
1973+
let hex_str = "01006dc371d2313be71f93ac759f3302e5a0e4ff77dd0e73f13bb491936b5489d5390032208fc53bd0984c84abaac44ecd777e473e3e325066217e9d7314baa5cdfe1847363e1036f364b4bf7982f4d103079b17c19bf8a19904e822c2d62a5021c19700000036737461636b732d7369676e657220302e302e3120283a2c2072656c65617365206275696c642c206c696e7578205b7838365f36345d290200000008000000006751c76e";
1974+
let bytes = hex_bytes(hex_str).unwrap();
1975+
let block_response = read_next::<SignerMessage, _>(&mut &bytes[..]).unwrap();
1976+
let SignerMessage::BlockResponse(BlockResponse::Accepted(accepted)) = block_response else {
1977+
panic!("Expected BlockResponse::Accepted");
1978+
};
1979+
assert_eq!(
1980+
accepted.response_data.reject_reason,
1981+
RejectReason::Unknown(RejectReasonPrefix::Unknown as u8)
1982+
);
1983+
}
19661984
}

stacks-signer/CHANGELOG.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@ and this project adheres to the versioning scheme outlined in the [README.md](RE
77

88
## [Unreleased]
99

10+
## Changed
11+
12+
- Add new reject codes to the signer response for better visibility into why a block was rejected.
13+
- When allowing a reorg within the `reorg_attempts_activity_timeout_ms`, the signer will now watch the responses from other signers and if >30% of them reject this reorg attempt, then the signer will mark the miner as invalid, reject further attempts to reorg and allow the previous miner to extend their tenure.
14+
15+
### Fixed
16+
17+
- The signer runloop no longer relies on pubkey reports from the SignerDB event system. This previously led to improper proposal rejections via #5858.
18+
19+
## [3.1.0.0.6.0]
20+
1021
## Added
1122

1223
- Introduced the `reorg_attempts_activity_timeout_ms` configuration option for signers which is used to determine the length of time after the last block of a tenure is confirmed that an incoming miner's attempts to reorg it are considered valid miner activity.
@@ -17,12 +28,6 @@ and this project adheres to the versioning scheme outlined in the [README.md](RE
1728
- Increase default `block_proposal_timeout_ms` from 10 minutes to 4 hours. Until #5729 is implemented, there is no value in rejecting a late block from a miner, since a late block is better than no block at all.
1829
- Signers no longer view any block proposal by a miner in their DB as indicative of valid miner activity.
1930
- Various index improvements to the signer's database to improve performance.
20-
- Add new reject codes to the signer response for better visibility into why a block was rejected.
21-
- When allowing a reorg within the `reorg_attempts_activity_timeout_ms`, the signer will now watch the responses from other signers and if >30% of them reject this reorg attempt, then the signer will mark the miner as invalid, reject further attempts to reorg and allow the previous miner to extend their tenure.
22-
23-
### Fixed
24-
25-
- The signer runloop no longer relies on pubkey reports from the SignerDB event system. This previously led to improper proposal rejections via #5858.
2631

2732
## [3.1.0.0.5.0]
2833

stackslib/src/clarity_vm/tests/costs.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -892,7 +892,12 @@ fn eval_cost_fn(
892892
.eval_read_only(&boot_costs_id, &exec)
893893
.map(|(value, _, _)| Some(value));
894894

895-
parse_cost(cost_fn_name, exec_result)
895+
let clarity_cost_fn_ref = ClarityCostFunctionReference {
896+
contract_id: boot_costs_id,
897+
function_name: cost_fn_name.to_string(),
898+
};
899+
900+
parse_cost(&clarity_cost_fn_ref.to_string(), exec_result)
896901
}
897902

898903
fn eval_replaced_cost_fn(

stackslib/src/config/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -915,6 +915,7 @@ impl Config {
915915
endpoint: observer.endpoint,
916916
events_keys,
917917
timeout_ms: observer.timeout_ms.unwrap_or(1_000),
918+
disable_retries: observer.disable_retries.unwrap_or(false),
918919
});
919920
}
920921
observers
@@ -928,6 +929,7 @@ impl Config {
928929
endpoint: val,
929930
events_keys: vec![EventKeyType::AnyEvent],
930931
timeout_ms: 1_000,
932+
disable_retries: false,
931933
});
932934
};
933935

@@ -2824,13 +2826,15 @@ pub struct EventObserverConfigFile {
28242826
pub endpoint: String,
28252827
pub events_keys: Vec<String>,
28262828
pub timeout_ms: Option<u64>,
2829+
pub disable_retries: Option<bool>,
28272830
}
28282831

28292832
#[derive(Clone, Default, Debug, Hash, PartialEq, Eq, PartialOrd)]
28302833
pub struct EventObserverConfig {
28312834
pub endpoint: String,
28322835
pub events_keys: Vec<EventKeyType>,
28332836
pub timeout_ms: u64,
2837+
pub disable_retries: bool,
28342838
}
28352839

28362840
#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd)]

0 commit comments

Comments
 (0)