Skip to content

Commit

Permalink
specs: add optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
tynes committed Feb 23, 2024
1 parent aeb20bc commit adfd287
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions specs/fjord/diff-based-attributes-tx.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

- [Implementation](#implementation)
- [Ecotone L1Attributes Example](#ecotone-l1attributes-example)
- [Optimization](#optimization)
- [Node Implementation](#node-implementation)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->
Expand Down Expand Up @@ -54,6 +55,17 @@ be read from the `calldata` and the offset of the next read from the calldata is
incremented by the `size`. If the value in the bitfield is a `0`, then the data
is not present and any reading/seeking is skipped.

### Optimization

The above example can be optimized by grouping the attributes that always change together
into a single bit. This would be the `l1BlockTimestamp`, the `l1BlockNumber` and `l1BlockHash`.
In the case of a missed L1 slot or L1 reorg, it is possible to have the `l1BlockNumber` not change but
the others may change. This case doesn't happen often and would result in some repeat data being
posted.

It is not safe to omit the `sequenceNumber` due to the fact that it always increases because we need
to guarantee that L1 Attributes Transactions have unique transaction hashes. In this way it acts as a nonce.

## Node Implementation

Previously, the node could read the calldata from the latest `L1Attributes` transaction
Expand Down

0 comments on commit adfd287

Please sign in to comment.