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

Cluster of stake pools in integration tests #1734

Merged
merged 27 commits into from
Jun 11, 2020

Conversation

KtorZ
Copy link
Member

@KtorZ KtorZ commented Jun 9, 2020

Issue Number

N/A

Overview

  • de6fec0
    📍 add command-line helpers for generating stake key and certificates

  • 50ae861
    📍 improve error handling and reporting when member of the cluster fail to start
    It's actually nice to be able to tell what's going on. The command-line will likely undergo changes so it's really likely
    that a command that used to work will fail. The previous message was sort of opaque / cryptic. Now we get a better error.

  • 772c813
    📍 fixup add new gen methods

  • bb2b82e
    📍 register stake pool and delegate funds to it using genesis faucets.
    This makes sure that a stake pool joins the cluster only after it has been registered and is ready to process block.

  • e08d5cd
    📍 Drop use of 'withAsync' so pools boot in parallel
    The issue with 'withAsync' is that it's actually synchronous.
    While the underlying action is executed in a thread, 'withAsync' will
    only resolve when the async action is done. Yet, in our case, we want
    all async actions to run in parallel and to be stopped when the test
    suite is completed.

  • de7559f
    📍 make the node a little less verbose regarding forging
    With a slot length of 0.2, blocks are produced at a much faster pace.

  • b2b3c0b
    📍 tweak genesis parameters with sensible values
    A value of '1' for the active slot coefficient makes actually no sense. Only small values of it are
    considered sensible. Tweaking also the decentralization level so that some blocks are deferred to
    registered stake pools

  • adf9dda
    📍 start a cluster of 3 pools when running integration tests

  • aaf7d6d
    📍 show little disclaimer when starting integration tests

  • 2d7ece5
    📍 do not restart the cluster between CLI and API spec
    We have a limited number of faucets, and it takes quite some time now

Comments

With this, we should be able to test all sort of things regarding pools o/

KtorZ added 6 commits June 9, 2020 17:01
…to start

It's actually nice to be able to tell what's going on. The command-line will likely undergo changes so it's really likely
that a command that used to work will fail. The previous message was sort of opaque / cryptic. Now we get a better error.
This makes sure that a stake pool joins the cluster only after it has been registered and is ready to process block.
The issue with 'withAsync' is that it's actually synchronous.
While the underlying action is executed in a thread, 'withAsync' will
only resolve when the async action is done. Yet, in our case, we want
all async actions to run in parallel and to be stopped when the test
suite is completed.
With a slot length of 0.2, blocks are produced at a much faster pace.
@KtorZ KtorZ requested review from Anviking and paweljakubas June 9, 2020 15:39
@KtorZ KtorZ self-assigned this Jun 9, 2020
@@ -104,14 +104,13 @@ spec = do
let networkParams = getFromResponse id r
networkParams `shouldBe`
toApiNetworkParameters (ctx ^. #_networkParameters)
let Right zeroPercent = Quantity <$> mkPercentage 0
let Right zeroPercent = Quantity <$> mkPercentage 75
Copy link
Contributor

Choose a reason for hiding this comment

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

?

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah, why 75?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because the d-parameter is now set to 0.25 (was 1) to allow both the BFT node and pools to produce blocks. We actually report (1 - d) in the API, hence 75% here. We are 75% decentralized in the integration test.

@@ -32,7 +31,8 @@ updateQuorum: 5
maxMajorPV: 25446
initialFunds: {}
maxLovelaceSupply: 45000000000000000
networkMagic: 1
protocolMagicId: 1
networkMagic: 764824073
Copy link
Contributor

Choose a reason for hiding this comment

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

why we need this?

Copy link
Member Author

Choose a reason for hiding this comment

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

While new Shelley addresses uses the new protocolMagic (1), the network still uses the old magic (764824073). This is therefore needed to match the right network configuration of the cluster.

]
pure file

-- | Generate a raw transaction. We kill two birds one stone here by also
Copy link
Contributor

Choose a reason for hiding this comment

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

aha

@KtorZ
Copy link
Member Author

KtorZ commented Jun 10, 2020

bors r+

iohk-bors bot added a commit that referenced this pull request Jun 10, 2020
1734: Cluster of stake pools in integration tests r=KtorZ a=KtorZ

# Issue Number

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

N/A

# Overview

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

- de6fec0
  📍 **add command-line helpers for generating stake key and certificates**
  
- 50ae861
  📍 **improve error handling and reporting when member of the cluster fail to start**
  It's actually nice to be able to tell what's going on. The command-line will likely undergo changes so it's really likely
that a command that used to work will fail. The previous message was sort of opaque / cryptic. Now we get a better error.

- 772c813
  📍 **fixup add new gen methods**
  
- bb2b82e
  📍 **register stake pool and delegate funds to it using genesis faucets.**
  This makes sure that a stake pool joins the cluster only after it has been registered and is ready to process block.

- e08d5cd
  📍 **Drop use of 'withAsync' so pools boot in parallel**
  The issue with 'withAsync' is that it's actually synchronous.
While the underlying action is executed in a thread, 'withAsync' will
only resolve when the async action is done. Yet, in our case, we want
all async actions to run in parallel and to be stopped when the test
suite is completed.

- de7559f
  📍 **make the node a little less verbose regarding forging**
  With a slot length of 0.2, blocks are produced at a much faster pace.

- b2b3c0b
  📍 **tweak genesis parameters with sensible values**
  A value of '1' for the active slot coefficient makes actually no sense. Only small values of it are
considered sensible. Tweaking also the decentralization level so that some blocks are deferred to
registered stake pools

- adf9dda
  📍 **start a cluster of 3 pools when running integration tests**
  
- aaf7d6d
  📍 **show little disclaimer when starting integration tests**
  
- 2d7ece5
  📍 **do not restart the cluster between CLI and API spec**
  We have a limited number of faucets, and it takes quite some time now

# Comments

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

With this, we should be able to test all sort of things regarding pools o/ 

<!-- 
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 <[email protected]>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jun 10, 2020

Build failed

KtorZ added 6 commits June 10, 2020 13:32
A value of '1' for the active slot coefficient makes actually no sense. Only small values of it are
considered sensible. Tweaking also the decentralization level so that some blocks are deferred to
registered stake pools
We have a limited number of faucets, and it takes quite some time now
@KtorZ KtorZ force-pushed the KtorZ/shelley-stake-pool-setup-part-2 branch from 8d615d4 to 2f94a92 Compare June 10, 2020 12:04
@KtorZ
Copy link
Member Author

KtorZ commented Jun 10, 2020

bors r+

iohk-bors bot added a commit that referenced this pull request Jun 10, 2020
1734: Cluster of stake pools in integration tests r=KtorZ a=KtorZ

# Issue Number

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

N/A

# Overview

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

- de6fec0
  📍 **add command-line helpers for generating stake key and certificates**
  
- 50ae861
  📍 **improve error handling and reporting when member of the cluster fail to start**
  It's actually nice to be able to tell what's going on. The command-line will likely undergo changes so it's really likely
that a command that used to work will fail. The previous message was sort of opaque / cryptic. Now we get a better error.

- 772c813
  📍 **fixup add new gen methods**
  
- bb2b82e
  📍 **register stake pool and delegate funds to it using genesis faucets.**
  This makes sure that a stake pool joins the cluster only after it has been registered and is ready to process block.

- e08d5cd
  📍 **Drop use of 'withAsync' so pools boot in parallel**
  The issue with 'withAsync' is that it's actually synchronous.
While the underlying action is executed in a thread, 'withAsync' will
only resolve when the async action is done. Yet, in our case, we want
all async actions to run in parallel and to be stopped when the test
suite is completed.

- de7559f
  📍 **make the node a little less verbose regarding forging**
  With a slot length of 0.2, blocks are produced at a much faster pace.

- b2b3c0b
  📍 **tweak genesis parameters with sensible values**
  A value of '1' for the active slot coefficient makes actually no sense. Only small values of it are
considered sensible. Tweaking also the decentralization level so that some blocks are deferred to
registered stake pools

- adf9dda
  📍 **start a cluster of 3 pools when running integration tests**
  
- aaf7d6d
  📍 **show little disclaimer when starting integration tests**
  
- 2d7ece5
  📍 **do not restart the cluster between CLI and API spec**
  We have a limited number of faucets, and it takes quite some time now

# Comments

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

With this, we should be able to test all sort of things regarding pools o/ 

<!-- 
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 <[email protected]>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jun 10, 2020

Build failed

@KtorZ
Copy link
Member Author

KtorZ commented Jun 10, 2020

bors r+

iohk-bors bot added a commit that referenced this pull request Jun 10, 2020
1734: Cluster of stake pools in integration tests r=KtorZ a=KtorZ

# Issue Number

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

N/A

# Overview

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

- de6fec0
  📍 **add command-line helpers for generating stake key and certificates**
  
- 50ae861
  📍 **improve error handling and reporting when member of the cluster fail to start**
  It's actually nice to be able to tell what's going on. The command-line will likely undergo changes so it's really likely
that a command that used to work will fail. The previous message was sort of opaque / cryptic. Now we get a better error.

- 772c813
  📍 **fixup add new gen methods**
  
- bb2b82e
  📍 **register stake pool and delegate funds to it using genesis faucets.**
  This makes sure that a stake pool joins the cluster only after it has been registered and is ready to process block.

- e08d5cd
  📍 **Drop use of 'withAsync' so pools boot in parallel**
  The issue with 'withAsync' is that it's actually synchronous.
While the underlying action is executed in a thread, 'withAsync' will
only resolve when the async action is done. Yet, in our case, we want
all async actions to run in parallel and to be stopped when the test
suite is completed.

- de7559f
  📍 **make the node a little less verbose regarding forging**
  With a slot length of 0.2, blocks are produced at a much faster pace.

- b2b3c0b
  📍 **tweak genesis parameters with sensible values**
  A value of '1' for the active slot coefficient makes actually no sense. Only small values of it are
considered sensible. Tweaking also the decentralization level so that some blocks are deferred to
registered stake pools

- adf9dda
  📍 **start a cluster of 3 pools when running integration tests**
  
- aaf7d6d
  📍 **show little disclaimer when starting integration tests**
  
- 2d7ece5
  📍 **do not restart the cluster between CLI and API spec**
  We have a limited number of faucets, and it takes quite some time now

# Comments

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

With this, we should be able to test all sort of things regarding pools o/ 

<!-- 
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 <[email protected]>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jun 10, 2020

Build failed

This prevents some race-condition where pools would start making queries but being not fully started _yet_.
@KtorZ KtorZ force-pushed the KtorZ/shelley-stake-pool-setup-part-2 branch from 064e6ac to 2f1c24e Compare June 10, 2020 15:52
@KtorZ
Copy link
Member Author

KtorZ commented Jun 10, 2020

bors r+

iohk-bors bot added a commit that referenced this pull request Jun 10, 2020
1734: Cluster of stake pools in integration tests r=KtorZ a=KtorZ

# Issue Number

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

N/A

# Overview

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

- de6fec0
  📍 **add command-line helpers for generating stake key and certificates**
  
- 50ae861
  📍 **improve error handling and reporting when member of the cluster fail to start**
  It's actually nice to be able to tell what's going on. The command-line will likely undergo changes so it's really likely
that a command that used to work will fail. The previous message was sort of opaque / cryptic. Now we get a better error.

- 772c813
  📍 **fixup add new gen methods**
  
- bb2b82e
  📍 **register stake pool and delegate funds to it using genesis faucets.**
  This makes sure that a stake pool joins the cluster only after it has been registered and is ready to process block.

- e08d5cd
  📍 **Drop use of 'withAsync' so pools boot in parallel**
  The issue with 'withAsync' is that it's actually synchronous.
While the underlying action is executed in a thread, 'withAsync' will
only resolve when the async action is done. Yet, in our case, we want
all async actions to run in parallel and to be stopped when the test
suite is completed.

- de7559f
  📍 **make the node a little less verbose regarding forging**
  With a slot length of 0.2, blocks are produced at a much faster pace.

- b2b3c0b
  📍 **tweak genesis parameters with sensible values**
  A value of '1' for the active slot coefficient makes actually no sense. Only small values of it are
considered sensible. Tweaking also the decentralization level so that some blocks are deferred to
registered stake pools

- adf9dda
  📍 **start a cluster of 3 pools when running integration tests**
  
- aaf7d6d
  📍 **show little disclaimer when starting integration tests**
  
- 2d7ece5
  📍 **do not restart the cluster between CLI and API spec**
  We have a limited number of faucets, and it takes quite some time now

# Comments

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

With this, we should be able to test all sort of things regarding pools o/ 

<!-- 
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 <[email protected]>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jun 10, 2020

Build failed

@KtorZ
Copy link
Member Author

KtorZ commented Jun 10, 2020

bors try

iohk-bors bot added a commit that referenced this pull request Jun 10, 2020
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jun 10, 2020

try

Build failed

@rvl
Copy link
Contributor

rvl commented Jun 11, 2020

bors try

iohk-bors bot added a commit that referenced this pull request Jun 11, 2020
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jun 11, 2020

try

Build failed

rvl and others added 3 commits June 11, 2020 20:10
It now makes a single payment with many outputs, instead of many payments with a single output.
This is to cope with the absence of transaction scheduler in the wallet at the moment where
pending outgoing transaction aren't automatically re-submitted after rollback.
@KtorZ
Copy link
Member Author

KtorZ commented Jun 11, 2020

bors r+

@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jun 11, 2020

Build succeeded

@iohk-bors iohk-bors bot merged commit 4cd2ce6 into master Jun 11, 2020
@iohk-bors iohk-bors bot deleted the KtorZ/shelley-stake-pool-setup-part-2 branch June 11, 2020 13:18
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.

3 participants