Skip to content

Commit eef1647

Browse files
authored
Merge pull request #7080 from stacks-network/release/3.4.0.0.1
Release/3.4.0.0.1 into master
2 parents d42ab0f + 48638ef commit eef1647

12 files changed

Lines changed: 131 additions & 16 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to the versioning scheme outlined in the [README.md](README.md).
77

8+
## [3.4.0.0.1]
9+
10+
### Fixed
11+
12+
- Fix a bug that could cause genesis sync to stall forever due to a slow path in computing the canonical Stacks tip getting triggerred when the Stacks tip is significantly behind the sortition tip.
13+
- Validate PoX addresses.
14+
- Fix the 3.4 activation height in sample testnet configs.
15+
816
## [3.4.0.0.0]
917

1018
### Added

changelog.d/7000-genesis-sync-stuck.fixed

Lines changed: 0 additions & 1 deletion
This file was deleted.

sample/conf/testnet-follower-conf.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,4 @@ start_height = 109280
115115

116116
[[burnchain.epochs]]
117117
epoch_name = "3.4"
118-
start_height = 159645
118+
start_height = 159350

sample/conf/testnet-miner-conf.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,4 +150,4 @@ start_height = 109280
150150

151151
[[burnchain.epochs]]
152152
epoch_name = "3.4"
153-
start_height = 159645
153+
start_height = 159350

sample/conf/testnet-signer.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,4 +118,4 @@ start_height = 109280
118118

119119
[[burnchain.epochs]]
120120
epoch_name = "3.4"
121-
start_height = 159645
121+
start_height = 159350

stacks-node/src/tests/nakamoto_integrations.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,10 @@ where
767767
Ok(())
768768
}
769769

770+
/// Wait until check returns Ok(true), if check ever returns an Err(), this
771+
/// method will immediately return that Err().
772+
///
773+
/// After timeout_seconds have passed, this function returns `Err("Timed out")`
770774
pub fn wait_for<F>(timeout_secs: u64, mut check: F) -> Result<(), String>
771775
where
772776
F: FnMut() -> Result<bool, String>,

stacks-node/src/tests/signer/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1794,6 +1794,7 @@ fn setup_stx_btc_node<G: FnMut(&mut NeonConfig)>(
17941794
EventKeyType::BlockProposal,
17951795
EventKeyType::MinedBlocks,
17961796
EventKeyType::BurnchainBlocks,
1797+
EventKeyType::MemPoolTransactions,
17971798
],
17981799
timeout_ms: 1000,
17991800
disable_retries: false,

stacks-signer/src/client/stacks_client.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,11 @@ impl StacksClient {
473473
&self,
474474
reward_cycle: u64,
475475
) -> Result<Option<Vec<NakamotoSignerEntry>>, ClientError> {
476+
Ok(self.get_reward_set(reward_cycle)?.stacker_set.signers)
477+
}
478+
479+
/// Get the reward set signers from the stacks node for the given reward cycle
480+
pub fn get_reward_set(&self, reward_cycle: u64) -> Result<GetStackersResponse, ClientError> {
476481
debug!("StacksClient: Getting reward set signers";
477482
"reward_cycle" => reward_cycle,
478483
);
@@ -506,7 +511,7 @@ impl StacksClient {
506511
let stackers_response =
507512
retry_with_exponential_backoff::<_, ClientError, GetStackersResponse>(send_request)?;
508513
timer.stop_and_record();
509-
Ok(stackers_response.stacker_set.signers)
514+
Ok(stackers_response)
510515
}
511516

512517
/// Retrieve the current pox data from the stacks node

stackslib/src/chainstate/nakamoto/miner.rs

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
// You should have received a copy of the GNU General Public License
1515
// along with this program. If not, see <http://www.gnu.org/licenses/>.
1616

17+
use clarity::vm::clarity::ClarityError;
1718
use clarity::vm::costs::ExecutionCost;
1819
use stacks_common::types::chainstate::{
1920
BlockHeaderHash, BurnchainHeaderHash, ConsensusHash, StacksBlockId,
@@ -853,13 +854,12 @@ impl BlockBuilder for NakamotoBlockBuilder {
853854
};
854855

855856
let quiet = !cfg!(test);
857+
let is_mainnet = clarity_tx.config.mainnet;
856858
let result = {
857859
// preemptively skip problematic transactions
858-
if let Err(e) = Relayer::static_check_problematic_relayed_tx(
859-
clarity_tx.config.mainnet,
860-
clarity_tx.get_epoch(),
861-
tx,
862-
) {
860+
if let Err(e) =
861+
Relayer::static_check_problematic_relayed_tx(is_mainnet, clarity_tx.get_epoch(), tx)
862+
{
863863
info!(
864864
"Detected problematic tx {} while mining; dropping from mempool",
865865
tx.txid()
@@ -874,6 +874,19 @@ impl BlockBuilder for NakamotoBlockBuilder {
874874
quiet,
875875
max_execution_time,
876876
|receipt| {
877+
if !receipt.post_condition_aborted {
878+
let all_events_valid = receipt.events.iter().all(|event| {
879+
crate::net::api::postblock_proposal::is_event_pox_addr_valid(
880+
is_mainnet, event,
881+
)
882+
});
883+
if !all_events_valid {
884+
return Err(Error::ClarityError(ClarityError::BadTransaction(
885+
"All PoX events were not valid".into(),
886+
)));
887+
}
888+
};
889+
877890
let size = receipt.size().ok_or_else(|| {
878891
Error::InvalidStacksBlock("Could not calculate receipt size".into())
879892
})?;

stackslib/src/chainstate/nakamoto/signer_set.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,10 @@ impl RawRewardSetEntry {
6161
})?;
6262

6363
let reward_address = PoxAddress::try_from_pox_tuple(is_mainnet, &pox_addr_tuple)
64-
.ok_or_else(|| {
65-
ChainstateError::Expects(format!("not a valid PoX address: {pox_addr_tuple}"))
66-
})?;
64+
.unwrap_or_else(|| {
65+
warn!("Invalid PoX address supplied, replacing with burn address"; "pox_addr_tuple" => %pox_addr_tuple);
66+
PoxAddress::standard_burn_address(is_mainnet)
67+
});
6768

6869
let total_ustx = tuple_data
6970
.remove("total-ustx")

0 commit comments

Comments
 (0)