Skip to content

Commit c6ce862

Browse files
authored
Merge pull request #4655 from stacks-network/chore/master-to-develop-040824
Chore: Merge master to develop
2 parents 3bd40e2 + 8450bc4 commit c6ce862

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ The changelog for this release is a high-level summary of these SIPs.
363363
### Added
364364

365365
- Added prometheus output for "transactions in last block" (#3138).
366-
- Added envrionement variable STACKS_LOG_FORMAT_TIME to set the time format
366+
- Added environment variable STACKS_LOG_FORMAT_TIME to set the time format
367367
stacks-node uses for logging. (#3219)
368368
Example: STACKS_LOG_FORMAT_TIME="%Y-%m-%d %H:%M:%S" cargo stacks-node
369369
- Added mock-miner sample config (#3225)

stackslib/src/net/stackerdb/sync.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -249,11 +249,9 @@ impl<NC: NeighborComms> StackerDBSync<NC> {
249249
.get_slot_write_timestamps(&self.smart_contract_id)?;
250250

251251
if local_slot_versions.len() != local_write_timestamps.len() {
252-
// interleaved DB write?
253-
return Err(net_error::Transient(
254-
"Interleaved DB write has led to an inconsistent view of the stackerdb. Try again."
255-
.into(),
256-
));
252+
let msg = format!("Local slot versions ({}) out of sync with DB slot versions ({}); abandoning sync and trying again", local_slot_versions.len(), local_write_timestamps.len());
253+
warn!("{}", &msg);
254+
return Err(net_error::Transient(msg));
257255
}
258256

259257
let mut need_chunks: HashMap<usize, (StackerDBGetChunkData, Vec<NeighborAddress>)> =
@@ -277,8 +275,7 @@ impl<NC: NeighborComms> StackerDBSync<NC> {
277275

278276
for (naddr, chunk_inv) in self.chunk_invs.iter() {
279277
if chunk_inv.slot_versions.len() != local_slot_versions.len() {
280-
// need to retry -- our view of the versions got changed through a
281-
// reconfiguration
278+
// remote peer and our DB are out of sync, so just skip this
282279
continue;
283280
}
284281

@@ -365,6 +362,7 @@ impl<NC: NeighborComms> StackerDBSync<NC> {
365362
let mut local_chunk = None;
366363
for (naddr, chunk_inv) in self.chunk_invs.iter() {
367364
if chunk_inv.slot_versions.len() != local_slot_versions.len() {
365+
// remote peer and our DB are out of sync, so just skip this
368366
continue;
369367
}
370368

stackslib/src/util_lib/db.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ pub fn get_ancestor_block_hash<T: MarfTrieId>(
745745
block_height: u64,
746746
tip_block_hash: &T,
747747
) -> Result<Option<T>, Error> {
748-
assert!(block_height < u32::MAX as u64);
748+
assert!(block_height <= u32::MAX as u64);
749749
let mut read_only = index.reopen_readonly()?;
750750
let bh = read_only.get_block_at_height(block_height as u32, tip_block_hash)?;
751751
Ok(bh)

0 commit comments

Comments
 (0)