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
554b3ebf
Commit
554b3ebf
authored
Jun 01, 2023
by
Felipe Andrade
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lint
parent
c9eed243
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
4 deletions
+10
-4
backend.go
proxyd/backend.go
+5
-4
consensus_test.go
proxyd/integration_tests/consensus_test.go
+2
-0
handler.go
proxyd/tools/mockserver/handler/handler.go
+3
-0
No files found.
proxyd/backend.go
View file @
554b3ebf
...
...
@@ -7,9 +7,6 @@ import (
"encoding/json"
"errors"
"fmt"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/rpc"
"github.com/google/uuid"
"io"
"math"
"math/rand"
...
...
@@ -20,6 +17,10 @@ import (
"sync"
"time"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/rpc"
"github.com/google/uuid"
sw
"github.com/ethereum-optimism/optimism/proxyd/pkg/avg-sliding-window"
"github.com/ethereum/go-ethereum/log"
...
...
@@ -415,7 +416,7 @@ func (b *Backend) doForward(ctx context.Context, rpcReqs []*RPCReq, isBatch bool
originalRequests
:=
rpcReqs
translatedReqs
:=
make
(
map
[
string
]
*
RPCReq
,
len
(
rpcReqs
))
derivedRequests
:=
make
([]
*
RPCReq
,
0
,
0
)
derivedRequests
:=
make
([]
*
RPCReq
,
0
)
// translate consensus_getReceipts to receipts target
// right now we only support non-batched
if
!
isBatch
{
...
...
proxyd/integration_tests/consensus_test.go
View file @
554b3ebf
...
...
@@ -802,6 +802,7 @@ func TestConsensus(t *testing.T) {
var
resJsonMap
map
[
string
]
interface
{}
err
=
json
.
Unmarshal
(
resRaw
,
&
resJsonMap
)
require
.
NoError
(
t
,
err
)
require
.
Equal
(
t
,
"debug_getRawReceipts"
,
resJsonMap
[
"result"
]
.
(
map
[
string
]
interface
{})[
"method"
]
.
(
string
))
require
.
Equal
(
t
,
"debug_getRawReceipts"
,
resJsonMap
[
"result"
]
.
(
map
[
string
]
interface
{})[
"result"
]
.
(
map
[
string
]
interface
{})[
"_"
])
...
...
@@ -824,6 +825,7 @@ func TestConsensus(t *testing.T) {
var
resJsonMap
map
[
string
]
interface
{}
err
=
json
.
Unmarshal
(
resRaw
,
&
resJsonMap
)
require
.
NoError
(
t
,
err
)
require
.
Equal
(
t
,
"debug_getRawReceipts"
,
resJsonMap
[
"result"
]
.
(
map
[
string
]
interface
{})[
"method"
]
.
(
string
))
require
.
Equal
(
t
,
"debug_getRawReceipts"
,
resJsonMap
[
"result"
]
.
(
map
[
string
]
interface
{})[
"result"
]
.
(
map
[
string
]
interface
{})[
"_"
])
...
...
proxyd/tools/mockserver/handler/handler.go
View file @
554b3ebf
...
...
@@ -90,6 +90,9 @@ func (mh *MockedHandler) Handler(w http.ResponseWriter, req *http.Request) {
if
selectedResponse
!=
""
{
var
rpcRes
proxyd
.
RPCRes
err
=
json
.
Unmarshal
([]
byte
(
selectedResponse
),
&
rpcRes
)
if
err
!=
nil
{
panic
(
err
)
}
idJson
,
_
:=
json
.
Marshal
(
r
[
"id"
])
rpcRes
.
ID
=
idJson
res
,
_
:=
json
.
Marshal
(
rpcRes
)
...
...
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