Skip to content

Commit

Permalink
corections
Browse files Browse the repository at this point in the history
  • Loading branch information
maciejka committed Jan 10, 2025
1 parent 3165959 commit e6904c1
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
31 changes: 31 additions & 0 deletions operator/src/l1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ We should have a way to create deposit transactions for users. Tbd.

Assuming that aggregation happens in rounds:

<<<<<<< Updated upstream
- `aggregateDeposits(txs: L1TxHash) -> Promise<L1TxHashAndStatus[]>` - create and send a round of aggregation txs based on previous round of aggregation. Actual parameter types during implementation.

### Register aggregated deposits in the Bridge State Contract
Expand All @@ -33,6 +34,29 @@ Assuming that aggregation happens in rounds:
Assuming that aggregation happens in rounds:

- `aggregateWithdrawals(txs: L1TxHash) -> Promise<L1TxHashAndStatus[]>` - create and send a round of aggregation txs based on previous round of aggregation. Actual parameter types during implementation.
=======
- `aggregateDeposits(txs: L1TxHash[]) -> Promise<L1TxHashAndStatus[]>` - create and send a round of aggregation txs based on previous round of aggregation. Actual parameter types should be defined during implementation.

### Register aggregated deposits in the Bridge State Contract

- `registerDepositBatch(depositBatchTx: L1TxHash, root: string) -> Promise<L1TxHashAndStatus>` - create and send a deposit batch registration transaction. Exact parameters tbd during implementation.

### Mark aggregated deposits as completed on L2 in the Bridge State Contract

- `completeDepositBatch(depositBatchTx: L1TxHash, root: string) -> Promise<L1TxHashAndStatus>` - given aggregated deposit batch create and send a deposit batch completion transaction

### Register aggregated withdrawals in the Bridge State Contract

- `registerWithdrawalBatch(withdrawalBatchId: number, root: string) -> Promise<L1TxHashAndStatus>` - create and send a withdrawal batch registration transaction



### Withdrawals expansion

Assuming that expansion happens in rounds:

- `expandWithdrawals(txs: L1TxHash) -> Promise<L1TxHashAndStatus[]>` - create and send a round of expansion txs based on previous round of expansion. Actual parameter types tbd during implementation.
>>>>>>> Stashed changes
### Withdrawal Creation

Expand All @@ -41,3 +65,10 @@ We should have a way to create withdrawal transactions for users. Tbd.
### Transaction monitoring

- `l1TransactionStatus(tx: L1TxHash) -> L1TxHashAndStatus` - return status of l1 transaction given its txid
<<<<<<< Updated upstream
=======

### Transaction state transiontion function

Is should handle transaction state, handle necessary edge cases. Tbd.
>>>>>>> Stashed changes
11 changes: 11 additions & 0 deletions operator/src/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ type DepositBatch =
depositTx: L2TxHashAndStatus;
} & DepositBatchCommon)
| ({
<<<<<<< Updated upstream
status: 'SUBMITTED_FOR_VERIFICATION';
=======
status: 'SUBMITTED_FOR_COMPLETION';
>>>>>>> Stashed changes
aggregationTxs: L1TxHashAndStatus[][];
stateUpdateTx: L1TxHashAndStatus;
depositTx: L2TxHashAndStatus;
Expand Down Expand Up @@ -108,7 +112,11 @@ type WithdrawalBatch =
closeWithdrawalBatchTx: L2TxHashAndStatus;
} & WithdrawalBatchCommon)
| ({
<<<<<<< Updated upstream
status: 'SUBMITTED_FOR_VERIFICATION';
=======
status: 'SUBMITTED_FOR_EXPANSION';
>>>>>>> Stashed changes
withdrawals: Withdrawal[];
hash: bigint;
closeWithdrawalBatchTx: L2TxHashAndStatus;
Expand Down Expand Up @@ -197,7 +205,10 @@ export function applyChange(
switch (depositBatch.status) {
case 'SUBMITTED_TO_L2':
if (depositBatch.depositTx.hash === change.hash) {
<<<<<<< Updated upstream
depositBatch.depositTx = change;
=======
>>>>>>> Stashed changes
if (change.status.isSuccess()) {
// TODO: finality?
newState.depositBatches[i] = {
Expand Down

0 comments on commit e6904c1

Please sign in to comment.