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
1b908768
Commit
1b908768
authored
Feb 27, 2025
by
vicotor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update proto
parent
6b703c0d
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
376 additions
and
147 deletions
+376
-147
engine.go
engine/engine.go
+5
-2
receipt.pb.go
exchain/protocol/gen/go/nebula/v1/receipt.pb.go
+109
-35
transaction.pb.go
exchain/protocol/gen/go/nebula/v1/transaction.pb.go
+227
-98
receipt.proto
exchain/protocol/proto/nebula/v1/receipt.proto
+4
-0
transaction.proto
exchain/protocol/proto/nebula/v1/transaction.proto
+11
-1
payload_util.go
op-node/rollup/derive/payload_util.go
+15
-6
build_start.go
op-node/rollup/engine/build_start.go
+5
-5
No files found.
engine/engine.go
View file @
1b908768
...
@@ -34,8 +34,11 @@ func (e *ExChainAPI) OutputV0AtBlock(ctx context.Context, blockHash common.Hash)
...
@@ -34,8 +34,11 @@ func (e *ExChainAPI) OutputV0AtBlock(ctx context.Context, blockHash common.Hash)
}
}
func
(
e
*
ExChainAPI
)
ChainID
(
ctx
context
.
Context
)
(
*
big
.
Int
,
error
)
{
func
(
e
*
ExChainAPI
)
ChainID
(
ctx
context
.
Context
)
(
*
big
.
Int
,
error
)
{
//TODO implement me
id
,
err
:=
e
.
chain
.
ChainId
()
panic
(
"implement me"
)
if
err
!=
nil
{
return
nil
,
err
}
return
new
(
big
.
Int
)
.
SetUint64
(
id
.
Uint64
()),
nil
}
}
func
(
e
*
ExChainAPI
)
NewPayload
(
params
exchain
.
PayloadParams
)
(
exchain
.
ExecutionResult
,
error
)
{
func
(
e
*
ExChainAPI
)
NewPayload
(
params
exchain
.
PayloadParams
)
(
exchain
.
ExecutionResult
,
error
)
{
...
...
exchain/protocol/gen/go/nebula/v1/receipt.pb.go
View file @
1b908768
This diff is collapsed.
Click to expand it.
exchain/protocol/gen/go/nebula/v1/transaction.pb.go
View file @
1b908768
This diff is collapsed.
Click to expand it.
exchain/protocol/proto/nebula/v1/receipt.proto
View file @
1b908768
...
@@ -32,6 +32,7 @@ message TransactionReceipt {
...
@@ -32,6 +32,7 @@ message TransactionReceipt {
LimitOrderReceipt
limit_r
=
11
;
LimitOrderReceipt
limit_r
=
11
;
MarketOrderReceipt
market_r
=
12
;
MarketOrderReceipt
market_r
=
12
;
CancelOrderReceipt
cancel_r
=
13
;
CancelOrderReceipt
cancel_r
=
13
;
ProtocolTransactionReceipt
protocol_r
=
14
;
}
}
}
}
...
@@ -60,3 +61,6 @@ message MarketOrderReceipt {
...
@@ -60,3 +61,6 @@ message MarketOrderReceipt {
message
CancelOrderReceipt
{
message
CancelOrderReceipt
{
string
order_id
=
1
;
string
order_id
=
1
;
}
}
message
ProtocolTransactionReceipt
{
}
exchain/protocol/proto/nebula/v1/transaction.proto
View file @
1b908768
...
@@ -24,6 +24,7 @@ enum TxType {
...
@@ -24,6 +24,7 @@ enum TxType {
LimitTx
=
5
;
LimitTx
=
5
;
MarketTx
=
6
;
MarketTx
=
6
;
CancelTx
=
7
;
CancelTx
=
7
;
ProtocolTx
=
8
;
}
}
message
Signature
{
message
Signature
{
...
@@ -50,8 +51,9 @@ message Transaction {
...
@@ -50,8 +51,9 @@ message Transaction {
LimitOrderTransaction
limit_tx
=
10
;
LimitOrderTransaction
limit_tx
=
10
;
MarketOrderTransaction
market_tx
=
11
;
MarketOrderTransaction
market_tx
=
11
;
CancelOrderTransaction
cancel_tx
=
12
;
CancelOrderTransaction
cancel_tx
=
12
;
ProtocolTransaction
protocol_tx
=
13
;
}
}
Signature
signature
=
1
3
;
Signature
signature
=
1
4
;
}
}
message
SignProxyTransaction
{
message
SignProxyTransaction
{
...
@@ -97,3 +99,11 @@ message MarketOrderTransaction {
...
@@ -97,3 +99,11 @@ message MarketOrderTransaction {
message
CancelOrderTransaction
{
message
CancelOrderTransaction
{
string
order_id
=
1
;
string
order_id
=
1
;
}
}
message
ProtocolTransaction
{
uint64
l1_number
=
1
;
uint64
l1_time
=
2
;
bytes
l1_block_hash
=
3
;
uint64
sequence_number
=
4
;
bytes
batcher_addr
=
5
;
}
op-node/rollup/derive/payload_util.go
View file @
1b908768
...
@@ -3,7 +3,6 @@ package derive
...
@@ -3,7 +3,6 @@ package derive
import
(
import
(
"encoding/binary"
"encoding/binary"
"fmt"
"fmt"
"github.com/exchain/go-exchain/op-node/rollup"
"github.com/exchain/go-exchain/op-node/rollup"
"github.com/exchain/go-exchain/op-service/eth"
"github.com/exchain/go-exchain/op-service/eth"
)
)
...
@@ -22,11 +21,21 @@ func PayloadToBlockRef(rollupCfg *rollup.Config, payload *eth.ExecutionPayload)
...
@@ -22,11 +21,21 @@ func PayloadToBlockRef(rollupCfg *rollup.Config, payload *eth.ExecutionPayload)
sequenceNumber
=
0
sequenceNumber
=
0
}
else
{
}
else
{
// todo: vicotor implement this.
// todo: vicotor implement this.
data
:=
make
([]
byte
,
0
)
//if len(payload.Transactions) == 0 {
info
,
err
:=
L1BlockInfoFromBytes
(
rollupCfg
,
uint64
(
payload
.
Timestamp
),
data
)
// return eth.L2BlockRef{}, fmt.Errorf("l2 block is missing L1 info deposit tx, block hash: %s", payload.BlockHash)
if
err
!=
nil
{
//}
return
eth
.
L2BlockRef
{},
fmt
.
Errorf
(
"failed to parse L1 info deposit tx from L2 block: %w"
,
err
)
//var tx types.Transaction
}
//if err := tx.UnmarshalBinary(payload.Transactions[0]); err != nil {
// return eth.L2BlockRef{}, fmt.Errorf("failed to decode first tx to read l1 info from: %w", err)
//}
//if tx.Type() != types.DepositTxType {
// return eth.L2BlockRef{}, fmt.Errorf("first payload tx has unexpected tx type: %d", tx.Type())
//}
info
,
err
:=
L1BlockInfoFromBytes
(
rollupCfg
,
uint64
(
payload
.
Timestamp
),
tx
.
Data
())
//if err != nil {
// return eth.L2BlockRef{}, fmt.Errorf("failed to parse L1 info deposit tx from L2 block: %w", err)
//}
//l1Origin = eth.BlockID{Hash: info.BlockHash, Number: info.Number}
l1Origin
=
eth
.
BlockID
{
Hash
:
info
.
BlockHash
,
Number
:
info
.
Number
}
l1Origin
=
eth
.
BlockID
{
Hash
:
info
.
BlockHash
,
Number
:
info
.
Number
}
sequenceNumber
=
info
.
SequenceNumber
sequenceNumber
=
info
.
SequenceNumber
}
}
...
...
op-node/rollup/engine/build_start.go
View file @
1b908768
...
@@ -37,11 +37,11 @@ func (eq *EngDeriver) onBuildStart(ev BuildStartEvent) {
...
@@ -37,11 +37,11 @@ func (eq *EngDeriver) onBuildStart(ev BuildStartEvent) {
eq
.
emitter
.
Emit
(
rollup
.
CriticalErrorEvent
{
Err
:
err
})
// make the node exit, things are very wrong.
eq
.
emitter
.
Emit
(
rollup
.
CriticalErrorEvent
{
Err
:
err
})
// make the node exit, things are very wrong.
return
return
}
}
fc
:=
eth
.
ForkchoiceState
{
//
fc := eth.ForkchoiceState{
HeadBlockHash
:
fcEvent
.
UnsafeL2Head
.
Hash
,
//
HeadBlockHash: fcEvent.UnsafeL2Head.Hash,
SafeBlockHash
:
fcEvent
.
SafeL2Head
.
Hash
,
//
SafeBlockHash: fcEvent.SafeL2Head.Hash,
FinalizedBlockHash
:
fcEvent
.
FinalizedL2Head
.
Hash
,
//
FinalizedBlockHash: fcEvent.FinalizedL2Head.Hash,
}
//
}
buildStartTime
:=
time
.
Now
()
buildStartTime
:=
time
.
Now
()
result
,
err
:=
startPayload
(
context
.
TODO
(),
eq
.
ec
.
engine
,
fc
,
ev
.
Attributes
.
Attributes
)
result
,
err
:=
startPayload
(
context
.
TODO
(),
eq
.
ec
.
engine
,
fc
,
ev
.
Attributes
.
Attributes
)
if
err
!=
nil
{
if
err
!=
nil
{
...
...
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