-
Notifications
You must be signed in to change notification settings - Fork 7
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
[Solana][NONEVM-1028] Deduplicate accounts in execution #477
Conversation
a92072b
to
22c759c
Compare
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.
We need to ensure that the hash of the message is the same offchain and onchain. Saving space for those values in the extra args message means that the offchain code will need to hash the message with those values in, and then remove them to send the message through the contract. Then the program will need to do the same but the other way out, adding them on the hash.
If you feel that the saved space is worth it we could do this change, but if not it feels like a possible UX concern of the protocol, as all the nodes will need to sign a message with those values in, but then the message sent through is different.
CC @aalu1418 after our sync discussion yesterday on how to proceed with this 🙂 |
741a4fc
to
614f00b
Compare
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.
Let's keep the serialization of the accounts inside the hash, with this change the hash values should remain the same.
Can you add a test validating that when sending different accounts in remaining accounts to the ones in the hash then execution fails? So that way we can check that there is no override of the accounts
chains/solana/contracts/programs/ccip-router/src/instructions/v1/offramp.rs
Outdated
Show resolved
Hide resolved
chains/solana/contracts/programs/ccip-router/src/instructions/v1/offramp.rs
Outdated
Show resolved
Hide resolved
chains/solana/contracts/programs/ccip-router/src/instructions/v1/offramp.rs
Outdated
Show resolved
Hide resolved
chains/solana/contracts/programs/ccip-router/src/instructions/v1/offramp.rs
Outdated
Show resolved
Hide resolved
chains/solana/contracts/programs/ccip-router/src/instructions/v1/offramp.rs
Show resolved
Hide resolved
66d5e3b
to
5772fce
Compare
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.
Excelent work!
Can we add tests (as I don't think we have that already covered) for:
- Sending the correct accounts but a wrong bitmap for writable
- Hashing some accounts different than the ones sent in the transaction
chains/solana/contracts/programs/ccip-router/src/instructions/v1/offramp.rs
Show resolved
Hide resolved
chains/solana/contracts/programs/ccip-router/src/instructions/v1/offramp.rs
Outdated
Show resolved
Hide resolved
chains/solana/contracts/programs/ccip-router/src/instructions/v1/offramp.rs
Show resolved
Hide resolved
chains/solana/contracts/programs/ccip-router/src/instructions/v1/offramp.rs
Outdated
Show resolved
Hide resolved
chains/solana/contracts/programs/ccip-router/src/instructions/v1/offramp.rs
Show resolved
Hide resolved
chains/solana/contracts/programs/ccip-router/src/instructions/v1/offramp.rs
Outdated
Show resolved
Hide resolved
78128c8
to
0574909
Compare
@agusaldasoro addressed your review comments and added the tests you mentioned, PTAL when you have a moment :) |
9bdc2f2
to
b2938ab
Compare
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.
Awesome work!
Remove unneeded field Rework test comment Update test hash deduplicate logic receiver Fix execution check Address review comments Hash accounts separately Fix more tests Don't hash token accounts [CCIP-4938] Use map instead of slice in token price observations and outcome (#498) * check number of observed timestamps is at least 2f+1 * Change token price processor to observe feed tokens as a map instead of slice Using maps instead of slices make it sure that no duplicates can be added. Apply comment suggestions Co-authored-by: Agustina Aldasoro <[email protected]>
304688d
b2938ab
to
304688d
Compare
@agusaldasoro @aalu1418 resolved conflicts, feel free to merge right away when green :) |
|
No description provided.