Skip to content

Commit 7b61252

Browse files
authored
Merge pull request #2482 from blockstack/fix/preserve-parent-anchored-block
do NOT delete the parent anchored block if the microblock stream is too heavy
2 parents 797afe9 + 799b36a commit 7b61252

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ 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 [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [2.0.7] - 2021-02-26
9+
10+
This is an emergency hotfix that prevents the node from accidentally deleting
11+
valid block data if its descendant microblock stream is invalid for some reason.
12+
13+
## Fixed
14+
15+
- Do not delete a valid parent Stacks block.
16+
817
## [2.0.6] - 2021-02-15
918

1019
The database schema has not changed since 2.0.5, so when spinning up a

src/chainstate/stacks/db/blocks.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2333,18 +2333,6 @@ impl StacksChainState {
23332333

23342334
tx.execute(&update_block_children_sql, &update_block_children_args)
23352335
.map_err(|e| Error::DBError(db_error::SqliteError(e)))?;
2336-
2337-
// mark the block as empty if we haven't already
2338-
let block_path =
2339-
StacksChainState::get_block_path(blocks_path, consensus_hash, anchored_block_hash)?;
2340-
match fs::metadata(&block_path) {
2341-
Ok(_) => {
2342-
StacksChainState::free_block(blocks_path, consensus_hash, anchored_block_hash);
2343-
}
2344-
Err(_) => {
2345-
StacksChainState::atomic_file_write(&block_path, &vec![])?;
2346-
}
2347-
}
23482336
}
23492337

23502338
Ok(())

0 commit comments

Comments
 (0)