Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

interop: Specify deposit handling #258

Merged
merged 23 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
3cad559
interop: Specify deposit handling
Inphi Jun 25, 2024
24110f5
lint
Inphi Jun 25, 2024
5712225
refine spec; include L1Block upgrade
Inphi Jun 28, 2024
bf9fc12
chore: rename reset to complete
skeletor-spaceman Aug 12, 2024
04fb109
Merge branch 'main' into inphi/interop-deposits
skeletor-spaceman Aug 13, 2024
1acbb65
fix: fixes lint reference issues
skeletor-spaceman Aug 13, 2024
1009881
fix: missing rename of resetIsDeposit
skeletor-spaceman Aug 13, 2024
ed46ecd
fix: mdbook references
skeletor-spaceman Aug 13, 2024
9b1c671
fix: Interop to Isthmus rename
skeletor-spaceman Aug 13, 2024
5915c56
fix: typos
skeletor-spaceman Aug 13, 2024
5e81f8d
fix: reference L1BlockInterop instead of L1Block
skeletor-spaceman Aug 13, 2024
c453d23
fix: l1_attributes to -
skeletor-spaceman Aug 13, 2024
f94268d
fix: l1-attributes reference to corresponding folder
skeletor-spaceman Aug 14, 2024
aea46b9
fix: l1-attributes reference to corresponding folder
skeletor-spaceman Aug 14, 2024
94ec370
Merge branch 'main' into inphi/interop-deposits
skeletor-spaceman Aug 14, 2024
f2e2b06
fix: l1-attributes reference to corresponding folder
skeletor-spaceman Aug 14, 2024
04b70a3
fix: l1-attributes reference to corresponding folder
skeletor-spaceman Aug 14, 2024
c7c95f6
fix: l1-attributes reference to corresponding folder
skeletor-spaceman Aug 14, 2024
4014e3f
Merge branch 'main' into inphi/interop-deposits
skeletor-spaceman Aug 20, 2024
4f4c30b
fix: remove trailing spaces
skeletor-spaceman Aug 20, 2024
cfead3a
feat: merged from main
skeletor-spaceman Aug 29, 2024
47d441a
fix: remove liq-migration
skeletor-spaceman Aug 29, 2024
3a09f87
fix: rename interop to isthmus, remove L1BlockInterop reference
skeletor-spaceman Aug 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions specs/interop/derivation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents**

- [Overview](#overview)
- [Deposit Context](#deposit-context)
- [Security Considerations](#security-considerations)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## Overview

This is an experimental section and may be changed in the future. It is not required
tynes marked this conversation as resolved.
Show resolved Hide resolved
for the initial release.

### Deposit Context

Derivation is extended to create **deposit contexts**, which signifies the execution of a depositing transaction. A deposit context is scoped to a single block, commencing with the execution of the first deposited transaction and concluding immediately after the execution of the final deposited transaction within that block. As such, there is exactly one deposit context per block.

## Security Considerations

TODO
34 changes: 34 additions & 0 deletions specs/interop/predeploys.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- [`_target`](#_target)
- [`ExecutingMessage` Event](#executingmessage-event)
- [Reference implementation](#reference-implementation)
- [Deposit Handling](#deposit-handling)
- [`Identifier` Getters](#identifier-getters)
- [L2ToL2CrossDomainMessenger](#l2tol2crossdomainmessenger)
- [`relayMessage` Invariants](#relaymessage-invariants)
Expand All @@ -26,6 +27,9 @@
- [L1Block](#l1block)
- [Static Configuration](#static-configuration)
- [Dependency Set](#dependency-set)
- [Deposit Context](#deposit-context)
- [`isDeposit`](#isdeposit)
- [`setDepositing`](#setdepositing)
- [Security Considerations](#security-considerations)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->
Expand Down Expand Up @@ -139,6 +143,12 @@ function executeMessage(Identifier calldata _id, address _target, bytes calldata

Note that the `executeMessage` function is `payable` to enable relayers to earn in the gas paying asset.

### Deposit Handling

A call to `executeMessage` reverts if the call is made in a [deposit context](./derivation.md#deposit-context). The deposit context status can be determined by callling `isDeposit` on the `L1Block` contract.

In the future, deposit handling will be modified to be more permissive. It will revert only in specific cases where interop dependency resolution is not feasible.

### `Identifier` Getters

The `Identifier` MUST be exposed via `public` getters so that contracts can call back to authenticate
Expand Down Expand Up @@ -416,6 +426,30 @@ dependency set called `dependencySet()`. This function MUST return the array of
`L1Block` MUST also provide a public getter to get the dependency set size called `dependencySetSize()`. This function
MUST return the length of the dependency set array.

### Deposit Context

The `L1Block` contract is updated with the following methods to support [deposit contexts](./derivation.md#deposit-context).

#### `isDeposit`

```solidity
function isDeposit() (return bool)
Copy link
Member

Choose a reason for hiding this comment

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

Would fit very well as a transient storage variable.

```

A new method added to `L1Block` indicating whether the current execution is in a [deposit context](./derivation.md#deposit-context). The method has the following signature:


Only the `CrossL2Inbox` is authorized to call `isDeposit`.
tynes marked this conversation as resolved.
Show resolved Hide resolved

#### `setDepositing`

```solidity
function setDepositing(bool _isDepositing)
```
A new method added to indicate whether the current execution is in a deposit context.

Only the `DEPOSITOR_ACCOUNT` is authorized to call `setDepositing`.
tynes marked this conversation as resolved.
Show resolved Hide resolved

## Security Considerations

TODO
5 changes: 5 additions & 0 deletions specs/interop/upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
**Table of Contents**

- [Security Considerations](#security-considerations)
- [Deposit Transactions During Upgrades](#deposit-transactions-during-upgrades)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

Expand All @@ -29,3 +30,7 @@ The exact definitions for these upgrade transactions are still to be defined.
## Security Considerations

TODO

### Deposit Transactions During Upgrades

TODO
skeletor-spaceman marked this conversation as resolved.
Show resolved Hide resolved