Skip to content

Commit

Permalink
Merge branch 'main' into linea-besu-2
Browse files Browse the repository at this point in the history
  • Loading branch information
jlwllmr authored Sep 13, 2024
2 parents 3c9ddc2 + 02644d1 commit fb9eba0
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 35 deletions.
34 changes: 22 additions & 12 deletions docs/developers/guides/finalized-block.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,34 @@ image: /img/socialCards/retrieve-finalized-l2-blocks.jpg
A finalized L2 block is a block on an L2 blockchain (Linea) that has been confirmed and validated
by the L1 blockchain (Ethereum), ensuring its immutability and security.

Linea doesn't currently support the Ethereum-standard `finalized` block parameter tag, meaning you
cannot use the tag in JSON-RPC API calls to retrieve blocks that have been confirmed by the L1
network. This includes, for example, methods where you can specify a block parameter, such as
[`linea_estimateGas`](../reference/api/linea-estimategas.mdx).
There are two methods to obtain the current finalized block:

:::note
Support for the `finalized` block parameter is planned in a future Linea release.
:::
- [Use the `finalized` block parameter tag](#use-the-finalized-tag) in JSON-RPC API calls.
- [Query the Linea L1 rollup contract](#query-the-rollup-contract).

This limitation requires you to query the [Linea L1 rollup contract](https://etherscan.io/address/0xd19d4b5d358258f05d7b411e21a1460d11b0876f#readProxyContract)
to retrieve the value of the current finalized L2 block number stored in the `currentL2BlockNumber`
variable.
## Use the `finalized` tag

## Prerequisites
Use the `finalized` tag in API calls to specify a block that has been confirmed by the L1
network. For example, here the `eth_getBlockByNumber` method returns information about the current
finalized block:

```bash
curl https://rpc.linea.build \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["finalized",false],"id":1}'
```

## Query the rollup contract

Query the [Linea L1 rollup contract](https://etherscan.io/address/0xd19d4b5d358258f05d7b411e21a1460d11b0876f#readProxyContract)
to retrieve the value of the current finalized L2 block number stored in the `currentL2BlockNumber` variable.

### Prerequisites

- [Download and install Node.js](https://nodejs.org/en)

## Create the script
### Create the script

1. In your project folder, initialize the project and install the `web3` package:

Expand Down
6 changes: 3 additions & 3 deletions docs/developers/linea-version/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import TabItem from "@theme/TabItem";

**Mainnet: September 23**

**Linea Sepolia: September 16**
**Linea Sepolia: September 17**

Introduces an API that can be used to check whether a transaction was rejected because it exceeded
the sequencer's trace limits.
Expand All @@ -30,15 +30,15 @@ the sequencer's trace limits.

**Mainnet: September 18**

**Linea Sepolia: September 16**
**Linea Sepolia: September 18**

Upgrades the [Linea bridge](https://bridge.linea.build/) UI.

## Alpha v3.5.0

### `finalized` tag

**Mainnet: September 16**
**Mainnet: September 18**

**Linea Sepolia: Already available**

Expand Down
12 changes: 6 additions & 6 deletions docs/developers/quickstart/deploy-smart-contract/foundry.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,21 @@ To create a Foundry project, run:
forge init linea-tutorial
```

And change into the directory:
Running `forge init` sets up a sample contract, test, and script for `Counter.sol`.

Now change into the directory:

```bash
cd linea-tutorial
```

Running `forge init` sets up a sample contract, test, and script for `Counter.sol`.

## Deploy a smart contract

To deploy a smart contract, we highly recommend using an Infura endpoint, as the public endpoint may experience
rate limiting and not meant for production use.
To deploy a smart contract we highly recommend using an Infura endpoint, as the public endpoint may experience
rate limiting and is not meant for production use.

[Sign up for an Infura account](https://docs.infura.io/api/getting-started) to get an API key that
provides access the Linea endpoints. Assign the Linea endpoints you want to access, to your API key.
provides access to the Linea endpoints. Assign the Linea endpoints you want to access to your API key.

:::caution

Expand Down
9 changes: 6 additions & 3 deletions docs/developers/reference/api/linea-estimategas.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,13 @@ using `linea_estimateGas` for more accurate results.
- `value`: _\[optional]_ Hexadecimal value of the value sent with this transaction.
- `data`: _\[optional]_ Hash of the method signature and encoded parameters. See the
[Ethereum contract ABI specification](https://docs.soliditylang.org/en/latest/abi-spec.html).
- `block number`: _\[optional]_ A string representing a block number, or one of the string tags `latest`, `earliest`, or
`pending`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
You can [query the L1 rollup contract](../../guides/finalized-block.mdx) to retrieve the current finalized block.
- `block number`: _\[optional]_ A string representing a block number, or one of the string tags `latest`, `earliest`,
`pending`, or `finalized`.

:::note
A `finalized` block is a block on an L2 blockchain (Linea) that has been confirmed and validated by
the L1 blockchain (Ethereum).
:::

## Returns

Expand Down
18 changes: 7 additions & 11 deletions docs/developers/reference/api/linea-getproof.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,17 @@ The supplied block parameter must be an L2 block that has been finalized on L1.

In the [example response](#response) the account exists but the slot does not.

:::info important

Linea currently does not support the block parameter `finalized`, meaning that to get the current
finalised block on the L1, users must [retrieve the value from the `currentL2BlockNumber`](../../guides/finalized-block.mdx)
variable in the [LineaRollup L1 contract](https://etherscan.io/address/0xd19d4b5d358258f05d7b411e21a1460d11b0876f#readProxyContract).

:::

## Parameters

- `address`: A string representing the address (20 bytes) for which the proof is requested.
- `storageKeys`: An array of 32-byte storage keys to be proofed and included.
- `blockParameter`: A hexadecimal block number, or one of the string tags `latest`, `earliest`, or
`pending`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
You can [query the L1 rollup contract](../../guides/finalized-block.mdx) to retrieve the current finalized block.
- `blockParameter`: A hexadecimal block number, or one of the string tags `latest`, `earliest`,
`pending`, or `finalized`.

:::note
A `finalized` block is a block on an L2 blockchain (Linea) that has been confirmed and validated by
the L1 blockchain (Ethereum).
:::

## Returns

Expand Down

0 comments on commit fb9eba0

Please sign in to comment.