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

refactor: remove the ability to take a fee for each forwarded packet #202

Merged
merged 4 commits into from
Jul 23, 2024

Conversation

jtieri
Copy link
Member

@jtieri jtieri commented Jul 23, 2024

Previously the PFM had a parameter that was used to take a percentage of each transfer that was forward through it, which would then be sent to the community pool. After many years of being used on many chains we found that absolutely no one was utilizing this feature and that it likely didn't make sense in the context of how PFM was actually used out in the wild. Rather than trying to maintain this feature we decided that we would just remove this functionality from the PFM all together.

@github-actions github-actions bot added the packet-forward-middleware Label for items related to the packet forward middleware label Jul 23, 2024
@jtieri jtieri added the BACKPORT Backport into maintained branches label Jul 23, 2024
@jtieri jtieri requested review from agouin and Reecepbcups and removed request for agouin July 23, 2024 21:39
@@ -363,74 +363,6 @@ func TestOnRecvPacket_ForwardAmountInt256(t *testing.T) {
require.NoError(t, err)
}

func TestOnRecvPacket_ForwardWithFee(t *testing.T) {
Copy link
Member

@Reecepbcups Reecepbcups Jul 23, 2024

Choose a reason for hiding this comment

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

We no longer forward w/ fee. Already unit test without fee (TestOnRecvPacket_ForwardNoFee). So removal is safe given refactor changes.

Reason for this unit test failure in previous state: testCoin with 100 would have been successful (since no more 10% fee, which is why it was 90 testCoin). Since Distr removal, it expected 90 but got 100.

@Reecepbcups Reecepbcups marked this pull request as ready for review July 23, 2024 23:40
@Reecepbcups Reecepbcups merged commit 26d8080 into main Jul 23, 2024
11 checks passed
@Reecepbcups Reecepbcups deleted the justin/rm-params branch July 23, 2024 23:41
mergify bot pushed a commit that referenced this pull request Jul 23, 2024
…202)

* refactor: remove the ability to take a fee that is sent to the community pool

* fix: mocks

* fix: remove WithFee unit test (no longer used due to fee refactor)

* fix(e2e): upgrade test

---------

Co-authored-by: Reece Williams <[email protected]>
(cherry picked from commit 26d8080)

# Conflicts:
#	middleware/packet-forward-middleware/Makefile
#	middleware/packet-forward-middleware/e2e/forward_timeout_test.go
#	middleware/packet-forward-middleware/e2e/upgrade_test.go
#	middleware/packet-forward-middleware/go.mod
#	middleware/packet-forward-middleware/packetforward/client/cli/cli.go
#	middleware/packet-forward-middleware/packetforward/keeper/genesis.go
#	middleware/packet-forward-middleware/packetforward/keeper/grpc_query.go
#	middleware/packet-forward-middleware/packetforward/keeper/keeper.go
#	middleware/packet-forward-middleware/packetforward/keeper/params.go
#	middleware/packet-forward-middleware/packetforward/module.go
#	middleware/packet-forward-middleware/packetforward/module_test.go
#	middleware/packet-forward-middleware/packetforward/types/codec.go
#	middleware/packet-forward-middleware/packetforward/types/expected_keepers.go
#	middleware/packet-forward-middleware/packetforward/types/genesis.pb.go
#	middleware/packet-forward-middleware/packetforward/types/params.go
#	middleware/packet-forward-middleware/packetforward/types/query.pb.go
#	middleware/packet-forward-middleware/packetforward/types/query.pb.gw.go
#	middleware/packet-forward-middleware/proto/packetforward/v1/genesis.proto
#	middleware/packet-forward-middleware/proto/packetforward/v1/query.proto
#	middleware/packet-forward-middleware/test/mock/bank_keeper.go
#	middleware/packet-forward-middleware/test/mock/channel_keeper.go
#	middleware/packet-forward-middleware/test/mock/distribution_keeper.go
#	middleware/packet-forward-middleware/test/mock/ibc_module.go
#	middleware/packet-forward-middleware/test/mock/ics4_wrapper.go
#	middleware/packet-forward-middleware/test/mock/transfer_keeper.go
#	middleware/packet-forward-middleware/test/setup.go
#	middleware/packet-forward-middleware/testing/simapp/app.go
#	middleware/packet-forward-middleware/testing/simapp/upgrades/upgrades.go
mergify bot pushed a commit that referenced this pull request Jul 23, 2024
…202)

* refactor: remove the ability to take a fee that is sent to the community pool

* fix: mocks

* fix: remove WithFee unit test (no longer used due to fee refactor)

* fix(e2e): upgrade test

---------

Co-authored-by: Reece Williams <[email protected]>
(cherry picked from commit 26d8080)

# Conflicts:
#	middleware/packet-forward-middleware/e2e/forward_timeout_test.go
#	middleware/packet-forward-middleware/e2e/upgrade_test.go
#	middleware/packet-forward-middleware/go.mod
#	middleware/packet-forward-middleware/packetforward/client/cli/cli.go
#	middleware/packet-forward-middleware/packetforward/keeper/genesis.go
#	middleware/packet-forward-middleware/packetforward/keeper/grpc_query.go
#	middleware/packet-forward-middleware/packetforward/keeper/keeper.go
#	middleware/packet-forward-middleware/packetforward/keeper/params.go
#	middleware/packet-forward-middleware/packetforward/module.go
#	middleware/packet-forward-middleware/packetforward/module_test.go
#	middleware/packet-forward-middleware/packetforward/types/codec.go
#	middleware/packet-forward-middleware/packetforward/types/expected_keepers.go
#	middleware/packet-forward-middleware/packetforward/types/genesis.pb.go
#	middleware/packet-forward-middleware/packetforward/types/params.go
#	middleware/packet-forward-middleware/packetforward/types/query.pb.go
#	middleware/packet-forward-middleware/packetforward/types/query.pb.gw.go
#	middleware/packet-forward-middleware/proto/packetforward/v1/genesis.proto
#	middleware/packet-forward-middleware/proto/packetforward/v1/query.proto
#	middleware/packet-forward-middleware/test/mock/bank_keeper.go
#	middleware/packet-forward-middleware/test/mock/channel_keeper.go
#	middleware/packet-forward-middleware/test/mock/distribution_keeper.go
#	middleware/packet-forward-middleware/test/mock/ibc_module.go
#	middleware/packet-forward-middleware/test/mock/ics4_wrapper.go
#	middleware/packet-forward-middleware/test/mock/transfer_keeper.go
#	middleware/packet-forward-middleware/test/setup.go
#	middleware/packet-forward-middleware/testing/simapp/app.go
#	middleware/packet-forward-middleware/testing/simapp/upgrades/upgrades.go
mergify bot pushed a commit that referenced this pull request Jul 23, 2024
…202)

* refactor: remove the ability to take a fee that is sent to the community pool

* fix: mocks

* fix: remove WithFee unit test (no longer used due to fee refactor)

* fix(e2e): upgrade test

---------

Co-authored-by: Reece Williams <[email protected]>
(cherry picked from commit 26d8080)

# Conflicts:
#	middleware/packet-forward-middleware/e2e/upgrade_test.go
#	middleware/packet-forward-middleware/go.mod
#	middleware/packet-forward-middleware/packetforward/client/cli/cli.go
#	middleware/packet-forward-middleware/packetforward/keeper/genesis.go
#	middleware/packet-forward-middleware/packetforward/keeper/grpc_query.go
#	middleware/packet-forward-middleware/packetforward/keeper/keeper.go
#	middleware/packet-forward-middleware/packetforward/keeper/params.go
#	middleware/packet-forward-middleware/packetforward/module.go
#	middleware/packet-forward-middleware/packetforward/module_test.go
#	middleware/packet-forward-middleware/packetforward/types/codec.go
#	middleware/packet-forward-middleware/packetforward/types/expected_keepers.go
#	middleware/packet-forward-middleware/packetforward/types/genesis.pb.go
#	middleware/packet-forward-middleware/packetforward/types/params.go
#	middleware/packet-forward-middleware/packetforward/types/query.pb.go
#	middleware/packet-forward-middleware/packetforward/types/query.pb.gw.go
#	middleware/packet-forward-middleware/proto/packetforward/v1/genesis.proto
#	middleware/packet-forward-middleware/proto/packetforward/v1/query.proto
#	middleware/packet-forward-middleware/test/mock/bank_keeper.go
#	middleware/packet-forward-middleware/test/mock/channel_keeper.go
#	middleware/packet-forward-middleware/test/mock/distribution_keeper.go
#	middleware/packet-forward-middleware/test/mock/ibc_module.go
#	middleware/packet-forward-middleware/test/mock/ics4_wrapper.go
#	middleware/packet-forward-middleware/test/mock/transfer_keeper.go
#	middleware/packet-forward-middleware/test/setup.go
#	middleware/packet-forward-middleware/testing/simapp/app.go
#	middleware/packet-forward-middleware/testing/simapp/upgrades/upgrades.go
mergify bot added a commit that referenced this pull request Aug 6, 2024
… for each forwarded packet (#206)

* refactor: remove the ability to take a fee for each forwarded packet (#202)

* refactor: remove the ability to take a fee that is sent to the community pool

* fix: mocks

* fix: remove WithFee unit test (no longer used due to fee refactor)

* fix(e2e): upgrade test

---------

Co-authored-by: Reece Williams <[email protected]>
(cherry picked from commit 26d8080)

# Conflicts:
#	middleware/packet-forward-middleware/e2e/upgrade_test.go
#	middleware/packet-forward-middleware/go.mod
#	middleware/packet-forward-middleware/packetforward/client/cli/cli.go
#	middleware/packet-forward-middleware/packetforward/keeper/genesis.go
#	middleware/packet-forward-middleware/packetforward/keeper/grpc_query.go
#	middleware/packet-forward-middleware/packetforward/keeper/keeper.go
#	middleware/packet-forward-middleware/packetforward/keeper/params.go
#	middleware/packet-forward-middleware/packetforward/module.go
#	middleware/packet-forward-middleware/packetforward/module_test.go
#	middleware/packet-forward-middleware/packetforward/types/codec.go
#	middleware/packet-forward-middleware/packetforward/types/expected_keepers.go
#	middleware/packet-forward-middleware/packetforward/types/genesis.pb.go
#	middleware/packet-forward-middleware/packetforward/types/params.go
#	middleware/packet-forward-middleware/packetforward/types/query.pb.go
#	middleware/packet-forward-middleware/packetforward/types/query.pb.gw.go
#	middleware/packet-forward-middleware/proto/packetforward/v1/genesis.proto
#	middleware/packet-forward-middleware/proto/packetforward/v1/query.proto
#	middleware/packet-forward-middleware/test/mock/bank_keeper.go
#	middleware/packet-forward-middleware/test/mock/channel_keeper.go
#	middleware/packet-forward-middleware/test/mock/distribution_keeper.go
#	middleware/packet-forward-middleware/test/mock/ibc_module.go
#	middleware/packet-forward-middleware/test/mock/ics4_wrapper.go
#	middleware/packet-forward-middleware/test/mock/transfer_keeper.go
#	middleware/packet-forward-middleware/test/setup.go
#	middleware/packet-forward-middleware/testing/simapp/app.go
#	middleware/packet-forward-middleware/testing/simapp/upgrades/upgrades.go

* refactor: backport changes to remove the ability to take a fee that is sent to the community pool

* chore: fix linter errors

---------

Co-authored-by: Justin Tieri <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BACKPORT Backport into maintained branches packet-forward-middleware Label for items related to the packet forward middleware
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants