Skip to content

Commit

Permalink
Specify Granite protocol upgrade (#321)
Browse files Browse the repository at this point in the history
* Specify Granite protocol upgrade

* Update specs/protocol/granite/derivation.md

Co-authored-by: clabby <[email protected]>

* clarify activation timestamp for channel frames

---------

Co-authored-by: clabby <[email protected]>
Co-authored-by: Mark Tyneway <[email protected]>
  • Loading branch information
3 people authored Aug 16, 2024
1 parent b025e76 commit 8268de6
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 21 deletions.
23 changes: 23 additions & 0 deletions specs/protocol/granite/derivation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Granite L2 Chain Derivation Changes

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents**

- [Protocol Parameter Changes](#protocol-parameter-changes)
- [Reduce Channel Timeout](#reduce-channel-timeout)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## Protocol Parameter Changes

The following table gives an overview of the changes in parameters.

| Parameter | Pre-Granite (default) value | Granite value | Notes |
| --------- | ------------------------- | ----------- | ----- |
| `CHANNEL_TIMEOUT` | 300 | 50 | Protocol Constant is reduced. |

## Reduce Channel Timeout

With Granite, the `CHANNEL_TIMEOUT` is reduced from 300 to 50 L1 Blocks.
The new rule activation timestamp is based on the blocktime of the L1 block that the channel frame is included.
18 changes: 18 additions & 0 deletions specs/protocol/granite/exec-engine.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# L2 Execution Engine

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents**

- [EVM Changes](#evm-changes)
- [`bn256Pairing` precompile input restriction](#bn256pairing-precompile-input-restriction)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## EVM Changes

### `bn256Pairing` precompile input restriction

The `bn256Pairing` precompile execution has additional validation on its input.
The precompile reverts if its input is larger than `112687` bytes.
This is the input size that consumes approximately 20 M gas given the latest `bn256Pairing` gas schedule on L2.
8 changes: 3 additions & 5 deletions specs/protocol/granite/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,15 @@

- [Execution Layer](#execution-layer)
- [Consensus Layer](#consensus-layer)
- [Smart Contracts](#smart-contracts)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

This document is not finalized and should be considered experimental.

## Execution Layer

## Consensus Layer
- [Limit `bn256Pairing` precompile input size](./exec-engine.md#bn256pairing-precompile-input-restriction)

## Smart Contracts
## Consensus Layer

- [Custom Gas Token](./custom-gas-token.md)
- [Predeploys](./predeploys.md)
- [Reduce Channel Timeout to 50](./derivation.md#reduce-channel-timeout)
16 changes: 0 additions & 16 deletions specs/protocol/granite/predeploys.md

This file was deleted.

0 comments on commit 8268de6

Please sign in to comment.