Skip to content

Commit

Permalink
Merge pull request #5557 from stacks-network/release/3.1.0.0.1
Browse files Browse the repository at this point in the history
merge Release/3.1.0.0.1 to master
  • Loading branch information
wileyj authored Dec 11, 2024
2 parents b0d9179 + b108d09 commit 70d24ea
Show file tree
Hide file tree
Showing 61 changed files with 3,199 additions and 1,292 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/bitcoin-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ jobs:
- tests::signer::v0::signer_set_rollover
- tests::signer::v0::signing_in_0th_tenure_of_reward_cycle
- tests::signer::v0::continue_after_tenure_extend
- tests::signer::v0::tenure_extend_after_idle
- tests::signer::v0::stx_transfers_dont_effect_idle_timeout
- tests::signer::v0::idle_tenure_extend_active_mining
- tests::signer::v0::multiple_miners_with_custom_chain_id
- tests::signer::v0::block_commit_delay
- tests::signer::v0::continue_after_fast_block_no_sortition
Expand Down
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,23 @@ and this project adheres to the versioning scheme outlined in the [README.md](RE

### Changed

## [3.1.0.0.1]

### Added

- 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))

### Changed

## [3.1.0.0.0]

### Added

- **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)
- **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)
- New RPC endpoints
- `/v2/clarity/marf/:marf_key_hash`
- `/v2/clarity/metadata/:principal/:contract_name/:clarity_metadata_key`
- 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))

### Changed

Expand Down
2 changes: 1 addition & 1 deletion clarity/src/vm/ast/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ mod test {
) -> std::result::Result<ExecutionCost, CostErrors> {
self.invoked_functions.push((cost_f, input.to_vec()));
self.invocation_count += 1;
Ok(ExecutionCost::zero())
Ok(ExecutionCost::ZERO)
}
fn add_cost(&mut self, _cost: ExecutionCost) -> std::result::Result<(), CostErrors> {
self.cost_addition_count += 1;
Expand Down
30 changes: 16 additions & 14 deletions clarity/src/vm/costs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ impl CostTracker for () {
_cost_function: ClarityCostFunction,
_input: &[u64],
) -> std::result::Result<ExecutionCost, CostErrors> {
Ok(ExecutionCost::zero())
Ok(ExecutionCost::ZERO)
}
fn add_cost(&mut self, _cost: ExecutionCost) -> std::result::Result<(), CostErrors> {
Ok(())
Expand Down Expand Up @@ -707,7 +707,7 @@ impl LimitedCostTracker {
contract_call_circuits: HashMap::new(),
limit,
memory_limit: CLARITY_MEMORY_LIMIT,
total: ExecutionCost::zero(),
total: ExecutionCost::ZERO,
memory: 0,
epoch,
mainnet,
Expand All @@ -731,7 +731,7 @@ impl LimitedCostTracker {
contract_call_circuits: HashMap::new(),
limit,
memory_limit: CLARITY_MEMORY_LIMIT,
total: ExecutionCost::zero(),
total: ExecutionCost::ZERO,
memory: 0,
epoch,
mainnet,
Expand Down Expand Up @@ -880,7 +880,7 @@ impl LimitedCostTracker {
pub fn get_total(&self) -> ExecutionCost {
match self {
Self::Limited(TrackerData { total, .. }) => total.clone(),
Self::Free => ExecutionCost::zero(),
Self::Free => ExecutionCost::ZERO,
}
}
#[allow(clippy::panic)]
Expand Down Expand Up @@ -1050,7 +1050,7 @@ impl CostTracker for LimitedCostTracker {
match self {
Self::Free => {
// tracker is free, return zero!
return Ok(ExecutionCost::zero());
return Ok(ExecutionCost::ZERO);
}
Self::Limited(ref mut data) => {
if cost_function == ClarityCostFunction::Unimplemented {
Expand Down Expand Up @@ -1195,15 +1195,13 @@ impl CostOverflowingMath<u64> for u64 {
}

impl ExecutionCost {
pub fn zero() -> ExecutionCost {
Self {
runtime: 0,
write_length: 0,
read_count: 0,
write_count: 0,
read_length: 0,
}
}
pub const ZERO: Self = Self {
runtime: 0,
write_length: 0,
read_count: 0,
write_count: 0,
read_length: 0,
};

/// Returns the percentage of self consumed in `numerator`'s largest proportion dimension.
pub fn proportion_largest_dimension(&self, numerator: &ExecutionCost) -> u64 {
Expand Down Expand Up @@ -1328,6 +1326,10 @@ impl ExecutionCost {
read_length: first.read_length.max(second.read_length),
}
}

pub fn is_zero(&self) -> bool {
*self == Self::ZERO
}
}

// ONLY WORKS IF INPUT IS u64
Expand Down
Loading

0 comments on commit 70d24ea

Please sign in to comment.