-
Notifications
You must be signed in to change notification settings - Fork 491
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
transaction grouping support #172
Conversation
return pool.Remember([]transactions.SignedTxn{t}) | ||
} | ||
|
||
// Remember stores the provided transaction group | ||
// Precondition: Only Remember() properly-signed and well-formed transactions (i.e., ensure t.WellFormed()) |
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.
Not related to this PR's changes, but do you know if this precondition (check WellFormed before calling Remember) is still necessary?
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.
That comment is certainly misleading. The well-formedness doesn't matter much. It's critical that the transaction signature has been checked, though. The pool assumes the signature is already valid (doesn't do its own check), and the block evaluator subsequently assumes any transactions coming from the pool have good signatures.
To be sure I understand correctly, would the following be an accurate addition to the spec describing this change? A transaction may include a "Group" field (msgpack tag "grp"), a 32-byte hash that specifies what transaction group the transaction belongs to. More formally, when evaluating a block, consider the $i$th and $(i+1)$th transaction in the payset to belong to the same transaction group if the "Group" fields of the two transactions are equal and nonzero. |
Yes, that's accurate -- thank you for reverse-engineering that out of the code! |
What's the intended flow for signing a group of transactions where e.g., one of the transactions must be signed by person A and another must be signed by person B? |
re-implement txn counter more cleanly using cow deltas
Good point -- I'll add a goal command to split a transactions file into one file per txn. (I was using msgpacktool to do this, but that's not something we should be suggesting to all of our users.) |
unverifiedTxGroup := make([]transactions.SignedTxn, 1) | ||
for { | ||
if len(unverifiedTxGroup) == ntx { | ||
n := make([]transactions.SignedTxn, len(unverifiedTxGroup)*2) |
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.
To be sure I'm not missing something subtle here: Instead of decoding and calling append()
, you're growing the array yourself so that you can decode directly into &unverifiedTxGroup[ntx]
, saving a memcpy, right? Or am I missing something?
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.
Yes, that's all that's going on here.
I believe the code was originally carefully optimized to the level where an extra copy of the SignedTxn
mattered, so I tried to preserve that property.
It looks like there's currently no way to use goal to send a transaction group -- |
Good catch (thought I did this, but clearly not). I fixed rawsend to respect groups. |
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.
Looks good to me!
No description provided.