-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Reject TXs when there is a mismatch #6236
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -127,6 +127,7 @@ fn get_program_ids(instructions: &[Instruction]) -> Vec<Pubkey> { | |
| pub struct MessageHeader { | ||
| /// The number of signatures required for this message to be considered valid. The | ||
| /// signatures must match the first `num_required_signatures` of `account_keys`. | ||
| /// NOTE: Serialization-related changes must be paired with the direct read at sigverify. | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As bonuses, I added precautionary comments to prevent this bug from reoccurring in the future...
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you also add a test that fails if the serialization changes in a way to affect that?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, I could do that of course, however I think that will be out of scope for this PR, assuming you're meaning to write some robust set of unit tests for each plausible outcome of I've already wrote units tests, directly spotting the changed behavior: 1, 2 and 3. I understand those yet-to-be-written unit tests will be invaluable, considering sigverify will directly be faced to the outside world (= the public Internet for the permission-less DLT like solana). But the concern already are covered by the issues like #5414 and #6339. Anyway, if there are some thoughts I'm missing or better unit test scenario, please tell me!
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, no problem, we can take on writing that test.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for consideration! Hopefully, writing it will be me if I find some free time! |
||
| pub num_required_signatures: u8, | ||
|
|
||
| /// The last num_credit_only_signed_accounts of the signed keys are credit-only accounts. | ||
|
|
@@ -142,6 +143,7 @@ pub struct MessageHeader { | |
| #[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Clone)] | ||
| pub struct Message { | ||
| /// The message header, identifying signed and credit-only `account_keys` | ||
| /// NOTE: Serialization-related changes must be paired with the direct read at sigverify. | ||
| pub header: MessageHeader, | ||
|
|
||
| /// All the account keys used by this transaction | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.