-
Notifications
You must be signed in to change notification settings - Fork 56
Add support for Testnet4 #1034
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
base: master
Are you sure you want to change the base?
Add support for Testnet4 #1034
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -95,6 +95,11 @@ code chaser_block::validate(const block& block, | |
| if ((ec = header.check( | ||
| setting.timestamp_limit_seconds, | ||
| setting.proof_of_work_limit, | ||
| state.height(), | ||
| state.timestamp(), | ||
| state.previous_block_timestamp(), | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a more significant issue, since it is runtime context that is not part of
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In an earlier version of this code, I did make the database changes (locally) to add previous_block_time (pbt) so that it could be used by the context in header::accept. If that's the route we need to go, I can modernize that, but mostly I thought of it as a learning exercise
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is simpler actually, no database impact. The population queries already always populate the required state because of the MTP requirement. So just add this to
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure I'm following this last part. I think if we add anything to the context (i.e. new members), it will affect the database and those changes will be needed (i.e.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding members to the context and using header::accept along with this https://github.com/thecodefactory/libbitcoin-database/tree/testnet4 allows me to also sync testnet4
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If there's a way to do it w/o changing anything in database, I'd prefer that, so let me know
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| setting.retargeting_interval(), | ||
|
evoskuil marked this conversation as resolved.
|
||
| setting.forks.bip94, | ||
| setting.forks.scrypt_proof_of_work))) | ||
| return ec; | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -95,6 +95,11 @@ code chaser_header::validate(const header& header, | |
| if (const auto ec = header.check( | ||
| settings().timestamp_limit_seconds, | ||
| settings().proof_of_work_limit, | ||
| state.height(), | ||
| state.timestamp(), | ||
| state.previous_block_timestamp(), | ||
| settings().retargeting_interval(), | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comments as above. |
||
| settings().forks.bip94, | ||
| settings().forks.scrypt_proof_of_work)) | ||
| return ec; | ||
|
|
||
|
|
@@ -242,4 +247,4 @@ BC_POP_WARNING() | |
| // Minimum block versions (bip90 disabled). | ||
| // Minimum block version [1] changed to [2] at [227931:000000000000024b89b42a942fe0d9fea3bb44ab7bd1b19115dd6a759c0808b8] | ||
| // Minimum block version [2] changed to [3] at [363725:00000000000000000379eaa19dce8c9b722d46ae6a57c2f1a988119488b50931] | ||
| // Minimum block version [3] changed to [4] at [388381:000000000000000004c2b624ed5d7756c508d90fd0da2c7c679febfa6c4735f0] | ||
| // Minimum block version [3] changed to [4] at [388381:000000000000000004c2b624ed5d7756c508d90fd0da2c7c679febfa6c4735f0] | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These 2 are problematic here, as this is a context free check override (there is no contextual
header::check(..)). So this needs to move toheader::accept(...)where these values are passed viacontext.