Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[network] Remove Legacy Gossiper + Only Push Gossip from RPC #497

Merged
merged 47 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
7f1d2c2
remove legacy gossip sender
patrick-ogrady Feb 25, 2024
ae97532
simplify block builder (no gossip)
patrick-ogrady Feb 25, 2024
327f701
add handling on atomic submit
patrick-ogrady Feb 25, 2024
4b11d5b
spiking on simpler integration
patrick-ogrady Feb 25, 2024
e4a30bd
cleanup naming
patrick-ogrady Feb 25, 2024
309e352
cleanup consts
patrick-ogrady Feb 25, 2024
b338352
remove gossip logic from tx pool
patrick-ogrady Feb 25, 2024
1612eca
nit
patrick-ogrady Feb 25, 2024
dab0718
remove unused newTxs
patrick-ogrady Feb 26, 2024
3bad7ac
add TODO for moving
patrick-ogrady Feb 26, 2024
36a381c
import avalanchego sdk changes
patrick-ogrady Feb 27, 2024
21bc612
add Has to GossipEthTxPool
patrick-ogrady Feb 27, 2024
5f60307
update interfaces
patrick-ogrady Feb 27, 2024
e5c96a3
add shim for push gossiper
patrick-ogrady Feb 27, 2024
5866ae6
enforce interface
patrick-ogrady Feb 27, 2024
f0dee81
add has to mempool
patrick-ogrady Feb 27, 2024
18c9996
resolve vm errors
patrick-ogrady Feb 27, 2024
ed5ae95
remove gossiper tests for now
patrick-ogrady Feb 27, 2024
4b9b68c
re-add getValidEthTxs
patrick-ogrady Feb 27, 2024
4103f53
update avalanchego
patrick-ogrady Feb 27, 2024
501a426
fix err
patrick-ogrady Feb 27, 2024
4cabbbe
update version file to match
patrick-ogrady Feb 27, 2024
c0d271b
re-add legacy handling tests
patrick-ogrady Feb 27, 2024
ae5607a
revert unnecessary changes to the test files
patrick-ogrady Feb 27, 2024
3df79d9
non-commented out tests are passing
patrick-ogrady Feb 27, 2024
3191f0f
revert timeout
patrick-ogrady Feb 27, 2024
6b78c3e
fix most tests
joshua-kim Feb 27, 2024
bfcae19
this test was already fine
joshua-kim Feb 27, 2024
f7e3ac3
removing sent + regossip stats
joshua-kim Feb 27, 2024
72cc821
nit
joshua-kim Feb 27, 2024
da09bfb
nit
joshua-kim Feb 27, 2024
6fc6036
linting
patrick-ogrady Feb 27, 2024
96ef8ad
remove unused configs
patrick-ogrady Feb 27, 2024
06e7ae5
cleanup config use
patrick-ogrady Feb 27, 2024
a2bed84
remove KiB
patrick-ogrady Feb 27, 2024
0dae3e2
set back to 100ms
patrick-ogrady Feb 27, 2024
3d1b239
use correct config
patrick-ogrady Feb 27, 2024
5dd1f58
Update plugin/evm/gossip.go
patrick-ogrady Feb 28, 2024
f3d4a47
handle nil push gossiper
patrick-ogrady Feb 28, 2024
cffa2fc
update avalanchego version
StephenButtolph Feb 28, 2024
53a9894
Gossip cleanup test race (#499)
darioush Feb 28, 2024
3b80fe2
nit
StephenButtolph Feb 28, 2024
a822e34
Merge branch 'master' into gossip-cleanup
StephenButtolph Feb 28, 2024
035d78d
move push gossiper behind an atomic
StephenButtolph Feb 29, 2024
ae5c02b
Buffer pendingTxs channel
StephenButtolph Feb 29, 2024
a417087
update avalanchego version
StephenButtolph Feb 29, 2024
c3e7c7c
remove dead code
StephenButtolph Feb 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion eth/api_backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,14 @@ func (b *EthAPIBackend) SendTx(ctx context.Context, signedTx *types.Transaction)
if err := ctx.Err(); err != nil {
return err
}
return b.eth.txPool.AddLocal(signedTx)
if err := b.eth.txPool.AddLocal(signedTx); err != nil {
patrick-ogrady marked this conversation as resolved.
Show resolved Hide resolved
return err
}

// We only enqueue transactions for push gossip if they were submitted over the RPC and
// added to the mempool.
b.eth.gossiper.Add(signedTx)
patrick-ogrady marked this conversation as resolved.
Show resolved Hide resolved
return nil
}

func (b *EthAPIBackend) GetPoolTransactions() (types.Transactions, error) {
Expand Down
9 changes: 9 additions & 0 deletions eth/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,20 @@ type Settings struct {
MaxBlocksPerRequest int64 // Maximum number of blocks to serve per getLogs request
}

// PushGossiper sends pushes pending transactions to peers until they are
// removed from the mempool.
type PushGossiper interface {
Add(*types.Transaction)
}

// Ethereum implements the Ethereum full node service.
type Ethereum struct {
config *Config

// Handlers
txPool *txpool.TxPool
blockchain *core.BlockChain
gossiper PushGossiper

// DB interfaces
chainDb ethdb.Database // Block chain database
Expand Down Expand Up @@ -118,6 +125,7 @@ func New(
stack *node.Node,
config *Config,
cb dummy.ConsensusCallbacks,
gossiper PushGossiper,
chainDb ethdb.Database,
settings Settings,
lastAcceptedHash common.Hash,
Expand Down Expand Up @@ -151,6 +159,7 @@ func New(

eth := &Ethereum{
config: config,
gossiper: gossiper,
chainDb: chainDb,
eventMux: new(event.TypeMux),
accountManager: stack.AccountManager(),
Expand Down
47 changes: 23 additions & 24 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.21

require (
github.com/VictoriaMetrics/fastcache v1.10.0
github.com/ava-labs/avalanchego v1.11.1
github.com/ava-labs/avalanchego v1.11.2-rc.3
github.com/cespare/cp v0.1.0
github.com/davecgh/go-spew v1.1.1
github.com/deckarep/golang-set/v2 v2.1.0
Expand All @@ -13,7 +13,7 @@ require (
github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5
github.com/fsnotify/fsnotify v1.6.0
github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08
github.com/google/uuid v1.3.0
github.com/google/uuid v1.6.0
github.com/gorilla/rpc v1.2.0
github.com/gorilla/websocket v1.4.2
github.com/hashicorp/go-bexpr v0.1.10
Expand All @@ -34,15 +34,15 @@ require (
github.com/stretchr/testify v1.8.4
github.com/tyler-smith/go-bip39 v1.1.0
github.com/urfave/cli/v2 v2.17.2-0.20221006022127-8f469abc00aa
go.uber.org/goleak v1.2.1
go.uber.org/goleak v1.3.0
go.uber.org/mock v0.4.0
golang.org/x/crypto v0.17.0
golang.org/x/crypto v0.18.0
golang.org/x/exp v0.0.0-20231127185646-65229373498e
golang.org/x/sync v0.5.0
golang.org/x/sys v0.15.0
golang.org/x/sync v0.6.0
golang.org/x/sys v0.16.0
golang.org/x/text v0.14.0
golang.org/x/time v0.0.0-20220922220347-f3bd1da661af
google.golang.org/protobuf v1.31.0
google.golang.org/protobuf v1.32.0
gopkg.in/natefinch/lumberjack.v2 v2.0.0
)

Expand All @@ -52,7 +52,7 @@ require (
github.com/bits-and-blooms/bitset v1.7.0 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect
github.com/btcsuite/btcd/btcutil v1.1.3 // indirect
github.com/cenkalti/backoff/v4 v4.1.3 // indirect
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cockroachdb/errors v1.9.1 // indirect
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
Expand All @@ -67,7 +67,7 @@ require (
github.com/dlclark/regexp2 v1.7.0 // indirect
github.com/ethereum/c-kzg-4844 v0.2.0 // indirect
github.com/getsentry/sentry-go v0.18.0 // indirect
github.com/go-logr/logr v1.3.0 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect
Expand All @@ -81,7 +81,7 @@ require (
github.com/google/renameio/v2 v2.0.0 // indirect
github.com/graph-gophers/graphql-go v1.3.0 // indirect
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.12.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/huin/goupnp v1.0.3 // indirect
github.com/influxdata/influxdb-client-go/v2 v2.4.0 // indirect
Expand Down Expand Up @@ -119,23 +119,22 @@ require (
github.com/tklauser/numcpus v0.2.2 // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
github.com/yusufpapurcu/wmi v1.2.2 // indirect
go.opentelemetry.io/otel v1.11.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.11.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.11.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.11.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.11.0 // indirect
go.opentelemetry.io/otel/sdk v1.11.0 // indirect
go.opentelemetry.io/otel/trace v1.11.0 // indirect
go.opentelemetry.io/proto/otlp v0.19.0 // indirect
go.opentelemetry.io/otel v1.22.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.22.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.22.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.22.0 // indirect
go.opentelemetry.io/otel/metric v1.22.0 // indirect
go.opentelemetry.io/otel/sdk v1.22.0 // indirect
go.opentelemetry.io/otel/trace v1.22.0 // indirect
go.opentelemetry.io/proto/otlp v1.0.0 // indirect
go.uber.org/multierr v1.10.0 // indirect
go.uber.org/zap v1.26.0 // indirect
golang.org/x/net v0.19.0 // indirect
golang.org/x/term v0.15.0 // indirect
golang.org/x/net v0.20.0 // indirect
golang.org/x/term v0.16.0 // indirect
gonum.org/v1/gonum v0.11.0 // indirect
google.golang.org/genproto v0.0.0-20230711160842-782d3b101e98 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 // indirect
google.golang.org/grpc v1.58.3 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect
google.golang.org/grpc v1.62.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
Expand Down
Loading
Loading