-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Update the WASM compatibility tests for 0.36
release
#2271
Merged
Merged
Changes from 7 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
eba0868
Use the v36 node as the new genesis
rafal-ch f826223
Remove build script which was used to build client v0.26
rafal-ch df4504d
Remove `await` hack needed by v0.26 client
rafal-ch 13f2653
Restore the `latest_binary_is_backward_compatible_and_follows_blocks_…
rafal-ch 50d8b21
Rename the `deserialize_errors` test
rafal-ch ad7630e
Bump the timeout limits in tests
rafal-ch ee108f9
Merge branch 'master' into 2198_update_forward_compatibility_test
xgreenx e8a8505
Add V36 snapshot
rafal-ch c8f3a03
Update signing key and privileged address in the V36 snapshot
rafal-ch 9b60d9a
Update the WASM in V36 snapshot
rafal-ch 01d53b7
Add readme to V36 snapshot
rafal-ch 389434a
Update chain name in the V36 snapshot
rafal-ch 8df3171
Bump the block production timeout limits in version compatibility tes…
rafal-ch f1dde23
Merge branch 'master' into 2198_update_forward_compatibility_test
rafal-ch File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ use crate::tests_helper::{ | |
default_multiaddr, | ||
GenesisFuelCoreDriver, | ||
LatestFuelCoreDriver, | ||
Version36FuelCoreDriver, | ||
IGNITION_TESTNET_SNAPSHOT, | ||
POA_SECRET_KEY, | ||
}; | ||
|
@@ -25,6 +26,8 @@ use libp2p::{ | |
}; | ||
use std::time::Duration; | ||
|
||
const BLOCK_INCLUSION_TIMEOUT: Duration = Duration::from_secs(240); | ||
|
||
#[tokio::test] | ||
async fn latest_binary_is_backward_compatible_and_can_load_testnet_config() { | ||
// When | ||
|
@@ -109,7 +112,76 @@ async fn latest_binary_is_backward_compatible_and_follows_blocks_created_by_gene | |
|
||
// Then | ||
for i in 0..BLOCKS_TO_PRODUCE { | ||
let _ = tokio::time::timeout(Duration::from_secs(120), imported_blocks.next()) | ||
let _ = tokio::time::timeout(BLOCK_INCLUSION_TIMEOUT, imported_blocks.next()) | ||
.await | ||
.expect(format!("Timed out waiting for block import {i}").as_str()) | ||
.expect(format!("Failed to import block {i}").as_str()); | ||
} | ||
} | ||
|
||
#[tokio::test] | ||
async fn latest_binary_is_backward_compatible_and_follows_blocks_created_by_v36_binary() { | ||
// Given | ||
let v36_keypair = SecpKeypair::generate(); | ||
let hexed_secret = hex::encode(v36_keypair.secret().to_bytes()); | ||
let v36_port = "30333"; | ||
let v36_node = Version36FuelCoreDriver::spawn(&[ | ||
"--service-name", | ||
"V36Producer", | ||
"--debug", | ||
"--poa-instant", | ||
"true", | ||
"--consensus-key", | ||
POA_SECRET_KEY, | ||
"--snapshot", | ||
IGNITION_TESTNET_SNAPSHOT, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This snapshot using the state transition function from |
||
"--enable-p2p", | ||
"--keypair", | ||
hexed_secret.as_str(), | ||
"--peering-port", | ||
v36_port, | ||
]) | ||
.await | ||
.unwrap(); | ||
let public_key = Keypair::from(v36_keypair).public(); | ||
let v36_peer_id = PeerId::from_public_key(&public_key); | ||
let v36_multiaddr = default_multiaddr(v36_port, v36_peer_id); | ||
|
||
// Starting node that uses latest fuel core. | ||
// It will connect to the v36 node and sync blocks. | ||
let latest_keypair = SecpKeypair::generate(); | ||
let hexed_secret = hex::encode(latest_keypair.secret().to_bytes()); | ||
let latest_node = LatestFuelCoreDriver::spawn(&[ | ||
"--service-name", | ||
"LatestValidator", | ||
"--debug", | ||
"--poa-instant", | ||
"false", | ||
"--snapshot", | ||
IGNITION_TESTNET_SNAPSHOT, | ||
"--enable-p2p", | ||
"--keypair", | ||
hexed_secret.as_str(), | ||
"--reserved-nodes", | ||
v36_multiaddr.as_str(), | ||
"--peering-port", | ||
"0", | ||
]) | ||
.await | ||
.unwrap(); | ||
let mut imported_blocks = latest_node.node.shared.block_importer.events(); | ||
|
||
// When | ||
const BLOCKS_TO_PRODUCE: u32 = 10; | ||
v36_node | ||
.client | ||
.produce_blocks(BLOCKS_TO_PRODUCE, None) | ||
.await | ||
.unwrap(); | ||
|
||
// Then | ||
for i in 0..BLOCKS_TO_PRODUCE { | ||
let _ = tokio::time::timeout(BLOCK_INCLUSION_TIMEOUT, imported_blocks.next()) | ||
.await | ||
.expect(format!("Timed out waiting for block import {i}").as_str()) | ||
.expect(format!("Failed to import block {i}").as_str()); | ||
|
@@ -166,4 +238,4 @@ async fn latest_binary_is_backward_compatible_and_can_deserialize_errors_from_ge | |
result.skipped_transactions[0].1, | ||
ExecutorError::TransactionValidity(TransactionValidityError::CoinDoesNotExist(_)) | ||
)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It still would be nice to have one more backward compatibility tests that produces blocks by
fuel-core 0.26.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Genesis test is restored in 13f2653