pokt-network / pocket-core

Official implementation of the Pocket Network Protocol
http://www.pokt.network
MIT License
210 stars 103 forks source link

[v0.11 feature] Per-chain Relays To Token Multiplier #1580

Closed msmania closed 9 months ago

msmania commented 1 year ago

Description

This patch introduces a new network parameter pos/RelaysToTokensMultiplierMap so that we can set a custom RTTM per chain. The existing parameter pos/RelaysToTokensMultiplier serves the default RTTM if a custom RTTM is not set.

This change is consensus-breaking. The new behavior is put behind a new feature key RTTM2. The new parameter is kept unavailable until activation.

The patch also contains two tests:

Summary generated by Reviewpad on 07 Sep 23 00:52 UTC

This pull request contains the following changes:

  1. The addition of a new test function called TestKeeper_RewardForRelaysPerChain. This test function verifies the rewards generated for different scenarios related to relays per chain.

  2. Modifications to the file "expectedKeepers.go" were made. A new function called "RewardForRelaysPerChain" was added, which calculates and returns a value of type sdk.BigInt.

  3. Changes were made to the file "module.go" related to activating additional parameters and setting a minimum signed per window value.

  4. The file "keeper_test.go" includes the addition of a new test function called "Test_RTTM2_ChangeParamValue", which tests the change of a parameter value after a certain activation height.

  5. A new file "proof.go" was modified to enhance the functionality and reliability of the ExecuteProof function in handling relay proofs.

  6. The file "param.go" now includes additional tracking of parameters introduced after genesis and skips writing them to the database until the corresponding feature activation height is reached.

  7. The file "nodes.go" includes changes to the AwardCoinsForRelays function, enabling it to award coins for relays completed per chain.

  8. Modifications were made to the PosKeeper interface in the file "expectedKeepers.go", adding a new function called RewardForRelaysPerChain.

  9. The file "service_test.go" includes changes to the RewardForRelays method in the MockPosKeeper struct, allowing coins to be awarded for relays completed per chain.

  10. The file "abci.go" in the x/nodes/keeper package includes import statement additions and changes to variable names.

  11. The go.sum file shows updates to dependencies related to the "github.com/pokt-network/tendermint" package.

These changes enhance functionality, introduce new features, and improve reliability in various parts of the codebase.

POKT-Discourse commented 1 year ago

This pull request has been mentioned on Pocket Network Forum. There might be relevant details there:

https://forum.pokt.network/t/unleashing-the-potential-of-pocket/4720/1

POKT-Discourse commented 11 months ago

This pull request has been mentioned on Pocket Network Forum. There might be relevant details there:

https://forum.pokt.network/t/unleashing-the-potential-of-pocket-as-universal-rpc-provider/4797/1

Olshansk commented 9 months ago

@msmania Ty for linking to the commit messages. I don't want this to become a "developer workflow" discussion since I know everyone has opinions/preferences on how to use git, github, IDEs, etc.

I'm sharing mine below not in expectation of others adopting it, but just so you have context/visibility into how I work and I will accommodate your workflow as well.

  1. I read the GitHub PR description
  2. I go through all the files 1 by 1 (see screenshot below), checking them once I'm done.
  3. I use the "show changes since last review" when I do round 2, 3, etc...
  4. In GitHub land (note: not git), I don't pay attention to commits at all (and don't put effort into my own commits), since we end up doing a squash and merge to main at the end.

Screenshot 2023-12-13 at 4 34 44 PM

Screenshot 2023-12-13 at 4 34 38 PM

msmania commented 9 months ago

Got it. I personally thought one gigantic commit would be hard to be reviewed, or to be analyzed after merge in the future, so I split a patch to several PartX commits, following a convention in the projects I used to work. Anyway, thank you for signing off! Let's merge this!

POKT-Discourse commented 8 months ago

This pull request has been mentioned on Pocket Network Forum. There might be relevant details there:

https://forum.pokt.network/t/rc-0-11-1-upgrade-and-hi/5012/1