diff --git a/operator/src/l1/README.md b/operator/src/l1/README.md index 9368414..86a9a2f 100644 --- a/operator/src/l1/README.md +++ b/operator/src/l1/README.md @@ -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` - 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 @@ -33,6 +34,29 @@ Assuming that aggregation happens in rounds: Assuming that aggregation happens in rounds: - `aggregateWithdrawals(txs: L1TxHash) -> Promise` - create and send a round of aggregation txs based on previous round of aggregation. Actual parameter types during implementation. +======= +- `aggregateDeposits(txs: L1TxHash[]) -> Promise` - 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` - 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` - 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` - create and send a withdrawal batch registration transaction + + + +### Withdrawals expansion + +Assuming that expansion happens in rounds: + +- `expandWithdrawals(txs: L1TxHash) -> Promise` - create and send a round of expansion txs based on previous round of expansion. Actual parameter types tbd during implementation. +>>>>>>> Stashed changes ### Withdrawal Creation @@ -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 diff --git a/operator/src/state.ts b/operator/src/state.ts index 063a109..5a2991c 100644 --- a/operator/src/state.ts +++ b/operator/src/state.ts @@ -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; @@ -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; @@ -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] = {