Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding updated page on what's changed #1506

Merged
merged 31 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
b85aaff
Adding updated page on what's changed
piersy Oct 1, 2024
169fd1f
Correctly reference new page as doc
piersy Oct 1, 2024
fc9ece6
Add preceding forward slash to page path
piersy Oct 1, 2024
b89d742
Switch href to id, add newline at end of file
piersy Oct 1, 2024
abe3ebf
Update docs/cel2/whats-changed.md
piersy Oct 1, 2024
4359913
Update docs/cel2/whats-changed.md
piersy Oct 1, 2024
aa86904
Update docs/cel2/whats-changed.md
piersy Oct 1, 2024
2f624fd
Update docs/cel2/whats-changed.md
piersy Oct 1, 2024
77199e5
Update docs/cel2/whats-changed.md
piersy Oct 2, 2024
f8dc6fa
Respond to code review comments
piersy Oct 2, 2024
c2a2697
Update text covering validator roles
piersy Oct 2, 2024
9eec5de
Add sections covering EIP1559 changes
piersy Oct 2, 2024
6234eed
Fix broken link
piersy Oct 2, 2024
9b21462
Adjustments to EIP1559 details
piersy Oct 3, 2024
8a1a40f
Add note on block times for Optimism -> Celo L2 diff
piersy Oct 3, 2024
cd19e21
Update docs/cel2/whats-changed.md
piersy Oct 3, 2024
b586a07
Update docs/cel2/whats-changed.md
piersy Oct 3, 2024
cb85c8d
Update docs/cel2/whats-changed.md
piersy Oct 3, 2024
0f2fbdf
Update docs/cel2/whats-changed.md
piersy Oct 3, 2024
ba359de
Update docs/cel2/whats-changed.md
piersy Oct 3, 2024
f2fae33
Update docs/cel2/whats-changed.md
piersy Oct 3, 2024
710dee8
Update docs/cel2/whats-changed.md
piersy Oct 3, 2024
13076de
Update docs/cel2/whats-changed.md
piersy Oct 3, 2024
31b3388
Update docs/cel2/whats-changed.md
piersy Oct 3, 2024
15fef5e
Update docs/cel2/whats-changed.md
piersy Oct 3, 2024
80a23d9
Update docs/cel2/whats-changed.md
piersy Oct 3, 2024
3738816
Update docs/cel2/whats-changed.md
piersy Oct 3, 2024
5a08ec0
Update docs/cel2/whats-changed.md
piersy Oct 3, 2024
98d47ac
Update docs/cel2/whats-changed.md
piersy Oct 3, 2024
f8a0c11
Update docs/cel2/whats-changed.md
piersy Oct 3, 2024
e960409
PR comment adjustments
piersy Oct 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 114 additions & 0 deletions docs/cel2/whats-changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
---
title: What's changed?
description: Changes from L1 to L2 and from op-stack to L2
---

# Celo L1 → L2

## Deprecated transactions

Sending these transaction types will no longer be supported, however you will still be able to retrieve any historical instances of these transactions.

* __Type 0 (`0x0`) _Celo_ legacy transaction__. These are type 0 transactions that had some combination of the following fields set ("feeCurrency", "gatewayFee", "gatewayFeeRecipient") and "ethCompatible" set to false.
* __Type 124 (`0x7c`) Celo dynamic fee transaction__.

## Consensus

Consensus will no longer be controlled by the validators set, instead we will have a centralized sequencer, as such there will no longer be the notion of epochs. This also means validators will not need to run any infrastructure for the L2.

This is a temporary situation, after mainnet launch we will be looking at implementing a decentralized sequencer.

## Validator fees and staking rewards

Validator fees will now go to the sequencer.

We plan to keep validator and staking rewards, previously rewards were emitted on epoch blocks, since there are no epochs in Celo L2 this will now be handled through a smart contract that can be called to periodically distribute rewards.
The amount of rewards to be distributed has not been decided, however during the time that validators are no longer required to run infrastructure rewards will likely be less than in the Celo L1.

## Hardforks

See [here](https://specs.Celo.org/l2_migration.html#changes-for-contracts-developers) for the list of hardforks that will be enabled in the first block of the L2.
piersy marked this conversation as resolved.
Show resolved Hide resolved

## Precompiled contracts

All Celo specific precompiles removed except for the transfer precompile which supports Celo token duality (the native asset Celo is also an ERC20 token)
piersy marked this conversation as resolved.
Show resolved Hide resolved

## Randomness

The random contract removed, if randomness is needed then the PREVRANDAO opcode can be used, more details [here](https://specs.Celo.org/l2_migration.html#deactivated-random-contract).
piersy marked this conversation as resolved.
Show resolved Hide resolved

## Blocks

* Block interval changed from 5s to 1s
* Block gas changed from 50m to 30m
piersy marked this conversation as resolved.
Show resolved Hide resolved

:::note
Note this results in a 300% increase in gas per second due to the shortened block time
:::

### Added fields
* __withdrawals__ & __withdrawalsRoot__ - these fields are inherited from ethereum but not used by the op-stack or Celo, withdrawals will always be an empty list, withdrawalsRoot will always be the empty withdrawals root (`0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421`)
piersy marked this conversation as resolved.
Show resolved Hide resolved
* __blobGasUsed__ & __excessBlobGas__ - these fields are also inherited from ethereum but not used by the op-stack or Celo, they will always be zero.
piersy marked this conversation as resolved.
Show resolved Hide resolved
* __parentBeaconBlockRoot__ - set to the parentBeaconRoot of the L1 origin block.
piersy marked this conversation as resolved.
Show resolved Hide resolved

### Removed fields
* __randomness__ - not needed since the [randomness](#randomness) feature is being removed
* __epochSnarkData__ - not needed since there will be no [plumo](https://docs.Celo.org/protocol/plumo) support in the Celo L2.
piersy marked this conversation as resolved.
Show resolved Hide resolved
* __extraData__ - will have the BLS aggregated signature removed, this simplifies the L2 implementation and since we already trust those blocks and distributed rewards for them, the BLS signature is no longer required.

## RPC API

### Pre-transition data

Old blocks, transactions, receipts and logs will still be accessible via the RPC API but they will differ a bit from the corresponding objects retrieved from the L1 RPC API.

In general the changes involve additional extra unset fields that have been added upstream but were not present on historical Celo L1 objects, and the removal of some unnecessarily set fields on Celo L1 objects.

For in depth details of what is changed see here - (TODO add section in specs covering this)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What to do with the TODO?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Point it to the relevant specs section when it's done - https://github.com/celo-org/celo-blockchain-planning/issues/641


### Pre-transition execution and state access

RPC API calls for pre-transition blocks that are performing execution or accessing state will not be directly supported by the new Celo L2 implementation, however if this is required you can configure your Celo L2 node to proxy to an archive Celo L1 node for these calls. See [here](./l2-operator-guide#supporting-historical-execution)


# Optimism → Celo L2

## Native token
The native token is Celo as opposed to Eth. The native token is also an ERC20 token.
piersy marked this conversation as resolved.
Show resolved Hide resolved

## New transaction type
carterqw2 marked this conversation as resolved.
Show resolved Hide resolved

Type 123 (`0x7b`) transaction type allows paying for gas in currencies other than the native asset (Celo). It has an additional field `feeCurrency` which allows the sender to chose the currency they pay gas in a chosen fee currency.
piersy marked this conversation as resolved.
Show resolved Hide resolved

The fee currencies available at mainnet launch will be:

USDC (USDC)
piersy marked this conversation as resolved.
Show resolved Hide resolved
Tether USD (USDT)
PUSO (PUSO)
ECO CFA (eXOF)
Celo Kenyan Shilling (cKES)
Celo Dollar (cUSD)
Celo Euro (cEUR)
Celo Brazilian Real (cREAL)

## L1 fees

In the optimism model, an extra fee is added on to user transactions in order to cover the cost of the L1, this can be surprising to users since they have no visibility about what that fee may be since it is not included in the results of calling estimate_gas.
piersy marked this conversation as resolved.
Show resolved Hide resolved

The Celo L2 always keeps the L1 fee at zero. This doesn't however mean that we will not charge fees to cover the cost of the L1, just that we won't do it via the L1 fees mechanism. Instead we may raise or lower the [base fee floor](#base-fee-floor) accordingly to match the L1 fees.

## Base fee floor

The Celo L2 adds a base fee floor, which imposes a lower limit on the base fee. This is currently configured in the genesis, but it will likely become configurable.

## MaxCodeSize

The hardcoded protocol parameter MaxCodeSize is raised from 24576 to 65536.
piersy marked this conversation as resolved.
Show resolved Hide resolved

## Block receipt

Historically the Celo L1 generated a block receipts when system contract calls generated logs, although the Celo L2 doesn't produce block receipts, the pre-existing block receipts are retrievable via the RPC API `eth_getBlockReceipt` call passing the hash of the block in question.

## Improved finality guarantees

The Celo L2 blocks only reference L1 blocks that are finalized, this means that the Celo L2 is protected from re-orgs that could occur due to L1 re-orgs, this is in contrast to the optimism L2 blocks which reference L1 blocks a few blocks behind the L1 chain head.
6 changes: 3 additions & 3 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -1164,12 +1164,12 @@ const sidebars = {
label: "L2 Architecture",
id: "cel2/cel2-architecture",
},
{ type: "link",
{ type: "doc",
label: "What's Changed?",
href: "https://specs.celo.org/l2_migration.html",
id: "cel2/whats-changed",
},
{ type: "link", label: "Cel2 Specs", href: "https://specs.celo.org/" },
{ type: "doc", label: "FAQ", id: "cel2/faq" },
],
};
module.exports = sidebars;
module.exports = sidebars;