Skip to content

Conversation

@tarrencev
Copy link

@tarrencev tarrencev commented Sep 5, 2025

Added Cartridge as an author and updated nonce type in OutsideExecution.

This is an optimization we already have implemented in the Controller. It enables nonce channels for outside execution which supports using a bitmask as nonce value, allowing reuse of a single storage slot for 128 txns rather than requiring a new storage slot for every transaction.

For reference, the nonce check in Cairo:

let (channel, mask) = outside_execution.nonce;
let current_mask = self.outside_nonces.read(channel);
let (and, _, or) = bitwise(current_mask, mask);
assert(mask != 0 && and == 0, 'ctrl/invalid-outside-nonce');
self.outside_nonces.write(channel, or);

Added Cartridge as an author and updated nonce type in OutsideExecution.
@sgc-code
Copy link
Contributor

why not incremental nonces instead?, then you we can have 2**252 txs in the same channel

another thing, i think this is better than the tupple, actually i think tuples are not allowed in snip12

    { name: "Nonce Channel", type: "felt" },
    { name: "Nonce Value", type: "felt" },

i will really like to add another change if we are pushing revision 3, Nonces by caller: so the same nonce could be valid for different outside_execute.caller. it helps prevent many DoS issues

@sgc-code
Copy link
Contributor

maybe we should rename the title of this PR to "Snip-9 Revision 3"

@github-actions
Copy link

There hasn't been any activity on this pull request recently, and in order to prioritize active work, it has been marked as stale.
This PR will be closed and locked in 7 days if no further activity occurs.
Thank you for your contributions!

@github-actions github-actions bot added the stale label Oct 20, 2025
@github-actions github-actions bot closed this Oct 27, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Oct 28, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants