Skip to content

Conversation

@RensR
Copy link
Collaborator

@RensR RensR commented Nov 7, 2025

No description provided.

uint64 destChainSelector,
uint16 requestedBlockDepth,
Client.CCV[] calldata ccvs,
address[] calldata ccvs,
Copy link
Collaborator Author

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

@RensR RensR marked this pull request as ready for review November 7, 2025 11:55
@RensR RensR requested a review from a team as a code owner November 7, 2025 11:55
add fields
@github-actions
Copy link

github-actions bot commented Nov 7, 2025

Metric genericextraArgs develop
Coverage 69.4% 68.7%

/// 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;
Copy link
Contributor

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) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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 {
Copy link
Contributor

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);
Copy link
Member

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 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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)))
Copy link
Member

@0xsuryansh 0xsuryansh Nov 7, 2025

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(
Copy link
Member

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants