Skip to content

Commit ef1dfe7

Browse files
authored
Merge branch 'main' into state-store-db-benchmark
2 parents 0ffd130 + b6685c1 commit ef1dfe7

File tree

312 files changed

+3458
-1070
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

312 files changed

+3458
-1070
lines changed

.github/workflows/integration-test.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,12 @@ jobs:
138138
"./integration_test/evm_module/scripts/evm_giga_mixed_tests.sh"
139139
]
140140
},
141+
{
142+
name: "EVM RPC .io/.iox (spec fixtures)",
143+
scripts: [
144+
"./integration_test/evm_module/scripts/evm_rpc_tests.sh"
145+
]
146+
},
141147
]
142148
steps:
143149
- uses: actions/checkout@v3
@@ -184,7 +190,9 @@ jobs:
184190
- name: Verify Sei Chain is running
185191
run: python3 integration_test/scripts/runner.py integration_test/startup/startup_test.yaml
186192

193+
# EVM execution-apis .io is allowed to fail until endpoint coverage is fixed (non-blocking for PR merge)
187194
- name: ${{ matrix.test.name }}
195+
continue-on-error: ${{ matrix.test.name == 'EVM RPC .io/.iox (spec fixtures)' }}
188196
run: |
189197
scripts=$(echo '${{ toJson(matrix.test.scripts) }}' | jq -r '.[]')
190198
IFS=$'\n' # change the internal field separator to newline

cmd/seid/cmd/blocktest.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func BlocktestCmd(defaultNodeHome string) *cobra.Command {
5252
return err
5353
}
5454

55-
logger := log.NewTMLogger(log.NewSyncWriter(os.Stdout))
55+
logger := log.NewTMLogger(os.Stdout)
5656
cache := store.NewCommitKVStoreCacheManager()
5757
wasmGasRegisterConfig := wasmkeeper.DefaultGasRegisterConfig()
5858
wasmGasRegisterConfig.GasMultiplier = 21_000_000

cmd/seid/cmd/ethreplay.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func ReplayCmd(defaultNodeHome string) *cobra.Command {
4949
return err
5050
}
5151

52-
logger := log.NewTMLogger(log.NewSyncWriter(os.Stdout))
52+
logger := log.NewTMLogger(os.Stdout)
5353
cache := store.NewCommitKVStoreCacheManager()
5454
wasmGasRegisterConfig := wasmkeeper.DefaultGasRegisterConfig()
5555
wasmGasRegisterConfig.GasMultiplier = 21_000_000

cmd/seid/cmd/snapshot.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func SnapshotCmd() *cobra.Command {
5858
}
5959

6060
// Create logger
61-
logger := log.NewTMLogger(log.NewSyncWriter(os.Stdout))
61+
logger := log.NewTMLogger(os.Stdout)
6262

6363
// Get app options from server context
6464
appOpts := serverCtx.Viper

evmrpc/simulate_test.go

Lines changed: 74 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -697,53 +697,88 @@ func TestSimulationAPIRequestLimiter(t *testing.T) {
697697
})
698698

699699
t.Run("TestDifferentMethodsShareSameLimiter", func(t *testing.T) {
700-
tEnv := newTestEnv(t)
701-
// Test that different simulation methods share the same rate limiter
702-
numCallRequests := 10
703-
numEstimateRequests := 10
700+
// Test that different simulation methods share the same rate limiter.
701+
// A single burst can occasionally avoid contention on overloaded CI workers,
702+
// so retry a synchronized burst a few times.
703+
const (
704+
numCallRequests = 20
705+
numEstimateRequests = 20
706+
maxAttempts = 5
707+
)
704708
totalRequests := numCallRequests + numEstimateRequests
705709

706-
results := make(chan error, totalRequests)
707-
var wg sync.WaitGroup
708-
// Start mixed requests concurrently to verify they share the same limiter
709-
for range numCallRequests {
710-
wg.Add(1)
711-
go func() {
712-
defer wg.Done()
713-
_, err := tEnv.simAPI.Call(context.Background(), tEnv.args, nil, nil, nil)
714-
results <- err
715-
}()
716-
}
710+
runMixedBurst := func(tEnv *testEnv) (int, int) {
711+
results := make(chan error, totalRequests)
712+
start := make(chan struct{})
713+
var wg sync.WaitGroup
714+
715+
// Start mixed requests and release them at once to maximize contention.
716+
for range numCallRequests {
717+
wg.Add(1)
718+
go func() {
719+
defer wg.Done()
720+
<-start
721+
_, err := tEnv.simAPI.Call(context.Background(), tEnv.args, nil, nil, nil)
722+
results <- err
723+
}()
724+
}
725+
for range numEstimateRequests {
726+
wg.Add(1)
727+
go func() {
728+
defer wg.Done()
729+
<-start
730+
_, err := tEnv.simAPI.EstimateGas(context.Background(), tEnv.args, nil, nil)
731+
results <- err
732+
}()
733+
}
717734

718-
for range numEstimateRequests {
719-
wg.Add(1)
720-
go func() {
721-
defer wg.Done()
722-
_, err := tEnv.simAPI.EstimateGas(context.Background(), tEnv.args, nil, nil)
723-
results <- err
724-
}()
735+
close(start)
736+
wg.Wait()
737+
close(results)
738+
739+
successCount := 0
740+
rejectedCount := 0
741+
for err := range results {
742+
if err == nil {
743+
successCount++
744+
} else if strings.Contains(err.Error(), "rejected due to rate limit: server busy") {
745+
rejectedCount++
746+
}
747+
}
748+
return successCount, rejectedCount
725749
}
726750

727-
wg.Wait()
728-
close(results)
729-
730-
// Collect all results and count
731-
successCount := 0
732-
rejectedCount := 0
733-
for err := range results {
734-
if err == nil {
735-
successCount++
736-
} else if strings.Contains(err.Error(), "rejected due to rate limit: server busy") {
737-
rejectedCount++
751+
var (
752+
lastSuccess int
753+
lastRejected int
754+
attemptsUsed int
755+
observedRejection bool
756+
)
757+
for attempt := 1; attempt <= maxAttempts; attempt++ {
758+
attemptsUsed = attempt
759+
lastSuccess, lastRejected = runMixedBurst(newTestEnv(t))
760+
require.Equalf(t, totalRequests, lastSuccess+lastRejected, "All mixed method requests should be accounted for (attempt %d)", attempt)
761+
if lastRejected > 0 {
762+
observedRejection = true
763+
break
738764
}
739765
}
740766

741-
// Since the rate limiter allows 2 concurrent requests total, we should see some rejections
742-
// when running 6 concurrent requests across different methods
743-
require.Greater(t, rejectedCount, 0, "Different methods should share the same rate limiter")
744-
require.Equal(t, totalRequests, successCount+rejectedCount, "All mixed method requests should be accounted for")
745-
746-
t.Logf("Mixed methods rate limiting: %d successful, %d rejected out of %d total", successCount, rejectedCount, totalRequests)
767+
require.Truef(
768+
t,
769+
observedRejection,
770+
"Different methods should share the same rate limiter (last burst: %d successful, %d rejected)",
771+
lastSuccess,
772+
lastRejected,
773+
)
774+
t.Logf(
775+
"Mixed methods rate limiting (attempt %d/%d): %d successful, %d rejected out of %d total",
776+
attemptsUsed,
777+
maxAttempts,
778+
lastSuccess,
779+
lastRejected,
780+
totalRequests,
781+
)
747782
})
748783

749784
t.Run("TestRateLimitErrorFormat", func(t *testing.T) {

go.mod

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ require (
2828
github.com/ethereum/go-ethereum v1.16.8
2929
github.com/fortytw2/leaktest v1.3.0
3030
github.com/go-kit/kit v0.13.0
31-
github.com/go-kit/log v0.2.1
32-
github.com/go-logfmt/logfmt v0.6.0
3331
github.com/go-playground/validator/v10 v10.11.1
3432
github.com/gofrs/flock v0.13.0
3533
github.com/gogo/gateway v1.1.0

go.sum

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,15 +1101,11 @@ github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgO
11011101
github.com/go-kit/kit v0.13.0 h1:OoneCcHKHQ03LfBpoQCUfCluwd2Vt3ohz+kvbJneZAU=
11021102
github.com/go-kit/kit v0.13.0/go.mod h1:phqEHMMUbyrCFCTgH48JueqrM3md2HcAZ8N3XE4FKDg=
11031103
github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY=
1104-
github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU=
1105-
github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0=
11061104
github.com/go-latex/latex v0.0.0-20210118124228-b3d85cf34e07/go.mod h1:CO1AlKB2CSIqUrmQPqA0gdRIlnLEY0gK5JGjh37zN5U=
11071105
github.com/go-latex/latex v0.0.0-20210823091927-c0d11ff05a81/go.mod h1:SX0U8uGpxhq9o2S/CELCSUxEWWAuoCUcVCQWv7G2OCk=
11081106
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
11091107
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
11101108
github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
1111-
github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4=
1112-
github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs=
11131109
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
11141110
github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
11151111
github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=

0 commit comments

Comments
 (0)