Skip to content

Commit f62940b

Browse files
authored
DVO-1021: Switch to goccy/go-json (#730)
* DVO-1021: Switch to goccy/go-json This should improve latencies of some requests * DVO-1021: Fix failing test goccy/json doesn't support marshalling **SomeType values * fix linter
1 parent d96ec5f commit f62940b

22 files changed

+30
-26
lines changed

beaconclient/prod_beacon_instance.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package beaconclient
22

33
import (
4-
"encoding/json"
54
"fmt"
65
"net/http"
76
"os"
@@ -10,6 +9,7 @@ import (
109

1110
"github.com/attestantio/go-eth2-client/spec/capella"
1211
"github.com/flashbots/mev-boost-relay/common"
12+
"github.com/goccy/go-json"
1313
"github.com/r3labs/sse/v2"
1414
"github.com/sirupsen/logrus"
1515
)

beaconclient/util.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@ package beaconclient
22

33
import (
44
"bytes"
5-
"encoding/json"
65
"errors"
76
"fmt"
87
"io"
98
"net/http"
109
"strings"
10+
11+
"github.com/goccy/go-json"
1112
)
1213

1314
var (

cmd/tool/archive-execution-payloads.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ package tool
22

33
import (
44
"encoding/csv"
5-
"encoding/json"
65
"net/url"
76
"os"
87
"strings"
98

109
"github.com/flashbots/mev-boost-relay/database"
1110
"github.com/flashbots/mev-boost-relay/database/vars"
11+
"github.com/goccy/go-json"
1212
"github.com/spf13/cobra"
1313
)
1414

cmd/tool/export-data-api-payloads-bids.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package tool
22

33
import (
44
"encoding/csv"
5-
"encoding/json"
65
"fmt"
76
"net/url"
87
"os"
@@ -11,6 +10,7 @@ import (
1110

1211
"github.com/flashbots/mev-boost-relay/common"
1312
"github.com/flashbots/mev-boost-relay/database"
13+
"github.com/goccy/go-json"
1414
"github.com/spf13/cobra"
1515
)
1616

cmd/tool/export-data-api-payloads-delivered.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ package tool
22

33
import (
44
"encoding/csv"
5-
"encoding/json"
65
"net/url"
76
"os"
87
"strings"
98

109
"github.com/flashbots/mev-boost-relay/common"
1110
"github.com/flashbots/mev-boost-relay/database"
1211
"github.com/flashbots/mev-boost-relay/database/vars"
12+
"github.com/goccy/go-json"
1313
"github.com/spf13/cobra"
1414
)
1515

common/ssz_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package common
22

33
import (
44
"bytes"
5-
"encoding/json"
65
"os"
76
"testing"
87

@@ -11,6 +10,7 @@ import (
1110
builderSpec "github.com/attestantio/go-builder-client/spec"
1211
"github.com/attestantio/go-eth2-client/spec"
1312
"github.com/ethereum/go-ethereum/common/hexutil"
13+
"github.com/goccy/go-json"
1414
"github.com/stretchr/testify/require"
1515
)
1616

common/test_utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"bytes"
55
"compress/gzip"
66
"encoding/base64"
7-
"encoding/json"
87
"io"
98
"os"
109
"testing"
@@ -23,6 +22,7 @@ import (
2322
"github.com/flashbots/go-boost-utils/bls"
2423
"github.com/flashbots/go-boost-utils/ssz"
2524
"github.com/flashbots/go-boost-utils/utils"
25+
"github.com/goccy/go-json"
2626
"github.com/holiman/uint256"
2727
"github.com/sirupsen/logrus"
2828
"github.com/stretchr/testify/require"

common/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package common
22

33
import (
4-
"encoding/json"
54
"errors"
65
"fmt"
76
"os"
@@ -19,6 +18,7 @@ import (
1918
ssz "github.com/ferranbt/fastssz"
2019
boostSsz "github.com/flashbots/go-boost-utils/ssz"
2120
"github.com/flashbots/go-boost-utils/utils"
21+
"github.com/goccy/go-json"
2222
)
2323

2424
var (

common/types_spec.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package common
22

33
import (
44
"bytes"
5-
"encoding/json"
65
"fmt"
76

87
builderApi "github.com/attestantio/go-builder-client/api"
@@ -24,6 +23,7 @@ import (
2423
"github.com/flashbots/go-boost-utils/bls"
2524
"github.com/flashbots/go-boost-utils/ssz"
2625
"github.com/flashbots/go-boost-utils/utils"
26+
"github.com/goccy/go-json"
2727
"github.com/holiman/uint256"
2828
"github.com/pkg/errors"
2929
)

common/types_spec_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ package common
22

33
import (
44
"bytes"
5-
"encoding/json"
65
"testing"
76

87
"github.com/attestantio/go-eth2-client/spec"
8+
"github.com/goccy/go-json"
99
"github.com/stretchr/testify/require"
1010
)
1111

0 commit comments

Comments
 (0)