-
Notifications
You must be signed in to change notification settings - Fork 21
Efficient extraArgs & non-evm support #1359
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
base: develop
Are you sure you want to change the base?
Conversation
# Conflicts: # chains/evm/.gas-snapshot # chains/evm/contracts/onRamp/OnRamp.sol # chains/evm/contracts/test/helpers/OnRampTestHelper.sol # chains/evm/contracts/test/onRamp/OnRamp/OnRampSetup.t.sol
| uint64 destChainSelector, | ||
| uint16 requestedBlockDepth, | ||
| Client.CCV[] calldata ccvs, | ||
| address[] calldata ccvs, |
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 never needed the ccv args but it was more efficient to pass in the CCVs struct
be9e438 to
40b310f
Compare
5a9021f to
796bf24
Compare
add fields
796bf24 to
22c5e88
Compare
|
| /// a block depth. CCVs, Pools and the executor may all reject this value by reverting the transaction on the source | ||
| /// chain if they do not want to take on the risk of the block depth specified. | ||
| /// @dev May be zero to indicate waiting for finality is desired. | ||
| uint16 finalityConfig; |
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.
Do we want to change this to match the new blockConfirmations naming?
| if (extraArgs.length >= 4 && bytes4(extraArgs[0:4]) == Client.GENERIC_EXTRA_ARGS_V3_TAG) { | ||
| resolvedArgs = abi.decode(extraArgs[4:], (Client.GenericExtraArgsV3)); | ||
| ) internal view returns (ExtraArgsCodec.GenericExtraArgsV3 memory resolvedArgs) { | ||
| if (extraArgs.length >= 4 && bytes4(extraArgs[0:4]) == ExtraArgsCodec.GENERIC_EXTRA_ARGS_V3_TAG) { |
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.
| if (extraArgs.length >= 4 && bytes4(extraArgs[0:4]) == ExtraArgsCodec.GENERIC_EXTRA_ARGS_V3_TAG) { | |
| if (extraArgs.length >= 4 && bytes4(extraArgs[:4]) == ExtraArgsCodec.GENERIC_EXTRA_ARGS_V3_TAG) { |
| uint256 public constant SUI_EXECUTOR_ARGS_V1_BASE_SIZE = 4 + 1; | ||
|
|
||
| // Enum to indicate specific error locations during encoding/decoding. | ||
| enum EncodingErrorLocation { |
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.
Is part of the intention here to prevent having to update this for new non-EVMs?
If so, how is space for params that new non-EVMs may need accounted for?
| bytes memory encoded = ExtraArgsCodec._encodeSVMExecutorArgsV1(args); | ||
| ExtraArgsCodec.SVMExecutorArgsV1 memory decoded = s_helper._decodeSVMExecutorArgsV1(encoded); | ||
|
|
||
| assertEq(decoded.accountIsWritableBitmap, type(uint64).max); |
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.
assertEq(uint256(decoded.useATA), uint256(args.useATA));
adding this assertion test fails..
| s_helper = new ExtraArgsCodecHelper(); | ||
| } | ||
|
|
||
| function test_DecodeSVMExecutorArgsV1_Empty() public view { |
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.
| function test_DecodeSVMExecutorArgsV1_Empty() public view { | |
| function test_decodeSVMExecutorArgsV1_Empty() public view { |
or intuitionally kept uppercase for all the tests ?
| assembly { | ||
| // Read useATA (1 byte). | ||
| let useATA := byte(0, calldataload(add(encoded.offset, 4))) | ||
| mstore(executorArgs, iszero(iszero(useATA))) |
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.
Doing this would means both enum cases DERIVE_ATA_DONT_CREATE (1) and USE_AS_IS (2) decode to the same 1.
is this done to intentionally ?
if so please add comments
| /// @notice Decodes bytes into a SVMExecutorArgsV1 struct using assembly. | ||
| /// @param encoded The encoded bytes to decode. | ||
| /// @return executorArgs The decoded SVMExecutorArgsV1 struct. | ||
| function _decodeSVMExecutorArgsV1( |
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.
why not compare the tag ?
No description provided.