-
Notifications
You must be signed in to change notification settings - Fork 26
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
Applies multinodessuite in twonodessuite #1031
Merged
Merged
Changes from 18 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
1261f25
Sets timeout for codexclient httpClient. Adds reliable transfer test.
benbierens 98843f3
disable new test to check timeout setting in CI
benbierens 4c8788b
restores new test
benbierens cdaa924
Merge branch 'master' into feature/transfer-reliability-test
benbierens 4c68959
Merge branch 'master' into feature/transfer-reliability-test
benbierens 8b8b85f
adds heartbeat log and logfile to ci output
benbierens 44c8ca7
Merge branch 'feature/transfer-reliability-test' of https://github.co…
benbierens 661a3a4
fixes suite
benbierens c79c0af
fixes blocked output stream by switching to multinode fixture
benbierens de3a09d
new twonodessuite based on multinodesuite
benbierens b895c41
Applies updated twonodessuite
benbierens 0d6fcee
Merge branch 'master' into feature/transfer-reliability-test
benbierens 4170ded
removes heartbeat log
benbierens 101df5e
applies multinodesuite in testsales
benbierens 38c6eb1
applies multinodesuite in testmarketplace
benbierens d884b94
fixes account fetch for host and client in testmarketplace
benbierens ff0130c
adds waitTillNextPeriod at end of marketplace test
benbierens f1b1027
Uses marketplacesuite in testmarketplace
benbierens af0571a
Merge branch 'master' into feature/transfer-reliability-test
benbierens 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
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,57 +1,66 @@ | ||
import std/unittest | ||
import std/tempfiles | ||
import codex/conf | ||
import codex/utils/fileutils | ||
import ./nodes | ||
import ../asynctest | ||
import ../checktest | ||
import ./codexprocess | ||
import ./nodeprocess | ||
import ../examples | ||
|
||
suite "Command line interface": | ||
asyncchecksuite "Command line interface": | ||
|
||
let key = "4242424242424242424242424242424242424242424242424242424242424242" | ||
|
||
proc startCodex(args: seq[string]): Future[CodexProcess] {.async.} = | ||
return await CodexProcess.startNode( | ||
args, | ||
false, | ||
"cli-test-node" | ||
) | ||
|
||
test "complains when persistence is enabled without ethereum account": | ||
let node = startNode(@[ | ||
let node = await startCodex(@[ | ||
"persistence" | ||
]) | ||
node.waitUntilOutput("Persistence enabled, but no Ethereum account was set") | ||
node.stop() | ||
await node.waitUntilOutput("Persistence enabled, but no Ethereum account was set") | ||
await node.stop() | ||
|
||
test "complains when ethereum private key file has wrong permissions": | ||
let unsafeKeyFile = genTempPath("", "") | ||
discard unsafeKeyFile.writeFile(key, 0o666) | ||
let node = startNode(@[ | ||
let node = await startCodex(@[ | ||
"persistence", | ||
"--eth-private-key=" & unsafeKeyFile]) | ||
node.waitUntilOutput("Ethereum private key file does not have safe file permissions") | ||
node.stop() | ||
await node.waitUntilOutput("Ethereum private key file does not have safe file permissions") | ||
await node.stop() | ||
discard removeFile(unsafeKeyFile) | ||
|
||
let | ||
marketplaceArg = "--marketplace-address=" & $EthAddress.example | ||
expectedDownloadInstruction = "Proving circuit files are not found. Please run the following to download them:" | ||
|
||
test "suggests downloading of circuit files when persistence is enabled without accessible r1cs file": | ||
let node = startNode(@["persistence", "prover", marketplaceArg]) | ||
node.waitUntilOutput(expectedDownloadInstruction) | ||
node.stop() | ||
let node = await startCodex(@["persistence", "prover", marketplaceArg]) | ||
await node.waitUntilOutput(expectedDownloadInstruction) | ||
await node.stop() | ||
|
||
test "suggests downloading of circuit files when persistence is enabled without accessible wasm file": | ||
let node = startNode(@[ | ||
let node = await startCodex(@[ | ||
"persistence", | ||
"prover", | ||
marketplaceArg, | ||
"--circom-r1cs=tests/circuits/fixtures/proof_main.r1cs" | ||
]) | ||
node.waitUntilOutput(expectedDownloadInstruction) | ||
node.stop() | ||
await node.waitUntilOutput(expectedDownloadInstruction) | ||
await node.stop() | ||
|
||
test "suggests downloading of circuit files when persistence is enabled without accessible zkey file": | ||
let node = startNode(@[ | ||
let node = await startCodex(@[ | ||
"persistence", | ||
"prover", | ||
marketplaceArg, | ||
"--circom-r1cs=tests/circuits/fixtures/proof_main.r1cs", | ||
"--circom-wasm=tests/circuits/fixtures/proof_main.wasm" | ||
]) | ||
node.waitUntilOutput(expectedDownloadInstruction) | ||
node.stop() | ||
await node.waitUntilOutput(expectedDownloadInstruction) | ||
await node.stop() |
Oops, something went wrong.
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.
Hmm, I'm sure there was a good reason for this, but could you please explain why? We don't want the running node to be a HardhatNode, which wouldn't give us what we want (bootstrap info)
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.
This is behind
if var clients =? nodeConfigs.clients:
and nodeConfigs.clients is of type?CodexConfigs
. So these should always be Codexes. I changed this because usingclients()
assumes that the config for this test has at least 1 client configured and that the client will always be started before any providers/validators (true because of the ordering of the code). If a user creates a config with only providers or validators, none of them would be used for bootstrap. With this change, the first node regardless of role will be the bootstrap node.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.
If a user creates a configuration that runs a single hardhat node and at least one client node,
running.len == 1
will never be true when processing the first client node. We don't want that.Perhaps a better option would be to check that clients().len == 1 or providers.len() == 1
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.
Without a client config, there will be no bootstrap nodes, since this is nested under the iteration of
clients.configs
.I've made some changes that add each started client and validator to a seq of bootstrap nodes, that are used to start the next node. That means each subsequently started node should be more connected to peers than the last. This also fixes the case when no clients were started, that bootstrap SPRs are still used. PR #1048