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
chaincfg+blockchain: abstract/refactor BIP 9 version bits implementation to work w/ BIP 8 block heights #1700
Commits on Jan 25, 2022
-
chaincfg: create new abstract deployment starter/ender interfaces
In this commit, we create a series of new interfaces that'll allow us to abstract "when" exactly a deployment starts and ends. As is, all deployments start/end based on a unix timestamp, which is compared against the MTP of a given block to determine if a new deployment has started or ended. This works fine for BIP 9 which uses time based timeouts, but not so much for BIP 8. In order to prep a future refactor that allows our version bits implementation to support both time and block based start/end times, this new abstraction has been introduced.
Configuration menu - View commit details
-
Copy full SHA for dc4dc15 - Browse repository at this point
Copy the full SHA dc4dc15View commit details -
chaincfg: use DeploymentStarter/DeploymentEnder instead of start/end …
…times In this commit, we utilize the recently added ConsensusDeploymentStarter and ConsensusDeploymentEnder interfaces. Concrete implementations of this interface based on the median time past comparison are used now in the ConsensusDeployment struct instead of hard coded start/end times. Along the way, we had to switch to using the "zero time": time.Time{}, in place of 0 and math.MaxInt64 as comparison (After/Before) seems to be broken in the Go stdlib for times very far in the future. It appears Go isn't ready to handle the heat death of the universe.
Configuration menu - View commit details
-
Copy full SHA for 2b6370d - Browse repository at this point
Copy the full SHA 2b6370dView commit details -
blockchain: update version bits logic to use HasStarted/HasEnded for …
…deployments In this commit, we update our version bits logic to use the newly added HasStarted and HasEnded methods for consensus deployments. Along the way, wee modify the thresholdConditionChecker` interface to be based off the new chaincfg interfaces. In addition, we add a new method `PastMedianTime`, in order to allow the chain itself to be used as a `chaincfg.BlockClock`. This serves to make the logic more generic in order to support both block height and time based soft fork timeouts.
Configuration menu - View commit details
-
Copy full SHA for 298d616 - Browse repository at this point
Copy the full SHA 298d616View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0556c70 - Browse repository at this point
Copy the full SHA 0556c70View commit details -
chainparams: add new DeploymentTestDummyMinActivation
In this commit, we add a new "dummy" deployment that adds the new params used to activate taproot. We chose to add a new deployment as unlike the bitcoind codebase, we don't currently "bury" soft forks that have happened in the past (hard code an activation height). The old taproot deployment has been removed as with the way the array works, a deployment needs to be defined for _all_ networks.
Configuration menu - View commit details
-
Copy full SHA for 38737a8 - Browse repository at this point
Copy the full SHA 38737a8View commit details -
blockchain+integration: add support for min activation height and cus…
…tom thresholds In this commit, we extend the existing version bits state machine to add support for the new minimum activation height and custom block threshold for activation. We then extend the existing BIP 9 tests (tho this isn't really BIP 9 anymore...) to exercise the new min activation height logic.
Configuration menu - View commit details
-
Copy full SHA for c6b66ee - Browse repository at this point
Copy the full SHA c6b66eeView commit details -
blockchain: refactor new thresholdState method, test BIP9 transitions
In this commit, we extract the BIP 9 state transition logic from the thresholdState method into a new thresholdStateTransition function that allows us to test all the defined state transitions, including the modified "speedy trial" logic.
Configuration menu - View commit details
-
Copy full SHA for 54f6fa9 - Browse repository at this point
Copy the full SHA 54f6fa9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0b245cc - Browse repository at this point
Copy the full SHA 0b245ccView commit details