feat: surge actual real time proving#891
feat: surge actual real time proving#891smartprogrammer93 merged 16 commits intosurge-real-time-pocfrom
Conversation
|
@claude please review |
1 similar comment
|
@claude please review |
|
Claude finished @smartprogrammer93's task in 2m 31s —— View job PR Review: feat: surge actual real time proving
OverviewThis PR introduces a new Critical Issues🔴 Hardcoded Private Key — Must Fix Before Merge
// Surge: Hard coding the private key for the POC
l1_call_proof_signer: alloy::signers::local::PrivateKeySigner::from_bytes(
&"0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
.parse::<alloy::primitives::FixedBytes<32>>()?,
)?,This is the well-known Hardhat/Anvil account #0 private key ( High Priority Issues🟠 Bridging Guard vs. Bridge Handler Contradiction
if !config.disable_bridging {
return Err(anyhow::anyhow!(
"Bridging is not implemented. Exiting RealTime node creation."
));
}
🟠 Duplicate
|
* feat(realtime): support L2 UserOps for bridge-out (L2→L1 withdrawals) Add the ability for users to submit UserOps that execute on L2, enabling bridge-out functionality. The catalyst now processes both L1→L2 deposits and L2→L1 withdrawals in the same block. Changes: - New `surge_sendL2UserOp` RPC method for submitting L2-targeted UserOps - L2 UserOp execution transactions are constructed and included in L2 blocks - After block execution, existing `find_l1_call()` detects the resulting bridge MessageSent events and relays them to L1 via processMessage - Block building handles mixed deposit + withdrawal transactions - Remove `disable_bridging` gate that prevented bridge handler startup Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: remove unused deposit watcher and plan doc Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor(realtime): single surge_sendUserOp RPC with auto chain detection Instead of separate RPC methods for L1 and L2 UserOps, the single surge_sendUserOp endpoint now auto-detects the target chain by parsing the EIP-712 signature in the executeBatch calldata. The UserOpsSubmitter's EIP-712 domain includes chainId, so the signature is only valid for one chain. We compute the EIP-712 digest for both L1 and L2 chain IDs, ecrecover each, and route accordingly: - L1 signature → L1→L2 deposit flow (simulate on L1, processMessage on L2) - L2 signature → L2 direct execution (UserOp tx in L2 block, L2→L1 relay via find_l1_call) Both types can coexist in the same block. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor(realtime): use explicit chainId param instead of signature detection The surge_sendUserOp RPC now accepts an optional chainId field in the UserOp params. If chainId matches L2, the UserOp is executed directly on L2. Otherwise defaults to L1 (backwards compatible). Removes the EIP-712 signature parsing logic which was unreliable (ecrecover always returns a non-zero address). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix(realtime): increase L2 tx gas limit to 3M processMessage and L2 UserOp transactions need more gas for operations that deploy contracts (e.g. CREATE2 smart wallet deployment via bridge relay). 1M gas was insufficient — the bridge's post-call gas check was failing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix(realtime): only increase gas for bridge/UserOp txs, not anchor The anchor tx has a required gas limit enforced by the L2 engine. Revert anchor to 1M, keep processMessage and UserOp txs at 3M. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix(realtime): track L2 UserOp status through proving and submission L2 direct UserOps now get ProvingBlock and Executed/Rejected status updates, same as L1 UserOps. Added l2_user_op_ids to Proposal struct and included them in the async submitter's status tracking. Also adds cleanup: status entries are removed from sled after 60s to prevent unbounded disk growth. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: address code review feedback on L2 UserOps PR - Fix misleading Processing(zero_hash) status: remove premature status update for L2Direct UserOps; status remains Pending until async_submitter sets ProvingBlock - Propagate add_l2_user_op_id error instead of silently ignoring with let _, which could leave status entries orphaned forever - Remove redundant target_chain variable, simplify to direct chain_id comparison - Fix doc comment: routing is based on chainId field, not EIP-712 signature - Add SAFETY comment for Recovered::new_unchecked explaining why it's correct Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: address second round of review feedback - Mark L2 UserOp IDs as Rejected on L1 multicall failure (were stuck at ProvingBlock) - Track L2 UserOp ID before inserting tx into block (prevents executed-but-Rejected state) - Reject UserOps with unknown chainId instead of silently treating as L1 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: clarify debug log when L2Direct UserOp is handled The "No pending UserOps" log was misleading when an L2Direct op was processed, since add_pending_user_ops_to_draft_block returns None for both "nothing queued" and "L2Direct handled". Updated to distinguish. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * logs --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: AnshuJalan <anshujalan206@gmail.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
No description provided.