Skip to content

MAINNET-DAY-0 says registering and shielding need no proof, but apply_actions always validates one #223

Description

@Immadominion

MAINNET-DAY-0.md says:

What needs no proof at all: registering a viewing key, and shielding. Both are ordinary public transactions. A headless service can move value into the pool today with nothing but an RPC URL

I do not think that is right, and it is the kind of thing that costs a team a day.

apply_actions calls validate_proof unconditionally, before it does anything else:

fn apply_actions(
    ref self: ContractState,
    actions: Span<ServerAction>,
    screening: Option<ScreeningAttestation>,
) {
    self.reentrancy_guard.start();
    self.pausable.assert_not_paused();
    self.validate_proof(:actions);
    ...

and validate_proof starts with:

let mut proof_facts_span = execution_info.tx_info.proof_facts;
assert(!proof_facts_span.is_empty(), errors::EMPTY_PROOF_FACTS);

There is no branch on the action types. apply_actions is also the only non-admin write entrypoint on the contract, so as far as I can tell every state change needs a proof, registration and shielding included.

That matches what I observed building against the Sepolia pool: SetViewingKey and a shield both had to go through compile_actions, a prover, and then apply_actions with proof and proof_facts attached. Without them the submission does not get as far as reverting.

If there is a route I have missed I would like to know, since it would make the first mainnet transactions much cheaper to reach. But if the doc is out of date it is worth fixing: it currently tells teams they can write to the pool with only an RPC URL, and that is where the eligibility transactions have to happen.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions