rolling-shutter icon indicating copy to clipboard operation
rolling-shutter copied to clipboard

Collator: future batches `L1BlockNumber` inference

Open ezdac opened this issue 2 years ago • 0 comments

Problem definition

The shutter-transaction submission process has the following properties:

  • a user can submit transactions targeted for future batches up to a certain BatchIndexAcceptanceInterval threshold
  • the user has to encrypt a future batch with the epoch-encryption-key derived from the batch-number
  • the user has to include the L1BlockNumber for the future batch and sign it
  • the L1BlockNumber has to match exactly with the collators L1BlockNumber included in its batch-transaction

The result of this is that the collator has to provide users with the exact L1BlockNumber that will be used for the batch-transaction in the future. This block-number then has to be in a reasonable interval around the current ethereum block-number as known by the sequencer at the time of submittal of the batch (see #271 ).

Task

  • [ ] come up with an inference algorithm (let's call it block-oracle) that:
    • at any time provides the to-be used L1BlockNumber for all batches current-batch, current-batch +1, ... , current-batch+BatchIndexAcceptanceInterval
    • this has to be calculated based on some metrics like "average shutter batch-time" and layer 1 block time.
    • the value has to be inferred, and then can not change in the future, since user transactions might have already considered this
  • [ ] provide an endpoint where a user can query l1-block numbers
    • returning either a list of n (or all) next l1 block numbers
    • returning the block number for a specific batch queried by the user
  • [ ] use the generated block-numbers during creation of batch-transactions in the collators batcher mechanism

ezdac avatar Nov 07 '22 12:11 ezdac