Skip to content

Aditya's review PR [DO NOT MERGE] #8558

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 76 commits into
base: gjermund/tmp-review-branch
Choose a base branch
from

Conversation

gjermundgaraba
Copy link
Contributor

This PR is just to have a place to collect reviews from PR of main.
The target branch is from just before PFM was added, so all changes after that are included.

DeshErBojhaa and others added 30 commits May 15, 2025 15:05
Co-authored-by: Gjermund Garaba <[email protected]>
…sage (#8366)

Co-authored-by: Tamjid Ahmed <[email protected]>
Co-authored-by: Gjermund Garaba <[email protected]>
Co-authored-by: Tamjid Ahmed <[email protected]>
Co-authored-by: Gjermund Garaba <[email protected]>
dependabot bot and others added 19 commits June 10, 2025 17:32
…dules/light-clients/08-wasm (#8515)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* chore: rm checksums from proto and migrator

* chore: update proto files

* chore: use undeprecated option in buf lock

* docs: add breaking change to changelog

* docs: add space

* Update CHANGELOG.md

---------

Co-authored-by: Gjermund Garaba <[email protected]>
* test: genesis export

* Genesis test

* test: keeper for pfm

* test: pfm keeper -> Done

* fix: Lint. Shutup Meg

* remove comment

* Rename mock transfer

* refactor: clean up test code

* update deps

* fix deps

* refactor: rename malleates -> malleate
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Gjermund Garaba <[email protected]>
…dules/light-clients/08-wasm (#8532)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Gjermund Garaba <[email protected]>
Co-authored-by: Alex | Interchain Labs <[email protected]>
Co-authored-by: Gjermund Garaba <[email protected]>
Co-authored-by: mconcat <[email protected]>
Co-authored-by: Aditya <[email protected]>
Co-authored-by: tamjidahmed <[email protected]>
Comment on lines +15 to +20
for key, value := range state.InFlightPackets {
bz := k.cdc.MustMarshal(&value)
if err := store.Set([]byte(key), bz); err != nil {
panic(err)
}
}

Check warning

Code scanning / CodeQL

Iteration over map Warning

Iteration over map may be a possible source of non-determinism
Comment on lines +41 to +46
for prefix := range rtr.prefixRoutes {
// Prevent existing prefix routes from colliding with the new direct route to avoid confusing behavior.
if strings.HasPrefix(portID, prefix) {
panic(fmt.Errorf("route %s is already matched by registered prefix route: %s", portID, prefix))
}
}

Check warning

Code scanning / CodeQL

Iteration over map Warning

Iteration over map may be a possible source of non-determinism
Comment on lines +67 to +71
for portID := range rtr.routes {
if strings.HasPrefix(portID, portIDPrefix) {
panic(fmt.Errorf("route prefix %s is a prefix for already registered route: %s", portIDPrefix, portID))
}
}

Check warning

Code scanning / CodeQL

Iteration over map Warning

Iteration over map may be a possible source of non-determinism
* remove restriction in types package

* fix acknowledgement, and start keeper package testing

* 04-channel tests

* add transfer tests

* CHANGELOG

* lint

* address review

---------

Co-authored-by: Gjermund Garaba <[email protected]>
Copy link

codecov bot commented Jun 23, 2025

Codecov Report

Attention: Patch coverage is 49.62457% with 738 lines in your changes missing coverage. Please review.

Project coverage is 57.99%. Comparing base (33d2d18) to head (e54a696).

Files with missing lines Patch % Lines
...es/apps/packet-forward-middleware/keeper/keeper.go 52.08% 121 Missing and 17 partials ⚠️
modules/apps/rate-limiting/client/cli/query.go 0.00% 137 Missing ⚠️
e2e/testsuite/testsuite.go 0.00% 112 Missing ⚠️
...s/apps/packet-forward-middleware/ibc_middleware.go 55.42% 98 Missing and 13 partials ⚠️
modules/apps/rate-limiting/ibc_middleware.go 0.00% 56 Missing ⚠️
...packet-forward-middleware/migrations/v3/migrate.go 0.00% 39 Missing ⚠️
modules/apps/callbacks/testing/simapp/app.go 0.00% 31 Missing ⚠️
modules/apps/packet-forward-middleware/module.go 56.81% 16 Missing and 3 partials ⚠️
modules/apps/rate-limiting/client/cli/cli.go 0.00% 17 Missing ⚠️
modules/apps/rate-limiting/keeper/epoch.go 62.50% 10 Missing and 5 partials ⚠️
... and 18 more
Additional details and impacted files
@@                      Coverage Diff                       @@
##           gjermund/tmp-review-branch    #8558      +/-   ##
==============================================================
- Coverage                       67.17%   57.99%   -9.19%     
==============================================================
  Files                             280      319      +39     
  Lines                           19429    22814    +3385     
==============================================================
+ Hits                            13052    13231     +179     
- Misses                           5794     8978    +3184     
- Partials                          583      605      +22     
Flag Coverage Δ
08-wasm 65.99% <ø> (+21.70%) ⬆️
e2e 1.13% <0.00%> (?)
ibc-go 63.43% <54.37%> (-5.44%) ⬇️

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
Member

@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.

Very large PR. So I looked at PFM and rate limit to focus on the changes that i wasn't deeply involved in

// transfer stack contains (from top to bottom):
// - Packet Forward Middleware
// - Transfer
var transferStack ibcporttypes.IBCModule
Copy link
Member

Choose a reason for hiding this comment

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

Use new stack primitive

Comment on lines +89 to +94
if len(denom.Trace) == 0 {
// denom is now unwound back to native denom
return denom.Path()
}
// denom is still IBC denom
return denom.IBCDenom()
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if len(denom.Trace) == 0 {
// denom is now unwound back to native denom
return denom.Path()
}
// denom is still IBC denom
return denom.IBCDenom()
return denom.IBCDenom()

IBCDenom does this logic internally

"refund-port-id", inFlightPacket.RefundPortId,
)

return inFlightPacket, fmt.Errorf("giving up on packet on channel (%s) port (%s) after max retries", inFlightPacket.RefundChannelId, inFlightPacket.RefundPortId)
Copy link
Member

Choose a reason for hiding this comment

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

I don't like how this function is designed where it can return an inFlightpacket and an error. Not intuitive

// If GetHourEpoch returned a zero-value epoch (due to error or missing key),
// we cannot proceed with the check.
if hourEpoch.Duration == 0 || hourEpoch.EpochStartTime.IsZero() {
return false, 0, errorsmod.Wrapf(types.ErrInvalidEpoce, "cannot check hour epoch starting. epoch: %v", hourEpoch)
Copy link
Member

Choose a reason for hiding this comment

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

Misspelled epoch in error

return im.app.OnAcknowledgementPacket(ctx, sourceClient, destinationClient, sequence, acknowledgement, payload, relayer)
}

// TODO: Something looks off about this, please review carefully
Copy link
Member

Choose a reason for hiding this comment

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

This looks correct to me

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.