Skip to content
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

Integrate Packet Forward Middleware #3911

Merged
merged 27 commits into from
Feb 8, 2023

Conversation

nicolaslara
Copy link
Contributor

@nicolaslara nicolaslara commented Jan 3, 2023

What is the purpose of the change

Integrate the packet forward middleware

Brief Changelog

  • Integrated packet forward middleware.
  • Should this be in the changelog?

Testing and Verifying

  • All existing tests that use IBC pass (especially E2E)
  • Should we add an custom E2E test for PFM?

Documentation and Release Note

  • Does this pull request introduce a new feature or user-facing behavior changes? (yes )
  • Is a relevant changelog entry added to the Unreleased section in CHANGELOG.md? (no)
  • How is the feature or change documented? (not applicable )

@github-actions github-actions bot added the C:app-wiring Changes to the app folder label Jan 3, 2023
@nicolaslara nicolaslara added the V:state/breaking State machine breaking PR label Jan 3, 2023
@github-actions
Copy link
Contributor

This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed if no further activity occurs. Thank you!

@github-actions github-actions bot added the Stale label Jan 19, 2023
@nicolaslara nicolaslara removed the Stale label Jan 23, 2023
@nicolaslara nicolaslara marked this pull request as ready for review January 24, 2023 10:31
appKeepers.GetSubspace(packetforwardtypes.ModuleName),
appKeepers.TransferKeeper,
appKeepers.IBCKeeper.ChannelKeeper,
appKeepers.DistrKeeper,
Copy link
Member

Choose a reason for hiding this comment

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

Uhh, why does it need this? Community pool?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, the fee can be configured via a param as a percentage of the send and it funds the community pool.

Ideally this should go to stakers IMO, but the fee defaults to 0, so we can change that later

Copy link
Member

@ValarDragon ValarDragon Jan 29, 2023

Choose a reason for hiding this comment

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

RIP, this is bad module design imo, should be a middleware responsibility. (Fee at the base transport layer bad design)

Copy link

Choose a reason for hiding this comment

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

Can you please expand on this @ValarDragon ? Would love to understand your perspective so we can improve it. I'm not sure what you mean, as this is the keeper for the IBC middleware.

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 see why your transport layer for packet sending should have bips of fee bundled in at default. This is equivalent in design practice to saying our API for bank sends should take in a fee parameter as well, and have bips of all sends be captured.

You could in principle want this, but this can be pushed to wrappers of the main object, rather than being the main thing you import. (I'd prefer no capability of this in what we import, than having such a parameter forced)

Copy link
Member

Choose a reason for hiding this comment

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

(NOTE: This is very minor on the overall work going into this. Awesome job on the module! And I think my first comment "bad module design imo" was too harsh for the severity of opinion actually held)

tests/e2e/e2e_test.go Outdated Show resolved Hide resolved
tests/e2e/e2e_test.go Outdated Show resolved Hide resolved
@nicolaslara
Copy link
Contributor Author

@ValarDragon Updated to the newer version of PFM which solves the json encoding issue we discussed. This should be ready for re-review/merge

Comment on lines 429 to 431
count := response["count"].(float64)
// check if denom contains "uosmo"
return err == nil && count == 0
Copy link
Member

@ValarDragon ValarDragon Feb 6, 2023

Choose a reason for hiding this comment

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

We need to handle this TODO right? IMO we should ensure exact osmo amount received, in order to be certain that our default post-upgrade parameter has no fee taken.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think that comment is a leftover from previous code. The balance check is done above (line419) but it's not checking the denom, just the amount. I'll add the denom check.

@ValarDragon
Copy link
Member

Needs changelog pre-merge

return false
},
1*time.Minute,
10*time.Millisecond,
Copy link
Member

Choose a reason for hiding this comment

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

I think that CI might be flaky and blocking requests due to retrying this too frequently. I've run into similar issues before where AFAIR increasing this number helped.

I looked into the node logs: https://github.com/osmosis-labs/osmosis/suites/10828110105/artifacts/545247532 and they seem okay. So I'm guessing it might be some setup problem

Copy link
Contributor Author

@nicolaslara nicolaslara Feb 8, 2023

Choose a reason for hiding this comment

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

Tried increasing it and it didn't help, but somehow it works (locally) after I added the Require() you suggested

tests/e2e/e2e_test.go Outdated Show resolved Hide resolved
@nicolaslara nicolaslara merged commit 9f14694 into main Feb 8, 2023
@nicolaslara nicolaslara deleted the nicolas/packet-forward-middleware branch February 8, 2023 10:01
nicolaslara added a commit that referenced this pull request Feb 9, 2023
* added initial packet forward middleware integration

* gofumpt

* updated go.mod

* correct value

* updating to match upstream

* added params

* gofumpt

* added PFM to upgrades

* go imports

* added e2e test for PFM+wasm hoks

* refactor

* refactored for reusability and added comments

* updated to latest version that allows native json

* removed unnecessary param

* reordering imports after merge

* added denom check

* added changelog

* Update tests/e2e/e2e_test.go

Co-authored-by: Roman <[email protected]>

* requiring the txs to succeed

* fixed e2e tests

---------

Co-authored-by: Roman <[email protected]>
@nicolaslara nicolaslara added V:state/compatible/backport State machine compatible PR, should be backported and removed V:state/breaking State machine breaking PR V:state/compatible/backport State machine compatible PR, should be backported labels Feb 10, 2023
@nicolaslara nicolaslara self-assigned this Feb 10, 2023
@ValarDragon ValarDragon added A:backport/v15.x backport patches to v15.x branch V:state/breaking State machine breaking PR and removed V:state/compatible/backport State machine compatible PR, should be backported labels Feb 10, 2023
mergify bot pushed a commit that referenced this pull request Feb 10, 2023
* added initial packet forward middleware integration

* gofumpt

* updated go.mod

* correct value

* updating to match upstream

* added params

* gofumpt

* added PFM to upgrades

* go imports

* added e2e test for PFM+wasm hoks

* refactor

* refactored for reusability and added comments

* updated to latest version that allows native json

* removed unnecessary param

* reordering imports after merge

* added denom check

* added changelog

* Update tests/e2e/e2e_test.go

Co-authored-by: Roman <[email protected]>

* requiring the txs to succeed

* fixed e2e tests

---------

Co-authored-by: Roman <[email protected]>
(cherry picked from commit 9f14694)

# Conflicts:
#	app/upgrades/v15/constants.go
#	tests/e2e/e2e_test.go
ValarDragon pushed a commit that referenced this pull request Feb 10, 2023
* Integrate Packet Forward Middleware (#3911)

* added initial packet forward middleware integration

* gofumpt

* updated go.mod

* correct value

* updating to match upstream

* added params

* gofumpt

* added PFM to upgrades

* go imports

* added e2e test for PFM+wasm hoks

* refactor

* refactored for reusability and added comments

* updated to latest version that allows native json

* removed unnecessary param

* reordering imports after merge

* added denom check

* added changelog

* Update tests/e2e/e2e_test.go

Co-authored-by: Roman <[email protected]>

* requiring the txs to succeed

* fixed e2e tests

---------

Co-authored-by: Roman <[email protected]>

* removed CL test

---------

Co-authored-by: Roman <[email protected]>
@github-actions github-actions bot mentioned this pull request May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:backport/v15.x backport patches to v15.x branch C:app-wiring Changes to the app folder V:state/breaking State machine breaking PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants