File tree Expand file tree Collapse file tree 3 files changed +27
-8
lines changed Expand file tree Collapse file tree 3 files changed +27
-8
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file.
55The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ ) ,
66and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
77
8+ ## [ 2.0.8] - 2021-03-02
9+
10+ This is a hotfix release for improved handling of static analysis storage and
11+ improved ` at-block ` behavior. The chainstate directory of 2.0.8 is compatible with
12+ the 2.0.7 chainstate.
13+
14+ ## Fixed
15+
16+ - Improved static analysis storage
17+ - ` at-block ` behavior in ` clarity-cli ` and unit tests (no changes in ` stacks-node `
18+ behavior).
19+
820## [ 2.0.7] - 2021-02-26
921
1022This is an emergency hotfix that prevents the node from accidentally deleting
Original file line number Diff line number Diff line change @@ -1039,7 +1039,13 @@ impl StacksChainState {
10391039 . expect ( "BUG: total block cost decreased" ) ;
10401040
10411041 let ( asset_map, events) = match initialize_resp {
1042- Ok ( x) => x,
1042+ Ok ( x) => {
1043+ // store analysis -- if this fails, then the have some pretty bad problems
1044+ clarity_tx
1045+ . save_analysis ( & contract_id, & contract_analysis)
1046+ . expect ( "FATAL: failed to store contract analysis" ) ;
1047+ x
1048+ }
10431049 Err ( e) => match handle_clarity_runtime_error ( e) {
10441050 ClarityRuntimeTxError :: Acceptable { error, err_type } => {
10451051 info ! ( "Smart-contract processed with {}" , err_type;
@@ -1076,11 +1082,6 @@ impl StacksChainState {
10761082 } ,
10771083 } ;
10781084
1079- // store analysis -- if this fails, then the have some pretty bad problems
1080- clarity_tx
1081- . save_analysis ( & contract_id, & contract_analysis)
1082- . expect ( "FATAL: failed to store contract analysis" ) ;
1083-
10841085 let receipt = StacksTransactionReceipt :: from_smart_contract (
10851086 tx. clone ( ) ,
10861087 events,
Original file line number Diff line number Diff line change @@ -310,8 +310,14 @@ impl<'a> RollbackWrapper<'a> {
310310 bhh : StacksBlockId ,
311311 query_pending_data : bool ,
312312 ) -> Result < StacksBlockId > {
313- self . query_pending_data = query_pending_data;
314- self . store . set_block_hash ( bhh)
313+ self . store . set_block_hash ( bhh) . and_then ( |x| {
314+ // use and_then so that query_pending_data is only set once set_block_hash succeeds
315+ // this doesn't matter in practice, because a set_block_hash failure always aborts
316+ // the transaction with a runtime error (destroying its environment), but it's much
317+ // better practice to do this, especially if the abort behavior changes in the future.
318+ self . query_pending_data = query_pending_data;
319+ Ok ( x)
320+ } )
315321 }
316322
317323 /// this function will only return commitment proofs for values _already_ materialized
You can’t perform that action at this time.
0 commit comments