-
Notifications
You must be signed in to change notification settings - Fork 9
OOR client 3/4: durable actor, TLV codecs, signing context #79
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
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
5935f10
tx: split arktx and checkpoint primitives
bhandras 8750f96
tx: add PSBT and package encodings
bhandras c460047
oor: add VTXO signing context
bhandras 6f0186f
oor: add TLV codec for durable actor command payloads
bhandras eb59891
oor: validate TLV numeric conversions on decode
bhandras 26ef8e7
oor: stabilize start-session contract and session ID binding
bhandras 53e9009
oor: implement outbox proto envelopes
bhandras 2191ac0
actor: make restart enqueue independent of wall clock
bhandras 3ac7d78
oor: make DriveEventRequest durable
bhandras 4851097
test: improve OOR primitive coverage
bhandras a6b4c8e
tx: harden taptree TLV decoding boundaries
bhandras abdf8f4
oor: add GoDocs for exported types
bhandras 1d659be
oor: document TransferInputs FSM threading rationale
bhandras 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 hidden or 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 hidden or 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 hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| package arktx | ||
|
|
||
| import ( | ||
| "testing" | ||
|
|
||
| "github.com/btcsuite/btcd/wire" | ||
| "github.com/lightninglabs/darepo-client/lib/scripts" | ||
| "github.com/stretchr/testify/require" | ||
| ) | ||
|
|
||
| // TestCanonicalizeOrderingSortsAndValidates asserts CanonicalizeOrdering | ||
| // produces a transaction that passes ValidateCanonicalTx, even if the input tx | ||
| // is not canonical. | ||
| func TestCanonicalizeOrderingSortsAndValidates(t *testing.T) { | ||
| t.Parallel() | ||
|
|
||
| tx := wire.NewMsgTx(TxVersion) | ||
| tx.AddTxIn(&wire.TxIn{ | ||
| PreviousOutPoint: wire.OutPoint{ | ||
| Hash: [32]byte{2}, | ||
| Index: 1, | ||
| }, | ||
| }) | ||
| tx.AddTxIn(&wire.TxIn{ | ||
| PreviousOutPoint: wire.OutPoint{ | ||
| Hash: [32]byte{1}, | ||
| Index: 0, | ||
| }, | ||
| }) | ||
|
|
||
| // Add outputs in non-canonical order and with anchor not last. | ||
| tx.TxOut = append(tx.TxOut, | ||
| &wire.TxOut{ | ||
| Value: 1, | ||
| PkScript: []byte{0x52}, | ||
| }, | ||
| scripts.AnchorOutput(), | ||
| &wire.TxOut{ | ||
| Value: 2, | ||
| PkScript: []byte{0x51}, | ||
| }, | ||
| ) | ||
|
|
||
| err := CanonicalizeOrdering(tx) | ||
| require.NoError(t, err) | ||
|
|
||
| err = ValidateCanonicalTx(tx) | ||
| require.NoError(t, err) | ||
|
|
||
| require.True(t, IsAnchorOutput(tx.TxOut[len(tx.TxOut)-1])) | ||
| } |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| package arktx | ||
|
|
||
| // Package arktx contains helpers for constructing and validating Ark | ||
| // transactions that represent the virtual-chain step following checkpoints. | ||
| // | ||
| // Canonical output ordering is critical because multiple subsystems rely on | ||
| // byte-identical transaction construction (client retries, server validation, | ||
| // and persisted snapshots). This package provides a single, shared definition | ||
| // of that canonical ordering. |
Oops, something went wrong.
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.
just checking (maybe answered later): but think we dont have to keep things backwards compatible rn and can just do big refactors (i know the agents like to do this bw compat thing)
Uh oh!
There was an error while loading. Please reload this page.
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.
Updated: transitional OOR canonical wrappers were removed and call sites now use lib/tx/arktx directly, so there is no extra compatibility layer left here.