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
4aacef46
Commit
4aacef46
authored
Oct 26, 2023
by
clabby
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
:broom:
parent
7d603267
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
24 deletions
+6
-24
node.go
op-node/node/node.go
+1
-0
lib.rs
op-service/rethdb-reader/src/lib.rs
+2
-1
reth_db.go
op-service/sources/reth_db.go
+3
-1
reth_db_test.go
op-service/sources/reth_db_test.go
+0
-22
No files found.
op-node/node/node.go
View file @
4aacef46
...
@@ -156,6 +156,7 @@ func (n *OpNode) initL1(ctx context.Context, cfg *Config) error {
...
@@ -156,6 +156,7 @@ func (n *OpNode) initL1(ctx context.Context, cfg *Config) error {
return
fmt
.
Errorf
(
"failed to get L1 RPC client: %w"
,
err
)
return
fmt
.
Errorf
(
"failed to get L1 RPC client: %w"
,
err
)
}
}
// Set the RethDB path in the EthClientConfig, if there is one configured.
rpcCfg
.
EthClientConfig
.
RethDBPath
=
cfg
.
RethDBPath
rpcCfg
.
EthClientConfig
.
RethDBPath
=
cfg
.
RethDBPath
n
.
l1Source
,
err
=
sources
.
NewL1Client
(
n
.
l1Source
,
err
=
sources
.
NewL1Client
(
...
...
op-service/rethdb-reader/src/lib.rs
View file @
4aacef46
...
@@ -138,7 +138,8 @@ pub extern "C" fn free_string(string: *mut c_char) {
...
@@ -138,7 +138,8 @@ pub extern "C" fn free_string(string: *mut c_char) {
}
}
}
}
pub
(
crate
)
fn
build_transaction_receipt_with_block_receipts
(
#[inline(always)]
fn
build_transaction_receipt_with_block_receipts
(
tx
:
TransactionSigned
,
tx
:
TransactionSigned
,
meta
:
TransactionMeta
,
meta
:
TransactionMeta
,
receipt
:
Receipt
,
receipt
:
Receipt
,
...
...
op-service/sources/reth_db.go
View file @
4aacef46
...
@@ -52,7 +52,9 @@ func FetchRethReceipts(dbPath string, blockHash *common.Hash) (types.Receipts, e
...
@@ -52,7 +52,9 @@ func FetchRethReceipts(dbPath string, blockHash *common.Hash) (types.Receipts, e
// Convert the returned JSON string to Go string and parse it
// Convert the returned JSON string to Go string and parse it
receiptsJSON
:=
C
.
GoStringN
(
receiptsResult
.
data
,
C
.
int
(
receiptsResult
.
data_len
))
receiptsJSON
:=
C
.
GoStringN
(
receiptsResult
.
data
,
C
.
int
(
receiptsResult
.
data_len
))
var
receipts
types
.
Receipts
var
receipts
types
.
Receipts
json
.
Unmarshal
([]
byte
(
receiptsJSON
),
&
receipts
)
if
err
:=
json
.
Unmarshal
([]
byte
(
receiptsJSON
),
&
receipts
);
err
!=
nil
{
return
nil
,
err
}
// Free the memory allocated by the C code
// Free the memory allocated by the C code
C
.
free_string
(
receiptsResult
.
data
)
C
.
free_string
(
receiptsResult
.
data
)
...
...
op-service/sources/reth_db_test.go
deleted
100644 → 0
View file @
7d603267
package
sources
import
(
"testing"
"github.com/ethereum/go-ethereum/common"
"github.com/stretchr/testify/require"
)
func
TestRethReceiptsLoad
(
t
*
testing
.
T
)
{
t
.
Skip
(
"Skipping test that requires a local L1 Goerli Reth DB"
)
t
.
Parallel
()
// block = https://goerli.etherscan.io/block/994113
blockHash
:=
common
.
HexToHash
(
"0x6f6f00553e4f74262a9812927afd11c341730c5c9210824fe172367457adb5f6"
)
res
,
err
:=
FetchRethReceipts
(
"/path/to/goerli-db"
,
&
blockHash
)
require
.
NoError
(
t
,
err
,
"Failed to fetch receipts from Reth DB"
)
require
.
Len
(
t
,
res
,
2
,
"Expected 2 receipts to be returned"
)
require
.
Equal
(
t
,
res
[
0
]
.
Type
,
0
)
require
.
Equal
(
t
,
res
[
0
]
.
CumulativeGasUsed
,
uint64
(
93
_787
))
require
.
Equal
(
t
,
res
[
0
]
.
Status
,
uint64
(
1
))
}
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