Skip to content

feat: 7702 in RLP_TXN#362

Open
letypequividelespoubelles wants to merge 11 commits intomainfrom
361-7702-in-rlp-txn
Open

feat: 7702 in RLP_TXN#362
letypequividelespoubelles wants to merge 11 commits intomainfrom
361-7702-in-rlp-txn

Conversation

@letypequividelespoubelles
Copy link
Contributor

@letypequividelespoubelles letypequividelespoubelles commented Jan 20, 2026

Note

Medium Risk
Medium risk because it extends core rlp_txn constraint/spec logic with a new transaction type, new phase transitions, and new counters/columns; some of the new authorization-list constraints still contain TODO/incomplete pieces that could leave behavior underspecified.

Overview
Adds support for 7702 transactions by enabling typeFourTx and introducing a new \phaseAuthorizationList phase (plus NUMBER_OF_AUTHORIZATIONS) across the rlp_txn column definitions and general constraints.

Updates phase flag sums, binarity/constancy requirements, LT/LX participation, and transaction-type-specific phase-transition/RLP-component constraints to account for the new phase, and documents that 7702 txs cannot be deployment transactions.

Introduces a new phase_constraints/authorization_list/* section defining shorthands and RLP-ization/tuple-index/countdown constraints for authorization lists, adjusts auxiliary data column counts accordingly, and removes obsolete access_list/constraints.tex plus a stale version.md.

Written by Cursor Bugbot for commit a9d5cbb. This will update automatically on new commits. Configure here.

Signed-off-by: F Bojarski <[email protected]>
@letypequividelespoubelles letypequividelespoubelles linked an issue Jan 20, 2026 that may be closed by this pull request
cursor[bot]

This comment was marked as outdated.

Signed-off-by: F Bojarski <[email protected]>
cursor[bot]

This comment was marked as outdated.

Signed-off-by: F Bojarski <[email protected]>
cursor[bot]

This comment was marked as outdated.

\begin{enumerate}
\item \If $\locAuthorizationPrefix _{i} = 1$ \Then
\ob{We require a constraint that connects \rlpTxnCommonColumnNumberOfAuthorization{}
to an eponymous column in the $\isTxn{}$-perspective.}
Copy link

Choose a reason for hiding this comment

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

Required constraint explicitly marked as missing TODO

High Severity

Constraint item 1 contains a red TODO marker (\ob{}) stating "We require a constraint that connects \rlpTxnCommonColumnNumberOfAuthorization to an eponymous column in the \isTxn{}-perspective." This explicitly documents a missing constraint that is required but not specified. Without this linkage, the number of authorizations from transaction data won't be properly available during authorization list processing.

Fix in Cursor Fix in Web

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@OlivierBBB we can discard thos no ? \rlpTxnCommonColumnNumberOfAuthorization is a common colun, so no need to duplicate it in the txn perpective ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

We can indeed.

\left\{ \begin{array}{lclr}
\locAuthorizationIndex _{i - 1} & = & 0 & (\sanityCheck) \\
\locAuthorizationIndex _{i} & = & 0 \\
\locAuthorizationIndex _{i + 1} & = & 1 \vspace{2mm} \\
Copy link

Choose a reason for hiding this comment

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

Empty authorization list causes unsatisfiable constraints

High Severity

The specification cannot handle type-4 transactions with empty authorization lists. Line 45 unconditionally sets \locAuthorizationIndex _{i + 1} = 1 when entering the phase, but line 97 requires \locAuthorizationIndex = \rlpTxnCommonColumnNumberOfAuthorizations to exit. Combined with the monotonicity constraint (line 62) that only allows the index to increase, if NumberOfAuthorizations is 0, the index becomes 1 and can never return to 0, making the exit condition unsatisfiable.

Additional Locations (1)

Fix in Cursor Fix in Web

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that's the aim, yes.

OlivierBBB
OlivierBBB previously approved these changes Jan 29, 2026
Copy link
Collaborator

@OlivierBBB OlivierBBB left a comment

Choose a reason for hiding this comment

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

Several comments, also made some changes to the counter of authorization tuples.


\newcommand{\rlpTxnCommonColumnReplayProtection} {\col{REPLAY\_PROTECTION}}
\newcommand{\rlpTxnCommonColumnYparity} {\col{Y\_PARITY}}
\newcommand{\rlpTxnCommonColumnNumberOfAuthorization} {\col{NUMBER\_OF\_AUTHORIZATION}}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is that the number of an authorization tuple in the authorization list ? If so the name we use in the HUB and the RLP_TXN module is TUPLE_INDEX.

Edit. Since this column is constant the above doesn't apply. The only comment I would make is spelling, it has to be pural

\newcommand{\rlpTxnCommonColumnNumberOfAuthorizations}	  {\col{NUMBER\_OF\_AUTHORIZATIONS}}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

+1 for "s"

\markAsJustifiedHere{}
\rlpTxnCommonColumnNumberOfAuthorization{}:
the number of authorization in the authorization list;
\end{enumerate} No newline at end of file
Copy link
Collaborator

Choose a reason for hiding this comment

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

BTW we also (currently) count the number of auth tuples in the HUB: as it stands the HUB counts, for every type 4 transaction

  • the number of authorization tuples
  • the number of valid authorization tuples with sender == authority

Counting the valid ones with address collision in the HUB makes sense. I will remove the generic counting from the HUB as counting it in RLP_TXN makes more sense.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this column constant for the transaction ? Is it a countdown ? I ask this question in light of my

\rlpTxntransactionColumnLengthOfAuthorizationList

comment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, \rlpTxnCommonColumnNumberOfAuthorization{}: is transaction constant (and must be 0 for non-7702 txs)

\item \CFI
\item \rlpTxnCommonColumnReplayProtection
\item \rlpTxnCommonColumnYparity
\item \rlpTxnCommonColumnNumberOfAuthorization
Copy link
Collaborator

Choose a reason for hiding this comment

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

So \rlpTxnCommonColumnNumberOfAuthorization isn't a countdown given it's tx-constant.

}
\end{center}

We constrain \locAuthorizationIndex to increase by at most one:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Missing braces to separate the macro from "to"

... \locAuthorizationIndex{} to ...

\end{array} \right.
\]

\saNote{} We don't require any counter constancy for those columns. No newline at end of file
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we have a constraint imposing that authorization lists are nonempty ? Likely something à la

If
    TYPE_4[i] = true
    is_first_row_of_phase_y[i] = true
Then
    PHASE_AUTHORIZATION[i - 1] = true

Should do.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, the "listCantBeEmpty" bit of the rlpization of the prefix of the authorization list

Copy link
Collaborator

Choose a reason for hiding this comment

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

Cursor comment is right (Spurious text appended to section description)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there no constraint imposing that \locAuthorizationIndex _{i} should start at the value 1 for the first authorization tuple ?

Should we not impose e.g.

If AUTHORIZATION_PHASE[i - 1] = faux and AUTHORIZATION_PHASE[i] = true Then auth_index[i] = 1
If AUTHORIZATION_PHASE[i - 1] = true and AUTHORIZATION_PHASE[i] = true Then auth_index[i] is one of { auth_index[i - 1], 1 + auth_index[i - 1] }

Or do we know for sure that auth_index[i - 1] = 0 if i is the row where you compute the RLP prefix for the entire auth list ? If that is the case we should state it. Currently I'm not sure we couldn't start at the value auth_index = 13 for instance.

\phaseAuthorizationList _{i + 1} & = & 1 \\
\phaseAuthorizationList _{i + 10} & = & 1 \\
\phaseAuthorizationList _{i + \locAuthorizationNumberOfRows} & = & 1 \\
\end{array} \right.
Copy link

Choose a reason for hiding this comment

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

Authorization list constraints unsatisfiable for empty lists

High Severity

The authorization list constraints are unsatisfiable when rlpTxnCommonColumnNumberOfAuthorizations is 0 (empty list). Constraint 2 unconditionally sets locAuthorizationIndex[i+1] = 1 and forces the phase to last at least locAuthorizationNumberOfRows (19) rows. However, constraint 5 requires locAuthorizationIndex = numberOfAuthorizations when exiting the phase. For an empty list (count=0), these constraints contradict each other - the index is forced to 1 but must equal 0 to exit. No constraint forbids empty authorization lists for type-4 transactions.

Additional Locations (1)

Fix in Cursor Fix in Web


\ob{TODO: We require a constraint that connects \rlpTxnCommonColumnNumberOfAuthorizations{}
to an eponymous column in the $\isTxn{}$-perspective.}
\end{enumerate}
Copy link

Choose a reason for hiding this comment

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

Missing constraint connecting authorization count to transaction data

High Severity

The code contains an explicit TODO (lines 11-12) marking a required but missing constraint: "We require a constraint that connects \rlpTxnCommonColumnNumberOfAuthorizations to an eponymous column in the \isTxn-perspective." Without this constraint, the authorization count column is never actually set from transaction data for type-4 transactions, yet this value is used to control when authorization tuple processing terminates.

Fix in Cursor Fix in Web

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.


\ob{TODO: We require a constraint that connects \rlpTxnCommonColumnNumberOfAuthorizations{}
to an eponymous column in the $\isTxn{}$-perspective.}
\end{enumerate}
Copy link

Choose a reason for hiding this comment

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

Missing constraint leaves NumberOfAuthorizations unvalidated for type-4 transactions

High Severity

The constraint at lines 8-13 has an empty body after \If $\locAuthorizationPrefix _{i} = 1$ \Then - only a TODO comment exists where the actual constraint should be. This means \rlpTxnCommonColumnNumberOfAuthorizations is never connected to actual transaction data for type-4 transactions. While non-type-4 transactions force this to 0, type-4 transactions allow any prover-supplied positive value. This is a soundness issue where the count of authorization tuples processed may not match the actual transaction.

Fix in Cursor Fix in Web

\If $\locAuthorizationPrefix _{i} = 1$ \Then
\[
\left\{ \begin{array}{lclr}
\locAuthorizationIndex _{i - 1} & = & 0 \\
Copy link
Contributor Author

Choose a reason for hiding this comment

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

? the previous row is a TXN row tuple_index is a CMP row. This has to be deleted imho.

Copy link
Collaborator

Choose a reason for hiding this comment

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

👍 Good point

\locAuthorizationIndex _{i + 1} & = & 1 \vspace{2mm} \\
\isCmp _{i + 1} & = & 1 \vspace{2mm} \\
\phaseAuthorizationList _{i + 1} & = & 1 \\
\phaseAuthorizationList _{i + 10} & = & 1 \\
Copy link
Contributor Author

Choose a reason for hiding this comment

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

what is this +10 about ?

Copy link
Collaborator

@OlivierBBB OlivierBBB Jan 30, 2026

Choose a reason for hiding this comment

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

The above is a precaution to have checkpoints that are 100% reachable in any trace from the current vantage point to prevent early exits from the current phase. It's related to how constraints with large offsets get ignored if the trace runs out of rows such as how certain CALL constraints get clipped due to the presence of large MODEXP related shifts.

There are 1 + 3 rows per follow-up phase where integer rlp-utils calls are done on y, r, s. Three such phases are expected and must follow the current phase, so we are guaranteed that 12 rows must follow after the first CMP row of the AUTHORIZATION_LIST phase. The constraint with offset 10 falls squarely in that range and forces there to be at least 10 + 12 rows past the current vantage point.

The 3rd checkpoint isn't strictly speaking necessary due to this and will already be covered by the constraint saying that if tuple_index ≠ NUMBER_OF_AUTHORIZATIONS then IS_AUTHORIZATION[i + 19] = 1.

E.g. implemented as follows

(defconst
    AUTHORIZATION_PHASE___1ST_CHECKPOINT_OFFSET   1
    AUTHORIZATION_PHASE___2ND_CHECKPOINT_OFFSET  10
    AUTHORIZATION_PHASE___3RD_CHECKPOINT_OFFSET  19
)

(defconstraint   authority-list-phase---ensuring-minimum-phase-length (:guard ...)
          (begin
            (eq! (shift   IS_AUTHORIZATION_LIST   AUTHORIZATION_PHASE___1ST_CHECKPOINT_OFFSET ) 1)
            (eq! (shift   IS_AUTHORIZATION_LIST   AUTHORIZATION_PHASE___2ND_CHECKPOINT_OFFSET ) 1)
            (eq! (shift   IS_AUTHORIZATION_LIST   AUTHORIZATION_PHASE___3RD_CHECKPOINT_OFFSET ) 1)
          ))

\locAuthorizationIndex _{i - 1} & = & 0 \\
\locAuthorizationIndex _{i} & = & 0 \\
\locAuthorizationIndex _{i + 1} & = & 1 \vspace{2mm} \\
\isCmp _{i + 1} & = & 1 \vspace{2mm} \\
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can keep only of the two folowing: we have general constrains that a phase change <=> TXN row.

where $\ell$ is the length of the \texttt{authorization\_list} in the
current ``set code transaction'' i.e. $\ell \equiv \rlpTxnCommonColumnNumberOfAuthorizations$.
\item\label{rlp txn: phase constraints: authorization list: constraints: monotonicity of tuple index}
\If $\phaseAuthorizationList _{i - 1} = \true$ \Then $\locAuthorizationIndex _{i} \in \{ \locAuthorizationIndex _{i - 1}, 1 + \locAuthorizationIndex _{i - 1} \}$
Copy link
Contributor Author

Choose a reason for hiding this comment

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

why not using shorthand again_CMP_row_of_auth_phase ? We have already the constraint for the two first rows: 0 and then 1.

\Then
\[
\left\{ \begin{array}{lcl}
\phaseAuthorizationList _{i + 1} & = & 1 \\
Copy link
Contributor Author

Choose a reason for hiding this comment

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

one of the two is enough

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I mean one of the CMP or IS_AUTH_LIST, but the two offset are ok.

\locAuthorizationLengthCountdown _{i} & \define & \rlpTxnComputationColumnAuxiliaryData {1} _{i} \\
\locAuthorizationItemCountdown _{i} & \define & \rlpTxnComputationColumnAuxiliaryData {2} _{i} \\
\locAuthorizationIndex _{i} & \define & \rlpTxnComputationColumnCounterConstantAuxiliaryData {1} _{i} \\
\locAuthorizationChainId _{i} & \define & \rlpTxnComputationColumnCounterConstantAuxiliaryData {2} _{i} \\
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess we want a chainId hi as well ?

Image

We enforce that authorization lists must be nonempty
\begin{enumerate}[resume]
\item\label{rlp txn: phase constraints: authorization list: constraints: authorization lists must be nonempty}
$\rlpTxnCommonColumnNumberOfAuthorizations _{i} \neq 0$
Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's a sanity check, we already ask thge list to be non empty:

Image

and

Image

\rlpProcessInteger {
anchorRow = i ,
relOffset = \yellowm{1} ,
integerHi = 0 ,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

chainId Hi as well ?

\end{enumerate}
And a finalization constraint:
\begin{enumerate}[resume]
\item \If $\phaseEnd _{i} = 1$ \Then $\locAuthorizationLengthCountdown _{i} = 0$
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would put it as the same place as

Image (or at least a reminder ...)

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.

7702 in RLP-TXN

2 participants