Skip to content
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

blockchain: moved chainwork to blockindex #213

Merged

Conversation

edtubbs
Copy link
Collaborator

@edtubbs edtubbs commented Mar 27, 2024

Refactored chainwork by moving it from the block header to block index and updated related functions and tests accordingly.

@edtubbs edtubbs force-pushed the 0.1.4-dev-index-chainwork branch 6 times, most recently from 6ad84a9 to 7ac5895 Compare April 3, 2024 02:41
Copy link
Member

@xanimo xanimo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK. Tested on x86_64-pc-linux-gnu and all tests pass. Ran that through valgrind and no leaks. Ran valgrind on spvnode and no leaks.

@edtubbs edtubbs force-pushed the 0.1.4-dev-index-chainwork branch from 7ac5895 to bfe0fd4 Compare May 16, 2024 18:23
block: removed chainwork from block header
block: added chainwork parameter to deserialize functions
chainparams: added chainwork to genesis blocks and checkpoints
headersdb: added chainwork parameter to set_chainpoint_start
headersdb_file: added chainwork to genesis block and checkpoint
spv: added chainwork parameter to set checkpoint
validation: added chainwork parameter to check_auxpow
arith_uint256: updated add and sub_arith_uint256 to work from LSB
arith_uint256: updated set_compact to direct assignment
arith_uint256: updated sub_arith_uint256 to unsigned borrow
arith_uint256: updated sub_arith_uint256 to handle underflow
arith_uint256: added arith_shift functions to header
pow: updated target check with arith_uint256_is_zero
pow: updated uint256_cmp to work from MSB to LSB
pow: updated check_pow to swap_bytes in hash
tests: updated net and block tests
tests: added arith_uint256 tests
make: added arith_uint256 tests
@edtubbs edtubbs force-pushed the 0.1.4-dev-index-chainwork branch from bfe0fd4 to 2a29278 Compare May 16, 2024 18:31
Copy link
Member

@xanimo xanimo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re-ACK. Tested on x86_64 jammy.

@edtubbs edtubbs force-pushed the 0.1.4-dev-index-chainwork branch 3 times, most recently from 998a68d to 8eea8bd Compare May 31, 2024 22:08
headersdb_file: added chainwork to load and write
headersdb_file: updated chainwork check on reorg
headersdb_file: updated current version for chainwork
headersdb_file: updated load to connect first header
tests: updated reorg_test to load and write headers
@edtubbs edtubbs force-pushed the 0.1.4-dev-index-chainwork branch from 8eea8bd to ddac774 Compare June 1, 2024 01:52
@michilumin michilumin self-assigned this Aug 27, 2024
@michilumin michilumin merged commit 8357f69 into dogecoinfoundation:0.1.4-dev Aug 27, 2024
14 checks passed
@michilumin
Copy link
Contributor

Did soft-review on files, and looking at proof of operation from prev reviews, LGTM merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants