Blocklock Agent#1
Merged
Merged
Conversation
* Initial commit * updated solidity submodule * Create superallow crate * Implement helper function to retry execution * Add none retry strategy * Implement helper function to create provider with retries * feat: Add function to provider to watch for block numbers through pubsub / polling * feat: Update watch_block_numbers to return result * Create a MultiProvider to receive events concurrently from multiple rpc providers * Update .gitignore for Rust * feat: Create new Rust project for the agent * Create parser for blocklock agent * feat: Implement blocknumber-based condition resolver * Add function to remove conditions from the `BlockReachedConditionResolver * tests: Create test for removing conditions * tests: Create test for detecting duplicated parent ids * tests: Create test to verify that resolve does not delete conditions * refactor: Move BlockReachedConditionResolver to submodule * feat: Create StandaloneCondition struct implementing ChildCondition * fix: Update lifetimes of BlockReachedConditionResolver * feat: Create structure to resolve blocklock conditions * feat: Import solidity contract in rust * refactor: Mark block number as public in newtype wrapper * refactor: Lint condition_resolver.rs * feat: Skeleton implementation of blocklock agent * Detect missing requests in handler * Add marshmallow-crypto submodule * feat: Create trait describing IBE ciphersuites * feat: Implementation of IBE ciphersuite for bn254 with identity on G1 * refactor: Move DecryptionSender contract to submodule * refactor: Rename `IbeIdentityOnBn254G1` to `IbeIdentityOnBn254G1Suite` * feat: Create IbeCiphertext trait with a function to get the ephemeral pk * Ignore request with invalid scheme id in agent * Derive Copy on RequestId * feat: Implement handling for upcoming decryption requests * Create decryption sender fulfiller trait * Implementation of a DecryptionSenderFulfiller with sequential transactions * refactor: Move `EvmSerialize` trait to new file * feat: Create new EvmDeserialize trait and implementation for bn254 identity on g1 ciphertext * tests: Implement tests to verify evm de(serialization) * Reformat fulfiller.rs * Forward resolved requests to fulfiller in agent * Lower decryption request already seen log from warn to debug * refactor: Create function responsible for storing condition * feat: Remove condition after submitting to fulfiller * Mark attributes of DecryptionRequest as public * Implement function to create DecryptionRequest from solidity type * Implement function to synchronize state with decryption sender contract * Create file with retry strategies for DecryptionSenderFulfiller * Refactor fulfiller trait * refactor: Rework the DecryptionSenderFulfiller trait by adding a custom stopper type * Rework fulfiller to support retries * tests: Implement test for fulfiller * refactor: Split DecryptionSenderFulfiller and transaction fulfillment into two traits * refactor: Use a ReadyRequest instead of a RetryableRequest in transaction fulfiller * tests: Fix wrong comments / naming * Derive Clone for IbeIdentityOnBn254G1Suite * Decouple signer from fulfiller * Move agent code to new library * Move fulfiller module to decryption_sender module * Move ser module outside blocklock * Cargo fmt * Update visibility of various modules and structs * Various clippy-recommended refactors * Move DecryptionSender and BlocklockSender contracts to separate modules * Remove clap dependencies from dcipher-agents * Desugar DecryptionSenderStop * refactor: Move blocklock to agents module * Remove default code from lib.rs * Rename ChildCondition to ChildResolver * Transform the decryption fulfiller into a generic fulfiller * Various logs and comments * tests: Various tests for the blocklock agent * Replace anyhow by this error throughout blocklock agent * Refactor blocklock sync function * tests: Ensure that sync ignores fulfilled requests * docs: Various module comments * Removed unnecessary error log * Refactoring to only call fulfil_requests when request array is non-empty, add a per-tick fulfillment counter, and change the priority of retry requests * Refactor TickerBasedFulfiller to use cancellation tokens throughout * feat: Update condition parsing to support future conditions * Expose RetryStrategy in fulfiller rather than failure submodule * Move main.rs to example and create blocklock lib * Make fulfiller ready log into an info instead of debug * Create wrapper to parse bls key with clap * Implementation of a blocklock agent binary * Implement healthcheck with simple TcpListener * Refactor single party signer in impl outside trait * Implement function that allows to save the current state of the blocklock agent * Improve state restore to automatically recover missing requests & more * Manage state on start & stop in the agent * feat: Implementation of a libp2p node w/ message forwarding * feat: Add verification function to ibe ciphersuite trait * feat: Implementation of a libp2p-based threshold signer * Update blocklock-solidity to track feat/payments-v1 and fixes * Add chain id to blocklock DST * Implementation of a fulfiller for the blocklock contracts * Add missing lib.rs used by blocklock agent * Improve blocklock fulfiller to correctly fetch request cost * Add short peer ids to arguments of threshold signer * Update blocklock agent's state restore to update last seen request id * Update arguments parsing for blocklock threshold signer * Various linting fixes * Add support for non-tls websockets to superalloy * fix: Rename blocklock threshold env variable name * fix: Remove unused is_multiparty function * Update nodes_config argument description * Various changes proposed by linter * GitHub actions to build rust agent * Add PAT token to github actions * Move PAT to docker/build-push-action * Rust agent Dockerfile * Change decoding of blocklock condition to prefix-less implementation * Use file instead of dockerfile attribute in build-push-action * Update github actions to use path context * Make chain id optional, and retrieve from provider * Return a result from BlocklockAgent::from_state * Move multicall3 presigned transaction into a const rather than inline * Remove default TX_PRIVATE_KEY from argument parser * docs: Add comment on tokio infinite sleep loop * Apply suggestions from code review Co-authored-by: PM <3749956+CluEleSsUK@users.noreply.github.com> * tests: Update test using from_state * Rename no_ variables into num_ * Include base_gas_price_wei as an argument to BlocklockFulfiller * Move rs to parent folder --------- Co-authored-by: Nemitari Ajienka <najienka@users.noreply.github.com> Co-authored-by: PM <3749956+CluEleSsUK@users.noreply.github.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.