Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
4fe1dc3c
Unverified
Commit
4fe1dc3c
authored
Sep 14, 2023
by
mergify[bot]
Committed by
GitHub
Sep 14, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into dependabot/npm_and_yarn/chai-and-types/chai-4.3.8
parents
5c02fcc1
3268e32c
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
70 additions
and
6 deletions
+70
-6
mighty-countries-drum.md
.changeset/mighty-countries-drum.md
+5
-0
smart-goats-camp.md
.changeset/smart-goats-camp.md
+5
-0
config.yml
.circleci/config.yml
+4
-0
txmgr.go
op-service/txmgr/txmgr.go
+7
-6
txmgr_test.go
op-service/txmgr/txmgr_test.go
+29
-0
types.ts
packages/sdk/src/interfaces/types.ts
+2
-0
chain-constants.ts
packages/sdk/src/utils/chain-constants.ts
+18
-0
No files found.
.changeset/mighty-countries-drum.md
0 → 100644
View file @
4fe1dc3c
---
'
@eth-optimism/sdk'
:
patch
---
Adds Sepolia & OP Sepolia support to SDK
.changeset/smart-goats-camp.md
0 → 100644
View file @
4fe1dc3c
---
'
@eth-optimism/contracts-bedrock'
:
patch
---
bumps sdk version to have access to sepolia deployments
.circleci/config.yml
View file @
4fe1dc3c
...
@@ -863,6 +863,10 @@ jobs:
...
@@ -863,6 +863,10 @@ jobs:
name
:
Lint
name
:
Lint
command
:
golangci-lint run -E goimports,sqlclosecheck,bodyclose,asciicheck,misspell,errorlint --timeout 4m -e "errors.As" -e "errors.Is" ./...
command
:
golangci-lint run -E goimports,sqlclosecheck,bodyclose,asciicheck,misspell,errorlint --timeout 4m -e "errors.As" -e "errors.Is" ./...
working_directory
:
indexer
working_directory
:
indexer
-
run
:
name
:
Check generated code
command
:
npm run generate && git diff --exit-code
working_directory
:
indexer/api-ts
-
run
:
-
run
:
name
:
install geth
name
:
install geth
command
:
make install-geth
command
:
make install-geth
...
...
op-service/txmgr/txmgr.go
View file @
4fe1dc3c
...
@@ -211,14 +211,8 @@ func (m *SimpleTxManager) craftTx(ctx context.Context, candidate TxCandidate) (*
...
@@ -211,14 +211,8 @@ func (m *SimpleTxManager) craftTx(ctx context.Context, candidate TxCandidate) (*
}
}
gasFeeCap
:=
calcGasFeeCap
(
basefee
,
gasTipCap
)
gasFeeCap
:=
calcGasFeeCap
(
basefee
,
gasTipCap
)
nonce
,
err
:=
m
.
nextNonce
(
ctx
)
if
err
!=
nil
{
return
nil
,
err
}
rawTx
:=
&
types
.
DynamicFeeTx
{
rawTx
:=
&
types
.
DynamicFeeTx
{
ChainID
:
m
.
chainID
,
ChainID
:
m
.
chainID
,
Nonce
:
nonce
,
To
:
candidate
.
To
,
To
:
candidate
.
To
,
GasTipCap
:
gasTipCap
,
GasTipCap
:
gasTipCap
,
GasFeeCap
:
gasFeeCap
,
GasFeeCap
:
gasFeeCap
,
...
@@ -247,6 +241,13 @@ func (m *SimpleTxManager) craftTx(ctx context.Context, candidate TxCandidate) (*
...
@@ -247,6 +241,13 @@ func (m *SimpleTxManager) craftTx(ctx context.Context, candidate TxCandidate) (*
rawTx
.
Gas
=
gas
rawTx
.
Gas
=
gas
}
}
// Avoid bumping the nonce if the gas estimation fails.
nonce
,
err
:=
m
.
nextNonce
(
ctx
)
if
err
!=
nil
{
return
nil
,
err
}
rawTx
.
Nonce
=
nonce
ctx
,
cancel
:=
context
.
WithTimeout
(
ctx
,
m
.
cfg
.
NetworkTimeout
)
ctx
,
cancel
:=
context
.
WithTimeout
(
ctx
,
m
.
cfg
.
NetworkTimeout
)
defer
cancel
()
defer
cancel
()
return
m
.
cfg
.
Signer
(
ctx
,
m
.
cfg
.
From
,
types
.
NewTx
(
rawTx
))
return
m
.
cfg
.
Signer
(
ctx
,
m
.
cfg
.
From
,
types
.
NewTx
(
rawTx
))
...
...
op-service/txmgr/txmgr_test.go
View file @
4fe1dc3c
...
@@ -93,6 +93,7 @@ type gasPricer struct {
...
@@ -93,6 +93,7 @@ type gasPricer struct {
mineAtEpoch
int64
mineAtEpoch
int64
baseGasTipFee
*
big
.
Int
baseGasTipFee
*
big
.
Int
baseBaseFee
*
big
.
Int
baseBaseFee
*
big
.
Int
err
error
mu
sync
.
Mutex
mu
sync
.
Mutex
}
}
...
@@ -206,6 +207,9 @@ func (b *mockBackend) HeaderByNumber(ctx context.Context, number *big.Int) (*typ
...
@@ -206,6 +207,9 @@ func (b *mockBackend) HeaderByNumber(ctx context.Context, number *big.Int) (*typ
}
}
func
(
b
*
mockBackend
)
EstimateGas
(
ctx
context
.
Context
,
msg
ethereum
.
CallMsg
)
(
uint64
,
error
)
{
func
(
b
*
mockBackend
)
EstimateGas
(
ctx
context
.
Context
,
msg
ethereum
.
CallMsg
)
(
uint64
,
error
)
{
if
b
.
g
.
err
!=
nil
{
return
0
,
b
.
g
.
err
}
return
b
.
g
.
basefee
()
.
Uint64
(),
nil
return
b
.
g
.
basefee
()
.
Uint64
(),
nil
}
}
...
@@ -420,6 +424,31 @@ func TestTxMgr_EstimateGas(t *testing.T) {
...
@@ -420,6 +424,31 @@ func TestTxMgr_EstimateGas(t *testing.T) {
require
.
Equal
(
t
,
gasEstimate
,
tx
.
Gas
())
require
.
Equal
(
t
,
gasEstimate
,
tx
.
Gas
())
}
}
func
TestTxMgr_EstimateGasFails
(
t
*
testing
.
T
)
{
t
.
Parallel
()
h
:=
newTestHarness
(
t
)
candidate
:=
h
.
createTxCandidate
()
// Set the gas limit to zero to trigger gas estimation.
candidate
.
GasLimit
=
0
// Craft a successful transaction.
tx
,
err
:=
h
.
mgr
.
craftTx
(
context
.
Background
(),
candidate
)
require
.
Nil
(
t
,
err
)
lastNonce
:=
tx
.
Nonce
()
// Mock gas estimation failure.
h
.
gasPricer
.
err
=
fmt
.
Errorf
(
"execution error"
)
_
,
err
=
h
.
mgr
.
craftTx
(
context
.
Background
(),
candidate
)
require
.
ErrorContains
(
t
,
err
,
"failed to estimate gas"
)
// Ensure successful craft uses the correct nonce
h
.
gasPricer
.
err
=
nil
tx
,
err
=
h
.
mgr
.
craftTx
(
context
.
Background
(),
candidate
)
require
.
Nil
(
t
,
err
)
require
.
Equal
(
t
,
lastNonce
+
1
,
tx
.
Nonce
())
}
// TestTxMgrOnlyOnePublicationSucceeds asserts that the tx manager will return a
// TestTxMgrOnlyOnePublicationSucceeds asserts that the tx manager will return a
// receipt so long as at least one of the publications is able to succeed with a
// receipt so long as at least one of the publications is able to succeed with a
// simulated rpc failure.
// simulated rpc failure.
...
...
packages/sdk/src/interfaces/types.ts
View file @
4fe1dc3c
...
@@ -15,6 +15,7 @@ import { IBridgeAdapter } from './bridge-adapter'
...
@@ -15,6 +15,7 @@ import { IBridgeAdapter } from './bridge-adapter'
export
enum
L1ChainID
{
export
enum
L1ChainID
{
MAINNET
=
1
,
MAINNET
=
1
,
GOERLI
=
5
,
GOERLI
=
5
,
SEPOLIA
=
11155111
,
HARDHAT_LOCAL
=
31337
,
HARDHAT_LOCAL
=
31337
,
BEDROCK_LOCAL_DEVNET
=
900
,
BEDROCK_LOCAL_DEVNET
=
900
,
}
}
...
@@ -25,6 +26,7 @@ export enum L1ChainID {
...
@@ -25,6 +26,7 @@ export enum L1ChainID {
export
enum
L2ChainID
{
export
enum
L2ChainID
{
OPTIMISM
=
10
,
OPTIMISM
=
10
,
OPTIMISM_GOERLI
=
420
,
OPTIMISM_GOERLI
=
420
,
OPTIMISM_SEPOLIA
=
11155420
,
OPTIMISM_HARDHAT_LOCAL
=
31337
,
OPTIMISM_HARDHAT_LOCAL
=
31337
,
OPTIMISM_HARDHAT_DEVNET
=
17
,
OPTIMISM_HARDHAT_DEVNET
=
17
,
OPTIMISM_BEDROCK_ALPHA_TESTNET
=
28528
,
OPTIMISM_BEDROCK_ALPHA_TESTNET
=
28528
,
...
...
packages/sdk/src/utils/chain-constants.ts
View file @
4fe1dc3c
...
@@ -2,50 +2,62 @@ import { predeploys } from '@eth-optimism/core-utils'
...
@@ -2,50 +2,62 @@ import { predeploys } from '@eth-optimism/core-utils'
import
{
ethers
}
from
'
ethers
'
import
{
ethers
}
from
'
ethers
'
import
portalArtifactsMainnet
from
'
@eth-optimism/contracts-bedrock/deployments/mainnet/OptimismPortalProxy.json
'
import
portalArtifactsMainnet
from
'
@eth-optimism/contracts-bedrock/deployments/mainnet/OptimismPortalProxy.json
'
import
portalArtifactsGoerli
from
'
@eth-optimism/contracts-bedrock/deployments/goerli/OptimismPortalProxy.json
'
import
portalArtifactsGoerli
from
'
@eth-optimism/contracts-bedrock/deployments/goerli/OptimismPortalProxy.json
'
import
portalArtifactsSepolia
from
'
@eth-optimism/contracts-bedrock/deployments/sepolia/OptimismPortalProxy.json
'
import
l2OutputOracleArtifactsMainnet
from
'
@eth-optimism/contracts-bedrock/deployments/mainnet/L2OutputOracleProxy.json
'
import
l2OutputOracleArtifactsMainnet
from
'
@eth-optimism/contracts-bedrock/deployments/mainnet/L2OutputOracleProxy.json
'
import
l2OutputOracleArtifactsGoerli
from
'
@eth-optimism/contracts-bedrock/deployments/goerli/L2OutputOracleProxy.json
'
import
l2OutputOracleArtifactsGoerli
from
'
@eth-optimism/contracts-bedrock/deployments/goerli/L2OutputOracleProxy.json
'
import
l2OutputOracleArtifactsSepolia
from
'
@eth-optimism/contracts-bedrock/deployments/sepolia/L2OutputOracleProxy.json
'
import
addressManagerArtifactMainnet
from
'
@eth-optimism/contracts-bedrock/deployments/mainnet/AddressManager.json
'
import
addressManagerArtifactMainnet
from
'
@eth-optimism/contracts-bedrock/deployments/mainnet/AddressManager.json
'
import
addressManagerArtifactGoerli
from
'
@eth-optimism/contracts-bedrock/deployments/goerli/AddressManager.json
'
import
addressManagerArtifactGoerli
from
'
@eth-optimism/contracts-bedrock/deployments/goerli/AddressManager.json
'
import
addressManagerArtifactSepolia
from
'
@eth-optimism/contracts-bedrock/deployments/sepolia/AddressManager.json
'
import
l1StandardBridgeArtifactMainnet
from
'
@eth-optimism/contracts-bedrock/deployments/mainnet/L1StandardBridgeProxy.json
'
import
l1StandardBridgeArtifactMainnet
from
'
@eth-optimism/contracts-bedrock/deployments/mainnet/L1StandardBridgeProxy.json
'
import
l1StandardBridgeArtifactGoerli
from
'
@eth-optimism/contracts-bedrock/deployments/goerli/L1StandardBridgeProxy.json
'
import
l1StandardBridgeArtifactGoerli
from
'
@eth-optimism/contracts-bedrock/deployments/goerli/L1StandardBridgeProxy.json
'
import
l1StandardBridgeArtifactSepolia
from
'
@eth-optimism/contracts-bedrock/deployments/sepolia/L1StandardBridgeProxy.json
'
import
l1CrossDomainMessengerArtifactMainnet
from
'
@eth-optimism/contracts-bedrock/deployments/mainnet/L1CrossDomainMessengerProxy.json
'
import
l1CrossDomainMessengerArtifactMainnet
from
'
@eth-optimism/contracts-bedrock/deployments/mainnet/L1CrossDomainMessengerProxy.json
'
import
l1CrossDomainMessengerArtifactGoerli
from
'
@eth-optimism/contracts-bedrock/deployments/goerli/L1CrossDomainMessengerProxy.json
'
import
l1CrossDomainMessengerArtifactGoerli
from
'
@eth-optimism/contracts-bedrock/deployments/goerli/L1CrossDomainMessengerProxy.json
'
import
l1CrossDomainMessengerArtifactSepolia
from
'
@eth-optimism/contracts-bedrock/deployments/sepolia/L1CrossDomainMessengerProxy.json
'
const
portalAddresses
=
{
const
portalAddresses
=
{
mainnet
:
portalArtifactsMainnet
.
address
,
mainnet
:
portalArtifactsMainnet
.
address
,
goerli
:
portalArtifactsGoerli
.
address
,
goerli
:
portalArtifactsGoerli
.
address
,
sepolia
:
portalArtifactsSepolia
.
address
,
}
}
const
l2OutputOracleAddresses
=
{
const
l2OutputOracleAddresses
=
{
mainnet
:
l2OutputOracleArtifactsMainnet
.
address
,
mainnet
:
l2OutputOracleArtifactsMainnet
.
address
,
goerli
:
l2OutputOracleArtifactsGoerli
.
address
,
goerli
:
l2OutputOracleArtifactsGoerli
.
address
,
sepolia
:
l2OutputOracleArtifactsSepolia
.
address
,
}
}
const
addressManagerAddresses
=
{
const
addressManagerAddresses
=
{
mainnet
:
addressManagerArtifactMainnet
.
address
,
mainnet
:
addressManagerArtifactMainnet
.
address
,
goerli
:
addressManagerArtifactGoerli
.
address
,
goerli
:
addressManagerArtifactGoerli
.
address
,
sepolia
:
addressManagerArtifactSepolia
.
address
,
}
}
const
l1StandardBridgeAddresses
=
{
const
l1StandardBridgeAddresses
=
{
mainnet
:
l1StandardBridgeArtifactMainnet
.
address
,
mainnet
:
l1StandardBridgeArtifactMainnet
.
address
,
goerli
:
l1StandardBridgeArtifactGoerli
.
address
,
goerli
:
l1StandardBridgeArtifactGoerli
.
address
,
sepolia
:
l1StandardBridgeArtifactSepolia
.
address
,
}
}
const
l1CrossDomainMessengerAddresses
=
{
const
l1CrossDomainMessengerAddresses
=
{
mainnet
:
l1CrossDomainMessengerArtifactMainnet
.
address
,
mainnet
:
l1CrossDomainMessengerArtifactMainnet
.
address
,
goerli
:
l1CrossDomainMessengerArtifactGoerli
.
address
,
goerli
:
l1CrossDomainMessengerArtifactGoerli
.
address
,
sepolia
:
l1CrossDomainMessengerArtifactSepolia
.
address
,
}
}
// legacy
// legacy
const
stateCommitmentChainAddresses
=
{
const
stateCommitmentChainAddresses
=
{
mainnet
:
'
0xBe5dAb4A2e9cd0F27300dB4aB94BeE3A233AEB19
'
,
mainnet
:
'
0xBe5dAb4A2e9cd0F27300dB4aB94BeE3A233AEB19
'
,
goerli
:
'
0x9c945aC97Baf48cB784AbBB61399beB71aF7A378
'
,
goerli
:
'
0x9c945aC97Baf48cB784AbBB61399beB71aF7A378
'
,
sepolia
:
ethers
.
constants
.
AddressZero
,
}
}
// legacy
// legacy
const
canonicalTransactionChainAddresses
=
{
const
canonicalTransactionChainAddresses
=
{
mainnet
:
'
0x5E4e65926BA27467555EB562121fac00D24E9dD2
'
,
mainnet
:
'
0x5E4e65926BA27467555EB562121fac00D24E9dD2
'
,
goerli
:
'
0x607F755149cFEB3a14E1Dc3A4E2450Cde7dfb04D
'
,
goerli
:
'
0x607F755149cFEB3a14E1Dc3A4E2450Cde7dfb04D
'
,
sepolia
:
ethers
.
constants
.
AddressZero
,
}
}
import
{
import
{
...
@@ -67,6 +79,7 @@ export const DEPOSIT_CONFIRMATION_BLOCKS: {
...
@@ -67,6 +79,7 @@ export const DEPOSIT_CONFIRMATION_BLOCKS: {
}
=
{
}
=
{
[
L2ChainID
.
OPTIMISM
]:
50
as
const
,
[
L2ChainID
.
OPTIMISM
]:
50
as
const
,
[
L2ChainID
.
OPTIMISM_GOERLI
]:
12
as
const
,
[
L2ChainID
.
OPTIMISM_GOERLI
]:
12
as
const
,
[
L2ChainID
.
OPTIMISM_SEPOLIA
]:
12
as
const
,
[
L2ChainID
.
OPTIMISM_HARDHAT_LOCAL
]:
2
as
const
,
[
L2ChainID
.
OPTIMISM_HARDHAT_LOCAL
]:
2
as
const
,
[
L2ChainID
.
OPTIMISM_HARDHAT_DEVNET
]:
2
as
const
,
[
L2ChainID
.
OPTIMISM_HARDHAT_DEVNET
]:
2
as
const
,
[
L2ChainID
.
OPTIMISM_BEDROCK_ALPHA_TESTNET
]:
12
as
const
,
[
L2ChainID
.
OPTIMISM_BEDROCK_ALPHA_TESTNET
]:
12
as
const
,
...
@@ -81,6 +94,7 @@ export const CHAIN_BLOCK_TIMES: {
...
@@ -81,6 +94,7 @@ export const CHAIN_BLOCK_TIMES: {
}
=
{
}
=
{
[
L1ChainID
.
MAINNET
]:
13
as
const
,
[
L1ChainID
.
MAINNET
]:
13
as
const
,
[
L1ChainID
.
GOERLI
]:
15
as
const
,
[
L1ChainID
.
GOERLI
]:
15
as
const
,
[
L1ChainID
.
SEPOLIA
]:
15
as
const
,
[
L1ChainID
.
HARDHAT_LOCAL
]:
1
as
const
,
[
L1ChainID
.
HARDHAT_LOCAL
]:
1
as
const
,
[
L1ChainID
.
BEDROCK_LOCAL_DEVNET
]:
15
as
const
,
[
L1ChainID
.
BEDROCK_LOCAL_DEVNET
]:
15
as
const
,
}
}
...
@@ -137,6 +151,10 @@ export const CONTRACT_ADDRESSES: {
...
@@ -137,6 +151,10 @@ export const CONTRACT_ADDRESSES: {
l1
:
getL1ContractsByNetworkName
(
'
goerli
'
),
l1
:
getL1ContractsByNetworkName
(
'
goerli
'
),
l2
:
DEFAULT_L2_CONTRACT_ADDRESSES
,
l2
:
DEFAULT_L2_CONTRACT_ADDRESSES
,
},
},
[
L2ChainID
.
OPTIMISM_SEPOLIA
]:
{
l1
:
getL1ContractsByNetworkName
(
'
sepolia
'
),
l2
:
DEFAULT_L2_CONTRACT_ADDRESSES
,
},
[
L2ChainID
.
OPTIMISM_HARDHAT_LOCAL
]:
{
[
L2ChainID
.
OPTIMISM_HARDHAT_LOCAL
]:
{
l1
:
{
l1
:
{
AddressManager
:
'
0x5FbDB2315678afecb367f032d93F642f64180aa3
'
as
const
,
AddressManager
:
'
0x5FbDB2315678afecb367f032d93F642f64180aa3
'
as
const
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment