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

v0.2.0 #610

Merged
merged 116 commits into from
May 24, 2024
Merged

v0.2.0 #610

merged 116 commits into from
May 24, 2024

Conversation

volovyks
Copy link
Collaborator

@volovyks volovyks commented May 23, 2024

Let's merge this PR before everything else and update the contract.

ChaoticTempest and others added 30 commits November 23, 2023 11:28
Co-authored-by: Daniyar Itegulov <ditegulov@gmail.com>
Update integration-tests/src/env/containers.rs:
* use ipv4 port for macos localstack
* pull from the near-lake-indexer's specific tag that has both macos and linux images

---------

Co-authored-by: Xiangyi Zheng <xiangyi@near.org>
Co-authored-by: Daniyar Itegulov <ditegulov@gmail.com>
* decrypt message during joining phase

* extra anyhow context for wait_for functions
* Added queue for sending encrypted messages

* Handle message errors at call site and more explicit logs

---------

Co-authored-by: Daniyar Itegulov <ditegulov@gmail.com>
* fix testnet rpc url

* upgrade zerocopy
* add persistent secret storage

* make deployment work

* fix compilation errors
* Randomly assign triples to a node after creation

* Use a stable hash function

While it's not strictly necessary right now (every node should be
running the same version) it will save people trouble should they ever
want to loosen that restriction/if nodes are running subtley different
binaries.

* Remove unnecessary type

* First version of the testing code (it's dog slow)

* Working test

* Expanded test slightly

* Clippy fix

* Added mailbox debuggers, but disabled them
* TripleProtocol do not require locks

* PresignatureProtocol do not require locks

* SignatureProtocol do not require lock
* create terraform for multichain testnet and prod

* fix service_account_id and service_name for testnet and mainnet
* contract state maping
* participant id refactoring
* async me
* me removed from consensus layer
* vote_join accepts account id
* differentiate the logging messages

* upgrade h2 to 0.3.24
* Added refreshable for KeygenProtocol

* Cargo fmt & clippy

* Added refreshable ReshareProtocol
* make node code work with self calls

* index receipt txs properly

* migrate to async_broadcast_tx

* prevent submission of the same paylaod

---------

Co-authored-by: Daniyar Itegulov <ditegulov@gmail.com>
Co-authored-by: Serhii Volovyk <SergeyVolovyk@gmail.com>
* Moved clean up signature test and added actions mod

* Internalize loop for checking triples and presigs

* Clippy
* contract logs
* try fix CI

* cargo.lock changes
* datastore endpoints working
* Cargo.lock change
* encryption
* test utils
* make datstore triple peristance work in integration tests
* add env variables in terraform
* remove unnecessary env variable
* add loaded triples to mine as well
* add datastore iam resource to terraform
* add more info to note state

* fmt

---------

Co-authored-by: Serhii Volovyk <SergeyVolovyk@gmail.com>
volovyks and others added 25 commits April 2, 2024 17:11
* added init_running contract function

* init_running should initialize counter
* added automated deployment to dev on merge to develop

* added conditional for only deploy on PR merge, not close
* versioned contract
- versioned node
* clear_payloads func
* reset counter
* added add_signature in the contract
* gas check in the contract
* added automated deployment to dev on merge to develop

* added conditional for only deploy on PR merge, not close

* add initial run of contract GHA

* added temp workflow dispatch for testing

* updated to semi working actions workflow

* added rustup step

* fixed wasm issue and fixed echo command to format json correctly

* fixed deployment of contract

* added conditional to only run if merged

* remove dispatch trigger
* subaccounts for loadtests

* delete subaccount
* vote_kick test added

* test to check voting below trashhold

* running mpc retry changed

* number of retries

* config as a reference removed

* add/remove participant code

* T number of participants vote

* simple test_multichain_reshare

* kill node by Account Id

* kick node logic used in tests

* check that going below T will not work

* better parameter naming
* Make sure when we fail in the busy loop we cleanup

We got reports of users getting responses to sign requests on testnet of
"Too many pending requests. Please, try again later." when the signing
contract was under no load.

I believe this was caused by someone sending a message that failed, the
contract cleaning up the request but then immediately panicking. This
caused the state cleanup to roll back and the system keeping a limit on
the total number of requests to eventually run out of space.

This PR fixes that by panicking on a seperate call and allowing the
cleanup to persist.
)

* differentiate between TripleIsGenerating and TripleIsMissing, and skip presignature and signature messages that were sent more than 1 min ago.

* add timestamp to messages
* fix: only retry signature generators with proposer = me

* modify integration test test_signature_offline_node to wait for mine presignatures before dealing with a signature
* Lowered the minimum gas limit and upped the depth

Observationally 30 transactions uses about 160 TG of Gas, so 250 should
be plenty. The protocol team says that this should come down soon.

The current gas limit makes it impossible for people to call the sign
method using another smart contract.

In the future we should abort when the remaining gas in the call starts
to get low to avoid the risk of an out of gas panic causing the system
to not clean up after itself.

* Make the gas unit more clear

* Start cleaning up if the gas level falls below 10%
* removed workflow automation for mpc cloudrun envs

* remove tf feat env
* Added separate sign key for signing messages

* Added terraform setup for sign-sk

* Address comments

* Made sign_sk optional and utilize account_sk by default

* Made terraform only take the MPC_RECOVERY_SIGN_SK if the resource is present

* Fix integration tests
* versioned contract

* migrate_state and fmt
* Some cleanup

* Allow taking triples from memory only
* use disk storage for secret storage

* wait for the same payload+account instead of for the signature tx

* delete secret key share files after test finish

* add logic for checking signature for one payload instead of one signature tx
* Made failed generators only get added on self proposers

* Forward retry error

* Rework sign request handling logic

* Fix clippy
* contract API and other functions grouped
* fix condition

* update main.tf for testnet too. note testnet never reran terraform
@volovyks volovyks requested review from ChaoticTempest and ppca May 23, 2024 12:00
@volovyks volovyks merged commit 240839f into main May 24, 2024
10 of 12 checks passed
Copy link

Terraform Feature Environment Destroy (dev-610)

Terraform Initialization ⚙️success

Terraform Destroy success

Show Destroy Plan


No changes. No objects need to be destroyed.

Either you have not created any objects yet or the existing objects were
already deleted outside of Terraform.

Destroy complete! Resources: 0 destroyed.

Pusher: @volovyks, Action: pull_request, Working Directory: ``, Workflow: Terraform Feature Env (Destroy)

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.

7 participants