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

hash: added dogecoin_hashwriter_free #174

Merged
merged 1 commit into from
Dec 13, 2023

Conversation

edtubbs
Copy link
Collaborator

@edtubbs edtubbs commented Nov 28, 2023

Updates were made based on valgrind analysis results
valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes ./tests
valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes ./spvnode -f 0 -y 0 -b -p scan

@edtubbs edtubbs force-pushed the 0.1.3-dev-test_mem branch 12 times, most recently from 06a6a2a to 455d198 Compare December 1, 2023 18:39
@michilumin michilumin self-requested a review December 2, 2023 00:03
Copy link
Contributor

@michilumin michilumin left a comment

Choose a reason for hiding this comment

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

Looks good for mitigating unconstrained memory issues; want to quickly run it with valgrind and double check, but looks good pre-that.

@edtubbs edtubbs force-pushed the 0.1.3-dev-test_mem branch 16 times, most recently from 57f2bfd to bbaf8ed Compare December 5, 2023 21:34
@edtubbs edtubbs force-pushed the 0.1.3-dev-test_mem branch 25 times, most recently from a2b23ca to 2bdc622 Compare December 11, 2023 18:42
auxpow: updated check_merkle_branch iterator to size_t and hash parameters
block: updated dogecoin_block_header_new to initialize header
block: updated dogecoin_block_header_free to clear version and removed debug print
block: updated dogecoin_block_header_copy to copy auxpow
block: updated header and dogecoin_block_header_serialize/deserialize to signed version
headersdb_file: updated dogecoin_headers_db_free to free chaintip to chainbottom
headersdb_file: updated dogecoin_headers_db_connect_hdr to free blockindex and todo
headersdb_file: updated dogecoin_headers_db_load to print progress
spv: updated dogecoin_spv_client_free to check for headers_db_ctx
spv: updated dogecoin_net_spv_post_cmd to recover after invalid headers and blocks
spv: updated dogecoin_net_spv_periodic_statecheck to request blocks in full block sync
spv: updated dogecoin_net_spv_request_headers to requests blocks from node with best height
transaction: updated sign_transaction_w_privkey to free script_pubkey and txtmp
tx: updated dogecoin_tx_out_pubkey_hash_to_p2pkh_address to free copy of txout
wallet: removed dogecoin_wallet_add_to_spent as dogecoin_wallet_scrape_utxos handles spends
wallet: updated dogecoin_wallet_new frees and to call dogecoin_hdnode_free
wallet: updated dogecoin_wallet_free to call dogecoin_btree_tdestroy with NULL/free
wallet: updated dogecoin_wallet_create to check for open wallet file
wallet: updated dogecoin_wallet_init with temp_address_copy and free address_copy
wallet: updated dogecoin_wallet_init with dogecoin_wallet_addr_free if address found
wallet: updated dogecoin_wallet_load_address and to free buf
wallet: updated dogecoin_wallet_load_transaction to free buf
wallet: updated dogecoin_wallet_next_addr to free key
wallet: updated dogecoin_wallet_next_bip44_addr to free keys and waddr
wallet: updated dogecoin_register_watch_address_with_node to free address_copy and wallet
wallet: updated dogecoin_register_watch_address_with_node to free waddr
wallet: updated dogecoin_unregister_watch_address_with_node to free address_copy and record
wallet: updated dogecoin_unregister_watch_address_with_node to free waddr_check and waddr
wallet: updated dogecoin_get_utxo functions and dogecoin_get_balance to free wallet/utxos
wallet: updated dogecoin_wallet_utxo_new to initialize elements
wallet: updated dogecoin_wallet_scrape_utxos to check pointers before memcmp
address_test: updated generateHDMasterPubKeypair testnet parameter to true
bip44_test: updated test_seed pointer and assignment
block_test: updated to signed version
hash_test: added dogecoin_hashwriter_free
wallet_test: added vector_add of waddr and dogecoin_free of tx_data to test_wallet
wallet_test: added dogecoin_wallet_flush and dogecoin_wallet_free to test_wallet
wallet_test: added vector_free of addrs to test_wallet_basics
@michilumin michilumin self-requested a review December 13, 2023 00:10
Copy link
Contributor

@michilumin michilumin left a comment

Choose a reason for hiding this comment

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

Eyes on the further zeroing/nulling mem safing, and changes from unsigned to signed, looks good - and the changes to address different logic branches needed to take care of getting certain blocks from certain nodes/chains... good to split out, probably can do with some further cleanup later on since i think we're going to likely run into more of those sort of conditions. but that's just a todo: like anything else. so 👍

@michilumin michilumin merged commit 6759b39 into dogecoinfoundation:0.1.3-dev Dec 13, 2023
8 checks passed
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.

2 participants