Skip to content

Commit 6e4ce40

Browse files
committed
Merge branch 'develop' of https://github.com/stacks-network/stacks-core into fix/signers-verify-reward-cycle
2 parents 6282ad9 + a70b3d5 commit 6e4ce40

File tree

40 files changed

+212
-169
lines changed

40 files changed

+212
-169
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ and this project adheres to the versioning scheme outlined in the [README.md](RE
1010
### Added
1111

1212
- Add `tenure_timeout_secs` to the miner for determining when a time-based tenure extend should be attempted.
13+
- Added configuration option `block_proposal_max_age_secs` under `[connection_options]` to prevent processing stale block proposals
1314

1415
### Changed
16+
- The RPC endpoint `/v3/block_proposal` no longer will evaluate block proposals more than `block_proposal_max_age_secs` old
1517

1618
- When a transaction is dropped due to replace-by-fee, the `/drop_mempool_tx` event observer payload now includes `new_txid`, which is the transaction that replaced this dropped transaction. When a transaction is dropped for other reasons, `new_txid` is `null`. [#5381](https://github.com/stacks-network/stacks-core/pull/5381)
1719
- Nodes will assume that all PoX anchor blocks exist by default, and stall initial block download indefinitely to await their arrival (#5502)

sample/conf/testnet-follower-conf.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ start_height = 6
7777

7878
[[burnchain.epochs]]
7979
epoch_name = "3.0"
80-
start_height = 56_457
80+
start_height = 1900
8181

8282
[[burnchain.epochs]]
8383
epoch_name = "3.1"
84-
start_height = 77_770
84+
start_height = 2000

sample/conf/testnet-miner-conf.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ start_height = 6
7373

7474
[[burnchain.epochs]]
7575
epoch_name = "3.0"
76-
start_height = 56_457
76+
start_height = 1900
7777

7878
[[burnchain.epochs]]
7979
epoch_name = "3.1"
80-
start_height = 77_770
80+
start_height = 2000

sample/conf/testnet-signer.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,8 @@ start_height = 6
7575

7676
[[burnchain.epochs]]
7777
epoch_name = "3.0"
78-
start_height = 56_457
78+
start_height = 1900
79+
80+
[[burnchain.epochs]]
81+
epoch_name = "3.1"
82+
start_height = 2000

stacks-signer/src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ use std::path::PathBuf;
2121
use std::time::Duration;
2222

2323
use blockstack_lib::chainstate::stacks::TransactionVersion;
24+
use blockstack_lib::net::connection::DEFAULT_BLOCK_PROPOSAL_MAX_AGE_SECS;
2425
use clarity::util::hash::to_hex;
2526
use libsigner::SignerEntries;
2627
use serde::Deserialize;
@@ -39,7 +40,6 @@ const BLOCK_PROPOSAL_VALIDATION_TIMEOUT_MS: u64 = 120_000;
3940
const DEFAULT_FIRST_PROPOSAL_BURN_BLOCK_TIMING_SECS: u64 = 60;
4041
const DEFAULT_TENURE_LAST_BLOCK_PROPOSAL_TIMEOUT_SECS: u64 = 30;
4142
const TENURE_IDLE_TIMEOUT_SECS: u64 = 300;
42-
const DEFAULT_BLOCK_PROPOSAL_MAX_AGE_SECS: u64 = 600;
4343

4444
#[derive(thiserror::Error, Debug)]
4545
/// An error occurred parsing the provided configuration

stackslib/src/burnchains/bitcoin/blocks.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,7 @@ impl BitcoinMessageHandler for BitcoinBlockDownloader {
150150
None => panic!("No block header set"),
151151
Some(ref ipc_header) => {
152152
let block_hash = ipc_header.block_header.header.bitcoin_hash().clone();
153-
indexer
154-
.send_getdata(&vec![block_hash])
155-
.and_then(|_r| Ok(true))
153+
indexer.send_getdata(&vec![block_hash]).map(|_r| true)
156154
}
157155
}
158156
}

stackslib/src/burnchains/bitcoin/indexer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ impl BitcoinIndexer {
458458
}
459459
spv_client
460460
.run(self)
461-
.and_then(|_r| Ok(spv_client.end_block_height.unwrap()))
461+
.map(|_r| spv_client.end_block_height.unwrap())
462462
}
463463

464464
#[cfg(test)]

stackslib/src/burnchains/bitcoin/network.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,16 +127,16 @@ impl BitcoinIndexer {
127127
// classify the message here, so we can pass it along to the handler explicitly
128128
match message {
129129
btc_message::NetworkMessage::Version(..) => {
130-
return self.handle_version(message).and_then(|_r| Ok(true));
130+
return self.handle_version(message).map(|_r| true);
131131
}
132132
btc_message::NetworkMessage::Verack => {
133-
return self.handle_verack(message).and_then(|_r| Ok(true));
133+
return self.handle_verack(message).map(|_r| true);
134134
}
135135
btc_message::NetworkMessage::Ping(..) => {
136-
return self.handle_ping(message).and_then(|_r| Ok(true));
136+
return self.handle_ping(message).map(|_r| true);
137137
}
138138
btc_message::NetworkMessage::Pong(..) => {
139-
return self.handle_pong(message).and_then(|_r| Ok(true));
139+
return self.handle_pong(message).map(|_r| true);
140140
}
141141
_ => match handler {
142142
Some(custom_handler) => custom_handler.handle_message(self, message),

stackslib/src/burnchains/bitcoin/spv.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ impl SpvClient {
274274
tx.execute("UPDATE db_config SET version = ?1", &[version])
275275
.map_err(db_error::SqliteError)
276276
.map_err(|e| e.into())
277-
.and_then(|_| Ok(()))
277+
.map(|_| ())
278278
}
279279

280280
#[cfg(test)]
@@ -354,7 +354,7 @@ impl SpvClient {
354354
pub fn is_initialized(&self) -> Result<(), btc_error> {
355355
fs::metadata(&self.headers_path)
356356
.map_err(btc_error::FilesystemError)
357-
.and_then(|_m| Ok(()))
357+
.map(|_m| ())
358358
}
359359

360360
/// Get the block range to scan
@@ -762,7 +762,7 @@ impl SpvClient {
762762

763763
tx.execute(sql, args)
764764
.map_err(|e| btc_error::DBError(db_error::SqliteError(e)))
765-
.and_then(|_x| Ok(()))
765+
.map(|_x| ())
766766
}
767767

768768
/// Initialize the block headers file with the genesis block hash.
@@ -1231,7 +1231,7 @@ impl BitcoinMessageHandler for SpvClient {
12311231

12321232
indexer.runtime.last_getheaders_send_time = get_epoch_time_secs();
12331233
self.send_next_getheaders(indexer, start_height)
1234-
.and_then(|_r| Ok(true))
1234+
.map(|_r| true)
12351235
}
12361236

12371237
/// Trait message handler
@@ -1298,7 +1298,7 @@ impl BitcoinMessageHandler for SpvClient {
12981298
);
12991299
}
13001300
self.send_next_getheaders(indexer, block_height)
1301-
.and_then(|_| Ok(true))
1301+
.map(|_| true)
13021302
}
13031303
x => Err(btc_error::UnhandledMessage(x)),
13041304
}

stackslib/src/burnchains/tests/affirmation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ pub fn make_reward_cycle_with_vote(
413413
new_commits.push(commits.clone());
414414
commits
415415
.into_iter()
416-
.filter_map(|cmt| cmt)
416+
.flatten()
417417
.map(|cmt| BlockstackOperationType::LeaderBlockCommit(cmt))
418418
.collect()
419419
};

0 commit comments

Comments
 (0)