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
90ade85a
Commit
90ade85a
authored
Mar 11, 2023
by
clabby
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused dependencies from `contracts-bedrock`
parent
eeed99ed
Changes
6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
67 additions
and
247 deletions
+67
-247
api.go
op-node/node/api.go
+1
-1
output_root.go
op-node/rollup/output_root.go
+1
-1
package.json
packages/contracts-bedrock/package.json
+0
-2
differential-testing.go
...rock/scripts/differential-testing/differential-testing.go
+41
-91
utils.go
...s/contracts-bedrock/scripts/differential-testing/utils.go
+22
-37
yarn.lock
yarn.lock
+2
-115
No files found.
op-node/node/api.go
View file @
90ade85a
...
@@ -114,7 +114,7 @@ func (n *nodeAPI) OutputAtBlock(ctx context.Context, number hexutil.Uint64) (*et
...
@@ -114,7 +114,7 @@ func (n *nodeAPI) OutputAtBlock(ctx context.Context, number hexutil.Uint64) (*et
}
}
var
l2OutputRootVersion
eth
.
Bytes32
// it's zero for now
var
l2OutputRootVersion
eth
.
Bytes32
// it's zero for now
l2OutputRoot
:=
rollup
.
ComputeL2OutputRoot
(
l2OutputRootVersion
,
head
.
Hash
(),
head
.
Root
(),
proof
.
StorageHash
)
l2OutputRoot
:=
rollup
.
ComputeL2OutputRoot
(
l2OutputRootVersion
,
head
.
Root
(),
proof
.
StorageHash
,
head
.
Hash
()
)
return
&
eth
.
OutputResponse
{
return
&
eth
.
OutputResponse
{
Version
:
l2OutputRootVersion
,
Version
:
l2OutputRootVersion
,
...
...
op-node/rollup/output_root.go
View file @
90ade85a
...
@@ -8,7 +8,7 @@ import (
...
@@ -8,7 +8,7 @@ import (
)
)
// ComputeL2OutputRoot computes the L2 output root
// ComputeL2OutputRoot computes the L2 output root
func
ComputeL2OutputRoot
(
l2OutputRootVersion
eth
.
Bytes32
,
block
Hash
common
.
Hash
,
blockRoot
common
.
Hash
,
storageRoot
common
.
Hash
)
eth
.
Bytes32
{
func
ComputeL2OutputRoot
(
l2OutputRootVersion
eth
.
Bytes32
,
block
Root
common
.
Hash
,
storageRoot
common
.
Hash
,
blockHash
common
.
Hash
)
eth
.
Bytes32
{
digest
:=
crypto
.
Keccak256Hash
(
digest
:=
crypto
.
Keccak256Hash
(
l2OutputRootVersion
[
:
],
l2OutputRootVersion
[
:
],
blockRoot
.
Bytes
(),
blockRoot
.
Bytes
(),
...
...
packages/contracts-bedrock/package.json
View file @
90ade85a
...
@@ -59,8 +59,6 @@
...
@@ -59,8 +59,6 @@
},
},
"devDependencies"
:
{
"devDependencies"
:
{
"@eth-optimism/hardhat-deploy-config"
:
"^0.2.5"
,
"@eth-optimism/hardhat-deploy-config"
:
"^0.2.5"
,
"@ethereumjs/trie"
:
"^5.0.0-beta.1"
,
"@ethereumjs/util"
:
"^8.0.0-beta.1"
,
"@ethersproject/abstract-provider"
:
"^5.7.0"
,
"@ethersproject/abstract-provider"
:
"^5.7.0"
,
"@ethersproject/abstract-signer"
:
"^5.7.0"
,
"@ethersproject/abstract-signer"
:
"^5.7.0"
,
"ethereumjs-wallet"
:
"^1.0.2"
,
"ethereumjs-wallet"
:
"^1.0.2"
,
...
...
packages/contracts-bedrock/scripts/differential-testing/differential-testing.go
View file @
90ade85a
This diff is collapsed.
Click to expand it.
packages/contracts-bedrock/scripts/differential-testing/utils.go
View file @
90ade85a
...
@@ -5,17 +5,16 @@ import (
...
@@ -5,17 +5,16 @@ import (
"fmt"
"fmt"
"math/big"
"math/big"
"github.com/ethereum-optimism/optimism/op-bindings/bindings"
"github.com/ethereum-optimism/optimism/op-chain-ops/crossdomain"
"github.com/ethereum-optimism/optimism/op-chain-ops/crossdomain"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"
)
)
var
UnknownNonceVersion
=
errors
.
New
(
"Unknown nonce version"
)
var
UnknownNonceVersion
=
errors
.
New
(
"Unknown nonce version"
)
var
ZeroPadding
=
[
32
]
byte
{}
// checkOk checks if ok is false, and panics if so.
// checkOk checks if ok is false, and panics if so.
// Shorthand to ease go's god awful error handling
// Shorthand to ease go's god awful error handling
func
checkOk
(
ok
bool
)
{
func
checkOk
(
ok
bool
)
{
...
@@ -53,52 +52,26 @@ func encodeCrossDomainMessage(nonce *big.Int, sender common.Address, target comm
...
@@ -53,52 +52,26 @@ func encodeCrossDomainMessage(nonce *big.Int, sender common.Address, target comm
// hashWithdrawal hashes a withdrawal transaction.
// hashWithdrawal hashes a withdrawal transaction.
func
hashWithdrawal
(
nonce
*
big
.
Int
,
sender
common
.
Address
,
target
common
.
Address
,
value
*
big
.
Int
,
gasLimit
*
big
.
Int
,
data
[]
byte
)
(
common
.
Hash
,
error
)
{
func
hashWithdrawal
(
nonce
*
big
.
Int
,
sender
common
.
Address
,
target
common
.
Address
,
value
*
big
.
Int
,
gasLimit
*
big
.
Int
,
data
[]
byte
)
(
common
.
Hash
,
error
)
{
// Pack withdrawal
wd
:=
crossdomain
.
Withdrawal
{
wdtx
:=
struct
{
Nonce
*
big
.
Int
Sender
common
.
Address
Target
common
.
Address
Value
*
big
.
Int
GasLimit
*
big
.
Int
Data
[]
byte
}{
Nonce
:
nonce
,
Nonce
:
nonce
,
Sender
:
sender
,
Sender
:
&
sender
,
Target
:
target
,
Target
:
&
target
,
Value
:
value
,
Value
:
value
,
GasLimit
:
gasLimit
,
GasLimit
:
gasLimit
,
Data
:
data
,
Data
:
data
,
}
}
packed
,
err
:=
withdrawalTransactionArgs
.
Pack
(
&
wdtx
)
return
wd
.
Hash
()
if
err
!=
nil
{
return
common
.
Hash
{},
err
}
// Hash packed withdrawal (we ignore the pointer)
return
crypto
.
Keccak256Hash
(
packed
[
32
:
]),
nil
}
}
// hashOutputRootProof hashes an output root proof.
// hashOutputRootProof hashes an output root proof.
func
hashOutputRootProof
(
version
common
.
Hash
,
stateRoot
common
.
Hash
,
messagePasserStorageRoot
common
.
Hash
,
latestBlockHash
common
.
Hash
)
(
common
.
Hash
,
error
)
{
func
hashOutputRootProof
(
version
common
.
Hash
,
stateRoot
common
.
Hash
,
messagePasserStorageRoot
common
.
Hash
,
latestBlockHash
common
.
Hash
)
common
.
Hash
{
// Pack proof
proof
:=
bindings
.
TypesOutputRootProof
{
proof
:=
struct
{
Version
common
.
Hash
StateRoot
common
.
Hash
MessagePasserStorageRoot
common
.
Hash
LatestBlockHash
common
.
Hash
}{
Version
:
version
,
Version
:
version
,
StateRoot
:
stateRoot
,
StateRoot
:
stateRoot
,
MessagePasserStorageRoot
:
messagePasserStorageRoot
,
MessagePasserStorageRoot
:
messagePasserStorageRoot
,
LatestBlockHash
:
latestBlockHash
,
LatestBlockhash
:
latestBlockHash
,
}
packed
,
err
:=
outputRootProofArgs
.
Pack
(
&
proof
)
if
err
!=
nil
{
return
common
.
Hash
{},
err
}
}
return
common
.
Hash
(
rollup
.
HashOutputRootProof
(
&
proof
))
// Hash packed proof
return
crypto
.
Keccak256Hash
(
packed
),
nil
}
}
// makeDepositTx creates a deposit transaction type.
// makeDepositTx creates a deposit transaction type.
...
@@ -139,3 +112,15 @@ func makeDepositTx(
...
@@ -139,3 +112,15 @@ func makeDepositTx(
return
depositTx
return
depositTx
}
}
// Custom type to write the generated proof to
type
proofList
[][]
byte
func
(
n
*
proofList
)
Put
(
key
[]
byte
,
value
[]
byte
)
error
{
*
n
=
append
(
*
n
,
value
)
return
nil
}
func
(
n
*
proofList
)
Delete
(
key
[]
byte
)
error
{
panic
(
"not supported"
)
}
yarn.lock
View file @
90ade85a
This diff is collapsed.
Click to expand it.
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