-
Notifications
You must be signed in to change notification settings - Fork 3.9k
fix(bss,dtl): correctly submit and parse timestamp information for L1 to L2 txs #2090
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a135aa3
test: add integration tests for running a verifier
tynes fcce5b6
fix: update batch submitter to include all ts info
tynes 58b1d09
fix(ops): ignore .env files
tynes 2e7f6a5
fix(l2geth): misc timestamp fixes
tynes 1741d88
fix(dtl): return enqueue tx timestamps
tynes b022c49
Merge branch 'develop' into feat/verifier-itests-patch-ctx
mslipper File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@eth-optimism/data-transport-layer': patch | ||
| --- | ||
|
|
||
| Updates DTL to correctly parse L1 to L2 tx timestamps after the first bss hardfork |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@eth-optimism/integration-tests': patch | ||
| --- | ||
|
|
||
| Updates integration tests to include a test for syncing a Verifier from L1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@eth-optimism/l2geth': patch | ||
| --- | ||
|
|
||
| Fixes incorrect timestamp handling for L1 syncing verifiers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@eth-optimism/batch-submitter': patch | ||
| --- | ||
|
|
||
| Updates batch submitter to also include separate timestamps for deposit transactions" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@eth-optimism/integration-tests': patch | ||
| --- | ||
|
|
||
| Add verifier integration tests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,8 @@ | ||
| .github | ||
|
|
||
| node_modules | ||
| .env | ||
| **/.env | ||
|
|
||
| test | ||
| **/*_test.go | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,103 @@ | ||
| import { TransactionReceipt } from '@ethersproject/abstract-provider' | ||
|
|
||
| import { expect } from './shared/setup' | ||
| import { OptimismEnv } from './shared/env' | ||
| import { | ||
| defaultTransactionFactory, | ||
| gasPriceForL2, | ||
| sleep, | ||
| envConfig, | ||
| } from './shared/utils' | ||
|
|
||
| describe('Verifier Tests', () => { | ||
| let env: OptimismEnv | ||
|
|
||
| before(async function () { | ||
| if (!envConfig.RUN_VERIFIER_TESTS) { | ||
| this.skip() | ||
| return | ||
| } | ||
|
|
||
| env = await OptimismEnv.new() | ||
| }) | ||
|
|
||
| describe('Matching blocks', () => { | ||
| it('should sync a transaction', async () => { | ||
| const tx = defaultTransactionFactory() | ||
| tx.gasPrice = await gasPriceForL2() | ||
| const result = await env.l2Wallet.sendTransaction(tx) | ||
|
|
||
| let receipt: TransactionReceipt | ||
| while (!receipt) { | ||
| receipt = await env.verifierProvider.getTransactionReceipt(result.hash) | ||
| await sleep(200) | ||
| } | ||
|
|
||
| const sequencerBlock = (await env.l2Provider.getBlock( | ||
| result.blockNumber | ||
| )) as any | ||
|
|
||
| const verifierBlock = (await env.verifierProvider.getBlock( | ||
| result.blockNumber | ||
| )) as any | ||
|
|
||
| expect(sequencerBlock.stateRoot).to.deep.eq(verifierBlock.stateRoot) | ||
| expect(sequencerBlock.hash).to.deep.eq(verifierBlock.hash) | ||
| }) | ||
|
|
||
| it('sync an unprotected tx (eip155)', async () => { | ||
| const tx = { | ||
| ...defaultTransactionFactory(), | ||
| nonce: await env.l2Wallet.getTransactionCount(), | ||
| gasPrice: await gasPriceForL2(), | ||
| chainId: null, // Disables EIP155 transaction signing. | ||
| } | ||
| const signed = await env.l2Wallet.signTransaction(tx) | ||
| const result = await env.l2Provider.sendTransaction(signed) | ||
|
|
||
| let receipt: TransactionReceipt | ||
| while (!receipt) { | ||
| receipt = await env.verifierProvider.getTransactionReceipt(result.hash) | ||
| await sleep(200) | ||
| } | ||
|
|
||
| const sequencerBlock = (await env.l2Provider.getBlock( | ||
| result.blockNumber | ||
| )) as any | ||
|
|
||
| const verifierBlock = (await env.verifierProvider.getBlock( | ||
| result.blockNumber | ||
| )) as any | ||
|
|
||
| expect(sequencerBlock.stateRoot).to.deep.eq(verifierBlock.stateRoot) | ||
| expect(sequencerBlock.hash).to.deep.eq(verifierBlock.hash) | ||
| }) | ||
|
|
||
| it('should forward tx to sequencer', async () => { | ||
| const tx = { | ||
| ...defaultTransactionFactory(), | ||
| nonce: await env.l2Wallet.getTransactionCount(), | ||
| gasPrice: await gasPriceForL2(), | ||
| } | ||
| const signed = await env.l2Wallet.signTransaction(tx) | ||
| const result = await env.verifierProvider.sendTransaction(signed) | ||
|
|
||
| let receipt: TransactionReceipt | ||
| while (!receipt) { | ||
| receipt = await env.verifierProvider.getTransactionReceipt(result.hash) | ||
| await sleep(200) | ||
| } | ||
|
|
||
| const sequencerBlock = (await env.l2Provider.getBlock( | ||
| result.blockNumber | ||
| )) as any | ||
|
|
||
| const verifierBlock = (await env.verifierProvider.getBlock( | ||
| result.blockNumber | ||
| )) as any | ||
|
|
||
| expect(sequencerBlock.stateRoot).to.deep.eq(verifierBlock.stateRoot) | ||
| expect(sequencerBlock.hash).to.deep.eq(verifierBlock.hash) | ||
| }) | ||
| }) | ||
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.