stacks-core icon indicating copy to clipboard operation
stacks-core copied to clipboard

Fix/3285

Open jcnelson opened this issue 1 year ago • 3 comments

Fixes #3285, as well as another error in which an attempt to check the chain work from the genesis block can cause a subtract-with-underflow panic.

jcnelson avatar Sep 12 '22 18:09 jcnelson

Codecov Report

Merging #3286 (57a914a) into next (1b19aa0) will increase coverage by 0.14%. The diff coverage is 39.77%.

@@            Coverage Diff             @@
##             next    #3286      +/-   ##
==========================================
+ Coverage   29.35%   29.49%   +0.14%     
==========================================
  Files         278      278              
  Lines      229613   229688      +75     
==========================================
+ Hits        67400    67749     +349     
+ Misses     162213   161939     -274     
Impacted Files Coverage Δ
src/burnchains/bitcoin/indexer.rs 16.11% <13.63%> (-0.26%) :arrow_down:
testnet/stacks-node/src/tests/neon_integrations.rs 83.39% <48.48%> (+1.71%) :arrow_up:
...ommon/src/deps_common/bitcoin/network/serialize.rs 28.00% <0.00%> (-5.00%) :arrow_down:
clarity/src/vm/functions/options.rs 57.71% <0.00%> (-2.29%) :arrow_down:
src/burnchains/bitcoin/mod.rs 36.61% <0.00%> (-1.41%) :arrow_down:
stacks-common/src/types/mod.rs 79.67% <0.00%> (-0.82%) :arrow_down:
clarity/src/vm/analysis/type_checker/mod.rs 74.00% <0.00%> (-0.47%) :arrow_down:
src/util_lib/strings.rs 41.28% <0.00%> (-0.36%) :arrow_down:
clarity/src/vm/mod.rs 57.50% <0.00%> (-0.26%) :arrow_down:
... and 29 more

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

codecov[bot] avatar Sep 12 '22 18:09 codecov[bot]

Is this bug present in develop and master as well? Looking at the patch, it doesn't seem like this is specific to 2.1

kantai avatar Sep 14 '22 15:09 kantai

It is, but it's very unlikely to manifest. You'd have to boot up a node right at the end of a difficulty adjustment period (it seems to only manifest on boot-up). So, you'd expect to see it for a 10-minute interval twice a month. Also, the problem goes away just by waiting for the next Bitcoin block and trying again.

jcnelson avatar Sep 14 '22 15:09 jcnelson

I can confirm this fix works in my testing environment.

zone117x avatar Sep 28 '22 10:09 zone117x