Skip to content

Commit 70d24ea

Browse files
authored
Merge pull request #5557 from stacks-network/release/3.1.0.0.1
merge Release/3.1.0.0.1 to master
2 parents b0d9179 + b108d09 commit 70d24ea

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+3199
-1292
lines changed

.github/workflows/bitcoin-tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ jobs:
122122
- tests::signer::v0::signer_set_rollover
123123
- tests::signer::v0::signing_in_0th_tenure_of_reward_cycle
124124
- tests::signer::v0::continue_after_tenure_extend
125+
- tests::signer::v0::tenure_extend_after_idle
126+
- tests::signer::v0::stx_transfers_dont_effect_idle_timeout
127+
- tests::signer::v0::idle_tenure_extend_active_mining
125128
- tests::signer::v0::multiple_miners_with_custom_chain_id
126129
- tests::signer::v0::block_commit_delay
127130
- tests::signer::v0::continue_after_fast_block_no_sortition

CHANGELOG.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,23 @@ and this project adheres to the versioning scheme outlined in the [README.md](RE
1111

1212
### Changed
1313

14+
## [3.1.0.0.1]
15+
16+
### Added
17+
18+
- A miner will now generate a tenure-extend when at least 70% of the signers have confirmed that they are willing to allow one, via the new timestamp included in block responses. This allows the miner to refresh its budget in between Bitcoin blocks. ([#5476](https://github.com/stacks-network/stacks-core/discussions/5476))
19+
20+
### Changed
21+
1422
## [3.1.0.0.0]
1523

1624
### Added
1725

18-
- **SIP-029 consensus rules, activating in epoch 3.1 at block 875,000** (see [SIP-029](https://github.com/will-corcoran/sips/blob/feat/sip-029-halving-alignment/sips/sip-029/sip-029-halving-alignment.md) for details)
26+
- **SIP-029 consensus rules, activating in epoch 3.1 at block 875,000** (see [SIP-029](https://github.com/stacksgov/sips/blob/main/sips/sip-029/sip-029-halving-alignment.md) for details)
1927
- New RPC endpoints
2028
- `/v2/clarity/marf/:marf_key_hash`
2129
- `/v2/clarity/metadata/:principal/:contract_name/:clarity_metadata_key`
30+
- When a proposed block is validated by a node, the block can be validated even when the block version is different than the node's default ([#5539](https://github.com/stacks-network/stacks-core/pull/5539))
2231

2332
### Changed
2433

clarity/src/vm/ast/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ mod test {
353353
) -> std::result::Result<ExecutionCost, CostErrors> {
354354
self.invoked_functions.push((cost_f, input.to_vec()));
355355
self.invocation_count += 1;
356-
Ok(ExecutionCost::zero())
356+
Ok(ExecutionCost::ZERO)
357357
}
358358
fn add_cost(&mut self, _cost: ExecutionCost) -> std::result::Result<(), CostErrors> {
359359
self.cost_addition_count += 1;

clarity/src/vm/costs/mod.rs

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ impl CostTracker for () {
140140
_cost_function: ClarityCostFunction,
141141
_input: &[u64],
142142
) -> std::result::Result<ExecutionCost, CostErrors> {
143-
Ok(ExecutionCost::zero())
143+
Ok(ExecutionCost::ZERO)
144144
}
145145
fn add_cost(&mut self, _cost: ExecutionCost) -> std::result::Result<(), CostErrors> {
146146
Ok(())
@@ -707,7 +707,7 @@ impl LimitedCostTracker {
707707
contract_call_circuits: HashMap::new(),
708708
limit,
709709
memory_limit: CLARITY_MEMORY_LIMIT,
710-
total: ExecutionCost::zero(),
710+
total: ExecutionCost::ZERO,
711711
memory: 0,
712712
epoch,
713713
mainnet,
@@ -731,7 +731,7 @@ impl LimitedCostTracker {
731731
contract_call_circuits: HashMap::new(),
732732
limit,
733733
memory_limit: CLARITY_MEMORY_LIMIT,
734-
total: ExecutionCost::zero(),
734+
total: ExecutionCost::ZERO,
735735
memory: 0,
736736
epoch,
737737
mainnet,
@@ -880,7 +880,7 @@ impl LimitedCostTracker {
880880
pub fn get_total(&self) -> ExecutionCost {
881881
match self {
882882
Self::Limited(TrackerData { total, .. }) => total.clone(),
883-
Self::Free => ExecutionCost::zero(),
883+
Self::Free => ExecutionCost::ZERO,
884884
}
885885
}
886886
#[allow(clippy::panic)]
@@ -1050,7 +1050,7 @@ impl CostTracker for LimitedCostTracker {
10501050
match self {
10511051
Self::Free => {
10521052
// tracker is free, return zero!
1053-
return Ok(ExecutionCost::zero());
1053+
return Ok(ExecutionCost::ZERO);
10541054
}
10551055
Self::Limited(ref mut data) => {
10561056
if cost_function == ClarityCostFunction::Unimplemented {
@@ -1195,15 +1195,13 @@ impl CostOverflowingMath<u64> for u64 {
11951195
}
11961196

11971197
impl ExecutionCost {
1198-
pub fn zero() -> ExecutionCost {
1199-
Self {
1200-
runtime: 0,
1201-
write_length: 0,
1202-
read_count: 0,
1203-
write_count: 0,
1204-
read_length: 0,
1205-
}
1206-
}
1198+
pub const ZERO: Self = Self {
1199+
runtime: 0,
1200+
write_length: 0,
1201+
read_count: 0,
1202+
write_count: 0,
1203+
read_length: 0,
1204+
};
12071205

12081206
/// Returns the percentage of self consumed in `numerator`'s largest proportion dimension.
12091207
pub fn proportion_largest_dimension(&self, numerator: &ExecutionCost) -> u64 {
@@ -1328,6 +1326,10 @@ impl ExecutionCost {
13281326
read_length: first.read_length.max(second.read_length),
13291327
}
13301328
}
1329+
1330+
pub fn is_zero(&self) -> bool {
1331+
*self == Self::ZERO
1332+
}
13311333
}
13321334

13331335
// ONLY WORKS IF INPUT IS u64

0 commit comments

Comments
 (0)