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
Show 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)
}
func
(
e
*
ExChainAPI
)
ChainID
(
ctx
context
.
Context
)
(
*
big
.
Int
,
error
)
{
//TODO implement me
panic
(
"implement me"
)
id
,
err
:=
e
.
chain
.
ChainId
()
if
err
!=
nil
{
return
nil
,
err
}
return
new
(
big
.
Int
)
.
SetUint64
(
id
.
Uint64
()),
nil
}
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 {
LimitOrderReceipt
limit_r
=
11
;
MarketOrderReceipt
market_r
=
12
;
CancelOrderReceipt
cancel_r
=
13
;
ProtocolTransactionReceipt
protocol_r
=
14
;
}
}
...
...
@@ -60,3 +61,6 @@ message MarketOrderReceipt {
message
CancelOrderReceipt
{
string
order_id
=
1
;
}
message
ProtocolTransactionReceipt
{
}
exchain/protocol/proto/nebula/v1/transaction.proto
View file @
1b908768
...
...
@@ -24,6 +24,7 @@ enum TxType {
LimitTx
=
5
;
MarketTx
=
6
;
CancelTx
=
7
;
ProtocolTx
=
8
;
}
message
Signature
{
...
...
@@ -50,8 +51,9 @@ message Transaction {
LimitOrderTransaction
limit_tx
=
10
;
MarketOrderTransaction
market_tx
=
11
;
CancelOrderTransaction
cancel_tx
=
12
;
ProtocolTransaction
protocol_tx
=
13
;
}
Signature
signature
=
1
3
;
Signature
signature
=
1
4
;
}
message
SignProxyTransaction
{
...
...
@@ -97,3 +99,11 @@ message MarketOrderTransaction {
message
CancelOrderTransaction
{
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
import
(
"encoding/binary"
"fmt"
"github.com/exchain/go-exchain/op-node/rollup"
"github.com/exchain/go-exchain/op-service/eth"
)
...
...
@@ -22,11 +21,21 @@ func PayloadToBlockRef(rollupCfg *rollup.Config, payload *eth.ExecutionPayload)
sequenceNumber
=
0
}
else
{
// todo: vicotor implement this.
data
:=
make
([]
byte
,
0
)
info
,
err
:=
L1BlockInfoFromBytes
(
rollupCfg
,
uint64
(
payload
.
Timestamp
),
data
)
if
err
!=
nil
{
return
eth
.
L2BlockRef
{},
fmt
.
Errorf
(
"failed to parse L1 info deposit tx from L2 block: %w"
,
err
)
}
//if len(payload.Transactions) == 0 {
// return eth.L2BlockRef{}, fmt.Errorf("l2 block is missing L1 info deposit tx, block hash: %s", payload.BlockHash)
//}
//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
}
sequenceNumber
=
info
.
SequenceNumber
}
...
...
op-node/rollup/engine/build_start.go
View file @
1b908768
...
...
@@ -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.
return
}
fc
:=
eth
.
ForkchoiceState
{
HeadBlockHash
:
fcEvent
.
UnsafeL2Head
.
Hash
,
SafeBlockHash
:
fcEvent
.
SafeL2Head
.
Hash
,
FinalizedBlockHash
:
fcEvent
.
FinalizedL2Head
.
Hash
,
}
//
fc := eth.ForkchoiceState{
//
HeadBlockHash: fcEvent.UnsafeL2Head.Hash,
//
SafeBlockHash: fcEvent.SafeL2Head.Hash,
//
FinalizedBlockHash: fcEvent.FinalizedL2Head.Hash,
//
}
buildStartTime
:=
time
.
Now
()
result
,
err
:=
startPayload
(
context
.
TODO
(),
eq
.
ec
.
engine
,
fc
,
ev
.
Attributes
.
Attributes
)
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