-
Notifications
You must be signed in to change notification settings - Fork 2
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
Allow offchain worker requests to all TSS nodes in entropy-tss
test environment
#1147
base: master
Are you sure you want to change the base?
Conversation
…e mock OCW requests
I am a bit stuck with this. DKG is working fine but the reshare protocol has problems. To be specific its the aux gen protocol when run from within the 'reshare' protocol: The DKG protocol is composed of the key init, reshare and aux gen protocol - so we know all of these will work with this setup. 'Reshare' is composed of reshare and aux gen. It seems from looking at logs that the reshare runs, but only two of the three parties finalize successfully, then during aux gen a connection gets dropped. I tried switching things around so the aux gen protocol gets run before the reshare, and it seems that aux gen is the problem as a connection gets dropped and it seems only one peer runs the protocol loop. There are also issues with mocking the DKG using pre-generated keyshares which we do in the signing tests, as now when the jump start extrinsic is submitted, it starts a real DKG, and things get messy when the mock DKG confirmations are also submitted. But i think this should be not to hard to fix. |
I had a hunch that the problems i am seeing are related to problems introduced by my recent PR: #1136 I have now tried rolling back to before that commit and re-applying these changes and running the tests, but i am seeing exactly the same behavior as on this branch. So thats not the problem. Here is the relevant part of the test logging output:
|
Had a look at this problem with @HCastano thismorning. He made a suggestion to try running the DKG with an additional reshare immediately after the DKG finishes. To see if it is something to do with the test conditions for the reshare test rather than the reshare protocol itself. I tried doing this, but got into a muddle with new holders and old holders, and was having synedrion's But if i run an extra aux gen protocol at the end of the DKG protocol, it does work. |
* Add pre-jumpstart option to chainspec and helper fn, update tests * Dont include JumpStartDetails in staking pallet config, only ids of the jumpstarted signer set * Update mock config for propagation and registry pallets * Comments, tidy * Add new field to attestation pallet mock * Update client tests * Fix issue with test helper fn * Add pre-generated keyshares directly to the kvdb, rather than using the unsafe API * Update integratiion test chain spec * Fixes for pre-jumpstarted state in tests - mocking jump start no longer works * Update reshare test * Update client tests * Typo * Tidy test * Tidy test * Fix for deadline issue * Rm unused variable * Fix local storage for rotate network key endpoint * Update test * Clippy * Clippy * Fix remaining tests * Fix tests, tidy * Update generated keyshares * Update script to generate keyshares * Update script to generate keyshares readme * Tidy * Undo testnet reshare fix
This PR sets the TSS node endpoints associated with all chain nodes in our test setup for
entropy-tss
.It means that http requests coming from the propagation pallet will be made to all four TSS nodes. Previously, only Alice got a request from the chain and the other 3 TSS server's had similar requests made by an http client in the test code itself.
This had the advantage that we could test the handling of bad inputs given to these endpoints. But a lot of care had to be taken to make the mock requests appear at the right time, and we have had problems with the tests occasionally failing, eg: #1119
I am hoping that we can make the tests more reliable and more closely emulate what will happen in production by doing this.
This PR also makes a change to the genesis config making it possible to start in a pre-jumpstarted state to test signing. For an explainantion see the (merged) sub-PR which introduces that change: #1162
A couple of related changes:
testing_utils::helpers::spawn_tss_nodes_and_start_chain
. This has the advantage that it sets up both the chain and TSS nodes in one function, making a bit less boilerplate code in the tests. But it has a gotcha, which is that because it lives intesting-utils
and notentropy-tss
,cfg(test)
is false meaning the unsafe api does not get loaded. So it can only be used in the tests which don't need the unsafe API. I could move it intoentropy-tss
, but then we would not be able to use it in integration tests.next_signers
for the reshare to match what signers get chosen, but there is no guarantee that this will continue to work if the initial chain state changes. So now we only test resharing following a mock DKG where we know the initial signers beforehand.