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
b799c26c
Commit
b799c26c
authored
Mar 25, 2025
by
vicotor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug for genesis block hash doesn't match.
parent
988bc0a4
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
55 deletions
+46
-55
genesis.go
exchain/genesis/genesis.go
+5
-19
types.go
op-service/eth/types.go
+5
-0
Deploy.s.sol
packages/contracts-bedrock/scripts/deploy/Deploy.s.sol
+36
-36
No files found.
exchain/genesis/genesis.go
View file @
b799c26c
...
@@ -9,7 +9,7 @@ import (
...
@@ -9,7 +9,7 @@ import (
"github.com/exchain/go-exchain/exchain"
"github.com/exchain/go-exchain/exchain"
"github.com/exchain/go-exchain/exchain/chaindb"
"github.com/exchain/go-exchain/exchain/chaindb"
nebulav1
"github.com/exchain/go-exchain/exchain/protocol/gen/go/nebula/v1"
nebulav1
"github.com/exchain/go-exchain/exchain/protocol/gen/go/nebula/v1"
"github.com/
golang/protobuf/proto
"
"github.com/
exchain/go-exchain/exchain/wrapper
"
"github.com/holiman/uint256"
"github.com/holiman/uint256"
"math/big"
"math/big"
"os"
"os"
...
@@ -107,7 +107,7 @@ func (g *GenesisBlock) ToBlock() *nebulav1.Block {
...
@@ -107,7 +107,7 @@ func (g *GenesisBlock) ToBlock() *nebulav1.Block {
tx
:=
&
nebulav1
.
Transaction
{
tx
:=
&
nebulav1
.
Transaction
{
TxType
:
nebulav1
.
TxType_SignProxyTx
,
TxType
:
nebulav1
.
TxType_SignProxyTx
,
User
:
account
.
String
(),
User
:
account
.
String
(),
Nonce
:
exchain
.
GetNonce
()
.
Bytes
()
,
Nonce
:
nil
,
Proxy
:
false
,
Proxy
:
false
,
Tx
:
&
nebulav1
.
Transaction_SignProxyTx
{
Tx
:
&
nebulav1
.
Transaction_SignProxyTx
{
SignProxyTx
:
&
nebulav1
.
SignProxyTransaction
{
SignProxyTx
:
&
nebulav1
.
SignProxyTransaction
{
...
@@ -123,7 +123,7 @@ func (g *GenesisBlock) ToBlock() *nebulav1.Block {
...
@@ -123,7 +123,7 @@ func (g *GenesisBlock) ToBlock() *nebulav1.Block {
tx
:=
&
nebulav1
.
Transaction
{
tx
:=
&
nebulav1
.
Transaction
{
TxType
:
nebulav1
.
TxType_DepositTx
,
TxType
:
nebulav1
.
TxType_DepositTx
,
User
:
account
.
String
(),
User
:
account
.
String
(),
Nonce
:
exchain
.
GetNonce
()
.
Bytes
()
,
Nonce
:
nil
,
Proxy
:
false
,
Proxy
:
false
,
Tx
:
&
nebulav1
.
Transaction_DepositTx
{
Tx
:
&
nebulav1
.
Transaction_DepositTx
{
DepositTx
:
&
nebulav1
.
DepositTransaction
{
DepositTx
:
&
nebulav1
.
DepositTransaction
{
...
@@ -139,10 +139,6 @@ func (g *GenesisBlock) ToBlock() *nebulav1.Block {
...
@@ -139,10 +139,6 @@ func (g *GenesisBlock) ToBlock() *nebulav1.Block {
}
}
}
}
}
}
hash
:=
BlockHash
(
blk
)
signature
,
_
:=
crypto
.
Sign
(
hash
.
Bytes
(),
genesisSignerKey
)
blk
.
Header
.
Signature
=
signature
return
blk
return
blk
}
}
...
@@ -164,18 +160,8 @@ func NewGenesisBlock(genfile string) (*GenesisBlock, error) {
...
@@ -164,18 +160,8 @@ func NewGenesisBlock(genfile string) (*GenesisBlock, error) {
}
}
func
BlockHash
(
blk
*
nebulav1
.
Block
)
common
.
Hash
{
func
BlockHash
(
blk
*
nebulav1
.
Block
)
common
.
Hash
{
data
:=
make
([]
byte
,
0
)
wblk
:=
wrapper
.
NewBlkWrapper
(
blk
)
data
=
append
(
data
,
uint256
.
NewInt
(
blk
.
Header
.
Height
)
.
Bytes
()
...
)
return
wblk
.
Hash
()
data
=
append
(
data
,
uint256
.
NewInt
(
blk
.
Header
.
Timestamp
)
.
Bytes
()
...
)
data
=
append
(
data
,
blk
.
Header
.
L1Hash
...
)
data
=
append
(
data
,
uint256
.
NewInt
(
blk
.
Header
.
L1Height
)
.
Bytes
()
...
)
data
=
append
(
data
,
blk
.
Header
.
ParentHash
...
)
data
=
append
(
data
,
blk
.
Header
.
AppRoot
...
)
data
=
append
(
data
,
blk
.
Header
.
Proposer
...
)
txdata
,
_
:=
proto
.
Marshal
(
blk
.
Transactions
)
data
=
append
(
data
,
txdata
...
)
return
crypto
.
Keccak256Hash
(
data
)
}
}
func
LoadGenesisAllocs
(
allocsPath
string
)
(
GenesisAlloc
,
error
)
{
func
LoadGenesisAllocs
(
allocsPath
string
)
(
GenesisAlloc
,
error
)
{
...
...
op-service/eth/types.go
View file @
b799c26c
...
@@ -256,6 +256,11 @@ func (payload *ExecutionPayload) Transactions() []*nebulav1.Transaction {
...
@@ -256,6 +256,11 @@ func (payload *ExecutionPayload) Transactions() []*nebulav1.Transaction {
return
[]
*
nebulav1
.
Transaction
{}
return
[]
*
nebulav1
.
Transaction
{}
}
}
func
(
payload
*
ExecutionPayload
)
String
()
string
{
d
,
_
:=
json
.
Marshal
(
payload
.
Payload
)
return
string
(
d
)
}
func
(
payload
*
ExecutionPayload
)
MarshalData
(
o
io
.
Writer
)
(
int
,
error
)
{
func
(
payload
*
ExecutionPayload
)
MarshalData
(
o
io
.
Writer
)
(
int
,
error
)
{
d
,
err
:=
proto
.
Marshal
(
payload
.
Payload
)
d
,
err
:=
proto
.
Marshal
(
payload
.
Payload
)
if
err
!=
nil
{
if
err
!=
nil
{
...
...
packages/contracts-bedrock/scripts/deploy/Deploy.s.sol
View file @
b799c26c
...
@@ -1424,46 +1424,46 @@ contract Deploy is Deployer {
...
@@ -1424,46 +1424,46 @@ contract Deploy is Deployer {
/// @notice Sets the implementation for the `CANNON` game type in the `DisputeGameFactory`
/// @notice Sets the implementation for the `CANNON` game type in the `DisputeGameFactory`
function setCannonFaultGameImplementation(bool _allowUpgrade) public broadcast {
function setCannonFaultGameImplementation(bool _allowUpgrade) public broadcast {
console.log("Setting Cannon FaultDisputeGame implementation");
//
console.log("Setting Cannon FaultDisputeGame implementation");
DisputeGameFactory factory = DisputeGameFactory(mustGetAddress("DisputeGameFactoryProxy"));
//
DisputeGameFactory factory = DisputeGameFactory(mustGetAddress("DisputeGameFactoryProxy"));
DelayedWETH weth = DelayedWETH(mustGetAddress("DelayedWETHProxy"));
//
DelayedWETH weth = DelayedWETH(mustGetAddress("DelayedWETHProxy"));
//
// Set the Cannon FaultDisputeGame implementation in the factory.
//
// Set the Cannon FaultDisputeGame implementation in the factory.
_setFaultGameImplementation({
//
_setFaultGameImplementation({
_factory: factory,
//
_factory: factory,
_allowUpgrade: _allowUpgrade,
//
_allowUpgrade: _allowUpgrade,
_params: FaultDisputeGameParams({
//
_params: FaultDisputeGameParams({
anchorStateRegistry: AnchorStateRegistry(mustGetAddress("AnchorStateRegistryProxy")),
//
anchorStateRegistry: AnchorStateRegistry(mustGetAddress("AnchorStateRegistryProxy")),
weth: weth,
//
weth: weth,
gameType: GameTypes.CANNON,
//
gameType: GameTypes.CANNON,
absolutePrestate: loadMipsAbsolutePrestate(),
//
absolutePrestate: loadMipsAbsolutePrestate(),
faultVm: IBigStepper(mustGetAddress("Mips")),
//
faultVm: IBigStepper(mustGetAddress("Mips")),
maxGameDepth: cfg.faultGameMaxDepth(),
//
maxGameDepth: cfg.faultGameMaxDepth(),
maxClockDuration: Duration.wrap(uint64(cfg.faultGameMaxClockDuration()))
//
maxClockDuration: Duration.wrap(uint64(cfg.faultGameMaxClockDuration()))
})
//
})
});
//
});
}
}
/// @notice Sets the implementation for the `PERMISSIONED_CANNON` game type in the `DisputeGameFactory`
/// @notice Sets the implementation for the `PERMISSIONED_CANNON` game type in the `DisputeGameFactory`
function setPermissionedCannonFaultGameImplementation(bool _allowUpgrade) public broadcast {
function setPermissionedCannonFaultGameImplementation(bool _allowUpgrade) public broadcast {
console.log("Setting Cannon PermissionedDisputeGame implementation");
//
console.log("Setting Cannon PermissionedDisputeGame implementation");
DisputeGameFactory factory = DisputeGameFactory(mustGetAddress("DisputeGameFactoryProxy"));
//
DisputeGameFactory factory = DisputeGameFactory(mustGetAddress("DisputeGameFactoryProxy"));
DelayedWETH weth = DelayedWETH(mustGetAddress("PermissionedDelayedWETHProxy"));
//
DelayedWETH weth = DelayedWETH(mustGetAddress("PermissionedDelayedWETHProxy"));
//
// Set the Cannon FaultDisputeGame implementation in the factory.
//
// Set the Cannon FaultDisputeGame implementation in the factory.
_setFaultGameImplementation({
//
_setFaultGameImplementation({
_factory: factory,
//
_factory: factory,
_allowUpgrade: _allowUpgrade,
//
_allowUpgrade: _allowUpgrade,
_params: FaultDisputeGameParams({
//
_params: FaultDisputeGameParams({
anchorStateRegistry: AnchorStateRegistry(mustGetAddress("AnchorStateRegistryProxy")),
//
anchorStateRegistry: AnchorStateRegistry(mustGetAddress("AnchorStateRegistryProxy")),
weth: weth,
//
weth: weth,
gameType: GameTypes.PERMISSIONED_CANNON,
//
gameType: GameTypes.PERMISSIONED_CANNON,
absolutePrestate: loadMipsAbsolutePrestate(),
//
absolutePrestate: loadMipsAbsolutePrestate(),
faultVm: IBigStepper(mustGetAddress("Mips")),
//
faultVm: IBigStepper(mustGetAddress("Mips")),
maxGameDepth: cfg.faultGameMaxDepth(),
//
maxGameDepth: cfg.faultGameMaxDepth(),
maxClockDuration: Duration.wrap(uint64(cfg.faultGameMaxClockDuration()))
//
maxClockDuration: Duration.wrap(uint64(cfg.faultGameMaxClockDuration()))
})
//
})
});
//
});
}
}
/// @notice Sets the implementation for the `ALPHABET` game type in the `DisputeGameFactory`
/// @notice Sets the implementation for the `ALPHABET` game type in the `DisputeGameFactory`
...
...
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