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

Set mixer contract config in genesis #395

Merged
merged 11 commits into from Jun 16, 2022
Merged

Set mixer contract config in genesis #395

merged 11 commits into from Jun 16, 2022

Conversation

alpe
Copy link
Contributor

@alpe alpe commented Jun 15, 2022

Follow up on #386

Note to reviewer: tests do fail with my second commit. The sigmoid valued used in tests and config before were not equal.
I need help to adjust them to the expected values

Reverted the changes to the test after discussing with @maurolacy

@alpe alpe requested a review from ethanfrey June 15, 2022 10:18

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `sigmoid` | [MixerContractConfig.Sigmoid](#confio.poe.v1beta1.MixerContractConfig.Sigmoid) | | Sigmoid returns a sigmoid-like value of staked amount times engagement points. See the Proof-of-Engagement white-paper for details. |
Copy link
Member

Choose a reason for hiding this comment

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

I would like to support the other variants as well. I can define these on a branch off of this.

Copy link
Member

Choose a reason for hiding this comment

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

I will do that later, please merge without that. It is not required yet

@alpe alpe marked this pull request as ready for review June 16, 2022 10:30
// https://github.com/confio/poe-contracts/tree/main/contracts/tg4-mixer
message MixerContractConfig {
message Sigmoid {
uint64 max_rewards = 1;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note here and others: this is going to be renamed to max_points for PoE contracts v0.11.0

Copy link
Contributor

@pinosu pinosu left a comment

Choose a reason for hiding this comment

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

lgtm 👍

Copy link
Member

@ethanfrey ethanfrey left a comment

Choose a reason for hiding this comment

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

Let's get this in. I played with the values a bit. If tests pass, then let's merge these as good basis for others. I can add other equations later.


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `sigmoid` | [MixerContractConfig.Sigmoid](#confio.poe.v1beta1.MixerContractConfig.Sigmoid) | | Sigmoid returns a sigmoid-like value of staked amount times engagement points. See the Proof-of-Engagement white-paper for details. |
Copy link
Member

Choose a reason for hiding this comment

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

I will do that later, please merge without that. It is not required yet

MixerContractConfig: &MixerContractConfig{
Sigmoid: MixerContractConfig_Sigmoid{
MaxRewards: 1000,
P: sdk.MustNewDecFromStr("0.62"),
Copy link
Member

Choose a reason for hiding this comment

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

I picked new values from my model. Let's try with these and see how simulations work.

@ethanfrey
Copy link
Member

I left a low-priority follow up issue here: #399
And adjusted the parameters to provide desired results.

This is good to go for mainnet. We can extend later, especially if a new network will use this implementation.

@codecov-commenter
Copy link

Codecov Report

Merging #395 (782c4e9) into main (8a6618d) will increase coverage by 0.14%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #395      +/-   ##
==========================================
+ Coverage   57.43%   57.57%   +0.14%     
==========================================
  Files          73       73              
  Lines        5544     5563      +19     
==========================================
+ Hits         3184     3203      +19     
  Misses       2043     2043              
  Partials      317      317              
Impacted Files Coverage Δ
x/poe/bootstrap.go 64.56% <100.00%> (ø)
x/poe/types/genesis.go 94.37% <100.00%> (+0.37%) ⬆️

@ethanfrey ethanfrey merged commit d8967b8 into main Jun 16, 2022
@ethanfrey ethanfrey deleted the sigmoid branch June 16, 2022 20:09
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.

None yet

4 participants