Skip to content

feat: l1 anchoring#33

Merged
lightsing merged 14 commits intodev/m2from
feat/l1-anchoring
Mar 2, 2026
Merged

feat: l1 anchoring#33
lightsing merged 14 commits intodev/m2from
feat/l1-anchoring

Conversation

@lightsing
Copy link
Owner

No description provided.

@lightsing lightsing requested a review from Copilot February 28, 2026 05:07
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds L1 anchoring support around the UniversalTimestamps system by introducing an L2 manager for paid submissions, an L1 gateway for batching/confirmation, and supporting tooling/config.

Changes:

  • Introduces L2 anchoring flow (manager, fee oracle, gateway) plus scripts for deploy + E2E interactions.
  • Refactors UniversalTimestamps to store richer attestation data (timestamp + block number) using ERC-7201 storage libraries.
  • Adds Scroll contracts dependency (submodule + remapping) and updates Foundry config (Solc version, RPC endpoints).

Reviewed changes

Copilot reviewed 28 out of 30 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
script/E2E.s.sol Adds scripts to submit roots on L2 and confirm batches on L1.
script/DeployCreate2.s.sol Removes legacy Create2 deploy script (replaced by new deploy scripts).
script/Deploy.s.sol Adds deployment/upgrade scripts for UTS, fee oracle, manager, and gateway.
remappings.txt Adds remapping for scroll-contracts/ imports.
lib/scroll-contracts Adds Scroll contracts as a git submodule pin.
foundry.toml Updates Solc version, ignored codes, and adds RPC endpoints.
foundry.lock Locks scroll-contracts dependency version.
crates/contracts/abi/UniversalTimestamps.json Regenerates ABI/artifacts for updated UniversalTimestamps.
crates/contracts/abi/IUniversalTimestamps.json Regenerates ABI/artifacts for updated IUniversalTimestamps.
crates/contracts/abi/ERC1967Proxy.json Regenerates ABI/artifacts (compiler version bump).
contracts/core/UniversalTimestampsTypes.sol Adds shared Attestation type (timestamp + blockNumber).
contracts/core/UniversalTimestampsStorage.sol Adds ERC-7201 storage access library for UTS.
contracts/core/MerkleTree.sol Adds Merkle root computation/verification library intended to match Rust logic.
contracts/core/IUniversalTimestamps.sol Adds expanded UTS interface (timestamp, blockNumber, full attestation, event).
contracts/UniversalTimestamps.sol Refactors UTS implementation to new interface + ERC-7201 storage library.
contracts/L2/oracle/L1FeeOracle.sol Adds fee oracle using Scroll L1 gas oracle predeploy.
contracts/L2/oracle/IL1FeeOracle.sol Adds fee oracle interface.
contracts/L2/manager/L2AnchoringManagerTypes.sol Adds anchoring queue item type.
contracts/L2/manager/L2AnchoringManagerStorage.sol Adds ERC-7201 storage access library for the manager.
contracts/L2/manager/L2AnchoringManager.sol Adds L2 anchoring manager (queueing, confirmation via messenger, fee collection).
contracts/L2/manager/IL2AnchoringManager.sol Adds L2 anchoring manager interface and events.
contracts/L1/L1AnchoringGatewayStorage.sol Adds ERC-7201 storage access library for the gateway.
contracts/L1/L1AnchoringGateway.sol Adds L1 gateway to attest aggregate root and message L2 confirmation.
contracts/L1/IL1AnchoringGateway.sol Adds L1 gateway interface.
contracts/IUniversalTimestamps.sol Removes old interface (superseded by contracts/core/IUniversalTimestamps.sol).
contract-tests/UniversalTimestamps.t.sol Removes old upgrade/storage persistence test.
contract-tests/Storage.t.sol Adds ERC-7201 slot derivation consistency test.
contract-tests/L1AnchoringManager.t.sol Adds tests for L2AnchoringManager (but file naming suggests L1).
.gitmodules Registers lib/scroll-contracts submodule.
.env.test Adds addresses/env vars for testing scripts and deployments.
Comments suppressed due to low confidence (1)

contracts/core/UniversalTimestampsStorage.sol:1

  • NAMESPACE and SLOT are marked internal, but contract-tests/Storage.t.sol references UniversalTimestampsStorage.SLOT/NAMESPACE (and similarly for the L1/L2 storage libraries). This will not compile. Expose these constants (e.g., public) if external test/contracts need them, or update tests to avoid direct access.
// SPDX-License-Identifier: MIT

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@lightsing lightsing requested a review from Copilot February 28, 2026 08:00
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 35 out of 38 changed files in this pull request and generated 8 comments.

Comments suppressed due to low confidence (5)

script/E2E.s.sol:1

  • IL2AnchoringManager.submitForL1Anchoring now takes (bytes32 root, address refundAddress), but the script calls it with a single argument. Update the script to pass a refund address (e.g., msg.sender or an env-provided address) so it compiles and so overpayments can be refunded as intended.
    script/E2E.s.sol:1
  • IL2AnchoringManager.submitForL1Anchoring now takes (bytes32 root, address refundAddress), but the script calls it with a single argument. Update the script to pass a refund address (e.g., msg.sender or an env-provided address) so it compiles and so overpayments can be refunded as intended.
    script/E2E.s.sol:1
  • IL1AnchoringGateway.submitBatch requires 4 parameters (merkleRoot, startIndex, count, gasLimit), but the script provides only 3. Pass an explicit gasLimit so the call compiles and the Scroll messenger invocation has a bounded L2 execution budget.
    script/Deploy.s.sol:1
  • The deployment script arguments don’t match the new contract constructors/initializers:
  • L1FeeOracle constructor takes only initialOwner, but the script passes 3 parameters.
  • L2AnchoringManager.initialize takes 4 parameters (initialOwner, uts, feeOracle, l2Messenger), but the script encodes 5 (includes l1Messenger).
    Adjust the script to match the new signatures (and set L1 gateway / messenger via the manager’s admin setters if needed).
    script/Deploy.s.sol:1
  • The deployment script arguments don’t match the new contract constructors/initializers:
  • L1FeeOracle constructor takes only initialOwner, but the script passes 3 parameters.
  • L2AnchoringManager.initialize takes 4 parameters (initialOwner, uts, feeOracle, l2Messenger), but the script encodes 5 (includes l1Messenger).
    Adjust the script to match the new signatures (and set L1 gateway / messenger via the manager’s admin setters if needed).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

lightsing and others added 3 commits February 28, 2026 16:11
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@lightsing lightsing added this to the L1 Anchoring milestone Mar 1, 2026
lightsing and others added 3 commits March 1, 2026 16:17
* integrate with EAS

* reduce gas cost

* add EAS test and adjust l1 gas

* use timestamp instead of attest to reduce L1 gas

* feat(eas): update rust side (#36)

* update contracts

* feat(eas): update ts sdk & web (#37)
@lightsing lightsing merged commit b7a7764 into dev/m2 Mar 2, 2026
@lightsing lightsing deleted the feat/l1-anchoring branch March 2, 2026 12:02
lightsing added a commit that referenced this pull request Mar 4, 2026
* init

* fix

* remove sort in MerkleTree

* minimize uts

* add refund

* apply reviews and fix

* add tests and fix

* seperate notify and finalize

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* add submitter and use _msgSender

* add token

* add constants

* update fee model

* feat: integrate with EAS (#35)

* integrate with EAS

* reduce gas cost

* add EAS test and adjust l1 gas

* use timestamp instead of attest to reduce L1 gas

* feat(eas): update rust side (#36)

* update contracts

* feat(eas): update ts sdk & web (#37)

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.

2 participants