Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: Merge master to develop #4655

Merged
merged 9 commits into from
Apr 8, 2024
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ The changelog for this release is a high-level summary of these SIPs.
### Added

- Added prometheus output for "transactions in last block" (#3138).
- Added envrionement variable STACKS_LOG_FORMAT_TIME to set the time format
- Added environment variable STACKS_LOG_FORMAT_TIME to set the time format
stacks-node uses for logging. (#3219)
Example: STACKS_LOG_FORMAT_TIME="%Y-%m-%d %H:%M:%S" cargo stacks-node
- Added mock-miner sample config (#3225)
Expand Down
12 changes: 5 additions & 7 deletions stackslib/src/net/stackerdb/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,9 @@ impl<NC: NeighborComms> StackerDBSync<NC> {
.get_slot_write_timestamps(&self.smart_contract_id)?;

if local_slot_versions.len() != local_write_timestamps.len() {
// interleaved DB write?
return Err(net_error::Transient(
"Interleaved DB write has led to an inconsistent view of the stackerdb. Try again."
.into(),
));
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());
warn!("{}", &msg);
return Err(net_error::Transient(msg));
Comment on lines -252 to +254
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jcnelson can you confirm that the master versions of the stackerdb::sync changes should be preferred here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

}

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

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

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

Expand Down
2 changes: 1 addition & 1 deletion stackslib/src/util_lib/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ pub fn get_ancestor_block_hash<T: MarfTrieId>(
block_height: u64,
tip_block_hash: &T,
) -> Result<Option<T>, Error> {
assert!(block_height < u32::MAX as u64);
assert!(block_height <= u32::MAX as u64);
let mut read_only = index.reopen_readonly()?;
let bh = read_only.get_block_at_height(block_height as u32, tip_block_hash)?;
Ok(bh)
Expand Down