Skip to content

refactor: call args as an array instead of a slice#18417

Merged
benesjan merged 1 commit intonextfrom
11-14-refactor_dropping_use_of_slices_from_calls
Nov 24, 2025
Merged

refactor: call args as an array instead of a slice#18417
benesjan merged 1 commit intonextfrom
11-14-refactor_dropping_use_of_slices_from_calls

Conversation

@benesjan
Copy link
Contributor

@benesjan benesjan commented Nov 14, 2025

Usage of slices is now discouraged and for this reason I am dropping their use from calls.

This made me drop the hash_args function and rename hash_args_array to just hash_args as the original was no longer in use. Also poseidon2_hash_with_separator_slice got dropped due to lack of use.

@benesjan benesjan force-pushed the 11-14-refactor_dropping_callinterface_trait branch from 75b4577 to 8ba41d6 Compare November 14, 2025 18:58
@benesjan benesjan force-pushed the 11-14-refactor_dropping_use_of_slices_from_calls branch 2 times, most recently from 71f23d5 to fa41a20 Compare November 18, 2025 18:01
@benesjan benesjan force-pushed the 11-14-refactor_dropping_callinterface_trait branch 2 times, most recently from 2011739 to 14e7d4d Compare November 18, 2025 19:31
@benesjan benesjan force-pushed the 11-14-refactor_dropping_use_of_slices_from_calls branch 2 times, most recently from 397ca53 to 5fd93f6 Compare November 19, 2025 13:20
@benesjan benesjan force-pushed the 11-14-refactor_dropping_callinterface_trait branch from 14e7d4d to c8246fc Compare November 19, 2025 13:20
@AztecBot AztecBot force-pushed the 11-14-refactor_dropping_callinterface_trait branch from c8246fc to 24e5513 Compare November 19, 2025 13:46
@benesjan benesjan force-pushed the 11-14-refactor_dropping_use_of_slices_from_calls branch from 22b59bb to ae1fd78 Compare November 19, 2025 14:42
@benesjan benesjan force-pushed the 11-14-refactor_dropping_callinterface_trait branch from 24e5513 to 05792c2 Compare November 19, 2025 14:42
@benesjan benesjan marked this pull request as ready for review November 19, 2025 14:43
@AztecBot AztecBot force-pushed the 11-14-refactor_dropping_callinterface_trait branch from 05792c2 to 47fbde1 Compare November 19, 2025 15:29
Base automatically changed from 11-14-refactor_dropping_callinterface_trait to next November 19, 2025 16:03
@benesjan benesjan marked this pull request as draft November 23, 2025 22:51
@benesjan benesjan removed the request for review from fcarreiro November 23, 2025 22:51
@benesjan benesjan removed the request for review from dbanks12 November 23, 2025 22:51
@benesjan benesjan force-pushed the 11-14-refactor_dropping_use_of_slices_from_calls branch 2 times, most recently from 803e00b to fc8919f Compare November 23, 2025 23:48
@benesjan benesjan marked this pull request as ready for review November 23, 2025 23:51
@benesjan benesjan force-pushed the 11-14-refactor_dropping_use_of_slices_from_calls branch from fc8919f to 72976c7 Compare November 24, 2025 12:24
@benesjan benesjan marked this pull request as draft November 24, 2025 13:58
@benesjan benesjan marked this pull request as ready for review November 24, 2025 14:01
@benesjan benesjan changed the title refactor: dropping use of slices from calls refactor: call args as an array instead of a slice Nov 24, 2025
@AztecBot
Copy link
Collaborator

AztecBot commented Nov 24, 2025

Flakey Tests

🤖 says: This CI run detected 2 tests that failed, but were tolerated due to a .test_patterns.yml entry.

\033[38;2;188;109;208mFLAKED\033[0m (\033[38;2;250;217;121m8;;http://ci.aztec-labs.com/a56cf70ed9418f57�a56cf70ed9418f578;;�\033[0m): yarn-project/end-to-end/scripts/run_test.sh simple src/e2e_epochs/epochs_multi_proof.test.ts (162s) (code: 1) group:e2e-p2p-epoch-flakes (\033[38;2;188;109;208mJan Beneš\033[0m: refactor: call args as an array instead of a slice (#18417))
\033[38;2;188;109;208mFLAKED\033[0m (\033[38;2;250;217;121m8;;http://ci.aztec-labs.com/bced5a533061ba4e�bced5a533061ba4e8;;�\033[0m): yarn-project/end-to-end/scripts/run_test.sh simple src/e2e_p2p/multiple_validators_sentinel.parallel.test.ts "collects attestations for validators in proposer node when block is not published" (129s) (code: 1) group:e2e-p2p-epoch-flakes (\033[38;2;188;109;208mJan Beneš\033[0m: refactor: call args as an array instead of a slice (#18417))

Copy link
Contributor

@dbanks12 dbanks12 left a comment

Choose a reason for hiding this comment

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

Public context and avm transpiler stuff looks good to me!

};

pub unconstrained fn add_private_authwit_from_call<T, let M: u32>(
pub unconstrained fn add_private_authwit_from_call<let M: u32, let N: u32, T>(
Copy link
Contributor

Choose a reason for hiding this comment

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

Would be nice to have some comment briefly defining what M, N and T stand for. Or, if Noir allows, using more descriptive names for said type variables. eg: add_private_authwit_from_call<let CallNameLen: u32, ArgsLen: u32, CallReturnType>)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You have a point but this is all over the place and it's a bit unrelated so doesn't make sense to do in this PR.

}

pub unconstrained fn add_public_authwit_from_call<T, let M: u32>(
pub unconstrained fn add_public_authwit_from_call<let M: u32, let N: u32, T>(
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

Copy link
Contributor

@mverzilli mverzilli left a comment

Choose a reason for hiding this comment

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

Nice! Only general comment is I would try to use more descriptive names for parametric types (especially when a function or type ends up having more than one, like many cases in this PR where there's M, N and T).

I don't know if Noir supports names with more than letter in such cases though, so feel free to ignore me

Usage of slices is now discouraged and for this reason I am dropping their use from calls.

This made me drop the `hash_args` function and rename `hash_args_array` to just `hash_args` as the original was no longer in use. Also `poseidon2_hash_with_separator_slice` got dropped due to lack of use.
@AztecBot AztecBot force-pushed the 11-14-refactor_dropping_use_of_slices_from_calls branch from e73ead2 to 663806b Compare November 24, 2025 16:47
@benesjan benesjan added this pull request to the merge queue Nov 24, 2025
Merged via the queue into next with commit dfeb4e3 Nov 24, 2025
16 checks passed
@benesjan benesjan deleted the 11-14-refactor_dropping_use_of_slices_from_calls branch November 24, 2025 17:43
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.

4 participants