Skip to content

Commit ebd0449

Browse files
Merge branch 'master' into tw568-arbitrum-chain-feature-config-structure
2 parents 1602eed + 336397e commit ebd0449

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

docs/build-decentralized-apps/arbitrum-vs-ethereum/02-block-numbers-and-time.mdx

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ content_type: concept
99
displayed_sidebar: buildAppsSidebar
1010
---
1111

12+
import { VanillaAdmonition } from '@site/src/components/VanillaAdmonition/';
13+
1214
:::info block number vs `block.number`
1315

1416
Throughout this and other pages, we note that the block number of a chain does not match the value obtained from `block.number`. When using `block.number` in a smart contract, the value obtained will be the block of the first non-Arbitrum ancestor chain. That is:
@@ -22,7 +24,7 @@ As with Ethereum, Arbitrum clients submit transactions, and the system executes
2224

2325
Once in the chain's core inbox contract, transaction processing occurs in order. Generally, some time will elapse between when a message is put into the inbox (and timestamped) and when the contract processes the message and carries out the transaction requested by the message.
2426

25-
Additionally, since the calldata of Arbitrum transactions (or the DAC certificate on <a data-quicklook-from= "arbitrum-anytrust-chain">AnyTrust</a>chains) is posted to Ethereum, the gas paid when executing them includes a component for the parent chain to cover the costs of the batch poster.
27+
Additionally, since the calldata/blobs of Arbitrum transactions (or the DAC certificate on <a data-quicklook-from= "arbitrum-anytrust-chain">AnyTrust</a>chains) is posted to Ethereum, the gas paid when executing them includes a component for the parent chain to cover the costs of the batch poster.
2628

2729
This page explains the implications of this mechanism for the block gas limit, block numbers, and the time assumptions associated with transactions submitted to Arbitrum.
2830

@@ -42,7 +44,7 @@ A single Ethereum block can include multiple Arbitrum blocks; however, an Arbitr
4244

4345
### Ethereum (or parent chain) block numbers within Arbitrum
4446

45-
Accessing block numbers within an Arbitrum smart contract (i.e., `block.number` in Solidity) will return a value _close to_ (but not necessarily exactly) the block number of the first non-Arbitrum ancestor chain at which the sequencer received the transaction.
47+
Accessing block numbers within an Arbitrum smart contract (i.e., `block.number` in Solidity) will return a value _close to_ (but not necessarily exactly) the block number of the first non-Arbitrum ancestor chain where the sequencer received the transaction.
4648

4749
The "first non-Arbitrum ancestor chain" is:
4850

@@ -73,15 +75,14 @@ A client that queries an Arbitrum node's RPC interface (e.g., transaction receip
7375
```typescript
7476
const txnReceipt = await arbitrumProvider.getTransactionReceipt('0x...');
7577
/**
76-
txnReceipt.blockNumber => Arbitrum block number
7778
txnReceipt.l1BlockNumber => Approximate block number of the first non-Arbitrum ancestor chain
7879
*/
7980
```
8081

8182
The Arbitrum block number can also be retrieved within an Arbitrum contract via [ArbSys](/build-decentralized-apps/precompiles/02-reference.mdx#arbsys) precompile:
8283

8384
```solidity
84-
ArbSys(100).arbBlockNumber() // returns Arbitrum block number
85+
ArbSys(100).arbBlockNumber() // returns Arbitrum block number
8586
```
8687

8788
### Example
@@ -94,7 +95,13 @@ The following example illustrates timings on a chain that settles to Ethereum (s
9495
| Chain's `block.number` \* | 1000 | 1000 | 1000 | 1000 | 1004 | 1004 |
9596
| Chain's block number (from RPCs) \*\* | 370000 | 370005 | 370006 | 370008 | 370012 | 370015 |
9697

97-
_\* **The chain's `block.number`:** updated to sync with Ethereum's `block.number` approximately every minute. Thus, over time, it will, like Ethereum's `block.number`, average to ~12 seconds per block._
98+
<VanillaAdmonition type="info">
99+
100+
txnReceipt.blockNumber => Arbitrum block number
101+
102+
\_\* **The chain's `block.number`:** updated to sync with Ethereum's `block.number` every 13 to 15 seconds (occasionally longer).
103+
104+
</VanillaAdmonition>
98105

99106
_\*\* **Chain's block number from RPCs:** note that this can be updated multiple times per Ethereum block (this lets the sequencer give sub-Ethereum-block-time transaction receipts.)_
100107

0 commit comments

Comments
 (0)