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

Account for "active slot coefficient" in apparent performance calculation #1189

Merged
merged 4 commits into from
Dec 16, 2019

Conversation

KtorZ
Copy link
Member

@KtorZ KtorZ commented Dec 16, 2019

Issue Number

#1188

Overview

  • commit 84c49e4
    Move 'BlockchainParameters' from Primitive.Model -> Primitive.Types

    1. No reasons it's define in the Model rather than the types (although we should really break this gigantic .Types into smaller pieces)
    2. Without this, finding a good home for 'ActiveSlotCoefficient' would have been awkward
  • commit 3eb5896
    add 'ActiveSlotCoefficient' to blockchain parameters

  • commit 7c7dd0a
    Add extra unit test to pools perf illustrating the influence of f
    Currently fails, as expected:

    1) Cardano.Pool.Metrics.calculatePerformances, golden test cases, 100% stake, coeff=0.1, producing 1/10 blocks => p=1.0
         expected: Just 1.0
          but got: Just 0.1
    
  • commit cb780de
    take 'active slot coefficient' into account in the apparent performance calculation

Comments

TOP 10 Pools on Nightly
[
    {
        "apparent_performance": 1,
        "metadata": { "ticker": "IOHK2" },
        "id": "05663389504cd649fdd6cfc406c31872c32399ae6721642245f76946e55bb1fe"
    },
    {
        "apparent_performance": 1,
        "metadata": { "ticker": "FRGL" },
        "id": "1171304154a20bd28cae430c7e9c915e5bdc1eec69893dc69d7267be7197ae21"
    },
    {
        "apparent_performance": 1,
        "metadata": { "ticker": "IOHK3" },
        "id": "26c1deb80f2e041fe5a6d67d3f4c4b27dde24ea532a11633ec0d6cfc14a880f7"
    },
    {
        "apparent_performance": 1,
        "metadata": { "ticker": "RELY" },
        "id": "27793e62100b6fefbbc4ea54af4bfb24454eb7c5e04b5e3ebe191ba0db8efd55"
    },
    {
        "apparent_performance": 1,
        "id": "3f096d23d43efaa13ec6d903304e23a2ef552cc460d39cdb1cafa233bc5394ef"
    },
    {
        "apparent_performance": 1,
        "metadata": { "ticker": "HEL" },
        "id": "46221fb809db63e408ce1751196705a88af6e27ccac1acb92b8b705dfbfceb6a"
    },
    {
        "apparent_performance": 1,
        "metadata": { "ticker": "COOL" },
        "id": "7062afd7fd83c372fc65438c302f3db23bd3404edc043e4806ec3ba6a486be3b"
    },
    {
        "apparent_performance": 1,
        "id": "8819ca23c3ac6865d6578350de0bcb072e797519410b923d18f56b61370d93ff"
    },
    {
        "apparent_performance": 1,
        "metadata": { "ticker": "JBREW" },
        "id": "8ca014edc250a888645dacf3e7803d9bf217148d2534e80ee99257479a074aa2"
    },
    {
        "apparent_performance": 1,
        "metadata": { "ticker": "247" },
        "id": "9d16d5dfb84296c54868050e0e9f3130632d9a3fe2aa4febd65cb5235a84557e"
    }
]
All pools performances seen on nightly
0
0.11336765496849342
0.17989919600079335
0.20586241451124396
0.3139972298831227
0.3583264647256367
0.5
0.5451975737056386
0.7106819593189653
0.7227635377048117
0.8973330307767313
0.9052103033417835
0.9480349364235434
0.9507090156555771
0.9583850034019517
0.9816576385996468
1

1. No reasons it's define in the Model rather than the types (although we should really break this gigantic .Types into smaller pieces)
2. Without this, finding a good home for 'ActiveSlotCoefficient' would have been awkward
Current fails, as expected:

1) Cardano.Pool.Metrics.calculatePerformances, golden test cases, 100% stake, coeff=0.1, producing 1/10 blocks => p=1.0
     expected: Just 1.0
      but got: Just 0.1
@KtorZ KtorZ self-assigned this Dec 16, 2019
@KtorZ KtorZ requested a review from Anviking December 16, 2019 10:34
@KtorZ
Copy link
Member Author

KtorZ commented Dec 16, 2019

bors try

iohk-bors bot added a commit that referenced this pull request Dec 16, 2019
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Dec 16, 2019

try

Build succeeded

Copy link
Member

@Anviking Anviking left a comment

Choose a reason for hiding this comment

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

lgtm

bors r+

iohk-bors bot added a commit that referenced this pull request Dec 16, 2019
1189: Account for "active slot coefficient" in apparent performance calculation r=Anviking a=KtorZ

# Issue Number

<!-- Put here a reference to the issue this PR relates to and which requirements it tackles -->

#1188 

# Overview

<!-- Detail in a few bullet points the work accomplished in this PR -->

- commit 84c49e4
    Move 'BlockchainParameters' from Primitive.Model -> Primitive.Types
    
    1. No reasons it's define in the Model rather than the types (although we should really break this gigantic .Types into smaller pieces)
    2. Without this, finding a good home for 'ActiveSlotCoefficient' would have been awkward

- commit 3eb5896
    add 'ActiveSlotCoefficient' to blockchain parameters

- commit 7c7dd0a
    Add extra unit test to pools perf illustrating the influence of f
    Currently fails, as expected:
    ```
    1) Cardano.Pool.Metrics.calculatePerformances, golden test cases, 100% stake, coeff=0.1, producing 1/10 blocks => p=1.0
         expected: Just 1.0
          but got: Just 0.1
    ```

- commit cb780de
    take 'active slot coefficient' into account in the apparent performance calculation


# Comments

<!-- Additional comments or screenshots to attach if any -->

<details><summary>TOP 10 Pools on Nightly</summary>

```json
[
    {
        "apparent_performance": 1,
        "metadata": { "ticker": "IOHK2" },
        "id": "05663389504cd649fdd6cfc406c31872c32399ae6721642245f76946e55bb1fe"
    },
    {
        "apparent_performance": 1,
        "metadata": { "ticker": "FRGL" },
        "id": "1171304154a20bd28cae430c7e9c915e5bdc1eec69893dc69d7267be7197ae21"
    },
    {
        "apparent_performance": 1,
        "metadata": { "ticker": "IOHK3" },
        "id": "26c1deb80f2e041fe5a6d67d3f4c4b27dde24ea532a11633ec0d6cfc14a880f7"
    },
    {
        "apparent_performance": 1,
        "metadata": { "ticker": "RELY" },
        "id": "27793e62100b6fefbbc4ea54af4bfb24454eb7c5e04b5e3ebe191ba0db8efd55"
    },
    {
        "apparent_performance": 1,
        "id": "3f096d23d43efaa13ec6d903304e23a2ef552cc460d39cdb1cafa233bc5394ef"
    },
    {
        "apparent_performance": 1,
        "metadata": { "ticker": "HEL" },
        "id": "46221fb809db63e408ce1751196705a88af6e27ccac1acb92b8b705dfbfceb6a"
    },
    {
        "apparent_performance": 1,
        "metadata": { "ticker": "COOL" },
        "id": "7062afd7fd83c372fc65438c302f3db23bd3404edc043e4806ec3ba6a486be3b"
    },
    {
        "apparent_performance": 1,
        "id": "8819ca23c3ac6865d6578350de0bcb072e797519410b923d18f56b61370d93ff"
    },
    {
        "apparent_performance": 1,
        "metadata": { "ticker": "JBREW" },
        "id": "8ca014edc250a888645dacf3e7803d9bf217148d2534e80ee99257479a074aa2"
    },
    {
        "apparent_performance": 1,
        "metadata": { "ticker": "247" },
        "id": "9d16d5dfb84296c54868050e0e9f3130632d9a3fe2aa4febd65cb5235a84557e"
    }
]
```
</details>

<details><summary>All pools performances seen on nightly</summary>

```
0
0.11336765496849342
0.17989919600079335
0.20586241451124396
0.3139972298831227
0.3583264647256367
0.5
0.5451975737056386
0.7106819593189653
0.7227635377048117
0.8973330307767313
0.9052103033417835
0.9480349364235434
0.9507090156555771
0.9583850034019517
0.9816576385996468
1
```
</details>

<!-- 
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Once created, link this PR to its corresponding ticket
 ✓ Assign the PR to a corresponding milestone
 ✓ Acknowledge any changes required to the Wiki
-->


Co-authored-by: KtorZ <matthias.benkort@gmail.com>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Dec 16, 2019

Build succeeded

@iohk-bors iohk-bors bot merged commit cb780de into master Dec 16, 2019
@KtorZ KtorZ deleted the KtorZ/active-slot-coeff branch December 30, 2019 15:42
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.

2 participants