Skip to content

Conversation

@Unique-Divine
Copy link
Member

Purpose / Abstract

Fixes faulty error propagation in eth/rpc/backend/blocks.go and related logic surrounding it, reduces complexity, and adds tests for prevent regressions in our EVM RPC endpoints

Blockers

🧱 This PR should be merged after #2274 and #2284. After those are merged, we can
switch the base branch to main.

Changes

  1. Error wrapping: Replace legacy aliases with sdkioerrors.Wrapf and standardized sdkerrors.Err* codes for uniform Cosmos SDK error handling.
  2. Backend errors: Simplify EVM backend reporting via fmt.Errorf with explicit prefixes (e.g. BlockNumberError, RPCBlockFromTendermintBlock error). Default the base fee to evm.BASE_FEE_WEI and suppress pruning-related bloom errors by returning empty blooms when events are missing.
  3. RPC helpers: Rename NewRPCTxFromMsg to NewRPCTxFromMsgEthTx, deprecate NewRPCTxFromEthTx, and centralize signer and signature extraction logic.
  4. Test suite overhaul: Refactor BackendSuite to use a SuccessfulTx map for structured receipt capture, eliminate global variables, enhance logging, and streamline setup.
  5. Debug API stubs: Stub unimplemented debug methods with context-aware signatures and return a clear ErrNotImplemented placeholder.
  6. Module cleanup: Inline BlockBloom in filter, tracing, and util modules; update imports to modern packages (e.g. eip1559, tracers); remove unused imports and methods.

…y Nibiru's EVM JSON-RPC

Replace legacy error aliases throughout the eth module with sdkioerrors.Wrapf and sdkerrors.Err* to ensure consistent wrapping of Cosmos SDK errors. Simplify EVM backend error reporting by using fmt.Errorf with clear method prefixes (e.g. “BlockNumberError”, “RPCBlockFromTendermintBlock error”) and defaulting the base fee to evm.BASE_FEE_WEI. Suppress pruning‑related bloom errors by returning empty blooms when data is missing.

Unify RPC transaction conversion logic by renaming NewRPCTxFromMsg to NewRPCTxFromMsgEthTx, retiring the older NewRPCTxFromEthTx, and centralizing signer and signature‑value extraction. Refactor BackendSuite tests to use a SuccessfulTx map for structured receipt capture—eliminating global variables and improving setup clarity. Stub out unimplemented debugapi methods with context‑aware signatures and adjust filters, tracing, and utils to inline BlockBloom usage and align imports (e.g. eip1559, tracers) with modern patterns.
@Unique-Divine Unique-Divine requested a review from a team as a code owner April 21, 2025 16:11
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Apr 21, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@Unique-Divine Unique-Divine changed the base branch from main to ud/geth/v1.13.15 April 21, 2025 16:12
@codecov
Copy link

codecov bot commented Apr 21, 2025

Codecov Report

Attention: Patch coverage is 36.26374% with 174 lines in your changes missing coverage. Please review.

Project coverage is 14.41%. Comparing base (9559775) to head (f481d9d).
Report is 16 commits behind head on ud/geth/v1.13.15.

Files with missing lines Patch % Lines
eth/rpc/backend/blocks.go 27.63% 53 Missing and 2 partials ⚠️
eth/rpc/rpcapi/debugapi/api.go 0.00% 47 Missing ⚠️
eth/rpc/rpc.go 5.55% 17 Missing ⚠️
eth/rpc/rpcapi/eth_api.go 44.82% 15 Missing and 1 partial ⚠️
eth/indexer/evm_tx_indexer.go 0.00% 10 Missing ⚠️
eth/rpc/rpcapi/apis.go 86.00% 4 Missing and 3 partials ⚠️
eth/rpc/backend/tx_info.go 44.44% 5 Missing ⚠️
eth/eip712/eip712_legacy.go 0.00% 4 Missing ⚠️
eth/eip712/types.go 33.33% 4 Missing ⚠️
eth/eip712/message.go 77.77% 2 Missing ⚠️
... and 5 more
Additional details and impacted files
@@                 Coverage Diff                  @@
##           ud/geth/v1.13.15    #2289      +/-   ##
====================================================
+ Coverage             14.35%   14.41%   +0.05%     
====================================================
  Files                   382      383       +1     
  Lines                101244   101355     +111     
====================================================
+ Hits                  14538    14606      +68     
- Misses                85693    85740      +47     
+ Partials               1013     1009       -4     
Files with missing lines Coverage Δ
eth/assert.go 100.00% <100.00%> (ø)
eth/errors.go 100.00% <100.00%> (ø)
eth/rpc/backend/utils.go 69.27% <100.00%> (+1.61%) ⬆️
eth/safe_math.go 100.00% <100.00%> (ø)
x/common/error.go 61.73% <ø> (+1.56%) ⬆️
eth/crypto/ethsecp256k1/ethsecp256k1.go 65.71% <0.00%> (ø)
eth/rpc/backend/account_info.go 55.00% <0.00%> (ø)
eth/rpc/backend/call_tx.go 56.29% <0.00%> (ø)
eth/eip712/message.go 81.92% <77.77%> (ø)
eth/rpc/rpcapi/debugapi/trace.go 0.00% <0.00%> (ø)
... and 10 more

... and 22 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.

@k-yang k-yang merged commit 7b0e334 into ud/geth/v1.13.15 Apr 21, 2025
10 checks passed
@k-yang k-yang deleted the ud/rpc-backend branch April 21, 2025 19:22
Unique-Divine added a commit that referenced this pull request Apr 21, 2025
…LE_ADDRS, and transient storage support (#2274)

* feat(evm)!: squashed commit

commit aaf6431
Author: Unique-Divine <[email protected]>
Date:   Mon Apr 14 10:25:36 2025 -0500

    refactor: linter and formatter

commit f36399c
Author: Unique-Divine <[email protected]>
Date:   Mon Apr 14 10:07:42 2025 -0500

    chore: changelog

commit f6bb649
Author: Unique-Divine <[email protected]>
Date:   Mon Apr 14 10:07:42 2025 -0500

    chore: changelog

commit a6877ee
Author: Unique-Divine <[email protected]>
Date:   Mon Apr 14 10:06:45 2025 -0500

    chore: move Go to v1.22 because it's required for geth

commit a1e74e9
Author: Unique-Divine <[email protected]>
Date:   Mon Apr 14 10:06:45 2025 -0500

    chore: move Go to v1.22 because it's required for geth

commit b546151
Author: Unique-Divine <[email protected]>
Date:   Mon Apr 14 10:04:56 2025 -0500

    feat(evm)!: update to geth v1.13 with EIP-1153, PRECOMPILE_ADDRS, and transient storage support

    This commit upgrades the Nibiru EVM module for compatibility with go-ethereum v1.13.14, introducing the following changes:

    - Updated all references from deprecated types in `rpc` to their new equivalents under `common/math`, such as replacing `rpc.DecimalOrHex` with `math.HexOrDecimal64`.
    - Removed deprecated EIP-155 seed hash API (`debug_seedHash`) and associated `ethash` import.
    - Aligned `vm.Config` and fee calculation logic with new EIP-based gas cost parameters (`isShanghai`, `isEIP3860`).
    - Introduced explicit `PRECOMPILE_ADDRS` constant to aggregate EVM precompiles with NibiruΓÇÖs extensions (FunToken, Wasm, Oracle).
    - Implemented support for **EIP-1153** (transient storage):
      - Added `transientStorage` map to `StateDB`, with getters/setters and journaling support.
      - Added `Prepare` method to reset access lists and transient storage for each tx.
    - Refactored `SelfDestruct` logic and exposed `HasSelfDestructed` (was `Suicide`) for better clarity and future EIP-6780 readiness.
    - Reworked balance mutation logic (`AddBalanceSigned`) to correctly handle signed values and prevent `uint256` overflow errors.
    - Minor typo corrections (e.g., "occured" → "occurred") in proto files and comments.

    This upgrade also adjusts `go.mod` to:
    - Replace `go-ethereum v1.10.x` with `v1.13.14`
    - Downgrade Go version to 1.21 for compatibility with `go-ethereum` and its Pebble dependency
    - Pin Pebble to a compatible commit required by geth's internal `ethdb`

commit 803f9b4
Author: Unique-Divine <[email protected]>
Date:   Mon Apr 14 10:04:56 2025 -0500

    feat(evm)!: update to geth v1.13 with EIP-1153, PRECOMPILE_ADDRS, and transient storage support

    This commit upgrades the Nibiru EVM module for compatibility with go-ethereum v1.13.14, introducing the following changes:

    - Updated all references from deprecated types in `rpc` to their new equivalents under `common/math`, such as replacing `rpc.DecimalOrHex` with `math.HexOrDecimal64`.
    - Removed deprecated EIP-155 seed hash API (`debug_seedHash`) and associated `ethash` import.
    - Aligned `vm.Config` and fee calculation logic with new EIP-based gas cost parameters (`isShanghai`, `isEIP3860`).
    - Introduced explicit `PRECOMPILE_ADDRS` constant to aggregate EVM precompiles with NibiruΓÇÖs extensions (FunToken, Wasm, Oracle).
    - Implemented support for **EIP-1153** (transient storage):
      - Added `transientStorage` map to `StateDB`, with getters/setters and journaling support.
      - Added `Prepare` method to reset access lists and transient storage for each tx.
    - Refactored `SelfDestruct` logic and exposed `HasSelfDestructed` (was `Suicide`) for better clarity and future EIP-6780 readiness.
    - Reworked balance mutation logic (`AddBalanceSigned`) to correctly handle signed values and prevent `uint256` overflow errors.
    - Minor typo corrections (e.g., "occured" → "occurred") in proto files and comments.

    This upgrade also adjusts `go.mod` to:
    - Replace `go-ethereum v1.10.x` with `v1.13.14`
    - Downgrade Go version to 1.21 for compatibility with `go-ethereum` and its Pebble dependency
    - Pin Pebble to a compatible commit required by geth's internal `ethdb`

commit 1834a61
Author: Unique-Divine <[email protected]>
Date:   Sat Apr 12 19:51:44 2025 -0500

    feat(evm): Adapt module to Geth v1.13 core package changes

    This commit updates the Nibiru EVM module to align with significant
    breaking changes introduced in the upstream go-ethereum v1.13 `core/vm`
    and `core/types` packages. The goal is to leverage the updated Geth
    dependencies while ensuring compatibility with Nibiru's specific
    requirements, particularly its custom precompiles that interact with the
    Cosmos SDK.

    This addresses several LSP errors and runtime issues arising from removed
    or modified upstream functions and interfaces:

    1.  **Replace `core.NewMessage` Calls:**
        - The `core.NewMessage` factory function was removed upstream in favor
          of direct struct instantiation.
        - All instances have been replaced with `core.Message{...}` struct
          literals, correctly mapping arguments to fields like `From`, `To`,
          `Nonce`, `Value`, `GasLimit`, gas price fields (`GasPrice`,
          `GasFeeCap`, `GasTipCap`), `Data`, `AccessList`.
        - Monetary and gas values are initialized as `*big.Int` per the
          `core.Message` definition.
        - Newer fields relevant to Cancun/EIP-4844 (`BlobGasFeeCap`,
          `BlobHashes`) and Nibiru-specific fields (`SkipAccountChecks`)
          are now correctly initialized.

    2.  **Revert `vm.PrecompiledContract` Interface for Nibiru Precompiles:**
        - Geth v1.13 simplified the `PrecompiledContract.Run` signature to
          `Run(input []byte)`.
        - This change breaks Nibiru's custom precompiles (e.g., Wasm) which
          require the `*vm.EVM` pointer to access `StateDB` and derive the
          `sdk.Context` needed for Cosmos SDK keeper interactions.
        - This commit *reverts* the interface definition within Nibiru's
          fork back to `Run(evm *vm.EVM, contract *vm.Contract, readonly bool)`.
        - The `Address() common.Address` method is also restored to the
          interface and implementations for use by the execution logic.
        - Standard precompile implementations included in this module have
          been adapted to match this reverted interface signature.
        - The `vm.RunPrecompiledContract` helper function is updated to pass
          the necessary `*vm.EVM`, `*vm.Contract`, and `readonly` context.

    3.  **Adopt `uint256` for VM Value/Balance Interactions:**
        - While `core.Message` retains `*big.Int`, the internal VM logic
          and `StateDB` methods (e.g., `vm.Call`, `vm.Create`, `AddBalance`,
          `SubBalance`, `Contract.value`) were updated upstream to use
          `*uint256.Int` (from `holiman/uint256`).
        - Code passing values into these VM contexts has been updated to
          perform the necessary `*big.Int` -> `*uint256.Int` conversions.
        - Added `holiman/uint256` as a direct dependency in `go.mod`.

    4.  **Replace `StateDB.PrepareAccessList`:**
        - The `PrepareAccessList` method was removed from the `vm.StateDB`
          interface upstream.
        - Calls have been replaced with the new, more comprehensive
          `StateDB.Prepare(rules, sender, ...)` method.

    5.  **Replace `evm.ActivePrecompiles` Method:**
        - The `ActivePrecompiles` method on the `vm.EVM` struct was removed.
        - Calls have been replaced with the standalone package function
          `vm.ActivePrecompiles(rules)`, passing the appropriate chain rules.

    These changes resolve the identified compatibility errors and ensure the
    EVM module integrates correctly with both the updated Geth core components
    and Nibiru's specific architecture and custom precompiles.

commit af71ded
Author: Unique-Divine <[email protected]>
Date:   Sat Apr 12 19:51:44 2025 -0500

    feat(evm): Adapt module to Geth v1.13 core package changes

    This commit updates the Nibiru EVM module to align with significant
    breaking changes introduced in the upstream go-ethereum v1.13 `core/vm`
    and `core/types` packages. The goal is to leverage the updated Geth
    dependencies while ensuring compatibility with Nibiru's specific
    requirements, particularly its custom precompiles that interact with the
    Cosmos SDK.

    This addresses several LSP errors and runtime issues arising from removed
    or modified upstream functions and interfaces:

    1.  **Replace `core.NewMessage` Calls:**
        - The `core.NewMessage` factory function was removed upstream in favor
          of direct struct instantiation.
        - All instances have been replaced with `core.Message{...}` struct
          literals, correctly mapping arguments to fields like `From`, `To`,
          `Nonce`, `Value`, `GasLimit`, gas price fields (`GasPrice`,
          `GasFeeCap`, `GasTipCap`), `Data`, `AccessList`.
        - Monetary and gas values are initialized as `*big.Int` per the
          `core.Message` definition.
        - Newer fields relevant to Cancun/EIP-4844 (`BlobGasFeeCap`,
          `BlobHashes`) and Nibiru-specific fields (`SkipAccountChecks`)
          are now correctly initialized.

    2.  **Revert `vm.PrecompiledContract` Interface for Nibiru Precompiles:**
        - Geth v1.13 simplified the `PrecompiledContract.Run` signature to
          `Run(input []byte)`.
        - This change breaks Nibiru's custom precompiles (e.g., Wasm) which
          require the `*vm.EVM` pointer to access `StateDB` and derive the
          `sdk.Context` needed for Cosmos SDK keeper interactions.
        - This commit *reverts* the interface definition within Nibiru's
          fork back to `Run(evm *vm.EVM, contract *vm.Contract, readonly bool)`.
        - The `Address() common.Address` method is also restored to the
          interface and implementations for use by the execution logic.
        - Standard precompile implementations included in this module have
          been adapted to match this reverted interface signature.
        - The `vm.RunPrecompiledContract` helper function is updated to pass
          the necessary `*vm.EVM`, `*vm.Contract`, and `readonly` context.

    3.  **Adopt `uint256` for VM Value/Balance Interactions:**
        - While `core.Message` retains `*big.Int`, the internal VM logic
          and `StateDB` methods (e.g., `vm.Call`, `vm.Create`, `AddBalance`,
          `SubBalance`, `Contract.value`) were updated upstream to use
          `*uint256.Int` (from `holiman/uint256`).
        - Code passing values into these VM contexts has been updated to
          perform the necessary `*big.Int` -> `*uint256.Int` conversions.
        - Added `holiman/uint256` as a direct dependency in `go.mod`.

    4.  **Replace `StateDB.PrepareAccessList`:**
        - The `PrepareAccessList` method was removed from the `vm.StateDB`
          interface upstream.
        - Calls have been replaced with the new, more comprehensive
          `StateDB.Prepare(rules, sender, ...)` method.

    5.  **Replace `evm.ActivePrecompiles` Method:**
        - The `ActivePrecompiles` method on the `vm.EVM` struct was removed.
        - Calls have been replaced with the standalone package function
          `vm.ActivePrecompiles(rules)`, passing the appropriate chain rules.

    These changes resolve the identified compatibility errors and ensure the
    EVM module integrates correctly with both the updated Geth core components
    and Nibiru's specific architecture and custom precompiles.

commit 6370b96
Author: Unique-Divine <[email protected]>
Date:   Sat Apr 12 10:38:30 2025 -0500

    fix(evm): Pass block timestamp to MakeSigner and refactor MsgEthereumTx field usage

    - Update all calls to `gethcore.MakeSigner` to include the block time as a Unix timestamp (seconds), using `evm.ParseBlockTimeUnixU64(ctx)`.
    - Add `ParseBlockTimeUnixU64` utility to extract block time from `sdk.Context` in a safe, reusable way.
    - Refactor usage of MsgEthereumTx field getters to use direct struct fields (`From`, `To`, `Value`, `GasFeeCap`, etc.), improving efficiency and clarity.
    - Enhance `ParseWeiAsMultipleOfMicronibi` to return `uint256.Int` and handle nil, zero, negative, and overflow edge cases with clear error messages.

commit 0fad842
Author: Unique-Divine <[email protected]>
Date:   Sat Apr 12 10:38:30 2025 -0500

    fix(evm): Pass block timestamp to MakeSigner and refactor MsgEthereumTx field usage

    - Update all calls to `gethcore.MakeSigner` to include the block time as a Unix timestamp (seconds), using `evm.ParseBlockTimeUnixU64(ctx)`.
    - Add `ParseBlockTimeUnixU64` utility to extract block time from `sdk.Context` in a safe, reusable way.
    - Refactor usage of MsgEthereumTx field getters to use direct struct fields (`From`, `To`, `Value`, `GasFeeCap`, etc.), improving efficiency and clarity.
    - Enhance `ParseWeiAsMultipleOfMicronibi` to return `uint256.Int` and handle nil, zero, negative, and overflow edge cases with clear error messages.

commit 1002634
Author: Unique-Divine <[email protected]>
Date:   Sat Apr 12 03:21:08 2025 -0500

    refactor(evm): add more compatibility the new geth StateDB inteface, updating AddBalance and SubBalance to use uint256

commit d69a8c3
Author: Unique-Divine <[email protected]>
Date:   Sat Apr 12 03:21:08 2025 -0500

    refactor(evm): add more compatibility the new geth StateDB inteface, updating AddBalance and SubBalance to use uint256

commit d07093c
Author: Unique-Divine <[email protected]>
Date:   Fri Apr 11 21:18:53 2025 -0500

    feat: impl slog.Handler for geth v1.13. used in json-rpc

    These changes update Nibiru's integration with the `go-ethereum/log` package to align with its upstream migration to Go's standard structured logging library (`slog`). The previous logging setup in Nibiru, which relied on `go-ethereum/log`'s deprecated `FuncHandler` and `Record` types, was removed.

    1.  **Added `LogHandler`:** A new file `app/server/geth_log_handler.go` introduces the `LogHandler` type. This type implements the standard `slog.Handler` interface. Its primary role is to receive log records generated by Geth components (which now use `slog`) and translate them into corresponding calls on Nibiru's standard `cmtlog.Logger` (CometBFT logger). It correctly maps Geth/`slog` levels (including `Trace` and `Crit`) and formats log attributes for compatibility.
    2.  **Updated Initialization:** In `app/server/json_rpc.go`, the old `ethlog.Root().SetHandler(...)` block was replaced. The code now instantiates the new `LogHandler` (providing it the context logger `ctx.Logger.With("module", "geth")`), wraps it using `gethlog.NewLogger()`, and sets the result as the default logger for `go-ethereum` components via `gethlog.SetDefault()`.

    The primary reason for this refactor was the breaking change in the `go-ethereum/log` dependency, which deprecated its custom logging implementation in favor of Go's standard `slog`. These changes adapt Nibiru to the new `slog`-based API, ensuring that logs generated within embedded Geth components are correctly captured and processed by Nibiru's existing logging infrastructure (`cmtlog.Logger`). This maintains consistent logging behavior and compatibility with the updated dependency.

commit 5937bbe
Author: Unique-Divine <[email protected]>
Date:   Fri Apr 11 21:18:53 2025 -0500

    feat: impl slog.Handler for geth v1.13. used in json-rpc

    These changes update Nibiru's integration with the `go-ethereum/log` package to align with its upstream migration to Go's standard structured logging library (`slog`). The previous logging setup in Nibiru, which relied on `go-ethereum/log`'s deprecated `FuncHandler` and `Record` types, was removed.

    1.  **Added `LogHandler`:** A new file `app/server/geth_log_handler.go` introduces the `LogHandler` type. This type implements the standard `slog.Handler` interface. Its primary role is to receive log records generated by Geth components (which now use `slog`) and translate them into corresponding calls on Nibiru's standard `cmtlog.Logger` (CometBFT logger). It correctly maps Geth/`slog` levels (including `Trace` and `Crit`) and formats log attributes for compatibility.
    2.  **Updated Initialization:** In `app/server/json_rpc.go`, the old `ethlog.Root().SetHandler(...)` block was replaced. The code now instantiates the new `LogHandler` (providing it the context logger `ctx.Logger.With("module", "geth")`), wraps it using `gethlog.NewLogger()`, and sets the result as the default logger for `go-ethereum` components via `gethlog.SetDefault()`.

    The primary reason for this refactor was the breaking change in the `go-ethereum/log` dependency, which deprecated its custom logging implementation in favor of Go's standard `slog`. These changes adapt Nibiru to the new `slog`-based API, ensuring that logs generated within embedded Geth components are correctly captured and processed by Nibiru's existing logging infrastructure (`cmtlog.Logger`). This maintains consistent logging behavior and compatibility with the updated dependency.

commit ca3c821
Author: Unique-Divine <[email protected]>
Date:   Fri Apr 11 19:03:04 2025 -0500

    wip!: start with a local brute force jump to a geth v1.13.15 with no changes

commit 10010d6
Author: Unique-Divine <[email protected]>
Date:   Fri Apr 11 19:03:04 2025 -0500

    wip!: start with a local brute force jump to a geth v1.13.15 with no changes

* feat(evm)!: Update to geth v1.14 with newer pebble and Go 1.24 (#2275)

This upgrade bumps Nibiru's Geth dependency from v1.13 to v1.14.13 and updates
the Go version to 1.24 across the codebase and CI workflows. The upgrade is
motivated by the need to support modern database backends (e.g., Cockroach Pebble),
leverage recent Go generics improvements, and remain aligned with upstream changes
in the Geth EVM architecture.

Key changes:
- Refactored EVM backend logic to use Geth's new `core.Block` constructor signature,
  which requires `core.Body`, `Receipts`, and `TrieHasher` explicitly.
- Migrated `TraceTransaction`, `TraceCall`, and `TraceBlock` methods to return
  `json.RawMessage` as required by Geth's new trace API interfaces.
- Replaced `go-ethereum/log` with the new `log/slog` stdlib implementation, per Geth v1.14’s logging changes.
- Introduced `SuccessfulTx` struct in EVM tests to simplify managing and reusing
  stateful block hashes and numbers across assertions.
- Updated all Dockerfile and CI workflows to Go 1.24 to ensure compatibility.
- Disabled the `revive` linter’s `exported` rule for smoother CI linting.

Compatibility notes:
- Nibiru remains on the Berlin hard fork to avoid breaking changes from Ethereum’s
  blob transactions (Cancun) and Verkle tree requirements that are not applicable
  to Nibiru’s consensus and storage design.
- Geth v1.14 is the last compatible version before Cancun-related features become mandatory.

BREAKING CHANGE: Trace API return types and internal block construction logic
have changed to comply with Geth v1.14. Any downstream tools or integrations
depending on older behaviors may need to be updated.

* refactor: self-review changes

* fix(evm-precompile): get new delegate call behavior using the sender arg

* refactor: more self-review

* refactor(evm): VerifyFee MUST use the same gethparams.Rules as the EVM

* docs: remove consecutive duplicate words (#2285)

* Update LEGACY-CHANGELOG.md

* Update HACKING.md

* chore: fix function name in comment (#2273)

Signed-off-by: tsinghuacoder <[email protected]>
Co-authored-by: Kevin Yang <[email protected]>

* chore: fix typo in RewardBand description (#2234)

Co-authored-by: Unique Divine <[email protected]>

* Update CHANGELOG.md

* fix(eth-rpc): error propagation fixes and tests for the methods exposed by Nibiru's EVM JSON-RPC (#2289)

* test(rpcapi): prevent more regressions with runtime service inspection

* fix(backend): fix error propagation

* fix(eth): error propagation fixes and tests for the methods exposed by Nibiru's EVM JSON-RPC

Replace legacy error aliases throughout the eth module with sdkioerrors.Wrapf and sdkerrors.Err* to ensure consistent wrapping of Cosmos SDK errors. Simplify EVM backend error reporting by using fmt.Errorf with clear method prefixes (e.g. “BlockNumberError”, “RPCBlockFromTendermintBlock error”) and defaulting the base fee to evm.BASE_FEE_WEI. Suppress pruning‑related bloom errors by returning empty blooms when data is missing.

Unify RPC transaction conversion logic by renaming NewRPCTxFromMsg to NewRPCTxFromMsgEthTx, retiring the older NewRPCTxFromEthTx, and centralizing signer and signature‑value extraction. Refactor BackendSuite tests to use a SuccessfulTx map for structured receipt capture—eliminating global variables and improving setup clarity. Stub out unimplemented debugapi methods with context‑aware signatures and adjust filters, tracing, and utils to inline BlockBloom usage and align imports (e.g. eip1559, tracers) with modern patterns.

* chore: changelog PR number

---------

Signed-off-by: tsinghuacoder <[email protected]>
Co-authored-by: Tomass <[email protected]>
Co-authored-by: tsinghuacoder <[email protected]>
Co-authored-by: Kevin Yang <[email protected]>
Co-authored-by: Dmitry <[email protected]>
Unique-Divine added a commit that referenced this pull request Apr 22, 2025
* feat(evm)!: squashed commit

commit aaf6431
Author: Unique-Divine <[email protected]>
Date:   Mon Apr 14 10:25:36 2025 -0500

    refactor: linter and formatter

commit f36399c
Author: Unique-Divine <[email protected]>
Date:   Mon Apr 14 10:07:42 2025 -0500

    chore: changelog

commit f6bb649
Author: Unique-Divine <[email protected]>
Date:   Mon Apr 14 10:07:42 2025 -0500

    chore: changelog

commit a6877ee
Author: Unique-Divine <[email protected]>
Date:   Mon Apr 14 10:06:45 2025 -0500

    chore: move Go to v1.22 because it's required for geth

commit a1e74e9
Author: Unique-Divine <[email protected]>
Date:   Mon Apr 14 10:06:45 2025 -0500

    chore: move Go to v1.22 because it's required for geth

commit b546151
Author: Unique-Divine <[email protected]>
Date:   Mon Apr 14 10:04:56 2025 -0500

    feat(evm)!: update to geth v1.13 with EIP-1153, PRECOMPILE_ADDRS, and transient storage support

    This commit upgrades the Nibiru EVM module for compatibility with go-ethereum v1.13.14, introducing the following changes:

    - Updated all references from deprecated types in `rpc` to their new equivalents under `common/math`, such as replacing `rpc.DecimalOrHex` with `math.HexOrDecimal64`.
    - Removed deprecated EIP-155 seed hash API (`debug_seedHash`) and associated `ethash` import.
    - Aligned `vm.Config` and fee calculation logic with new EIP-based gas cost parameters (`isShanghai`, `isEIP3860`).
    - Introduced explicit `PRECOMPILE_ADDRS` constant to aggregate EVM precompiles with NibiruΓÇÖs extensions (FunToken, Wasm, Oracle).
    - Implemented support for **EIP-1153** (transient storage):
      - Added `transientStorage` map to `StateDB`, with getters/setters and journaling support.
      - Added `Prepare` method to reset access lists and transient storage for each tx.
    - Refactored `SelfDestruct` logic and exposed `HasSelfDestructed` (was `Suicide`) for better clarity and future EIP-6780 readiness.
    - Reworked balance mutation logic (`AddBalanceSigned`) to correctly handle signed values and prevent `uint256` overflow errors.
    - Minor typo corrections (e.g., "occured" → "occurred") in proto files and comments.

    This upgrade also adjusts `go.mod` to:
    - Replace `go-ethereum v1.10.x` with `v1.13.14`
    - Downgrade Go version to 1.21 for compatibility with `go-ethereum` and its Pebble dependency
    - Pin Pebble to a compatible commit required by geth's internal `ethdb`

commit 803f9b4
Author: Unique-Divine <[email protected]>
Date:   Mon Apr 14 10:04:56 2025 -0500

    feat(evm)!: update to geth v1.13 with EIP-1153, PRECOMPILE_ADDRS, and transient storage support

    This commit upgrades the Nibiru EVM module for compatibility with go-ethereum v1.13.14, introducing the following changes:

    - Updated all references from deprecated types in `rpc` to their new equivalents under `common/math`, such as replacing `rpc.DecimalOrHex` with `math.HexOrDecimal64`.
    - Removed deprecated EIP-155 seed hash API (`debug_seedHash`) and associated `ethash` import.
    - Aligned `vm.Config` and fee calculation logic with new EIP-based gas cost parameters (`isShanghai`, `isEIP3860`).
    - Introduced explicit `PRECOMPILE_ADDRS` constant to aggregate EVM precompiles with NibiruΓÇÖs extensions (FunToken, Wasm, Oracle).
    - Implemented support for **EIP-1153** (transient storage):
      - Added `transientStorage` map to `StateDB`, with getters/setters and journaling support.
      - Added `Prepare` method to reset access lists and transient storage for each tx.
    - Refactored `SelfDestruct` logic and exposed `HasSelfDestructed` (was `Suicide`) for better clarity and future EIP-6780 readiness.
    - Reworked balance mutation logic (`AddBalanceSigned`) to correctly handle signed values and prevent `uint256` overflow errors.
    - Minor typo corrections (e.g., "occured" → "occurred") in proto files and comments.

    This upgrade also adjusts `go.mod` to:
    - Replace `go-ethereum v1.10.x` with `v1.13.14`
    - Downgrade Go version to 1.21 for compatibility with `go-ethereum` and its Pebble dependency
    - Pin Pebble to a compatible commit required by geth's internal `ethdb`

commit 1834a61
Author: Unique-Divine <[email protected]>
Date:   Sat Apr 12 19:51:44 2025 -0500

    feat(evm): Adapt module to Geth v1.13 core package changes

    This commit updates the Nibiru EVM module to align with significant
    breaking changes introduced in the upstream go-ethereum v1.13 `core/vm`
    and `core/types` packages. The goal is to leverage the updated Geth
    dependencies while ensuring compatibility with Nibiru's specific
    requirements, particularly its custom precompiles that interact with the
    Cosmos SDK.

    This addresses several LSP errors and runtime issues arising from removed
    or modified upstream functions and interfaces:

    1.  **Replace `core.NewMessage` Calls:**
        - The `core.NewMessage` factory function was removed upstream in favor
          of direct struct instantiation.
        - All instances have been replaced with `core.Message{...}` struct
          literals, correctly mapping arguments to fields like `From`, `To`,
          `Nonce`, `Value`, `GasLimit`, gas price fields (`GasPrice`,
          `GasFeeCap`, `GasTipCap`), `Data`, `AccessList`.
        - Monetary and gas values are initialized as `*big.Int` per the
          `core.Message` definition.
        - Newer fields relevant to Cancun/EIP-4844 (`BlobGasFeeCap`,
          `BlobHashes`) and Nibiru-specific fields (`SkipAccountChecks`)
          are now correctly initialized.

    2.  **Revert `vm.PrecompiledContract` Interface for Nibiru Precompiles:**
        - Geth v1.13 simplified the `PrecompiledContract.Run` signature to
          `Run(input []byte)`.
        - This change breaks Nibiru's custom precompiles (e.g., Wasm) which
          require the `*vm.EVM` pointer to access `StateDB` and derive the
          `sdk.Context` needed for Cosmos SDK keeper interactions.
        - This commit *reverts* the interface definition within Nibiru's
          fork back to `Run(evm *vm.EVM, contract *vm.Contract, readonly bool)`.
        - The `Address() common.Address` method is also restored to the
          interface and implementations for use by the execution logic.
        - Standard precompile implementations included in this module have
          been adapted to match this reverted interface signature.
        - The `vm.RunPrecompiledContract` helper function is updated to pass
          the necessary `*vm.EVM`, `*vm.Contract`, and `readonly` context.

    3.  **Adopt `uint256` for VM Value/Balance Interactions:**
        - While `core.Message` retains `*big.Int`, the internal VM logic
          and `StateDB` methods (e.g., `vm.Call`, `vm.Create`, `AddBalance`,
          `SubBalance`, `Contract.value`) were updated upstream to use
          `*uint256.Int` (from `holiman/uint256`).
        - Code passing values into these VM contexts has been updated to
          perform the necessary `*big.Int` -> `*uint256.Int` conversions.
        - Added `holiman/uint256` as a direct dependency in `go.mod`.

    4.  **Replace `StateDB.PrepareAccessList`:**
        - The `PrepareAccessList` method was removed from the `vm.StateDB`
          interface upstream.
        - Calls have been replaced with the new, more comprehensive
          `StateDB.Prepare(rules, sender, ...)` method.

    5.  **Replace `evm.ActivePrecompiles` Method:**
        - The `ActivePrecompiles` method on the `vm.EVM` struct was removed.
        - Calls have been replaced with the standalone package function
          `vm.ActivePrecompiles(rules)`, passing the appropriate chain rules.

    These changes resolve the identified compatibility errors and ensure the
    EVM module integrates correctly with both the updated Geth core components
    and Nibiru's specific architecture and custom precompiles.

commit af71ded
Author: Unique-Divine <[email protected]>
Date:   Sat Apr 12 19:51:44 2025 -0500

    feat(evm): Adapt module to Geth v1.13 core package changes

    This commit updates the Nibiru EVM module to align with significant
    breaking changes introduced in the upstream go-ethereum v1.13 `core/vm`
    and `core/types` packages. The goal is to leverage the updated Geth
    dependencies while ensuring compatibility with Nibiru's specific
    requirements, particularly its custom precompiles that interact with the
    Cosmos SDK.

    This addresses several LSP errors and runtime issues arising from removed
    or modified upstream functions and interfaces:

    1.  **Replace `core.NewMessage` Calls:**
        - The `core.NewMessage` factory function was removed upstream in favor
          of direct struct instantiation.
        - All instances have been replaced with `core.Message{...}` struct
          literals, correctly mapping arguments to fields like `From`, `To`,
          `Nonce`, `Value`, `GasLimit`, gas price fields (`GasPrice`,
          `GasFeeCap`, `GasTipCap`), `Data`, `AccessList`.
        - Monetary and gas values are initialized as `*big.Int` per the
          `core.Message` definition.
        - Newer fields relevant to Cancun/EIP-4844 (`BlobGasFeeCap`,
          `BlobHashes`) and Nibiru-specific fields (`SkipAccountChecks`)
          are now correctly initialized.

    2.  **Revert `vm.PrecompiledContract` Interface for Nibiru Precompiles:**
        - Geth v1.13 simplified the `PrecompiledContract.Run` signature to
          `Run(input []byte)`.
        - This change breaks Nibiru's custom precompiles (e.g., Wasm) which
          require the `*vm.EVM` pointer to access `StateDB` and derive the
          `sdk.Context` needed for Cosmos SDK keeper interactions.
        - This commit *reverts* the interface definition within Nibiru's
          fork back to `Run(evm *vm.EVM, contract *vm.Contract, readonly bool)`.
        - The `Address() common.Address` method is also restored to the
          interface and implementations for use by the execution logic.
        - Standard precompile implementations included in this module have
          been adapted to match this reverted interface signature.
        - The `vm.RunPrecompiledContract` helper function is updated to pass
          the necessary `*vm.EVM`, `*vm.Contract`, and `readonly` context.

    3.  **Adopt `uint256` for VM Value/Balance Interactions:**
        - While `core.Message` retains `*big.Int`, the internal VM logic
          and `StateDB` methods (e.g., `vm.Call`, `vm.Create`, `AddBalance`,
          `SubBalance`, `Contract.value`) were updated upstream to use
          `*uint256.Int` (from `holiman/uint256`).
        - Code passing values into these VM contexts has been updated to
          perform the necessary `*big.Int` -> `*uint256.Int` conversions.
        - Added `holiman/uint256` as a direct dependency in `go.mod`.

    4.  **Replace `StateDB.PrepareAccessList`:**
        - The `PrepareAccessList` method was removed from the `vm.StateDB`
          interface upstream.
        - Calls have been replaced with the new, more comprehensive
          `StateDB.Prepare(rules, sender, ...)` method.

    5.  **Replace `evm.ActivePrecompiles` Method:**
        - The `ActivePrecompiles` method on the `vm.EVM` struct was removed.
        - Calls have been replaced with the standalone package function
          `vm.ActivePrecompiles(rules)`, passing the appropriate chain rules.

    These changes resolve the identified compatibility errors and ensure the
    EVM module integrates correctly with both the updated Geth core components
    and Nibiru's specific architecture and custom precompiles.

commit 6370b96
Author: Unique-Divine <[email protected]>
Date:   Sat Apr 12 10:38:30 2025 -0500

    fix(evm): Pass block timestamp to MakeSigner and refactor MsgEthereumTx field usage

    - Update all calls to `gethcore.MakeSigner` to include the block time as a Unix timestamp (seconds), using `evm.ParseBlockTimeUnixU64(ctx)`.
    - Add `ParseBlockTimeUnixU64` utility to extract block time from `sdk.Context` in a safe, reusable way.
    - Refactor usage of MsgEthereumTx field getters to use direct struct fields (`From`, `To`, `Value`, `GasFeeCap`, etc.), improving efficiency and clarity.
    - Enhance `ParseWeiAsMultipleOfMicronibi` to return `uint256.Int` and handle nil, zero, negative, and overflow edge cases with clear error messages.

commit 0fad842
Author: Unique-Divine <[email protected]>
Date:   Sat Apr 12 10:38:30 2025 -0500

    fix(evm): Pass block timestamp to MakeSigner and refactor MsgEthereumTx field usage

    - Update all calls to `gethcore.MakeSigner` to include the block time as a Unix timestamp (seconds), using `evm.ParseBlockTimeUnixU64(ctx)`.
    - Add `ParseBlockTimeUnixU64` utility to extract block time from `sdk.Context` in a safe, reusable way.
    - Refactor usage of MsgEthereumTx field getters to use direct struct fields (`From`, `To`, `Value`, `GasFeeCap`, etc.), improving efficiency and clarity.
    - Enhance `ParseWeiAsMultipleOfMicronibi` to return `uint256.Int` and handle nil, zero, negative, and overflow edge cases with clear error messages.

commit 1002634
Author: Unique-Divine <[email protected]>
Date:   Sat Apr 12 03:21:08 2025 -0500

    refactor(evm): add more compatibility the new geth StateDB inteface, updating AddBalance and SubBalance to use uint256

commit d69a8c3
Author: Unique-Divine <[email protected]>
Date:   Sat Apr 12 03:21:08 2025 -0500

    refactor(evm): add more compatibility the new geth StateDB inteface, updating AddBalance and SubBalance to use uint256

commit d07093c
Author: Unique-Divine <[email protected]>
Date:   Fri Apr 11 21:18:53 2025 -0500

    feat: impl slog.Handler for geth v1.13. used in json-rpc

    These changes update Nibiru's integration with the `go-ethereum/log` package to align with its upstream migration to Go's standard structured logging library (`slog`). The previous logging setup in Nibiru, which relied on `go-ethereum/log`'s deprecated `FuncHandler` and `Record` types, was removed.

    1.  **Added `LogHandler`:** A new file `app/server/geth_log_handler.go` introduces the `LogHandler` type. This type implements the standard `slog.Handler` interface. Its primary role is to receive log records generated by Geth components (which now use `slog`) and translate them into corresponding calls on Nibiru's standard `cmtlog.Logger` (CometBFT logger). It correctly maps Geth/`slog` levels (including `Trace` and `Crit`) and formats log attributes for compatibility.
    2.  **Updated Initialization:** In `app/server/json_rpc.go`, the old `ethlog.Root().SetHandler(...)` block was replaced. The code now instantiates the new `LogHandler` (providing it the context logger `ctx.Logger.With("module", "geth")`), wraps it using `gethlog.NewLogger()`, and sets the result as the default logger for `go-ethereum` components via `gethlog.SetDefault()`.

    The primary reason for this refactor was the breaking change in the `go-ethereum/log` dependency, which deprecated its custom logging implementation in favor of Go's standard `slog`. These changes adapt Nibiru to the new `slog`-based API, ensuring that logs generated within embedded Geth components are correctly captured and processed by Nibiru's existing logging infrastructure (`cmtlog.Logger`). This maintains consistent logging behavior and compatibility with the updated dependency.

commit 5937bbe
Author: Unique-Divine <[email protected]>
Date:   Fri Apr 11 21:18:53 2025 -0500

    feat: impl slog.Handler for geth v1.13. used in json-rpc

    These changes update Nibiru's integration with the `go-ethereum/log` package to align with its upstream migration to Go's standard structured logging library (`slog`). The previous logging setup in Nibiru, which relied on `go-ethereum/log`'s deprecated `FuncHandler` and `Record` types, was removed.

    1.  **Added `LogHandler`:** A new file `app/server/geth_log_handler.go` introduces the `LogHandler` type. This type implements the standard `slog.Handler` interface. Its primary role is to receive log records generated by Geth components (which now use `slog`) and translate them into corresponding calls on Nibiru's standard `cmtlog.Logger` (CometBFT logger). It correctly maps Geth/`slog` levels (including `Trace` and `Crit`) and formats log attributes for compatibility.
    2.  **Updated Initialization:** In `app/server/json_rpc.go`, the old `ethlog.Root().SetHandler(...)` block was replaced. The code now instantiates the new `LogHandler` (providing it the context logger `ctx.Logger.With("module", "geth")`), wraps it using `gethlog.NewLogger()`, and sets the result as the default logger for `go-ethereum` components via `gethlog.SetDefault()`.

    The primary reason for this refactor was the breaking change in the `go-ethereum/log` dependency, which deprecated its custom logging implementation in favor of Go's standard `slog`. These changes adapt Nibiru to the new `slog`-based API, ensuring that logs generated within embedded Geth components are correctly captured and processed by Nibiru's existing logging infrastructure (`cmtlog.Logger`). This maintains consistent logging behavior and compatibility with the updated dependency.

commit ca3c821
Author: Unique-Divine <[email protected]>
Date:   Fri Apr 11 19:03:04 2025 -0500

    wip!: start with a local brute force jump to a geth v1.13.15 with no changes

commit 10010d6
Author: Unique-Divine <[email protected]>
Date:   Fri Apr 11 19:03:04 2025 -0500

    wip!: start with a local brute force jump to a geth v1.13.15 with no changes

* feat(evm)!: Update to geth v1.14 with newer pebble and Go 1.24 (#2275)

This upgrade bumps Nibiru's Geth dependency from v1.13 to v1.14.13 and updates
the Go version to 1.24 across the codebase and CI workflows. The upgrade is
motivated by the need to support modern database backends (e.g., Cockroach Pebble),
leverage recent Go generics improvements, and remain aligned with upstream changes
in the Geth EVM architecture.

Key changes:
- Refactored EVM backend logic to use Geth's new `core.Block` constructor signature,
  which requires `core.Body`, `Receipts`, and `TrieHasher` explicitly.
- Migrated `TraceTransaction`, `TraceCall`, and `TraceBlock` methods to return
  `json.RawMessage` as required by Geth's new trace API interfaces.
- Replaced `go-ethereum/log` with the new `log/slog` stdlib implementation, per Geth v1.14’s logging changes.
- Introduced `SuccessfulTx` struct in EVM tests to simplify managing and reusing
  stateful block hashes and numbers across assertions.
- Updated all Dockerfile and CI workflows to Go 1.24 to ensure compatibility.
- Disabled the `revive` linter’s `exported` rule for smoother CI linting.

Compatibility notes:
- Nibiru remains on the Berlin hard fork to avoid breaking changes from Ethereum’s
  blob transactions (Cancun) and Verkle tree requirements that are not applicable
  to Nibiru’s consensus and storage design.
- Geth v1.14 is the last compatible version before Cancun-related features become mandatory.

BREAKING CHANGE: Trace API return types and internal block construction logic
have changed to comply with Geth v1.14. Any downstream tools or integrations
depending on older behaviors may need to be updated.

* refactor: self-review changes

* fix(evm-precompile): get new delegate call behavior using the sender arg

* refactor: more self-review

* refactor(evm): VerifyFee MUST use the same gethparams.Rules as the EVM

* docs: remove consecutive duplicate words (#2285)

* Update LEGACY-CHANGELOG.md

* Update HACKING.md

* chore: fix function name in comment (#2273)

Signed-off-by: tsinghuacoder <[email protected]>
Co-authored-by: Kevin Yang <[email protected]>

* chore: fix typo in RewardBand description (#2234)

Co-authored-by: Unique Divine <[email protected]>

* test(rpcapi): prevent more regressions with runtime service inspection

* fix(backend): fix error propagation

* fix(eth): error propagation fixes and tests for the methods exposed by Nibiru's EVM JSON-RPC

Replace legacy error aliases throughout the eth module with sdkioerrors.Wrapf and sdkerrors.Err* to ensure consistent wrapping of Cosmos SDK errors. Simplify EVM backend error reporting by using fmt.Errorf with clear method prefixes (e.g. “BlockNumberError”, “RPCBlockFromTendermintBlock error”) and defaulting the base fee to evm.BASE_FEE_WEI. Suppress pruning‑related bloom errors by returning empty blooms when data is missing.

Unify RPC transaction conversion logic by renaming NewRPCTxFromMsg to NewRPCTxFromMsgEthTx, retiring the older NewRPCTxFromEthTx, and centralizing signer and signature‑value extraction. Refactor BackendSuite tests to use a SuccessfulTx map for structured receipt capture—eliminating global variables and improving setup clarity. Stub out unimplemented debugapi methods with context‑aware signatures and adjust filters, tracing, and utils to inline BlockBloom usage and align imports (e.g. eip1559, tracers) with modern patterns.

* refactor: use importas linter for consistent imports

* refactor: use importas linter for consistent imports

* refactor: sdkmath import alias

* linter fixes

* Update CHANGELOG.md

* fix(eth-rpc): error propagation fixes and tests for the methods exposed by Nibiru's EVM JSON-RPC (#2289)

* test(rpcapi): prevent more regressions with runtime service inspection

* fix(backend): fix error propagation

* fix(eth): error propagation fixes and tests for the methods exposed by Nibiru's EVM JSON-RPC

Replace legacy error aliases throughout the eth module with sdkioerrors.Wrapf and sdkerrors.Err* to ensure consistent wrapping of Cosmos SDK errors. Simplify EVM backend error reporting by using fmt.Errorf with clear method prefixes (e.g. “BlockNumberError”, “RPCBlockFromTendermintBlock error”) and defaulting the base fee to evm.BASE_FEE_WEI. Suppress pruning‑related bloom errors by returning empty blooms when data is missing.

Unify RPC transaction conversion logic by renaming NewRPCTxFromMsg to NewRPCTxFromMsgEthTx, retiring the older NewRPCTxFromEthTx, and centralizing signer and signature‑value extraction. Refactor BackendSuite tests to use a SuccessfulTx map for structured receipt capture—eliminating global variables and improving setup clarity. Stub out unimplemented debugapi methods with context‑aware signatures and adjust filters, tracing, and utils to inline BlockBloom usage and align imports (e.g. eip1559, tracers) with modern patterns.

* chore: changelog PR number

---------

Signed-off-by: Unique-Divine <[email protected]>
Co-authored-by: Tomass <[email protected]>
Co-authored-by: tsinghuacoder <[email protected]>
Co-authored-by: Dmitry <[email protected]>
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.

3 participants