Skip to content

Commit 552e2ee

Browse files
committed
doc: add timestamp and gas limit to Preconf in design doc
1 parent f286344 commit 552e2ee

File tree

2 files changed

+42
-9
lines changed

2 files changed

+42
-9
lines changed

.claude/settings.local.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"Bash(git log:*)",
5+
"Bash(git show:*)",
6+
"Bash(git ls-tree:*)"
7+
],
8+
"deny": [],
9+
"ask": []
10+
}
11+
}

docs/permissionless-design-doc.md

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,10 @@ struct Preconfirmation {
230230
bool eop;
231231
// Height of the preconfed block
232232
uint256 blockNumber;
233+
// Timestamp of the preconfed block
234+
uint256 timestamp
235+
// Gas limit for the preconfed block
236+
uint256 gasLimit
233237
// Height of the L1 block chosen as anchor for the preconfed block
234238
uint256 anchorBlockNumber;
235239
// Hash of the raw list of transactions included in the parent block
@@ -346,15 +350,33 @@ def verifyPreconf(# CHANGE: Function now takes rawTxList instead of full L2 bloc
346350
# 6) Verify rawTxList consistency
347351
assert hash(rawTxList) == preconf.rawTxListHash
348352

349-
# 7) Reconstruct full L2 block by adding anchor transaction
353+
# 7) Verify timestamp and gasLimit
354+
# Timestamp must be monotonically increasing
355+
assert preconf.timestamp >= localL2Head.timestamp
356+
# Timestamp must not drift too far from current time
357+
assert abs(preconf.timestamp - now()) <= MAX_TIMESTAMP_DRIFT
358+
359+
# Gas limit must match deterministic protocol calculation
360+
expectedGasLimit = getExpectedGasLimit(
361+
parentHash=localL2Head.hash,
362+
parentGasLimit=localL2Head.gasLimit,
363+
parentGasUsed=localL2Head.gasUsed
364+
)
365+
assert preconf.gasLimit == expectedGasLimit
366+
367+
# 8) Reconstruct full L2 block by adding anchor transaction
350368
anchorHash = L1.getBlockHash(preconf.anchorId)
351369
anchorTx = constructAnchorTx(anchorHash)
352-
l2Block = executeL2Block([anchorTx] + rawTxList)
370+
l2Block = executeL2Block(
371+
transactions=[anchorTx] + rawTxList,
372+
timestamp=preconf.timestamp,
373+
gasLimit=preconf.gasLimit
374+
)
353375

354-
# 8) Advance local canonical chain
376+
# 9) Advance local canonical chain
355377
localL2Head = l2Block
356378

357-
# 9) Handle explicit EOP handoff
379+
# 10) Handle explicit EOP handoff
358380
if preconf.eop:
359381
currentPreconfer = lookaheadStore.getNextPreconfer()
360382

@@ -383,21 +405,21 @@ The preconfers will need to eventually include their preconfed L2 transactions i
383405

384406
Preconf equivocation can be categorized into four categories:
385407

386-
- **RawTxList/anchorID mismatch:** The preconfer failed to honor the transaction ordering and/or anchor ID they preconfed.
408+
- **Block commitment mismatch:** The preconfer failed to honor the rawTxList, anchor ID, timestamp, or gas limit they preconfed.
387409
- **Missed submission**: The preconfer did not submit the preconfed block to the Taiko inbox.
388410
- **Invalid EOP:** The preconfer included additional L2 blocks after their `EOP=true` block.
389411
- **Missing EOP:** The preconfer did not include set `EOP=true` in their final preconfed block.
390412

391413
Let’s examine each category in detail.
392414

393-
### **RawTxList/anchorID** Mismatch Slashing
415+
### Block Commitment Mismatch Slashing
394416

395-
Slash when the rawTxList/anchorID for a given L2 block ID differs between:
417+
Slash when the rawTxList/anchorID/timestamp/gasLimit for a given L2 block ID differs between:
396418

397419
- The block is **preconfed** and published on the P2P network.
398420
- The block was **submitted** to L1 and later proven.
399421

400-
For example, in this diagram, the preconfed block `B1` (preconfed in P2P) and the submitted block `B1′` (submitted to L1) have different rawTxList/anchorID for the same L2 block ID.
422+
For example, in this diagram, the preconfed block `B1` (preconfed in P2P) and the submitted block `B1′` (submitted to L1) have different rawTxList/anchorID/timestamp/gasLimit for the same L2 block ID.
401423

402424
![image.png](images/image%205.png)
403425

@@ -417,7 +439,7 @@ However, checking `submissionWindowEnd` alone is not sufficient to protect preco
417439

418440
![image.png](images/image%207.png)
419441

420-
To protect against such cases, we compare not only the `rawTxList` and `anchorId` of the preconfirmed and submitted blocks, but also their **parent** `rawTxList`, `anchorId`, and `submissionWindowEnd` values. If any of these parent values differ, the slashing is not applied to the current preconfer. Instead, the slashing entity is expected to target the parent block. This allows us to trace the divergence back transitively to the original L2 block where the mismatch first occurred.
442+
To protect against such cases, we compare not only the `rawTxList`, `anchorId`, `timestamp`, and `gasLimit` of the preconfirmed and submitted blocks, but also their **parent** `rawTxList`, `anchorId`, and `submissionWindowEnd` values. If any of these parent values differ, the slashing is not applied to the current preconfer. Instead, the slashing entity is expected to target the parent block. This allows us to trace the divergence back transitively to the original L2 block where the mismatch first occurred.
421443

422444
### Missed Submission
423445

0 commit comments

Comments
 (0)