Skip to content

chore: rm misbehaviour endpoint#8516

Merged
gjermundgaraba merged 8 commits intomainfrom
johnnylarner/ibcgo-2327-remove-msgsubmitmisbehaviour-and-corresponding-rpc
Jun 11, 2025
Merged

chore: rm misbehaviour endpoint#8516
gjermundgaraba merged 8 commits intomainfrom
johnnylarner/ibcgo-2327-remove-msgsubmitmisbehaviour-and-corresponding-rpc

Conversation

@johnnylarner
Copy link
Copy Markdown
Contributor

@johnnylarner johnnylarner commented Jun 10, 2025

Description

Will add to the CHANGELOG and double check the test code again tomorrow.

closes: #3889


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Linked to GitHub issue with discussion and accepted design, OR link to spec that describes this work.
  • Include changelog entry when appropriate (e.g. chores should be omitted from changelog).
  • Wrote unit and integration tests if relevant.
  • Updated documentation (docs/) if anything is changed.
  • Added godoc comments if relevant.
  • Self-reviewed Files changed in the GitHub PR explorer.
  • Provide a conventional commit message to follow the repository standards.

@linear
Copy link
Copy Markdown

linear bot commented Jun 10, 2025

@codecov
Copy link
Copy Markdown

codecov bot commented Jun 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 57.74%. Comparing base (b0550d6) to head (adf5091).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8516      +/-   ##
==========================================
+ Coverage   57.68%   57.74%   +0.06%     
==========================================
  Files         291      291              
  Lines       21338    21265      -73     
==========================================
- Hits        12308    12279      -29     
+ Misses       8461     8418      -43     
+ Partials      569      568       -1     
Flag Coverage Δ
08-wasm 66.13% <ø> (ø)
e2e 1.18% <ø> (ø)
ibc-go 63.34% <ø> (+0.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@gjermundgaraba gjermundgaraba left a comment

Choose a reason for hiding this comment

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

I just did an initial review, but it looks very good 👍

},
channeltypes.ErrRedundantTx,
},
{
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would want @AdityaSripal to confirm this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yep, wasn't clear to me why the the older Submit... behaviour affects message redundancy, but judging by the rest of the tests the update client message should behave as this test does

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hmmm... this just seems like an oversight that happened once we merged the misbehaviour and recvPacket messages into a single endpoint.

Generally speaking, a relayer wouldn't pair a malicious update message with recvpacket messages together, since that would just freeze the client that you wanted to use later.

It could be the case that someone submits an update message that ends up being proof of misbehaviour (i.e. the update client is just a single header but it conflicts with a consensus state that already exists). If this update message was paired with only redundant receive packet messages it would also be ignored.

Perhaps we should check the update message first before rejecting the redundant messages in the antehandler

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In practice, this is not a huge deal though

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What is the most important scenario we should actually test for here in the antehandler?

Copy link
Copy Markdown
Contributor

@gjermundgaraba gjermundgaraba Jun 11, 2025

Choose a reason for hiding this comment

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

Or, to put it another way: is this test covering the most important scenario wrt misbehavior?

Also: I don't really think it makes sense to optimize for a scenario where someone posts misbehavior and recvPacket. I just want to make sure we have the right test case here

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The most important scenario:

There exists a consensus state in client with height 50 and hash: 0xABC

Relayer submits a new tx with:

  • Valid Header Update for height 50 and hash: 0xDEF
  • Redundant RecvPacket txs

Note: If the header update was submitted just on its own; IBC would automatically detect the misbehaviour even though it is a regular update because it conflicts with existing consensus state.

My suspicion however, is that this tx would be dropped by the antehandler

@johnnylarner johnnylarner marked this pull request as ready for review June 11, 2025 07:03
Copy link
Copy Markdown
Contributor

@gjermundgaraba gjermundgaraba left a comment

Choose a reason for hiding this comment

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

Looks mostly good to go. Left a couple of minor comments, and pending answer on the question from Aditya :)

johnnylarner and others added 2 commits June 11, 2025 11:26
Co-authored-by: Gjermund Garaba <gjermund@garaba.net>
Copy link
Copy Markdown
Contributor

@AdityaSripal AdityaSripal left a comment

Choose a reason for hiding this comment

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

LGTM! Yes, the redundant tx antedecorator can be improved to allow misbehavior processing even if the attached packet messages are redundant

But in practice, this is a relatively small concern

},
channeltypes.ErrRedundantTx,
},
{
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hmmm... this just seems like an oversight that happened once we merged the misbehaviour and recvPacket messages into a single endpoint.

Generally speaking, a relayer wouldn't pair a malicious update message with recvpacket messages together, since that would just freeze the client that you wanted to use later.

It could be the case that someone submits an update message that ends up being proof of misbehaviour (i.e. the update client is just a single header but it conflicts with a consensus state that already exists). If this update message was paired with only redundant receive packet messages it would also be ignored.

Perhaps we should check the update message first before rejecting the redundant messages in the antehandler

},
channeltypes.ErrRedundantTx,
},
{
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In practice, this is not a huge deal though

@gjermundgaraba gjermundgaraba merged commit 68e944f into main Jun 11, 2025
51 of 52 checks passed
@gjermundgaraba gjermundgaraba deleted the johnnylarner/ibcgo-2327-remove-msgsubmitmisbehaviour-and-corresponding-rpc branch June 11, 2025 16:58
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.

Remove MsgSubmitMisbehaviour and corresponding rpc handler/CLI

3 participants