Skip to content

Commit

Permalink
Merge branch 'main' into state-management
Browse files Browse the repository at this point in the history
  • Loading branch information
jlwllmr committed Sep 12, 2024
2 parents 5d93934 + b4d7a6b commit a11b3a7
Show file tree
Hide file tree
Showing 19 changed files with 130 additions and 571 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ In fact, it's part of the PR process.
### Contribute to community tutorials

If you've created fleshed-out guides and tutorials, or intend to, we'd love to feature your content
in our [community tutorials section](developers/guides/community).
in our [community tutorials section](./docs/developers/guides/community/index.mdx).

First, create an issue describing the content you want to see added or intend to add. If you're
representing an organization (such as a dapp), please use the ecosystem contribution issue form.
Expand Down
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
46 changes: 46 additions & 0 deletions docs/developers/linea-version/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,52 @@ import zkEVM2 from "!!raw-loader!/files/testnet/2023-06-13-release/zkEVM2.abi";
import L2MessageService from "!!raw-loader!/files/testnet/2023-06-13-release/L2MessageService.abi";
import TokenBridgeL1 from "!!raw-loader!/files/testnet/2023-06-13-release/TokenBridgeL1.abi";
import TokenBridgeL2 from "!!raw-loader!/files/testnet/2023-06-13-release/TokenBridgeL2.abi";
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";

## Alpha v3.5.2

### Transaction exclusion API

**Mainnet: September 23**

**Linea Sepolia: September 16**

Introduces an API that can be used to check whether a transaction was rejected because it exceeded
the sequencer's trace limits.

## Alpha v3.5.1

### Linea native bridge UI v2

**Mainnet: September 18**

**Linea Sepolia: September 16**

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

## Alpha v3.5.0

### `finalized` tag

**Mainnet: September 16**

**Linea Sepolia: Already available**

Adds support for the `finalized` tag to the `blockParameters` strings that can be used in various
JSON-RPC API calls. The tag enables you to confirm whether or not a block has been finalized on L1.
See our [guide](../guides/finalized-block.mdx) for more.

## Alpha v3.4.1

### Reactivate `linea_estimateGas`

**Mainnet: September 16**

**Linea Sepolia: September 9**

Reactivates [`linea_estimateGas`](../reference/api/linea-estimategas.mdx), disabling compatibility
mode.

## Alpha v3.4

Expand Down
4 changes: 2 additions & 2 deletions docs/developers/quickstart/deploy-smart-contract/cookbook.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ Cookbook's no-code deploy and using Cookbook with Remix, Hardhat and Foundry.

Before you begin, ensure you:

1. [Set up your wallet](/users/move-funds/set-up-your-wallet)
2. [Fund your wallet with Linea ETH](/users/move-funds/fund) on either the testnet or mainnet
1. [Set up your wallet](../../../users/move-funds/set-up-your-wallet.mdx)
2. [Fund your wallet with Linea ETH](../../../users/move-funds/fund.mdx) on either the testnet or mainnet

## Search Cookbook's smart contract registry

Expand Down
9 changes: 5 additions & 4 deletions docs/developers/quickstart/deploy-smart-contract/foundry.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ In this quickstart, we'll create a basic [Foundry](https://book.getfoundry.sh/)

Before you begin, ensure you:

1. [Set up your wallet](/users/move-funds/set-up-your-wallet)
1. [Fund your wallet with Linea ETH](/users/move-funds/fund) on either the testnet, or mainnet
1. [Set up your wallet](../../../users/move-funds/set-up-your-wallet.mdx)
1. [Fund your wallet with Linea ETH](../../../users/move-funds/fund.mdx) on either the testnet, or mainnet
1. Download and install Foundry:

```bash
Expand Down Expand Up @@ -72,8 +72,9 @@ forge create --rpc-url YOUR_LINEA_ENDPOINT src/Counter.sol:Counter --private-key

In the command:

- Replace `YOUR_LINEA_ENDPOINT` with the URL of a [supported Infura Linea network](https://docs.infura.io/api/networks/linea/choose-a-network)
or [public endpoint URL](/developers/quickstart/info-contracts#network-information).
- Replace `YOUR_LINEA_ENDPOINT` with the URL of a
[supported Infura Linea network](https://docs.infura.io/api/networks/linea/choose-a-network)
or [public endpoint URL](../info-contracts.mdx#network-information).
- Replace `YOUR_PRIVATE_KEY` with your wallet's private key.
Your output should look similar to:
Expand Down
10 changes: 6 additions & 4 deletions docs/developers/quickstart/deploy-smart-contract/remix.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ In this tutorial, we'll walk through creating a basic Remix project and deployin

Before you begin, ensure you:

1. [Set up your wallet](/users/move-funds/set-up-your-wallet)
2. [Fund your wallet with Linea ETH](/users/move-funds/fund) on either the testnet, or mainnet
1. [Set up your wallet](../../../users/move-funds/set-up-your-wallet.mdx)
2. [Fund your wallet with Linea ETH](../../../users/move-funds/fund.mdx) on either the testnet, or mainnet

## Explore the Remix workspace

Expand Down Expand Up @@ -49,8 +49,10 @@ on and your account information. To do this, navigate to the **Deploy & run tran

:::caution

The public endpoints are rate limited and not meant for production systems. To use Infura, you'll need to [get an API key](https://support.infura.io/hc/en-us/articles/15116941373979-Connecting-to-the-Linea-network). Then, [manually add a network to your MetaMask wallet](https://support.metamask.io/hc/en-us/articles/360043227612-How-to-add-a-custom-network-RPC#h_01G63GGJ83DGDRCS2ZWXM37CV5) with the information found
[here](/developers/quickstart/info-contracts#network-information).
The public endpoints are rate limited and not meant for production systems. To use Infura, you'll need to
[get an API key](https://docs.infura.io/api/getting-started).
Then, [manually add a network to your MetaMask wallet](https://support.metamask.io/hc/en-us/articles/360043227612-How-to-add-a-custom-network-RPC#h_01G63GGJ83DGDRCS2ZWXM37CV5) using the
[network information](../info-contracts.mdx#network-information).

:::

Expand Down
16 changes: 9 additions & 7 deletions docs/developers/quickstart/verify-smart-contract/foundry.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ You'll need to get a Lineascan (Linea instance of Etherscan) API key by creating
:::note


These instructions verify using the Linea instance of Etherscan, which currently does not support Yul. If you would like to verify using Blockscout, please use the API URLs referenced [here](/developers/quickstart/info-contracts#block-explorers).
These instructions verify using the Linea instance of Etherscan, which currently does not support Yul. If you
would like to verify using Blockscout, please use the [Blockscout API URL for the required network](../info-contracts.mdx#block-explorers).

:::

Expand Down Expand Up @@ -84,9 +85,11 @@ You can check that it was verified correctly by navigating to the [testnet block

## Using `.env` and `foundry.toml` to store etherscan information

If you don't want to paste your keys inline and have multiple Etherscan API keys to manage, you can use `.env` and `foundry.toml` to set up custom configurations.
If you don't want to paste your keys inline and have multiple Etherscan API keys to manage, you can use
the `.env` and `foundry.toml` files to set up custom configurations.

Assuming you followed the instructions to create a `.env` file [here](../deploy-smart-contract/foundry), add your Lineascan API key to the file:
These steps assume you stored your secret keys in a `.env` file. which you can read more about
[in the Foundry deployment instructions](../deploy-smart-contract/foundry.md#deploy-a-smart-contract-using-a-env-file).

```bash
LINEASCAN_API_KEY=YOUR_LINEASCAN_API_KEY
Expand Down Expand Up @@ -126,8 +129,7 @@ forge verify-contract --chain linea-testnet path_to_contract:contract_name --wat
</Tabs>
:::info
Learn more about different configurations for verifying your smart contracts [here](https://book.getfoundry.sh/reference/forge/forge-verify-contract) and [here](https://book.getfoundry.sh/forge/deploying).
Learn more about different configurations for verifying your smart contracts using the
[`forge verify-contract`](https://book.getfoundry.sh/reference/forge/forge-verify-contract#forge-verify-contract)
command and the [Forge deployment instructions](https://book.getfoundry.sh/forge/deploying).
:::
16 changes: 8 additions & 8 deletions docs/developers/quickstart/verify-smart-contract/hardhat.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,25 @@ title: Hardhat
image: /img/socialCards/hardhat.jpg
---

To verify your Hardhat contracts, you can use [Hardhat's Etherscan plugin](https://hardhat.org/hardhat-runner/plugins/nomiclabs-hardhat-etherscan) to verify contracts on Lineascan.
To verify your Hardhat contracts, use [Hardhat's Etherscan plugin](https://hardhat.org/hardhat-runner/plugins/nomiclabs-hardhat-etherscan) to verify contracts on Lineascan.

:::note


Note that this is included as part of the `hardhat-toolbox` plugin.
This is included as part of the `hardhat-toolbox` plugin.

:::

These steps assume you stored your secret keys in a `.env` file, which you can read more about [here](../deploy-smart-contract/hardhat).
These steps assume you stored your secret keys in a `.env` file. which you can read more about
[in the Hardhat deployment instructions](../deploy-smart-contract/hardhat.mdx#deploy-the-contract).

## Download the plugin

If you aren't already using `@nomicfoundation/hardhat-toolbox`, you can use `@nomicfoundation/hardhat-verify` instead. Find the instructions on how to add it to your project [here](https://hardhat.org/hardhat-runner/plugins/nomicfoundation-hardhat-verify#installation).

## Add your Lineascan API Key

We'll be using a `.env` file to store our sensitive information. You can find instructions on how to set up the file [here](../deploy-smart-contract/hardhat).

Next, you'll need to get a Lineascan (Linea instance of Etherscan) key by creating an account at [https://lineascan.build/myapikey](https://lineascan.build/myapikey). Grab your key, and add it to the `.env` file:
Obtain a Lineascan (Linea instance of Etherscan) key by creating an account at
[https://lineascan.build/myapikey](https://lineascan.build/myapikey). Grab your key, and add it to the `.env` file:

```
LINEASCAN_API_KEY=YOUR_API_KEY_HERE
Expand All @@ -39,7 +38,8 @@ const { PRIVATE_KEY, LINEASCAN_API_KEY } = process.env;
:::note


These instructions verify using the Linea instance of Etherscan, which currently does not support Yul. If you would like to verify using Blockscout, please use the API URLs referenced [here](/developers/quickstart/info-contracts#block-explorers).
These instructions verify using the Linea instance of Etherscan, which currently does not support Yul. If you
would like to verify using Blockscout, please use the [Blockscout API URL for the required network](../info-contracts.mdx#block-explorers).

:::

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
3 changes: 0 additions & 3 deletions docs/developers/tooling/automation/_category_.json

This file was deleted.

20 changes: 0 additions & 20 deletions docs/developers/tooling/automation/hal-stream.md

This file was deleted.

9 changes: 0 additions & 9 deletions docs/developers/tooling/automation/index.mdx

This file was deleted.

Loading

0 comments on commit a11b3a7

Please sign in to comment.