Skip to content

Commit

Permalink
Merge branch 'master' into coreth-diff-script
Browse files Browse the repository at this point in the history
  • Loading branch information
darioush committed Aug 27, 2024
2 parents 91f344e + c48cb2d commit 5377701
Show file tree
Hide file tree
Showing 21 changed files with 343 additions and 102 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ jobs:
shell: bash
run: ./scripts/build.sh
- name: Run Warp E2E Tests
uses: ava-labs/avalanchego/.github/actions/run-monitored-tmpnet-cmd@v1-actions
uses: ava-labs/avalanchego/.github/actions/run-monitored-tmpnet-cmd@v1.11.11-monitoring-url
with:
run: AVALANCHEGO_BUILD_PATH=/tmp/e2e-test/avalanchego ./scripts/run_ginkgo_warp.sh
prometheus_id: ${{ secrets.PROMETHEUS_ID || '' }}
Expand Down Expand Up @@ -172,7 +172,7 @@ jobs:
shell: bash
run: ./scripts/build.sh
- name: Run E2E Load Tests
uses: ava-labs/avalanchego/.github/actions/run-monitored-tmpnet-cmd@v1-actions
uses: ava-labs/avalanchego/.github/actions/run-monitored-tmpnet-cmd@v1.11.11-monitoring-url
with:
run: AVALANCHEGO_BUILD_PATH=/tmp/e2e-test/avalanchego ./scripts/run_ginkgo_load.sh
prometheus_id: ${{ secrets.PROMETHEUS_ID || '' }}
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/trigger-antithesis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
name: Trigger Antithesis

on:
# TODO(marun) Add a schedule
schedule:
# When adjusting the schedule and duration of execution, make sure
# to check the schedule of antithesis jobs scheduled by other
# repos (avalanchego and hypersdk). Ideally the schedules for
# different test setups should not overlap to avoid unintended
# resource contention.
- cron: '0 14 * * *' # Every day at 2PM UTC
workflow_dispatch:
inputs:
duration:
Expand Down Expand Up @@ -36,5 +42,5 @@ jobs:
email_recipients: ${{ github.event.inputs.recipients || secrets.ANTITHESIS_RECIPIENTS }}
# Duration is in hours
additional_parameters: |-
custom.duration=${{ github.event.inputs.duration || '11.25' }}
custom.duration=${{ github.event.inputs.duration || '7.5' }}
custom.workload=subnet-evm
3 changes: 0 additions & 3 deletions accounts/keystore/keystore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,6 @@ type walletEvent struct {
// Tests that wallet notifications and correctly fired when accounts are added
// or deleted from the keystore.
func TestWalletNotifications(t *testing.T) {
if os.Getenv("RUN_FLAKY_TESTS") != "true" {
t.Skip("FLAKY")
}
t.Parallel()
_, ks := tmpKeyStore(t, false)

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.21.12
require (
github.com/VictoriaMetrics/fastcache v1.12.1
github.com/antithesishq/antithesis-sdk-go v0.3.8
github.com/ava-labs/avalanchego v1.11.11-0.20240819192939-df91c2f4ab99
github.com/ava-labs/avalanchego v1.11.11-0.20240821175119-35c66e33f0dc
github.com/cespare/cp v0.1.0
github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233
github.com/davecgh/go-spew v1.1.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax
github.com/antithesishq/antithesis-sdk-go v0.3.8 h1:OvGoHxIcOXFJLyn9IJQ5DzByZ3YVAWNBc394ObzDRb8=
github.com/antithesishq/antithesis-sdk-go v0.3.8/go.mod h1:IUpT2DPAKh6i/YhSbt6Gl3v2yvUZjmKncl7U91fup7E=
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
github.com/ava-labs/avalanchego v1.11.11-0.20240819192939-df91c2f4ab99 h1:fPWpINk7O1W4w5thqa8CGMRJ/kvycHvehBEiWwMjezI=
github.com/ava-labs/avalanchego v1.11.11-0.20240819192939-df91c2f4ab99/go.mod h1:UkyrRDXK2E15Lq2abyae2Pt+JsWvgsg1pe0/AtoMyAM=
github.com/ava-labs/avalanchego v1.11.11-0.20240821175119-35c66e33f0dc h1:cUz1N+LJIeQAR0Z6zTBiuZ7s8GqIE5QQbRWs423VFRA=
github.com/ava-labs/avalanchego v1.11.11-0.20240821175119-35c66e33f0dc/go.mod h1:UkyrRDXK2E15Lq2abyae2Pt+JsWvgsg1pe0/AtoMyAM=
github.com/ava-labs/coreth v0.13.8-fixed-genesis-upgrade.0.20240813194342-7635a96aa180 h1:6aIHp7wbyGVYdhHVQUbG7BEcbCMEQ5SYopPPJyipyvk=
github.com/ava-labs/coreth v0.13.8-fixed-genesis-upgrade.0.20240813194342-7635a96aa180/go.mod h1:/wNBVq7J7wlC2Kbov7kk6LV5xZvau7VF9zwTVOeyAjY=
github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g=
Expand Down
4 changes: 0 additions & 4 deletions metrics/sample_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package metrics
import (
"math"
"math/rand"
"os"
"runtime"
"testing"
"time"
Expand Down Expand Up @@ -133,9 +132,6 @@ func TestExpDecaySample(t *testing.T) {
// The priority becomes +Inf quickly after starting if this is done,
// effectively freezing the set of samples until a rescale step happens.
func TestExpDecaySampleNanosecondRegression(t *testing.T) {
if os.Getenv("RUN_FLAKY_TESTS") != "true" {
t.Skip("FLAKY")
}
sw := NewExpDecaySample(100, 0.99)
for i := 0; i < 100; i++ {
sw.Update(10)
Expand Down
4 changes: 0 additions & 4 deletions plugin/evm/gossiper_eth_gossiping_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"crypto/ecdsa"
"encoding/json"
"math/big"
"os"
"strings"
"sync"
"testing"
Expand Down Expand Up @@ -74,9 +73,6 @@ func getValidEthTxs(key *ecdsa.PrivateKey, count int, gasPrice *big.Int) []*type
// show that a geth tx discovered from gossip is requested to the same node that
// gossiped it
func TestMempoolEthTxsAppGossipHandling(t *testing.T) {
if os.Getenv("RUN_FLAKY_TESTS") != "true" {
t.Skip("FLAKY")
}
assert := assert.New(t)

key, err := crypto.GenerateKey()
Expand Down
1 change: 0 additions & 1 deletion plugin/evm/syncervm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,6 @@ func TestStateSyncToggleEnabledToDisabled(t *testing.T) {
}

func TestVMShutdownWhileSyncing(t *testing.T) {
t.Skip("FLAKY")
var (
lock sync.Mutex
vmSetup *syncVMSetup
Expand Down
23 changes: 20 additions & 3 deletions plugin/evm/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ import (
"github.com/ava-labs/subnet-evm/plugin/evm/message"
"github.com/ava-labs/subnet-evm/trie/triedb/hashdb"

warpcontract "github.com/ava-labs/subnet-evm/precompile/contracts/warp"
"github.com/ava-labs/subnet-evm/rpc"
statesyncclient "github.com/ava-labs/subnet-evm/sync/client"
"github.com/ava-labs/subnet-evm/sync/client/stats"
"github.com/ava-labs/subnet-evm/trie"
"github.com/ava-labs/subnet-evm/warp"
"github.com/ava-labs/subnet-evm/warp/handlers"
warpValidators "github.com/ava-labs/subnet-evm/warp/validators"

// Force-load tracer engine to trigger registration
//
Expand Down Expand Up @@ -1019,8 +1019,7 @@ func (vm *VM) CreateHandlers(context.Context) (map[string]http.Handler, error) {
}

if vm.config.WarpAPIEnabled {
validatorsState := warpValidators.NewState(vm.ctx)
if err := handler.RegisterName("warp", warp.NewAPI(vm.ctx.NetworkID, vm.ctx.SubnetID, vm.ctx.ChainID, validatorsState, vm.warpBackend, vm.client)); err != nil {
if err := handler.RegisterName("warp", warp.NewAPI(vm.ctx.NetworkID, vm.ctx.SubnetID, vm.ctx.ChainID, vm.ctx.ValidatorState, vm.warpBackend, vm.client, vm.requirePrimaryNetworkSigners)); err != nil {
return nil, err
}
enabledAPIs = append(enabledAPIs, "warp")
Expand Down Expand Up @@ -1067,6 +1066,24 @@ func (vm *VM) GetCurrentNonce(address common.Address) (uint64, error) {
return state.GetNonce(address), nil
}

// currentRules returns the chain rules for the current block.
func (vm *VM) currentRules() params.Rules {
header := vm.eth.APIBackend.CurrentHeader()
return vm.chainConfig.Rules(header.Number, header.Time)
}

// requirePrimaryNetworkSigners returns true if warp messages from the primary
// network must be signed by the primary network validators.
// This is necessary when the subnet is not validating the primary network.
func (vm *VM) requirePrimaryNetworkSigners() bool {
switch c := vm.currentRules().ActivePrecompiles[warpcontract.ContractAddress].(type) {
case *warpcontract.Config:
return c.RequirePrimaryNetworkSigners
default: // includes nil due to non-presence
return false
}
}

func (vm *VM) startContinuousProfiler() {
// If the profiler directory is empty, return immediately
// without creating or starting a continuous profiler.
Expand Down
Loading

0 comments on commit 5377701

Please sign in to comment.