Skip to content

Conversation

@zsystm
Copy link
Contributor

@zsystm zsystm commented Jul 9, 2025

Description

This PR sets an empty evidencetypes.Router to the EvidenceKeeper when constructing the reference evmd app.

Context

The evmd app aims to support all precompiles as a reference implementation. However, the current setup lacks a router configuration for EvidenceKeeper, which causes a nil panic when invoking SubmitEvidence from the evidence precompile.

Moreover, the Evidence precompile isn't even enabled in local_node.sh by default, meaning it's not currently part of the standard local testing flow.

Even if we add the Evidence precompile to the runtime, it cannot function properly without a router set in EvidenceKeeper, making any E2E flow impossible at the moment.

Fix

  • Enable slashing and evidence precompiles in local_node.sh
  • Initializes a router with noOpEvidenceHandler and assigns it to the EvidenceKeeper in app.go. This allows the SubmitEvidence to be executed without panic and enables E2E testing for the evidence flow.
  • Addresses an argument parsing issue with the Equivocation struct: passing the argument using the exact Go struct format works in Go-based tests, but fails in E2E tests using this Hardhat script.

Closes: #275


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • tackled an existing issue or discussed with a team member
  • left instructions on how to review the changes
  • targeted the main branch

Reviewers Checklist

All items are required.
Please add a note if the item is not applicable
and please add your handle next to the items reviewed
if you only reviewed selected items.

I have...

  • added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • confirmed all author checklist items have been addressed
  • confirmed that this PR does not change production code
  • reviewed content
  • tested instructions (if applicable)
  • confirmed all CI checks have passed

zsystm added 2 commits July 9, 2025 20:25
When calling submitEvidence through hardhat(ethers.js), type conversion from args[1] into Equivocation doesn't work.
@zsystm zsystm self-assigned this Jul 9, 2025
@zsystm zsystm marked this pull request as ready for review July 9, 2025 15:09
@zsystm zsystm requested a review from vladjdk July 9, 2025 15:09
@zsystm zsystm marked this pull request as draft July 10, 2025 07:28
@zsystm zsystm removed the request for review from vladjdk July 10, 2025 07:28
@zsystm zsystm marked this pull request as ready for review July 10, 2025 12:07
@zsystm zsystm changed the title feat: set empty router to EvidenceKeeper for evmd feat: set no-op router to EvidenceKeeper for evmd Jul 10, 2025
@zsystm zsystm requested a review from vladjdk July 10, 2025 12:18
Copy link
Member

@vladjdk vladjdk left a comment

Choose a reason for hiding this comment

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

Lgtm, let's think about a permanent fix or whether we should remove the Evidence precompile entirely. @aljo242 pinging you here for visibility.

@zsystm
Copy link
Contributor Author

zsystm commented Jul 14, 2025

@vladjdk
Personally, I’m not sure the Evidence precompile is worth keeping. It’s generally good to support more features, but in this case, I haven’t seen chains actually using evidence routers on the app side. So I’m leaning toward removing it, since the practical value seems low.

cc: @cloudgray

@vladjdk vladjdk merged commit ec1a928 into cosmos:main Jul 15, 2025
15 checks passed
zsystm added a commit to zsystm/evm that referenced this pull request Nov 2, 2025
* add default router for evidence keeper

* fix type handling

When calling submitEvidence through hardhat(ethers.js), type conversion from args[1] into Equivocation doesn't work.

* fix lint

* enable evidence precompile at local_node.sh

* implement no-op evidence handler

* remove un-used code

---------

Co-authored-by: Vlad J <vladjdk@gmail.com>
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.

Evidence precompile causes nil panic due to missing router configuration in evmd app

2 participants