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

feat: multi-network ci #6162

Merged
merged 2 commits into from
Feb 26, 2024
Merged

feat: multi-network ci #6162

merged 2 commits into from
Feb 26, 2024

Conversation

CjS77
Copy link
Collaborator

@CjS77 CjS77 commented Feb 21, 2024

When formally implementing compiler features, the setting of the TARI_NETWORK and (from now) TARI_TARGET_NETWORK envar and the related compiler flags matter.

These changes require that when tests run, the correct network flags are set.

For example, blocks::genesis_block::test::stagenet_genesis_sanity_check should only run when TARI_NETWORK=stagenet.

The current setup reveals a problem:
There is not a 1:1 mapping between the build target and the actual network the binary may run on. E.g. the mainnet build can run on either stagenet or mainnet.

Unfortunately the TARI_NETWORK envar was used to set both of these variables.

Since these are 2 different things, this commit introduced TARI_TARGET_NETWORK which sets the build target. In most contexts, this then decouples the configured network, which is specified by the TARI_NETWORK envar as usual.

The other changes in this commit revolve around updating merkle roots and the correct faucet sets to make the target/network/faucet combination consistent.

The CI is configured to run tests for each of {target} ({network})

  • Testnet (Esme)
  • Nextnet (Nextnet)
  • Mainnet (Stagenet)

Description

This replaces part of #6131

Breaking Changes

  • None
  • Requires data directory on base node to be deleted
  • Requires hard fork
  • Other - Please specify

When formally implementing compiler features, the setting of the `TARI_NETWORK`
and (from now) `TARI_TARGET_NETWORK` envar and the related compiler flags matter.

These changes require that when tests run, the correct network flags are set.

For example, `blocks::genesis_block::test::stagenet_genesis_sanity_check` should
only run when `TARI_NETWORK=stagenet`.

The current setup reveals a problem:
There is not a 1:1 mapping between the build _target_ and the actual
network the binary may run on. E.g. the mainnet build can run on either
stagenet or mainnet.

Unfortunately the `TARI_NETWORK` envar was used to set both of these
variables.

Since these are 2 different things, this commit introduced
`TARI_TARGET_NETWORK` which sets the **build target**. In most contexts,
this then decouples the configured network, which is specified by the
`TARI_NETWORK` envar  as usual.

The other changes in this commit revolve around updating merkle roots
and the correct faucet sets to make the target/network/faucet
combination consistent.

The CI is configured to run tests for each of `{target} ({network})`
* Testnet (Esme)
* Nextnet (Nextnet)
* Mainnet (Stagenet)
@CjS77 CjS77 requested review from a team as code owners February 21, 2024 12:10
@ghpbot-tari-project ghpbot-tari-project added P-acks_required Process - Requires more ACKs or utACKs P-reviews_required Process - Requires a review from a lead maintainer to be merged labels Feb 21, 2024
@CjS77 CjS77 mentioned this pull request Feb 21, 2024
Copy link

github-actions bot commented Feb 21, 2024

Test Results (CI)

    3 files    117 suites   37m 32s ⏱️
1 260 tests 1 260 ✅ 0 💤 0 ❌
3 772 runs  3 772 ✅ 0 💤 0 ❌

Results for commit 1b1ba8b.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Feb 21, 2024

Test Results (Integration tests)

29 tests  +29   29 ✅ +29   12m 30s ⏱️ + 12m 30s
11 suites +11    0 💤 ± 0 
 2 files   + 2    0 ❌ ± 0 

Results for commit 1b1ba8b. ± Comparison against base commit f5860a8.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@leet4tari leet4tari left a comment

Choose a reason for hiding this comment

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

Workflow looks good - utACK

Copy link
Collaborator

@SWvheerden SWvheerden left a comment

Choose a reason for hiding this comment

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

This looks good, just one question about the tests,
I cant seem to find any test for the esme gen block anymore?

Comment on lines 399 to 400
// Note: Generate new data for `pub fn get_esmeralda_genesis_block()` and `fn get_esmeralda_genesis_block_raw()`
// if consensus values change, e.g. new faucet or other
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
// Note: Generate new data for `pub fn get_esmeralda_genesis_block()` and `fn get_esmeralda_genesis_block_raw()`
// if consensus values change, e.g. new faucet or other

@@ -399,11 +393,13 @@ mod test {
}

#[test]
fn esmeralda_genesis_sanity_check() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I dont see a test for esmeralda anymore?
We only have one for nextnet and stagenet

@ghpbot-tari-project ghpbot-tari-project removed the P-reviews_required Process - Requires a review from a lead maintainer to be merged label Feb 26, 2024
@SWvheerden SWvheerden merged commit 8990b57 into development Feb 26, 2024
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P-acks_required Process - Requires more ACKs or utACKs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants