Skip to content

feat: introducing #[internal]#17963

Merged
benesjan merged 1 commit intonextfrom
10-24-feat_introducing_internal_
Nov 10, 2025
Merged

feat: introducing #[internal]#17963
benesjan merged 1 commit intonextfrom
10-24-feat_introducing_internal_

Conversation

@benesjan
Copy link
Contributor

@benesjan benesjan commented Oct 24, 2025

Fixes F-22
Fixes #9180

Introduces #[internal(...)] macro that injects ContractSelf just like #[external(...)] macro but instead of constructing relevant context from inputs it directly accepts the context as first arg to the function (this is also injected into params by the macro). Then when a call to internal is formed via self.internal.my_internal_func(...) the call directly passes the relevant context.

The same approach is used as what was introduced for#[external(...)] in a PR down the stack in that the #[aztec] macro makes the original functions uncallable and generates new function with __aztec_nr_internals__ prefix and injects it into the contract. This gives devs a nice error if they attempt to call the function directly instead of via the intended API.

@benesjan benesjan force-pushed the 10-24-refactor_renaming_internal_as_only_self_ branch from 4511ff7 to c1e6fa2 Compare October 24, 2025 22:30
@benesjan benesjan force-pushed the 10-24-feat_introducing_internal_ branch from 25e1bcf to 9226d0a Compare October 24, 2025 22:30
@benesjan benesjan changed the base branch from 10-24-refactor_renaming_internal_as_only_self_ to graphite-base/17963 October 27, 2025 17:37
@benesjan benesjan force-pushed the 10-24-feat_introducing_internal_ branch from 18995f0 to 08237d7 Compare October 27, 2025 17:37
@benesjan benesjan changed the base branch from graphite-base/17963 to 10-27-refactor_dropping_pub_context_mutable_refs October 27, 2025 17:37
@benesjan benesjan force-pushed the 10-24-feat_introducing_internal_ branch from f83ebf5 to d0178d6 Compare October 29, 2025 14:05
@benesjan benesjan force-pushed the 10-27-refactor_dropping_pub_context_mutable_refs branch from 42a9663 to b3cbde8 Compare October 29, 2025 14:05
@benesjan benesjan force-pushed the 10-24-feat_introducing_internal_ branch from d0178d6 to 99304a7 Compare October 29, 2025 14:24
@benesjan benesjan force-pushed the 10-27-refactor_dropping_pub_context_mutable_refs branch 2 times, most recently from b8aafc7 to e4dac47 Compare October 29, 2025 19:14
@benesjan benesjan force-pushed the 10-24-feat_introducing_internal_ branch from 99304a7 to fa29492 Compare October 29, 2025 19:14
@benesjan benesjan force-pushed the 10-27-refactor_dropping_pub_context_mutable_refs branch from e4dac47 to 6910414 Compare October 29, 2025 19:28
@benesjan benesjan force-pushed the 10-24-feat_introducing_internal_ branch 2 times, most recently from 1f908ad to 623a4b1 Compare October 29, 2025 20:49
@benesjan benesjan force-pushed the 10-27-refactor_dropping_pub_context_mutable_refs branch from 797441f to bcc396a Compare October 29, 2025 20:51
Base automatically changed from 10-27-refactor_dropping_pub_context_mutable_refs to next October 29, 2025 21:55
@benesjan benesjan force-pushed the 10-24-feat_introducing_internal_ branch from 623a4b1 to b6171c8 Compare October 29, 2025 22:00
@benesjan benesjan force-pushed the 10-24-feat_introducing_internal_ branch from b6171c8 to e61889b Compare November 6, 2025 14:06
@benesjan benesjan changed the base branch from next to graphite-base/17963 November 6, 2025 19:48
@benesjan benesjan force-pushed the 10-24-feat_introducing_internal_ branch from e61889b to ae26939 Compare November 6, 2025 19:48
@benesjan benesjan changed the base branch from graphite-base/17963 to 10-31-feat_panicking_on_direct_calls_to_external_funcs November 6, 2025 19:48
@benesjan benesjan force-pushed the 10-31-feat_panicking_on_direct_calls_to_external_funcs branch from 78376ff to 69667c0 Compare November 8, 2025 22:18
@benesjan benesjan force-pushed the 10-24-feat_introducing_internal_ branch 2 times, most recently from 803e713 to f59e55f Compare November 8, 2025 23:16
@benesjan benesjan force-pushed the 10-31-feat_panicking_on_direct_calls_to_external_funcs branch from 5ef6d41 to d5d1f0d Compare November 8, 2025 23:16
Base automatically changed from 10-31-feat_panicking_on_direct_calls_to_external_funcs to next November 9, 2025 12:58
@benesjan benesjan force-pushed the 10-24-feat_introducing_internal_ branch from f59e55f to 8ba4963 Compare November 9, 2025 13:06
@benesjan benesjan marked this pull request as ready for review November 9, 2025 13:07
@AztecBot
Copy link
Collaborator

AztecBot commented Nov 9, 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/662c1e19fec92046�662c1e19fec920468;;�\033[0m): yarn-project/scripts/run_test.sh p2p/src/services/reqresp/reqresp.test.ts (28s) (code: 1) group:e2e-p2p-epoch-flakes (\033[38;2;188;109;208mJan Beneš\033[0m: feat: introducing #[internal] (#17963))
\033[38;2;188;109;208mFLAKED\033[0m (\033[38;2;250;217;121m8;;http://ci.aztec-labs.com/dfad1eb5d244daa9�dfad1eb5d244daa98;;�\033[0m): BOX=react BROWSER=firefox run_compose_test react-firefox box boxes (68s) (code: 1) (\033[38;2;188;109;208mJan Beneš\033[0m: feat: introducing #[internal] (#17963))

@benesjan benesjan marked this pull request as draft November 10, 2025 14:18
@benesjan benesjan marked this pull request as ready for review November 10, 2025 14:29
@benesjan benesjan enabled auto-merge November 10, 2025 14:29
@benesjan benesjan force-pushed the 10-24-feat_introducing_internal_ branch from 35153b1 to 571f69f Compare November 10, 2025 14:48
@AztecBot AztecBot force-pushed the 10-24-feat_introducing_internal_ branch from 571f69f to fd11b14 Compare November 10, 2025 15:09
Fixes F-22
Fixes #9180

Introduces `#[internal(...)]` macro that injects ContractSelf just like `#[external(...)]` macro but instead of constructing relevant context from inputs it directly accepts the context as first arg to the function (this is also injected into params by the macro). Then when a call to internal is formed via `self.internal.my_internal_func(...)` the call directly passes the relevant context.

The same approach is used as what was introduced for`#[external(...)]` in a PR down the stack in that the `#[aztec]` macro makes the original functions uncallable and generates new function with `__aztec_nr_internals__` prefix and injects it into the contract. This gives devs a nice error if they attempt to call the function directly instead of via the intended API.
@AztecBot AztecBot force-pushed the 10-24-feat_introducing_internal_ branch from fd11b14 to 7241673 Compare November 10, 2025 15:11
@benesjan benesjan added this pull request to the merge queue Nov 10, 2025
auto-merge was automatically disabled November 10, 2025 15:42

Pull Request is not mergeable

Merged via the queue into next with commit f8105ad Nov 10, 2025
15 checks passed
@benesjan benesjan deleted the 10-24-feat_introducing_internal_ branch November 10, 2025 15:49
ludamad pushed a commit that referenced this pull request Dec 16, 2025
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.

Consider allowing for calling of standard contract functions as internal

3 participants