Skip to content

Tests: rpc initial setup and rpc tests phase 1#3520

Open
kollegian wants to merge 4 commits into
mainfrom
tests/ev_rpc_tests
Open

Tests: rpc initial setup and rpc tests phase 1#3520
kollegian wants to merge 4 commits into
mainfrom
tests/ev_rpc_tests

Conversation

@kollegian
Copy link
Copy Markdown

Describe your changes and provide context

Testing performed to validate your change

@cursor
Copy link
Copy Markdown

cursor Bot commented May 29, 2026

PR Summary

Low Risk
Additive integration-test and tooling only; no production RPC or node logic changes. CI/runtime cost and env deps (docker, geth) are the main operational considerations.

Overview
Introduces a self-contained integration_test/rpc_tests module that compares Sei’s EVM JSON-RPC to a local geth --dev reference (optional Hardhat mainnet fork for shape-only checks), without importing shared integration helpers.

Harness: Mocha + tsx configs for sequential bootstrap vs sharded runs, env-driven endpoints, compile-only Hardhat, gitignored runtime state, and docs for test:rpc / test:rpc:full (docker cluster + geth + mochawesome merge).

Bootstrap (_start/00_bootstrap.spec.ts): Verifies Sei + geth, records chain/block anchors, funds admin, deploys TestERC20, SimpleAccount7702, RealGasBurner on Sei, mirrors ERC20 on geth, pre-funds a signer pool, writes runtime/runtime.json for parallel specs.

Phase 1 eth_* specs (happy path, schema vs geth, empty/null, raw JSON-RPC errors): eth_accounts, eth_blockNumber, eth_chainId, eth_coinbase (fee_collector / sei_*), eth_call (historical state, overrides, staking precompile, EIP-7702, labeled geth divergences), eth_estimateGas, eth_feeHistory, eth_gasPrice (fee-market burns + documented Sei vs geth pricing differences).

Reviewed by Cursor Bugbot for commit 2a9e78a. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 29, 2026

The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedMay 29, 2026, 3:04 PM

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 3 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit f1a394f. Configure here.

Comment thread integration_test/rpc_tests/config/endpoints.ts Outdated
describe('empty / null handling', () => {
it('a keyless node returns [] (empty array), never null', async function () {
const body = await rawAccountless<string[]>('eth_accounts', []);
console.log(body);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debug console.log left in test code

Low Severity

A console.log(body) statement is left in the "keyless node returns []" test. This dumps the full raw JSON-RPC response body to stdout on every run, cluttering test output and potentially leaking response details into CI logs.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit f1a394f. Configure here.

const err = expectJsonRpcError(s, 3, /execution reverted/i);
expect(err.data).to.equal(
'0x96c6fd1e0000000000000000000000000000000000000000000000000000000000000000',
);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert data assertion mismatches TestERC20 contract output

Medium Severity

The test asserts err.data equals 0x96c6fd1e..., but the TestERC20 contract uses require(balanceOf[from] >= value, "ERC20: insufficient balance") with a string message. This produces Error(string) revert data with selector 0x08c379a0, not 0x96c6fd1e. The custom-error require syntax is a different overload (Solidity 0.8.26+ via-ir only) and is not used here. This assertion will fail at runtime.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit f1a394f. Configure here.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.21%. Comparing base (8567422) to head (2a9e78a).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3520      +/-   ##
==========================================
- Coverage   59.03%   58.21%   -0.82%     
==========================================
  Files        2199     2129      -70     
  Lines      182207   174079    -8128     
==========================================
- Hits       107569   101346    -6223     
+ Misses      64975    63729    -1246     
+ Partials     9663     9004     -659     
Flag Coverage Δ
sei-db 70.41% <ø> (ø)
sei-db-state-db ?

Flags with carried forward coverage won't be shown. Click here to find out more.
see 70 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant