-
Notifications
You must be signed in to change notification settings - Fork 76
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
Client-side deposit sweep: Validate proposals #3521
Merged
Merged
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
c4ca78f
Add some Bitcoin tooling allowing to handle the on-chain `BitcoinTx.I…
lukasz-zimnoch 8af0fd8
Integrate with the chain function allowing to validate the sweep prop…
lukasz-zimnoch 9b308a3
Merge branch 'deposit-sweep-support' into deposit-sweep-support-2
lukasz-zimnoch 9beb922
Add `convertDepositSweepProposalToAbiType` function
lukasz-zimnoch b498888
Merge branch 'deposit-sweep-support' into deposit-sweep-support-2
lukasz-zimnoch 6814d17
Merge branch 'main' into deposit-sweep-support-2
lukasz-zimnoch 34af2ad
Introduce the wallet executor along with all necessary changes
lukasz-zimnoch f9ffe5f
Acquire lock within `walletExecutor.signBatch`
lukasz-zimnoch 88f0381
Fix broken unit tests
lukasz-zimnoch 3c9b4b3
Refactor wallet registry to hold wallet PKH
lukasz-zimnoch e956587
Fix compilation error
lukasz-zimnoch aa3c4c9
Make formatter happy
lukasz-zimnoch 8a11564
Replace `walletExecutor` with `walletDispatcher`
lukasz-zimnoch 5e568ec
Outline of the deposit sweep action logic
lukasz-zimnoch 0dd2132
Implement GetBlockNumberByTimestamp function
lukasz-zimnoch 8581aab
Expose `GetDepositRequest` function
lukasz-zimnoch 25ce495
Fix unit tests
lukasz-zimnoch 3a6b61c
Wiring up things within deposit sweep action
lukasz-zimnoch dabbee3
Add TODO about `depositSweepAction.execute` unit tests
lukasz-zimnoch 4015afb
Add unit tests for `walletRegistry.getWalletByPublicKeyHash`
lukasz-zimnoch 6117fd6
Unit tests for wallet dispatcher
lukasz-zimnoch e68ed99
Explain the `validateDepositSweepProposal` just-in-case check
lukasz-zimnoch bae3661
Small docs/logs improvements
lukasz-zimnoch 9b1ce32
Check the bool return value of `getSigningExecutor` just in case
lukasz-zimnoch 08769b5
TODO about making heartbeats a wallet action
lukasz-zimnoch 575f695
Rearrange and document `node`'s fields
lukasz-zimnoch f49238d
Make formatter happy
lukasz-zimnoch 94d72d7
Add additional explanation for hash orders for `transactionFixture`
lukasz-zimnoch 0bfa45a
Comment about nil `Vault` in `DepositRevealedEvent` and `DepositChain…
lukasz-zimnoch 80b6a3e
Additional explanation for `DepositChainRequest`
lukasz-zimnoch 7a41a8f
Narrow the docstring of `depositSweepProposalConfirmationBlocks`
lukasz-zimnoch 9e52fa1
Improve docs of `GetBlockNumberByTimestamp`
lukasz-zimnoch 9571928
Remove obsolete comment
lukasz-zimnoch File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
It would really help to have the tables on the top of
type Transaction struct
and then for eachSerialize*
function denote which parts we are serializing.For example, in
SerializeInputs
the output has[ tx_in_count | tx_in]
.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.
Honestly, I think that will cause confusion. The tables you mentioned are tailored to describe the
BitcoinTx.Info
where inputs and outputs are represented asbytes
vectors. Thebitcoin.Transaction
is more specific as it uses helper types likeTransactionInput
andTransactionOutput
that are also documented. Also, all fields of the aforementioned structs have their own docstrings. There are also references to the original Bitcoin docs. Maybe you can provide the places where the docs are confusing or not accurate so I can improve them?Regarding your example with
SerializeInputs
, this function has the following docstring:It uses the nomenclature we already have in the
bitcoin
package so I think it is more consistent than[ tx_in_count | tx_in]
which is a bit cryptic in this context.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.
I was looking at the Solidity documentation for
BitcoinTx.Info
to understand why are we taking 4 bytes or why are we skipping 4 bytes in other functions. The references todeveloper.bitcoin.org
are helpful but IMO they are not as helpful as having the structure described in the code comments as we have inBitcoinTx.Info
. It is not a blocker, I can leave this conversation open to marinate for a while to see if we can find a way to port some of those docs to Go.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.
Sure! What I want to avoid is putting too many docs as they add additional maintenance work and can obfuscate the picture even more. The Go
bitcoin
package differs from the Solidity code we were working with in the past. In Solidity, we used to deal with pure bytes quite often so a huge amount of docs was the only way to explain what happens. In Gobitcoin
package, the code itself is more verbose. All Bitcoin primitives and their contents are represented by dedicated Go types which have their own documentation. In that context, having a huge block of docs abovebitcoin.Transaction
just feels a bit redundant.