Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ jobs:
- name: Setup Contracts
run: ./scripts/run_task.sh setup-contracts
- name: Run Warp E2E Tests
uses: ava-labs/avalanchego/.github/actions/run-monitored-tmpnet-cmd@df4a8e531761a55d6878d6d2f16e9acb023de19d
uses: ava-labs/avalanchego/.github/actions/run-monitored-tmpnet-cmd@70148edc6ecabb2836b89d890718011b892b7063
with:
run: ./scripts/run_task.sh test-e2e-warp-ci
artifact_prefix: warp
Expand All @@ -133,7 +133,7 @@ jobs:
with:
fetch-depth: 0
- name: Run E2E Load Tests
uses: ava-labs/avalanchego/.github/actions/run-monitored-tmpnet-cmd@df4a8e531761a55d6878d6d2f16e9acb023de19d
uses: ava-labs/avalanchego/.github/actions/run-monitored-tmpnet-cmd@70148edc6ecabb2836b89d890718011b892b7063
with:
run: ./scripts/run_task.sh test-e2e-load-ci
artifact_prefix: load
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ go 1.24.9
require (
github.com/VictoriaMetrics/fastcache v1.12.1
github.com/antithesishq/antithesis-sdk-go v0.3.8
github.com/ava-labs/avalanchego v1.14.1-0.20251120155522-df4a8e531761
github.com/ava-labs/avalanchego v1.14.1-antithesis-docker-image-fix
github.com/ava-labs/firewood-go-ethhash/ffi v0.0.15
github.com/ava-labs/libevm v1.13.15-0.20251016142715-1bccf4f2ddb2
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
Expand Down Expand Up @@ -57,7 +57,7 @@ require (
github.com/DataDog/zstd v1.5.2 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/StephenButtolph/canoto v0.17.3 // indirect
github.com/ava-labs/coreth v0.16.0-rc.0 // indirect
github.com/ava-labs/avalanchego/graft/coreth v0.0.0-20251203215505-70148edc6eca // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bits-and-blooms/bitset v1.20.0 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.5 // indirect
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ github.com/antithesishq/antithesis-sdk-go v0.3.8/go.mod h1:IUpT2DPAKh6i/YhSbt6Gl
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
github.com/ava-labs/avalanchego v1.14.1-0.20251120155522-df4a8e531761 h1:FrsqYm5sms00jWnr8pV9Nj08v1ipYjp1x6p11NIpIBU=
github.com/ava-labs/avalanchego v1.14.1-0.20251120155522-df4a8e531761/go.mod h1:Ntq3RBvDQzNjy14NU3RC2Jf1A9pzfM5RVQ30Gwx/6IM=
github.com/ava-labs/coreth v0.16.0-rc.0 h1:nPvkDbxaH8N9f/wQe7B+IGMhPISMuW5CU0cDYuU8iCw=
github.com/ava-labs/coreth v0.16.0-rc.0/go.mod h1:uGr1C7BP0+dWhvsIouhuH0yCyI8YDgS6sfEFIExs0iI=
github.com/ava-labs/avalanchego v1.14.1-antithesis-docker-image-fix h1:4Md0YJrFoq9MPJjslvcVVRpE6RsGwHD/qatiLodNAQE=
github.com/ava-labs/avalanchego v1.14.1-antithesis-docker-image-fix/go.mod h1:VperC9rPkJEewH5W7NGsmuY9eRLHV2QUndn821yxLLg=
github.com/ava-labs/avalanchego/graft/coreth v0.0.0-20251203215505-70148edc6eca h1:zZIQZhOqKe82SUvEx7IeRVoahjyKI0gfouHPQkvEHeI=
github.com/ava-labs/avalanchego/graft/coreth v0.0.0-20251203215505-70148edc6eca/go.mod h1:y+/5DAxCTLAXdWRxAYN1V8DV0DIF7uHhOOeNa9oASuU=
github.com/ava-labs/firewood-go-ethhash/ffi v0.0.15 h1:NAVjEu508HwdgbxH/xQxMQoBUgYUn9RQf0VeCrhtYMY=
github.com/ava-labs/firewood-go-ethhash/ffi v0.0.15/go.mod h1:hR/JSGXxST9B9olwu/NpLXHAykfAyNGfyKnYQqiiOeE=
github.com/ava-labs/libevm v1.13.15-0.20251016142715-1bccf4f2ddb2 h1:hQ15IJxY7WOKqeJqCXawsiXh0NZTzmoQOemkWHz7rr4=
Expand Down
13 changes: 8 additions & 5 deletions plugin/evm/eth_gossiper.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (

"github.com/ava-labs/avalanchego/ids"
"github.com/ava-labs/avalanchego/network/p2p/gossip"
"github.com/ava-labs/avalanchego/utils/bloom"
"github.com/ava-labs/libevm/core/types"
"github.com/ava-labs/libevm/log"
"github.com/prometheus/client_golang/prometheus"
Expand All @@ -28,9 +29,11 @@ import (
const pendingTxsBuffer = 10

var (
_ gossip.Gossipable = (*GossipEthTx)(nil)
_ gossip.Marshaller[*GossipEthTx] = (*GossipEthTxMarshaller)(nil)
_ gossip.Set[*GossipEthTx] = (*GossipEthTxPool)(nil)
_ gossip.Gossipable = (*GossipEthTx)(nil)
_ gossip.Marshaller[*GossipEthTx] = (*GossipEthTxMarshaller)(nil)
_ gossip.HandlerSet[*GossipEthTx] = (*GossipEthTxPool)(nil)
_ gossip.PullGossiperSet[*GossipEthTx] = (*GossipEthTxPool)(nil)
_ gossip.PushGossiperSet = (*GossipEthTxPool)(nil)

_ eth.PushGossiper = (*EthPushGossiper)(nil)
)
Expand Down Expand Up @@ -132,11 +135,11 @@ func (g *GossipEthTxPool) Iterate(f func(tx *GossipEthTx) bool) {
})
}

func (g *GossipEthTxPool) GetFilter() ([]byte, []byte) {
func (g *GossipEthTxPool) BloomFilter() (*bloom.Filter, ids.ID) {
g.lock.RLock()
defer g.lock.RUnlock()

return g.bloom.Marshal()
return g.bloom.BloomFilter()
}

type GossipEthTxMarshaller struct{}
Expand Down
2 changes: 1 addition & 1 deletion plugin/evm/gossip/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var _ p2p.Handler = (*txGossipHandler)(nil)
func NewTxGossipHandler[T gossip.Gossipable](
log logging.Logger,
marshaller gossip.Marshaller[T],
mempool gossip.Set[T],
mempool gossip.HandlerSet[T],
metrics gossip.Metrics,
maxMessageSize int,
throttlingPeriod time.Duration,
Expand Down
46 changes: 25 additions & 21 deletions plugin/evm/tx_gossip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"github.com/ava-labs/avalanchego/snow/engine/enginetest"
"github.com/ava-labs/avalanchego/snow/validators"
"github.com/ava-labs/avalanchego/upgrade/upgradetest"
"github.com/ava-labs/avalanchego/utils/bloom"
"github.com/ava-labs/avalanchego/utils/logging"
"github.com/ava-labs/avalanchego/utils/set"
"github.com/ava-labs/libevm/core/types"
Expand All @@ -28,7 +29,6 @@ import (
"google.golang.org/protobuf/proto"

"github.com/ava-labs/subnet-evm/params/paramstest"
"github.com/ava-labs/subnet-evm/plugin/evm/config"
"github.com/ava-labs/subnet-evm/utils/utilstest"

agoUtils "github.com/ava-labs/avalanchego/utils"
Expand Down Expand Up @@ -98,25 +98,20 @@ func TestEthTxGossip(t *testing.T) {
}

// Ask the VM for any new transactions. We should get nothing at first.
emptyBloomFilter, err := gossip.NewBloomFilter(prometheus.NewRegistry(), "", config.TxGossipBloomMinTargetElements, config.TxGossipBloomTargetFalsePositiveRate, config.TxGossipBloomResetFalsePositiveRate)
require.NoError(err)
emptyBloomFilterBytes, _ := emptyBloomFilter.Marshal()
request := &sdk.PullGossipRequest{
Filter: emptyBloomFilterBytes,
Salt: agoUtils.RandomBytes(32),
}

requestBytes, err := proto.Marshal(request)
requestBytes, err := gossip.MarshalAppRequest(
bloom.EmptyFilter.Marshal(),
agoUtils.RandomBytes(32),
)
require.NoError(err)

wg := &sync.WaitGroup{}
wg.Add(1)
onResponse := func(_ context.Context, _ ids.NodeID, responseBytes []byte, err error) {
require.NoError(err)

response := &sdk.PullGossipResponse{}
require.NoError(proto.Unmarshal(responseBytes, response))
require.Empty(response.Gossip)
response, err := gossip.ParseAppResponse(responseBytes)
require.NoError(err)
require.Empty(response)
wg.Done()
}
require.NoError(client.AppRequest(ctx, set.Of(vm.ctx.NodeID), requestBytes, onResponse))
Expand All @@ -137,19 +132,20 @@ func TestEthTxGossip(t *testing.T) {
// wait so we aren't throttled by the vm
time.Sleep(5 * time.Second)

marshaller := GossipEthTxMarshaller{}
// Ask the VM for new transactions. We should get the newly issued tx.
wg.Add(1)
onResponse = func(_ context.Context, _ ids.NodeID, responseBytes []byte, err error) {
require.NoError(err)

response := &sdk.PullGossipResponse{}
require.NoError(proto.Unmarshal(responseBytes, response))
require.Len(response.Gossip, 1)
response, err := gossip.ParseAppResponse(responseBytes)
require.NoError(err)

gotTx, err := marshaller.UnmarshalGossip(response.Gossip[0])
txBytes, err := signedTx.MarshalBinary()
require.NoError(err)
require.Equal(signedTx.Hash(), gotTx.Tx.Hash())
require.Equal(
[][]byte{txBytes},
response,
)

wg.Done()
}
Expand All @@ -169,7 +165,7 @@ func TestEthTxPushGossipOutbound(t *testing.T) {
}

vm := &VM{
ethTxPullGossiper: gossip.NoOpGossiper{},
ethTxPullGossiper: noOpGossiper{},
}

require.NoError(vm.Initialize(
Expand Down Expand Up @@ -220,7 +216,7 @@ func TestEthTxPushGossipInbound(t *testing.T) {

sender := &enginetest.Sender{}
vm := &VM{
ethTxPullGossiper: gossip.NoOpGossiper{},
ethTxPullGossiper: noOpGossiper{},
}

require.NoError(vm.Initialize(
Expand Down Expand Up @@ -263,3 +259,11 @@ func TestEthTxPushGossipInbound(t *testing.T) {

require.True(vm.txPool.Has(signedTx.Hash()))
}

var _ gossip.Gossiper = (*noOpGossiper)(nil)

type noOpGossiper struct{}

func (noOpGossiper) Gossip(context.Context) error {
return nil
}