Skip to content

Commit 7715ba7

Browse files
dvushVitalii Drohan
andauthored
Allow users to set replacement nonce (#22)
## πŸ“ Summary <!--- A general summary of your changes --> ## β›± Motivation and Context <!--- Why is this change required? What problem does it solve? --> ## πŸ“š References <!-- Any interesting external links to documentation, articles, tweets which add value to the PR --> --- ## βœ… I have run these commands * [ ] `make lint` * [ ] `make test` * [ ] `go mod tidy` Co-authored-by: Vitalii Drohan <[email protected]>
1 parent 0ef18f8 commit 7715ba7

File tree

5 files changed

+20
-31
lines changed

5 files changed

+20
-31
lines changed

β€Žgo.modβ€Ž

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,34 +17,25 @@ require (
1717
)
1818

1919
require (
20-
github.com/Microsoft/go-winio v0.6.2 // indirect
21-
github.com/StackExchange/wmi v1.2.1 // indirect
2220
github.com/bits-and-blooms/bitset v1.17.0 // indirect
2321
github.com/consensys/bavard v0.1.22 // indirect
2422
github.com/consensys/gnark-crypto v0.14.0 // indirect
2523
github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect
2624
github.com/crate-crypto/go-ipa v0.0.0-20240724233137-53bbb0ceb27a // indirect
2725
github.com/crate-crypto/go-kzg-4844 v1.1.0 // indirect
2826
github.com/davecgh/go-spew v1.1.1 // indirect
29-
github.com/deckarep/golang-set/v2 v2.6.0 // indirect
3027
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
3128
github.com/ethereum/c-kzg-4844 v1.0.0 // indirect
3229
github.com/ethereum/go-verkle v0.2.2 // indirect
33-
github.com/go-ole/go-ole v1.3.0 // indirect
34-
github.com/gorilla/websocket v1.4.2 // indirect
3530
github.com/holiman/uint256 v1.3.2 // indirect
3631
github.com/mmcloughlin/addchain v0.4.0 // indirect
3732
github.com/pmezard/go-difflib v1.0.0 // indirect
3833
github.com/russross/blackfriday/v2 v2.1.0 // indirect
39-
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect
4034
github.com/supranational/blst v0.3.14 // indirect
41-
github.com/tklauser/go-sysconf v0.3.12 // indirect
42-
github.com/tklauser/numcpus v0.6.1 // indirect
4335
github.com/valyala/fastrand v1.1.0 // indirect
4436
github.com/valyala/histogram v1.2.0 // indirect
4537
github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913 // indirect
4638
golang.org/x/crypto v0.32.0 // indirect
47-
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect
4839
golang.org/x/sync v0.10.0 // indirect
4940
golang.org/x/sys v0.29.0 // indirect
5041
gopkg.in/yaml.v3 v3.0.1 // indirect

β€Žgo.sumβ€Ž

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY=
2-
github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU=
31
github.com/StackExchange/wmi v1.2.1 h1:VIkavFPXSjcnS+O8yTq7NI32k0R5Aj+v39y29VYDOSA=
42
github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8=
53
github.com/VictoriaMetrics/fastcache v1.12.2 h1:N0y9ASrJ0F6h0QaC3o6uJb3NIZ9VKLjCM7NQbSmF7WI=
@@ -24,8 +22,6 @@ github.com/crate-crypto/go-kzg-4844 v1.1.0 h1:EN/u9k2TF6OWSHrCCDBBU6GLNMq88OspHH
2422
github.com/crate-crypto/go-kzg-4844 v1.1.0/go.mod h1:JolLjpSff1tCCJKaJx4psrlEdlXuJEC996PL3tTAFks=
2523
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
2624
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
27-
github.com/deckarep/golang-set/v2 v2.6.0 h1:XfcQbWM1LlMB8BsJ8N9vW5ehnnPVIw0je80NsVHagjM=
28-
github.com/deckarep/golang-set/v2 v2.6.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4=
2925
github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y=
3026
github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo=
3127
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs=
@@ -36,13 +32,8 @@ github.com/ethereum/go-ethereum v1.15.2 h1:CcU13w1IXOo6FvS60JGCTVcAJ5Ik6RkWoVIvz
3632
github.com/ethereum/go-ethereum v1.15.2/go.mod h1:wGQINJKEVUunCeoaA9C9qKMQ9GEOsEIunzzqTUO2F6Y=
3733
github.com/ethereum/go-verkle v0.2.2 h1:I2W0WjnrFUIzzVPwm8ykY+7pL2d4VhlsePn4j7cnFk8=
3834
github.com/ethereum/go-verkle v0.2.2/go.mod h1:M3b90YRnzqKyyzBEWJGqj8Qff4IDeXnzFw0P9bFw3uk=
39-
github.com/flashbots/go-utils v0.8.2 h1:8JUKd9Cv1CTcp63V03ya+47nflTwBEqZq357iwW4fxQ=
40-
github.com/flashbots/go-utils v0.8.2/go.mod h1:Lo/nrlC+q8ANgT3e6MKALIJCU+V9qTSgNtoLk/q1uIw=
41-
github.com/flashbots/go-utils v0.8.3 h1:SRRer7bcQuPyVvKg+CaZtXu9VllYg3q9I9fRN+HilEg=
42-
github.com/flashbots/go-utils v0.8.3/go.mod h1:Lo/nrlC+q8ANgT3e6MKALIJCU+V9qTSgNtoLk/q1uIw=
4335
github.com/flashbots/go-utils v0.8.4-0.20250314133512-c61cce7f9d3f h1:wQVYAr5LVFu9bKa3zzRRSOjZUF27/4D6FWxvhoVcQGE=
4436
github.com/flashbots/go-utils v0.8.4-0.20250314133512-c61cce7f9d3f/go.mod h1:Lo/nrlC+q8ANgT3e6MKALIJCU+V9qTSgNtoLk/q1uIw=
45-
github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
4637
github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE=
4738
github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78=
4839
github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw=
@@ -52,8 +43,6 @@ github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb/go.mod h1:/XxbfmMg
5243
github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk=
5344
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
5445
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
55-
github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=
56-
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
5746
github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k=
5847
github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=
5948
github.com/holiman/uint256 v1.3.2 h1:a9EgMPSC1AAaj1SZL5zIQD3WbwTuHrMGOerLjGmM/TA=
@@ -105,10 +94,6 @@ golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa h1:FRnLl4eNAQl8hwxVVC17teOw8
10594
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa/go.mod h1:zk2irFbV9DP96SEBUUAy67IdHUaZuSnrz1n472HUCLE=
10695
golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ=
10796
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
108-
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
109-
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
110-
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
111-
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
11297
golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU=
11398
golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
11499
golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=

β€Žproxy/api_validate.goβ€Ž

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ import (
77
)
88

99
var (
10-
errSigningAddress = errors.New("signing address field should not be set")
11-
errReplacementNonce = errors.New("replacement nonce field should not be set")
10+
errSigningAddress = errors.New("signing address field should not be set")
1211

1312
errDroppingTxHashed = errors.New("dropping tx hashes field should not be set")
1413
errUUID = errors.New("uuid field should not be set")
@@ -24,10 +23,6 @@ func ValidateEthSendBundle(args *rpctypes.EthSendBundleArgs, publicEndpoint bool
2423
if args.SigningAddress != nil {
2524
return errSigningAddress
2625
}
27-
28-
if args.ReplacementNonce != nil {
29-
return errReplacementNonce
30-
}
3126
}
3227
if len(args.DroppingTxHashes) > 0 {
3328
return errDroppingTxHashed

β€Žproxy/receiver_api.goβ€Ž

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,9 @@ func (prx *ReceiverProxy) EthSendBundle(ctx context.Context, ethSendBundle rpcty
136136
timestamp = uint64(timestampInt)
137137
}
138138

139-
ethSendBundle.ReplacementNonce = &timestamp
139+
if ethSendBundle.ReplacementNonce == nil {
140+
ethSendBundle.ReplacementNonce = &timestamp
141+
}
140142
}
141143
}
142144

β€Žproxy/receiver_proxy_test.goβ€Ž

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,22 @@ func TestProxyBundleRequestWithPeerUpdate(t *testing.T) {
343343
require.Equal(t, expectedRequest, builderRequest.body)
344344
builderRequest = expectRequest(t, proxies[2].localBuilderRequests)
345345
require.Equal(t, expectedRequest, builderRequest.body)
346+
347+
replacementNonce := uint64(8976)
348+
_, err = client.Call(context.Background(), EthSendBundleMethod, &rpctypes.EthSendBundleArgs{
349+
BlockNumber: &blockNumber,
350+
ReplacementUUID: &replacementUUID,
351+
ReplacementNonce: &replacementNonce,
352+
})
353+
require.NoError(t, err)
354+
355+
expectedRequest = `{"method":"eth_sendBundle","params":[{"txs":null,"blockNumber":"0x3ea","replacementUuid":"550e8400-e29b-41d4-a716-446655440000","replacementNonce":8976,"signingAddress":"0x9349365494be4f6205e5d44bdc7ec7dcd134becf"}],"id":0,"jsonrpc":"2.0"}`
356+
builderRequest = expectRequest(t, proxies[0].localBuilderRequests)
357+
require.Equal(t, expectedRequest, builderRequest.body)
358+
builderRequest = expectRequest(t, proxies[1].localBuilderRequests)
359+
require.Equal(t, expectedRequest, builderRequest.body)
360+
builderRequest = expectRequest(t, proxies[2].localBuilderRequests)
361+
require.Equal(t, expectedRequest, builderRequest.body)
346362
}
347363

348364
func TestProxySendToArchive(t *testing.T) {

0 commit comments

Comments
Β (0)