--- ## /integrate/networks/helpful-core-contracts-endpoints # Helpful Core Contracts' Endpoints This page provides a list of useful in practice functions for a Network across Symbiotic Core contracts. | Function | Use-case | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ | | [`NetworkRegistry.registerNetwork()`](https://github.com/symbioticfi/core/blob/7cb06639c5cd656d1d212dafa2c270b5fde39306/src/interfaces/INetworkRegistry.sol#L12) | Register network | | [`Vault.isInitialized() → bool`](https://github.com/symbioticfi/core/blob/7cb06639c5cd656d1d212dafa2c270b5fde39306/src/interfaces/vault/IVault.sol#L165) | Check if the vault has set delegator and slasher before on-boarding as a valid Vault | | [`Vault.delegator() → address`](https://github.com/symbioticfi/core/blob/7cb06639c5cd656d1d212dafa2c270b5fde39306/src/interfaces/vault/IVaultStorage.sol#L60) | Get the Vault's delegator | | [`Vault.slasher() → address`](https://github.com/symbioticfi/core/blob/7cb06639c5cd656d1d212dafa2c270b5fde39306/src/interfaces/vault/IVaultStorage.sol#L72) | Get the Vault's slasher | | [`BaseDelegator.TYPE() → uint64`](https://github.com/symbioticfi/core/blob/7cb06639c5cd656d1d212dafa2c270b5fde39306/src/interfaces/common/IEntity.sol#L17) | Get the delegator's type (0 - NetworkRestake, 1 - FullRestake, etc.) | | [`BaseDelegator.setMaxNetworkLimit(uint96 identifier, uint256 amount)`](https://github.com/symbioticfi/core/blob/7cb06639c5cd656d1d212dafa2c270b5fde39306/src/interfaces/delegator/IBaseDelegator.sol#L158) | Set an amount of collateral you are ready to accept from the Vault (maximum network limit) | | [`BaseDelegator.maxNetworkLimit(bytes32 subnetwork) → uint256`](https://github.com/symbioticfi/core/blob/7cb06639c5cd656d1d212dafa2c270b5fde39306/src/interfaces/delegator/IBaseDelegator.sol#L125) | Check the maximum network limit | | [`BaseDelegator.stakeAt(bytes32 subnetwork, address operator, uint48 timestamp, bytes hints) → uint256`](https://github.com/symbioticfi/core/blob/7cb06639c5cd656d1d212dafa2c270b5fde39306/src/interfaces/delegator/IBaseDelegator.sol#L137) | Get the operator's stake at the given timestamp | | [`BaseSlasher.TYPE() → uint64`](https://github.com/symbioticfi/core/blob/7cb06639c5cd656d1d212dafa2c270b5fde39306/src/interfaces/common/IEntity.sol#L17) | Get the slasher's type (0 - Slasher, 1 - VetoSlasher) | | [`BaseSlasher.slashableStake() → uint256`](https://github.com/symbioticfi/core/blob/7cb06639c5cd656d1d212dafa2c270b5fde39306/src/interfaces/slasher/IBaseSlasher.sol#L113) | Get the operator's still slashable stake captured at the given timestamp | | [`Slasher.slash() → uint256`](https://github.com/symbioticfi/core/blob/7cb06639c5cd656d1d212dafa2c270b5fde39306/src/interfaces/slasher/ISlasher.sol#L55) | Slash the operator | | [`VetoSlasher.requestSlash(bytes32 subnetwork, address operator, uint256 amount, uint48 captureTimestamp, bytes hints) -> uint256`](https://github.com/symbioticfi/core/blob/7cb06639c5cd656d1d212dafa2c270b5fde39306/src/interfaces/slasher/IVetoSlasher.sol#L213) | Request slashing of the operator | | [`VetoSlasher.executeSlash(uint256 slashIndex, bytes hints) -> uint256`](https://github.com/symbioticfi/core/blob/7cb06639c5cd656d1d212dafa2c270b5fde39306/src/interfaces/slasher/IVetoSlasher.sol#L228) | Execute slashing of the operator | | [`VetoSlasher.setResolver(uint96 identifier, address resolver, bytes hints)`](https://github.com/symbioticfi/core/blob/7cb06639c5cd656d1d212dafa2c270b5fde39306/src/interfaces/slasher/IVetoSlasher.sol#L245) | Set a resolver | | [`VetoSlasher.resolver(bytes32 subnetwork, bytes hint)`](https://github.com/symbioticfi/core/blob/7cb06639c5cd656d1d212dafa2c270b5fde39306/src/interfaces/slasher/IVetoSlasher.sol#L201) | Check the resolver | --- ## /integrate/networks import { Card1 } from "../../../components/Card1"; # Get Started Symbiotic protocol contains a wide range of supportive tooling and products for various types of Networks to either build on top of or integrate with. This page provides you a high-level overview of Symbiotic integration flow: :::steps ## Register Network
} href="/integrate/networks/submit-metadata" />
## Submit Metadata
} href="/integrate/networks/submit-metadata" />
## Set Up Pre-deposit Vault (optional)
} href="/integrate/curators/deploy-vault" /> } href="/integrate/curators/submit-metadata" />
## Learn Symbiotic Rewards Integration
} href="/integrate/networks/rewards" />
## Learn Slashing Integration
} href="/integrate/networks/slashing" />
## Implement On-Chain Components
} href="/integrate/networks/relay-onchain" /> } href="/integrate/networks/register-network#manage-your-network" />
## Implement Off-Chain Components
} href="/integrate/networks/relay-offchain" />
::: --- ## /integrate/networks/pre-deposit import { Card1 } from "../../../components/Card1"; # Deploy Pre-deposit Vault In some cases the Network may want to curate or deploy the Vaults by itself, for example: - A DAO-controlled Vault with native Network asset used as a collateral - A Network needs a specific configuration of the Vaults to proceed with their onboarding The Vault deployment guide is available [inside the section for Curators](/integrate/curators/deploy-vault). ## Next Steps
} href="/integrate/networks/rewards" />
--- ## /integrate/networks/register-network import { Card1 } from "../../../components/Card1"; # Register Network To start the journey within the Symbiotic system, you should register your Network using `NetworkRegistry` smart contract. The registered address should be meant as a management address that will interact, e.g., with Symbiotic Vaults to accept stake allocations. To simplify this step and make the management process more secure we provide [network repository](https://github.com/symbioticfi/network) that contains `Network.sol` contract and tooling to manage it. Basically, `Network.sol` contract is an [OpenZeppelin](https://www.openzeppelin.com/)'s [`TimelockController.sol`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/governance/TimelockController.sol) with additional functionality to define delays for either `(exact target | exact selector)` or `(any target | exact selector)` pairs. ## Prerequisites :::steps #### Clone the repository ```bash [bash] git clone --recurse-submodules https://github.com/symbioticfi/network.git cd network ``` #### Install dependencies ```bash [bash] npm install ``` ::: ## Deploy Network And Register The repository's deployment scripting currently supports 2 scenarios: 1. Currently, only a Network is needed, while the opt-ins to Vaults are going to be handled later 2. A Network with Vaults' opt-ins is needed :::info The `Network.sol` contract automatically registers itself on deployment. ::: ### Pure Network Deployment :::steps ##### Open [`DeployNetwork.s.sol`](https://github.com/symbioticfi/network/blob/main/script/DeployNetwork.s.sol), you will see config like this: ```solidity [DeployNetwork.s.sol] // Name of the Network string NAME = "My Network"; // Default minimum delay (will be applied for any action that doesn't have a specific delay yet) uint256 DEFAULT_MIN_DELAY = 3 days; // Cold actions delay (a delay that will be applied for major actions like upgradeProxy and setMiddleware) uint256 COLD_ACTIONS_DELAY = 14 days; // Hot actions delay (a delay that will be applied for minor actions like setMaxNetworkLimit and setResolver) uint256 HOT_ACTIONS_DELAY = 0; // Admin address (will become executor, proposer, and default admin by default) address ADMIN = 0x0000000000000000000000000000000000000000; // Optional // Metadata URI of the Network string METADATA_URI = ""; // Salt for deterministic deployment bytes11 SALT = "SymNetwork"; ``` ##### Edit needed fields, and execute the script via: ```bash [bash] forge script script/DeployNetwork.s.sol --rpc-url --private-key --etherscan-api-key --broadcast --verify ``` ::: ### Network Deployment With Opt-ins :::steps ##### Open [`DeployNetworkForVaults.s.sol`](https://github.com/symbioticfi/network/blob/main/script/DeployNetworkForVaults.s.sol), you will see config like this: ```solidity [DeployNetworkForVaults.s.sol] // Name of the Network string NAME = "My Network"; // Default minimum delay (will be applied for any action that doesn't have a specific delay yet) uint256 DEFAULT_MIN_DELAY = 3 days; // Cold actions delay (a delay that will be applied for major actions like upgradeProxy and setMiddleware) uint256 COLD_ACTIONS_DELAY = 14 days; // Hot actions delay (a delay that will be applied for minor actions like setMaxNetworkLimit and setResolver) uint256 HOT_ACTIONS_DELAY = 0; // Admin address (will become executor, proposer, and default admin by default) address ADMIN = 0x0000000000000000000000000000000000000000; // Vault address to opt-in to (multiple vaults can be set) address[] VAULTS = [0x0000000000000000000000000000000000000000]; // Maximum amount of delegation that network is ready to receive (multiple vaults can be set) uint256[] MAX_NETWORK_LIMITS = [0]; // Resolver address (optional, is applied only if VetoSlasher is used) (multiple vaults can be set) address[] RESOLVERS = [0x0000000000000000000000000000000000000000]; // Optional // Subnetwork Identifier (multiple subnetworks can be used, e.g., to have different resolvers for the same network) uint96 SUBNETWORK_ID = 0; // Metadata URI of the Network string METADATA_URI = ""; // Salt for deterministic deployment bytes11 SALT = "SymNetwork"; ``` ##### Edit needed fields, and execute the script via: ```bash [bash] forge script script/DeployNetworkForVaults.s.sol --rpc-url --private-key --etherscan-api-key --broadcast --verify ``` ::: ## Manage Your Network There are 5 predefined action-scripts, that you can use from the start: - [SetMaxNetworkLimit](https://github.com/symbioticfi/network/blob/main/script/actions/SetMaxNetworkLimit.s.sol) - set new maximum network limit for the vault - [SetResolver](https://github.com/symbioticfi/network/blob/main/script/actions/SetResolver.s.sol) - set a new resolver for the vault (only if the vault uses VetoSlasher) - [SetMiddleware](https://github.com/symbioticfi/network/blob/main/script/actions/SetMiddleware.s.sol) - set a new middleware - [UpgradeProxy](https://github.com/symbioticfi/network/blob/main/script/actions/UpgradeProxy.s.sol) - upgrade the proxy (network itself) - [ArbitraryCall](https://github.com/symbioticfi/network/blob/main/script/actions/ArbitraryCall.s.sol) - make a call to any contract with any data Interaction with different actions is similar. Let's consider [SetMaxNetworkLimit](https://github.com/symbioticfi/network/blob/main/script/actions/SetMaxNetworkLimit.s.sol) as an example: :::steps ##### Open [SetMaxNetworkLimit.s.sol](https://github.com/symbioticfi/network/blob/main/script/actions/SetMaxNetworkLimit.s.sol), you will see config like this: ```solidity [SetMaxNetworkLimit.s.sol] // Address of the Network address NETWORK = 0x0000000000000000000000000000000000000000; // Address of the Vault address VAULT = 0x0000000000000000000000000000000000000000; // Maximum amount of delegation that network is ready to receive uint256 MAX_NETWORK_LIMIT = 0; // Delay for the action to be executed uint256 DELAY = 0; // Optional // Subnetwork Identifier (multiple subnetworks can be used, e.g., to have different max network limits for the same network) uint96 SUBNETWORK_IDENTIFIER = 0; // Salt for TimelockController operations bytes32 SALT = "SetMaxNetworkLimit"; ``` ##### Edit needed fields, and choose an operation: - `runS()` - schedule an action - `runE` - execute an action - `runSE()` - schedule and execute an action (possible only if a delay for the needed action is zero) ##### Execute the operation: - If you use an EOA and want to execute the script: ```bash [bash] forge script script/actions/SetMaxNetworkLimit.s.sol:SetMaxNetworkLimit --sig "runS()" --rpc-url --private-key --broadcast ``` - If you use a [Safe](https://app.safe.global/) multisig and want to get a transaction calldata: ```bash [bash] forge script script/actions/SetMaxNetworkLimit.s.sol:SetMaxNetworkLimit --sig "runS()" --rpc-url --sender --unlocked ``` In the logs, you will see `callData` field like this: ```bash [Expected output] callData:0x01d5062a00000000000000000000000025ed2ee6e295880326bdeca245ee4d8b72c8f103000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000005365744d61784e6574776f726b4c696d697400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004423f752d500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002b6700000000000000000000000000000000000000000000000000000000 ``` In [Safe](https://app.safe.global/)->TransactionBuilder, you should: 1. enable "Custom data" 2. enter **Network's address** as a target address 3. use the `callData` (e.g., `0x01d5062a0000000000000000000000...`) received earlier as a `Data (Hex encoded)` ::: ## Update Delays Any action that can be made by the Network is protected by the corresponding delay (which can be any value from zero to infinity). We provide "update delay" scripts for actions mentioned above, and also some additional ones: - [SetMaxNetworkLimitUpdateDelay](https://github.com/symbioticfi/network/blob/main/script/update-delay/SetMaxNetworkLimitUpdateDelay.s.sol) - [SetResolverUpdateDelay](https://github.com/symbioticfi/network/blob/main/script/update-delay/SetResolverUpdateDelay.s.sol) - [SetMiddlewareUpdateDelay](https://github.com/symbioticfi/network/blob/main/script/update-delay/SetMiddlewareUpdateDelay.s.sol) - [UpgradeProxyUpdateDelay](https://github.com/symbioticfi/network/blob/main/script/update-delay/UpgradeProxyUpdateDelay.s.sol) - [HotActionsUpdateDelay](https://github.com/symbioticfi/network/blob/main/script/update-delay/HotActionsUpdateDelay.s.sol) - update a delay for [SetMiddlewareUpdateDelay](https://github.com/symbioticfi/network/blob/main/script/update-delay/SetMiddlewareUpdateDelay.s.sol) and [SetResolverUpdateDelay](https://github.com/symbioticfi/network/blob/main/script/update-delay/SetResolverUpdateDelay.s.sol) - [ColdActionsUpdateDelay](https://github.com/symbioticfi/network/blob/main/script/update-delay/ColdActionsUpdateDelay.s.sol) - update a delay for [SetMaxNetworkLimitUpdateDelay](https://github.com/symbioticfi/network/blob/main/script/update-delay/SetMaxNetworkLimitUpdateDelay.s.sol) and [UpgradeProxyUpdateDelay](https://github.com/symbioticfi/network/blob/main/script/update-delay/UpgradeProxyUpdateDelay.s.sol) - [DefaultUpdateDelay](https://github.com/symbioticfi/network/blob/main/script/update-delay/DefaultUpdateDelay.s.sol) - update a delay for unconstrained actions - [ArbitraryUpdateDelay](https://github.com/symbioticfi/network/blob/main/script/update-delay/ArbitraryCallUpdateDelay.s.sol) - update a delay for an arbitrary call: - set a delay for the exact target address and the exact selector - set a delay for any target address and the exact selector (by setting target address to `0x0000000000000000000000000000000000000000`) For example usage of similar scripts see [Manage Your Network](/integrate/networks/register-network#manage-your-network). *** ## Dashboard :::warning Work-in-progress, use with caution. ::: `Network.sol` contract inherits [OpenZeppelin](https://www.openzeppelin.com/)'s `TimelockController`, while `TimelockController` inherits `AccessControl`. The similarity between `TimelockController` and `AccessControl` contracts' logic is that it is not possible to adequately determine their state (e.g., statuses of operations or holders of roles) using only the current chain's state via RPC calls. Hence, we provide a Network Dashboard which allows you to: - Get delays for all operations - Get holders of any role - Get scheduled/executed operations - Schedule/execute arbitrary actions :::info Network Dashboard UI: [https://network-sage-rho.vercel.app/](https://network-sage-rho.vercel.app/) ::: *** ## Next Steps
} href="/integrate/networks/submit-metadata" />
--- ## /integrate/networks/relay-offchain import { Card1 } from "../../../components/Card1"; # Relay Off-Chain :::warning The code is a work in progress and not production ready yet. Breaking changes may occur in the code updates as well as backward compatibility is not guaranteed. Use with caution. ::: The Symbiotic Relay operates as a distributed middleware layer that facilitates: - Validator Set Management: Derives and maintains validator sets across different epochs based on on-chain state - Signature Aggregation: Collects individual validator signatures and aggregates them using BLS signatures or zero-knowledge proofs - Cross-Chain Coordination: Manages validator sets across multiple EVM-compatible blockchains ## Architecture The relay consists of several key components: - **P2P Layer**: Uses libp2p with GossipSub for decentralized communication - **Signer Nodes**: Sign messages using BLS/ECDSA keys - **Aggregator Nodes**: Collect and aggregate signatures with configurable policies - **Committer Nodes**: Submit aggregated proofs to settlement chains - **API Server**: Exposes gRPC API for external clients For detailed architecture information, see [here](https://github.com/symbioticfi/relay/blob/dev/DEVELOPMENT.md). ## Configure :::info For a complete reference of all configuration options and command-line flags, see the [relay\_sidecar CLI documentation](https://github.com/symbioticfi/relay/tree/dev/docs/cli/relay/relay_sidecar.md). ::: Create a `config.yaml` file with the following structure: ```yaml [config.yaml] # Logging log: level: "debug" # Options: debug, info, warn, error mode: "pretty" # Options: json, text, pretty # Storage storage-dir: ".data" # Directory for persistent data circuits-dir: "" # Path to ZK circuits (optional, empty disables ZK proofs) # API Server api: listen: ":8080" # API server address verbose-logging: false # Enable verbose API logging # Metrics (optional) metrics: listen: ":9090" # Metrics endpoint address pprof: false # Enable pprof debug endpoints # Driver Contract driver: chain-id: 31337 # Chain ID where driver contract is deployed address: "0x..." # Driver contract address # Secret Keys secret-keys: - namespace: "symb" # Namespace for the key key-type: 0 # 0=BLS-BN254, 1=ECDSA key-id: 15 # Key identifier secret: "0x..." # Private key hex - namespace: "evm" key-type: 1 key-id: 31337 secret: "0x..." - namespace: "p2p" key-type: 1 key-id: 1 secret: "0x..." # Alternatively, use keystore # keystore: # path: "/path/to/keystore.json" # password: "your-password" # Signal Configuration, used for internal messages and event queues signal: worker-count: 10 # Number of signal workers buffer-size: 20 # Signal buffer size # Cache Configuration, used for in memorylookups for db queries cache: network-config-size: 10 # Network config cache size validator-set-size: 10 # Validator set cache size # Sync Configuration, sync signatures and proofs over p2p to recover missing information sync: enabled: true # Enable P2P sync period: 5s # Sync period timeout: 1m # Sync timeout epochs: 5 # Number of epochs to sync # Key Cache, used for fast public key lookups key-cache: size: 100 # Key cache size enabled: true # Enable key caching # P2P Configuration p2p: listen: "/ip4/0.0.0.0/tcp/8880" # P2P listen address bootnodes: # List of bootstrap nodes (optional) - /dns4/node1/tcp/8880/p2p/... dht-mode: "server" # Options: auto, server, client, disabled, default: server (ideally should not change) mdns: true # Enable mDNS local discovery (useful for local networks) # EVM Configuration evm: chains: # List of settlement chain RPC endpoints - "http://localhost:8545" - "http://localhost:8546" max-calls: 30 # Max calls in multicall batches # Aggregation Policy aggregation-policy-max-unsigners: 50 # Max unsigners for low-cost policy ``` ### Configure via Command-Line Flags You can override config file values with command-line flags: ```bash ./relay_sidecar \ --config config.yaml \ --log.level debug \ --storage-dir /var/lib/relay \ --api.listen ":8080" \ --p2p.listen "/ip4/0.0.0.0/tcp/8880" \ --driver.chain-id 1 \ --driver.address "0x..." \ --secret-keys "symb/0/15/0x...,evm/1/31337/0x..." \ --evm.chains "http://localhost:8545" ``` ### Configure via Environment Variables Environment variables use the `SYMB_` prefix with underscores instead of dashes and dots: ```bash export SYMB_LOG_LEVEL=debug export SYMB_LOG_MODE=pretty export SYMB_STORAGE_DIR=/var/lib/relay export SYMB_API_LISTEN=":8080" export SYMB_P2P_LISTEN="/ip4/0.0.0.0/tcp/8880" export SYMB_DRIVER_CHAIN_ID=1 export SYMB_DRIVER_ADDRESS="0x..." ./relay_sidecar --config config.yaml ``` ### Configuration Priority Configuration is loaded in the following order (highest priority first): 1. Command-line flags 2. Environment variables (with `SYMB_` prefix) 3. Configuration file (specified by `--config`) ### Example For reference, see how configurations are generated in the E2E setup: ```bash # See the template in e2e/scripts/sidecar-start.sh (lines 11-27) cat e2e/scripts/sidecar-start.sh ``` ## Download and Run Pre-built Docker images are available from Docker Hub: :::steps #### Pull the image The latest image: ```bash [bash] docker pull symbioticfi/relay:latest ``` Or a specific version: ```bash [bash] docker pull symbioticfi/relay: ``` #### Run the relay sidecar ```bash [bash] docker run -v $(pwd)/config.yaml:/config.yaml \ symbioticfi/relay:latest \ --config /config.yaml ``` ::: :::info Docker Hub: [https://hub.docker.com/r/symbioticfi/relay](https://hub.docker.com/r/symbioticfi/relay) ::: ## API The relay exposes both gRPC and HTTP/JSON REST APIs for interacting with the network: ### gRPC API - [**API Documentation**](https://github.com/symbioticfi/relay/tree/dev/docs/api/v1/doc.md) - [**Proto Definitions**](https://github.com/symbioticfi/relay/blob/dev/api/proto/v1/api.proto) - [**Go Client**](https://github.com/symbioticfi/relay/tree/dev/api/client/v1/) - [**Client Examples**](https://github.com/symbioticfi/relay/tree/dev/api/client/examples/) ### HTTP/JSON REST API Gateway The relay includes an optional HTTP/JSON REST API gateway that translates HTTP requests to gRPC: - [**Swagger File**](https://github.com/symbioticfi/relay/tree/dev/docs/api/v1/api.swagger.json) - **Endpoints**: All gRPC methods accessible via RESTful HTTP at `/api/v1/*` Enable via configuration: ```yaml [config.yaml] api: http-gateway: true ``` Or via command-line flag: ```bash [bash] ./relay_sidecar --api.http-gateway=true ``` ### Client Libraries | Language | Repository | | ---------- | -------------------------------------------------------------------- | | Go | [relay](https://github.com/symbioticfi/relay/tree/dev/api/client/v1) | | TypeScript | [relay-client-ts](https://github.com/symbioticfi/relay-client-ts) | | Rust | [relay-client-rs](https://github.com/symbioticfi/relay-client-rs) | :::note Use the HTTP gateway for language-agnostic access if needed. ::: ### Snippets Check out multiple simple snippets how to use the clients mentioned above: :::code-group
```go [myApp.go] import ( relay "github.com/symbioticfi/relay/api/client/v1" ) func main() { relayClient = relay.NewSymbioticClient(conn) epochInfos, _ := relayClient.GetLastAllCommitted(ctx, &relay.GetLastAllCommittedRequest{}) suggestedEpoch := epochInfos.SuggestedEpochInfo.GetLastCommittedEpoch() signMessageResponse, _ := relayClient.SignMessage(ctx, &relay.SignMessageRequest{ KeyTag: 15, // default key tag - BN254 Message: encode(taskId), RequiredEpoch: &suggestedEpoch, }) listenProofsRequest := &relay.ListenProofsRequest{ StartEpoch: suggestedEpoch, } proofsStream, _ := relayClient.ListenProofs(ctx, listenProofsRequest) aggregationProof = []byte{} while proofResponse, _ := proofsStream.Recv() { if proofResponse.GetRequestId() == signMessageResponse.GetRequestId() { aggregationProof = proofResponse.GetAggregationProof().GetProof() break } } appContract.CompleteTask(taskId, signMessageResponse.Epoch, aggregationProof) } ```
```go [myApp.ts] import { createClient } from "@connectrpc/connect"; import { SymbioticAPIService } from "@symbioticfi/relay-client-ts"; import { GetLastAllCommittedRequestSchema, SignMessageRequestSchema, ListenProofsRequestSchema, } from "@symbioticfi/relay-client-ts"; import { create } from "@bufbuild/protobuf"; async function main() { const relayClient = createClient(SymbioticAPIService, transport); const getLastAllCommittedResponse = await relayClient.getLastAllCommitted(create(GetLastAllCommittedRequestSchema)); const suggestedEpoch = getLastAllCommittedResponse.suggestedEpochInfo.lastCommittedEpoch; const signMessageRequest = create(SignMessageRequestSchema, { keyTag: 15, // default key tag - BN254 message: encode(taskId), requiredEpoch: suggestedEpoch, }); const signMessageResponse = await relayClient.signMessage(signMessageRequest); const listenProofsRequest = create(ListenProofsRequestSchema, { startEpoch: suggestedEpoch }); const proofsStream = await relayClient.listenProofs(listenProofsRequest); let aggregationProof; for await (const proofResponse of proofsStream) { if (proofResponse.requestId === signMessageResponse.requestId) { aggregationProof = proofResponse.aggregationProof?.proof; break; } } await appContract.completeTask(taskId, signMessageResponse.epoch, aggregationProof); } ```
```go [my_app.rs] use symbiotic_relay_client::generated::api::proto::v1::{ GetLastAllCommittedRequest, SignMessageRequest, ListenProofsRequest, symbiotic_api_service_client::SymbioticApiServiceClient, }; #[tokio::main] async fn main() -> Result<(), Box> { let mut relay_client = SymbioticApiServiceClient::new(channel); let epoch_infos_response = relay_client.get_last_all_committed(tonic::Request::new(GetLastAllCommittedRequest {})).await?; let epoch_infos_data = epoch_infos_response.into_inner(); let mut suggested_epoch = epoch_infos_data.suggested_epoch_info.last_committed_epoch; let sign_request = tonic::Request::new(SignMessageRequest { key_tag: 15, // default key tag - BN254 message: encode(task_id).into(), required_epoch: suggested_epoch, }); let sign_response = relay_client.sign_message(sign_request).await?; let sign_data = sign_response.into_inner(); let listen_proofs_request = tonic::Request::new(ListenProofsRequest { start_epoch: suggested_epoch }); let proofs_stream = relay_client.listen_proofs(listen_proofs_request).await?.into_inner(); let mut aggregation_proof = None; while let Some(proof_response) = proofs_stream.next().await { match proof_response { Ok(proof_data) => { if proof_data.request_id == sign_data.request_id { if let Some(proof) = proof_data.aggregation_proof { aggregation_proof = Some(proof.proof); break; } } } Err(e) => { break; } } } appContract.complete_task(task_id, sign_data.epoch, aggregation_proof.unwrap()).await?; } ```
::: ## Integration Examples For a complete end-to-end examples application using the relay, see: | Repository | Description | | ------------------------------------------------------------------------- | ------------------------------------------------------------- | | [Symbiotic Super Sum](https://github.com/symbioticfi/symbiotic-super-sum) | A simple task-based network | | [Cosmos Relay SDK](https://github.com/symbioticfi/cosmos-relay-sdk) | An application built using the Cosmos SDK and Symbiotic Relay | ## Next Steps
} href="/integrate/networks/helpful-core-contracts-endpoints" />
--- ## /integrate/networks/relay-onchain import { Card1 } from "../../../components/Card1"; # Relay On-Chain The Symbiotic Relay system implements a complete signature aggregation workflow from validator set derivation through on-chain commitment of the ValSetHeader data structure. This allows for provable attestation checks on any chain of an arbitrary data signed by the validator set quorum. The system provides a modular smart contract framework that enables networks to manage validator sets dynamically, handle cryptographic keys, aggregate signatures, and commit cross-chain state ## Architecture Symbiotic provides a set of predefined smart contracts, in general, representing the following modules: - [`VotingPowerProvider`](https://github.com/symbioticfi/relay-contracts/blob/main/src/modules/voting-power/) - provides the basic data regarding operators, vaults and their voting power, it allows constructing various onboarding schemes - [`KeyRegistry`](https://github.com/symbioticfi/relay-contracts/blob/main/src/modules/key-registry/) - verifies and manages operators' keys; currently, these key types are supported: - [`BlsBn254`](https://github.com/symbioticfi/relay-contracts/blob/main/src/libraries/keys/KeyBlsBn254.sol) ([signature verification](https://github.com/symbioticfi/relay-contracts/blob/main/src/libraries/sigs/SigBlsBn254.sol)) - [`EcdsaSecp256k1`](https://github.com/symbioticfi/relay-contracts/blob/main/src/libraries/keys/KeyEcdsaSecp256k1.sol) ([signature verification](https://github.com/symbioticfi/relay-contracts/blob/main/src/libraries/sigs/SigEcdsaSecp256k1.sol)) - [`ValSetDriver`](https://github.com/symbioticfi/relay-contracts/blob/main/src/modules/valset-driver/) - is used by the off-chain part of the Symbiotic Relay for validator set deriving and maintenance - [`Settlement`](https://github.com/symbioticfi/relay-contracts/blob/main/src/modules/settlement/) - requires a compressed validator set (header) to be committed each epoch, but allows verifying signatures made by the validator set; currently, it supports the following verification mechanics: - [`SimpleVerifier`](https://github.com/symbioticfi/relay-contracts/blob/main/src/modules/settlement/sig-verifiers/SigVerifierBlsBn254Simple.sol) - requires the whole validator set to be inputted on the verification, but in a compressed and efficient way, so that it is the best choice to use up to around 125 validators - [`ZKVerifier`](https://github.com/symbioticfi/relay-contracts/blob/main/src/modules/settlement/sig-verifiers/SigVerifierBlsBn254ZK.sol) - uses ZK verification made with [gnark](https://github.com/Consensys/gnark), allowing larger validator sets with an almost constant verification gas cost :::info In sense of Symbiotic Core's `NetworkMiddlewareService` contract exactly `VotingPowerProvider` contract should be set as a middleware. ::: ### Permissions Relay contracts have three ready-to-use permission models: - [`OzOwnable`](https://github.com/symbioticfi/relay-contracts/blob/main/src/modules/common/permissions/OzOwnable.sol) - allows setting an owner address that can perform permissioned actions - Based on [OpenZeppelin's `Ownable` contract](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol) - [`OzAccessControl`](https://github.com/symbioticfi/relay-contracts/blob/main/src/modules/common/permissions/OzAccessControl.sol) - enables role-based permissions for each action - Based on [OpenZeppelin's `AccessControl` contract](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/AccessControl.sol) - Roles can be assigned to function selectors using `_setSelectorRole(bytes4 selector, bytes32 role)` - [`OzAccessManaged`](https://github.com/symbioticfi/relay-contracts/blob/main/src/modules/common/permissions/OzAccessManaged.sol) - controls which callers can access specific functions - Based on [OpenZeppelin's `AccessManaged` contract](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/manager/AccessManager.sol) To use these permission models, developers must inherit one of the above contracts and add the `checkPermission` modifier to functions that require access control. :::info Only one permission model can be used at a time. ::: #### Examples ##### ValSetDriver with OzOwnable ```solidity [MyValSetDriver.sol] // SPDX-License-Identifier: MIT pragma solidity ^0.8.25; import {ValSetDriver} from "../src/modules/valset-driver/ValSetDriver.sol"; import {OzOwnable} from "../src/modules/common/permissions/OzOwnable.sol"; import {IEpochManager} from "../src/interfaces/modules/valset-driver/IEpochManager.sol"; import {IValSetDriver} from "../src/interfaces/modules/valset-driver/IValSetDriver.sol"; contract MyValSetDriver is ValSetDriver, OzOwnable { function initialize( ValSetDriverInitParams memory valSetDriverInitParams, address owner ) public virtual initializer { __ValSetDriver_init(valSetDriverInitParams); __OzOwnable_init(ozOwnableInitParams); } } ``` ##### Settlement with OzAccessControl ```solidity [MySettlement.sol] // SPDX-License-Identifier: MIT pragma solidity ^0.8.25; import {Settlement} from "../src/modules/settlement/Settlement.sol"; import {OzAccessControl} from "../src/modules/common/permissions/OzAccessControl.sol"; import {ISettlement} from "../src/interfaces/modules/settlement/ISettlement.sol"; contract MySettlement is Settlement, OzAccessControl { bytes32 public constant SET_SIG_VERIFIER_ROLE = keccak256("SET_SIG_VERIFIER_ROLE"); bytes32 public constant SET_GENESIS_ROLE = keccak256("SET_GENESIS_ROLE"); function initialize( SettlementInitParams memory settlementInitParams, address defaultAdmin ) public virtual initializer { __Settlement_init(settlementInitParams); _grantRole(DEFAULT_ADMIN_ROLE, defaultAdmin); _setSelectorRole(ISettlement.setSigVerifier.selector, SET_SIG_VERIFIER_ROLE); _setSelectorRole(ISettlement.setGenesis.selector, SET_GENESIS_ROLE); } } ``` ### VotingPowerProvider Extensions There are multiple voting power extensions can be combined to achieve different properties of the VotingPowerProvider: - [`OperatorsWhitelist`](https://github.com/symbioticfi/relay-contracts/blob/main/src/modules/voting-power/extensions/OperatorsWhitelist.sol) - only whitelisted operators can register - [`OperatorsBlacklist`](https://github.com/symbioticfi/relay-contracts/blob/main/src/modules/voting-power/extensions/OperatorsBlacklist.sol) - blacklisted operators are unregistered and are forbidden to return back - [`OperatorsJail`](https://github.com/symbioticfi/relay-contracts/blob/main/src/modules/voting-power/extensions/OperatorsJail.sol) - operators can be jailed for some amount of time and register back after that - [`SharedVaults`](https://github.com/symbioticfi/relay-contracts/blob/main/src/modules/voting-power/extensions/SharedVaults.sol) - shared (with other networks) vaults (like the ones with NetworkRestakeDelegator) can be added - [`OperatorVaults`](https://github.com/symbioticfi/relay-contracts/blob/main/src/modules/voting-power/extensions/OperatorVaults.sol) - vaults that are attached to a single operator can be added - [`MultiToken`](https://github.com/symbioticfi/relay-contracts/blob/main/src/modules/voting-power/extensions/MultiToken.sol) - possible to add new supported tokens on the go - [`OpNetVaultAutoDeploy`](https://github.com/symbioticfi/relay-contracts/blob/main/src/modules/voting-power/extensions/OpNetVaultAutoDeploy.sol) - enable auto-creation of the configured by you vault on each operator registration - Also, there are ready bindings for [slashing](https://github.com/symbioticfi/relay-contracts/blob/main/src/modules/voting-power/extensions/BaseSlashing.sol) and [rewards](https://github.com/symbioticfi/relay-contracts/blob/main/src/modules/voting-power/extensions/BaseRewards.sol) #### Examples ##### Single-Operator Vaults Added by Owner ```solidity [MyVotingPowerProvider.sol] // SPDX-License-Identifier: MIT pragma solidity ^0.8.25; import {VotingPowerProvider} from "../src/modules/voting-power/VotingPowerProvider.sol"; import {OzOwnable} from "../src/modules/common/permissions/OzOwnable.sol"; import {EqualStakeVPCalc} from "../src/modules/voting-power/common/voting-power-calc/EqualStakeVPCalc.sol"; import {OperatorVaults} from "../src/modules/voting-power/extensions/OperatorVaults.sol"; contract MyVotingPowerProvider is VotingPowerProvider, OzOwnable, EqualStakeVPCalc, OperatorVaults { constructor(address operatorRegistry, address vaultFactory) VotingPowerProvider(operatorRegistry, vaultFactory) {} function initialize( VotingPowerProviderInitParams memory votingPowerProviderInitParams, OzOwnableInitParams memory ozOwnableInitParams ) public virtual initializer { __VotingPowerProvider_init(votingPowerProviderInitParams); __OzOwnable_init(ozOwnableInitParams); } } ``` ##### Shared Vaults Whitelisted under AccessControl ```solidity [MyVotingPowerProvider.sol] // SPDX-License-Identifier: MIT pragma solidity ^0.8.25; import {VotingPowerProvider} from "../src/modules/voting-power/VotingPowerProvider.sol"; import {OzAccessControl} from "../src/modules/common/permissions/OzAccessControl.sol"; import {EqualStakeVPCalc} from "../src/modules/voting-power/common/voting-power-calc/EqualStakeVPCalc.sol"; import {SharedVaults} from "../src/modules/voting-power/extensions/SharedVaults.sol"; import {OperatorsWhitelist} from "../src/modules/voting-power/extensions/OperatorsWhitelist.sol"; import {ISharedVaults} from "../src/interfaces/modules/voting-power/extensions/ISharedVaults.sol"; contract MyVotingPowerProvider is VotingPowerProvider, OzAccessControl, EqualStakeVPCalc, SharedVaults, OperatorsWhitelist { bytes32 public constant REGISTER_SHARED_VAULT = keccak256("REGISTER_SHARED_VAULT"); bytes32 public constant UNREGISTER_SHARED_VAULT = keccak256("UNREGISTER_SHARED_VAULT"); bytes32 public constant SET_WHITELIST_STATUS = keccak256("SET_WHITELIST_STATUS"); bytes32 public constant WHITELIST_OPERATOR = keccak256("WHITELIST_OPERATOR"); bytes32 public constant UNWHITELIST_OPERATOR = keccak256("UNWHITELIST_OPERATOR"); constructor(address operatorRegistry, address vaultFactory) VotingPowerProvider(operatorRegistry, vaultFactory) {} function initialize( VotingPowerProviderInitParams memory votingPowerProviderInitParams, address defaultAdmin ) public virtual initializer { __VotingPowerProvider_init(votingPowerProviderInitParams); _grantRole(DEFAULT_ADMIN_ROLE, defaultAdmin); _setSelectorRole(ISharedVaults.registerSharedVault.selector, REGISTER_SHARED_VAULT); _setSelectorRole(ISharedVaults.unregisterSharedVault.selector, UNREGISTER_SHARED_VAULT); _setSelectorRole(ISharedVaults.setWhitelistStatus.selector, SET_WHITELIST_STATUS); _setSelectorRole(ISharedVaults.whitelistOperator.selector, WHITELIST_OPERATOR); _setSelectorRole(ISharedVaults.unwhitelistOperator.selector, UNWHITELIST_OPERATOR); } function _registerOperatorImpl( address operator ) internal virtual override(VotingPowerProvider, OperatorsWhitelist) { super._registerOperatorImpl(operator); } } ``` ### VotingPowerProvider Power Calculators `VotingPowerProvider` always inherits a virtual [VotingPowerCalculators](https://github.com/symbioticfi/relay-contracts/blob/main/src/modules/voting-power/common/voting-power-calc/) contracts that has to be implemented in the resulting contract. Symbiotic provides several stake-to-votingPower conversion mechanisms you can separately or combine: - [EqualStakeVPCalc](https://github.com/symbioticfi/relay-contracts/blob/main/src/modules/voting-power/common/voting-power-calc/EqualStakeVPCalc.sol) - voting power is equal to stake - [NormalizedTokenDecimalsVPCalc](https://github.com/symbioticfi/relay-contracts/blob/main/src/modules/voting-power/common/voting-power-calc/NormalizedTokenDecimalsVPCalc.sol) - all tokens' decimals are normalized to 18 - [PricedTokensChainlinkVPCalc](https://github.com/symbioticfi/relay-contracts/blob/main/src/modules/voting-power/common/voting-power-calc/PricedTokensChainlinkVPCalc.sol) - voting power is calculated using Chainlink price feeds - [WeightedTokensVPCalc](https://github.com/symbioticfi/relay-contracts/blob/main/src/modules/voting-power/common/voting-power-calc/WeightedTokensVPCalc.sol) - voting power is affected by configured weights for tokens - [WeightedVaultsVPCalc](https://github.com/symbioticfi/relay-contracts/blob/main/src/modules/voting-power/common/voting-power-calc/WeightedVaultsVPCalc.sol) - voting power is affected by configured weights for vaults #### Examples ##### Chainlink-Priced Stake with Token-/Vault-Specific Weights ```solidity [MyVotingPowerProvider.sol] // SPDX-License-Identifier: MIT pragma solidity ^0.8.25; import {VotingPowerProvider} from "../src/modules/voting-power/VotingPowerProvider.sol"; import {PricedTokensChainlinkVPCalc} from "../src/modules/voting-power/common/voting-power-calc/PricedTokensChainlinkVPCalc.sol"; import {OzOwnable} from "../src/modules/common/permissions/OzOwnable.sol"; import {WeightedTokensVPCalc} from "../src/modules/voting-power/common/voting-power-calc/WeightedTokensVPCalc.sol"; import {WeightedVaultsVPCalc} from "../src/modules/voting-power/common/voting-power-calc/WeightedVaultsVPCalc.sol"; import {VotingPowerCalcManager} from "../src/modules/voting-power/base/VotingPowerCalcManager.sol"; contract MyVotingPowerProvider is VotingPowerProvider, OzOwnable, PricedTokensChainlinkVPCalc, WeightedTokensVPCalc, WeightedVaultsVPCalc { constructor(address operatorRegistry, address vaultFactory) VotingPowerProvider(operatorRegistry, vaultFactory) {} function initialize( VotingPowerProviderInitParams memory votingPowerProviderInitParams, OzOwnableInitParams memory ozOwnableInitParams ) public virtual initializer { __VotingPowerProvider_init(votingPowerProviderInitParams); __OzOwnable_init(ozOwnableInitParams); } function stakeToVotingPowerAt( address vault, uint256 stake, bytes memory extraData, uint48 timestamp ) public view override(VotingPowerCalcManager, PricedTokensChainlinkVPCalc, WeightedTokensVPCalc, WeightedVaultsVPCalc) returns (uint256) { return super.stakeToVotingPowerAt(vault, stake, extraData, timestamp); } function stakeToVotingPower( address vault, uint256 stake, bytes memory extraData ) public view override(VotingPowerCalcManager, PricedTokensChainlinkVPCalc, WeightedTokensVPCalc, WeightedVaultsVPCalc) returns (uint256) { return super.stakeToVotingPower(vault, stake, extraData); } } ``` :::note If too many extensions/additions are implemented, the contract may exceed the maximum bytecode size. In this case, try adding `via-ir` flag with low number of optimizer runs for Solidity compiler. ::: ## Deployment The deployment tooling can be found at [`script/`](https://github.com/symbioticfi/relay-contracts/tree/main/script) folder. It consists of [`RelayDeploy.sol`](https://github.com/symbioticfi/relay-contracts/tree/main/script/RelayDeploy.sol) Foundry script template [`relay-deploy.sh`](https://github.com/symbioticfi/relay-contracts/tree/main/script/relay-deploy.sh) bash script (the Relay smart contracts use external libraries for their implementations, so that it's not currently possible to use solely Foundry script for multi-chain deployment). - [`RelayDeploy.sol`](https://github.com/symbioticfi/relay-contracts/tree/main/script/RelayDeploy.sol) - abstract base that wires common Symbiotic Core helpers and exposes the four deployment hooks: KeyRegistry, VotingPowerProvider, Settlement, and ValVetDriver - [`relay-deploy.sh`](https://github.com/symbioticfi/relay-contracts/tree/main/script/relay-deploy.sh) - orchestrates per-contract multi-chain deployments (uses Python inside to parse `toml` file) The script deploys Relay modules under [OpenZeppelin's TransparentUpgradeableProxy](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) using [CreateX](https://github.com/pcaversaccio/createx) (it provides better control for production deployments and more simplified approaches for development). ::::steps ### Configure on-chain deployment Implement your `MyRelayDeploy.sol` ([see example](https://github.com/symbioticfi/relay-contracts/tree/main/script/examples/MyRelayDeploy.sol)) - this Foundry script should include the deployment configuration of your Relay modules - you need to implement all virtual functions of `RelayDeploy.sol` - in constructor, need to input the path of the `toml` file - you are provided with additional helpers such as `getCore()`, `getKeyRegistry()`, `getVotingPowerProvider()`, etc. (see full list in [`RelayDeploy.sol`](https://github.com/symbioticfi/relay-contracts/tree/main/script/RelayDeploy.sol)) ### Choose multi-chain setup Implement your `my-relay-deploy.toml` ([see example](https://github.com/symbioticfi/relay-contracts/tree/main/script/examples/my-relay-deploy.toml)) - this configuration file should include RPC URLs that will be needed for the deployment, and which modules should be deployed on which chains - **do not replace \[1234567890] placeholder with endpoint\_url = ""** - the contracts are deployed in such order: 1. KeyRegistry 2. VotingPowerProvider 3. Settlement 4. ValSetDriver ### Run the deployment Execute the deployment script, e.g.: ```bash [bash] ./script/relay-deploy.sh ./script/examples/MyRelayDeploy.sol ./script/examples/my-relay-deploy.toml --broadcast --ledger ``` :::note Basic form is `./script/relay-deploy.sh ` ::: At the end, your `toml` file will contain the addresses of the deployed Relay modules. :::: ## Integrate The Symbiotic Relay provides you a comprehensive tooling working on its own, so that you don't care about anything except only your stake-backed application logic. ### Verify Message Your application contract is able to verify any message using a validator set at any point of time needed via: ```solidity [MyApp.sol] import {ISettlement} from "@symbioticfi/relay-contracts/src/interfaces/modules/settlement/ISettlement.sol"; function verifyMessage(bytes calldata message, uint48 epoch, bytes calldata proof) public returns (bool) { return ISettlement(SETTLEMENT).verifyQuorumSigAt( abi.encode(keccak256(message)), 15, // default key tag - BN254 (uint248(1e18) * 2) / 3 + 1, // default quorum threshold - 2/3 + 1 proof, epoch, new bytes(0) ); } ``` :::note You need to have a `Settlement` deployed on the verification chain first. ::: ### Use Validator Set Data Your application contract is able to use the validator set at any point of time using [SSZ](https://ethereum.org/developers/docs/data-structures-and-encoding/ssz/) proof verification via, e.g.: ```solidity [MyApp.sol] import {ValSetVerifier} from "@symbioticfi/relay-contracts/src/libraries/utils/ValSetVerifier.sol"; import {Math} from "openzeppelin-contracts/contracts/utils/math/Math.sol"; function verifyOperatorVotingPower( ValSetVerifier.SszProof calldata validatorRootProof, uint256 validatorRootLocalIndex, bytes32 validatorSetRoot, ValSetVerifier.SszProof calldata operatorProof, address operator, ValSetVerifier.SszProof calldata votingPowerProof, uint256 votingPower ) public returns (bool) { return operatorProof.leaf == bytes32(uint256(uint160(operator)) << 96) && ValSetVerifier.verifyOperator( validatorRootProof, validatorRootLocalIndex, validatorSetRoot, operatorProof ) && votingPowerProof.leaf == bytes32(votingPower << (256 - (Math.log2(votingPower) / 8 + 1) * 8)) && ValSetVerifier.verifyVotingPower( validatorRootProof, validatorRootLocalIndex, validatorSetRoot, votingPowerProof ); } ``` :::note You need to have a `Settlement` deployed on the verification chain first. ::: ## Next Steps
} href="/integrate/networks/relay-offchain" />
--- ## /integrate/networks/rewards import { Card1 } from "../../../components/Card1"; # Rewards [Read Learn first](/learn/core-concepts/rewards) Rewards is a encouraging mechanism provided by a network to motivate operators to do their work. The rewards are divided into Staker and Operator rewards: - The Staker rewards can be provided depending purely on the provided stake’s value (the representation of value can differ from the standard "dollars view" depending on alignment, token distribution, or other factors) - The Operator rewards can be provided depending on the economic factors similar to the above ones and on the operators’ performance metrics (e.g., number of tasks completed, liveness, or validators’ distribution). ## Staker Rewards The rewards contracts are not a part of the core contracts. However, we provide a default implementation of Staker rewards, which is represented by a simple pro-rata rewards distribution concerning the collateral amounts provided by stakers at the capture time point and providing an ability to the Vault curator to receive fees. Code: [`DefaultStakerRewards`](https://github.com/symbioticfi/rewards/blob/main/src/contracts/defaultStakerRewards/DefaultStakerRewards.sol) :::info An unlimited number of networks can use one `DefaultStakerRewards` contract in favor of one specific vault’s stakers. ::: Factory deployment: [`DefaultStakerRewardsFactory`](/get-started/resources/addresses#rewards) ### Counterparties - Network: 1. Distributes the rewards via `distributeRewards()` - Staker: 1. Claims the rewards via `claimRewards()` - Curator: 1. Configures an admin fee via `setAdminFee()` 2. Claims an admin fee (it accumulates after each distribution) via `claimAdminFee()` ### Example This example walks you through setting up a test environment to simulate the staker rewards distribution process on Holešky. ::::steps #### Prepare Mock Accounts You'll need 6 EOAs: - **Network Admin**: registers the network - **Middleware**: set by the network to handle reward distribution and vault opt-ins - **Vault Admin**: sets up the vault and allocates shares - **Mock Operator**: receives delegated stake - **Two Test Stakers**: deposit collateral :::warning For test purposes, EOAs are fine. On mainnet, use contracts for middleware logic. ::: #### Register Network & Set Middleware 1. Register your network - [Example tx](https://holesky.etherscan.io/tx/0xfaf4b1d5cd0ce1a34a796b53a330092584b3e5886ef0de6937fe9ab4b698fe59) 2. Set middleware address - [Example tx](https://holesky.etherscan.io/tx/0x84459916991fd14762f49adfb958fd41d59b381c33c4e34bb26fba51aa12307d) :::warning On mainnet, avoid using EOAs for middleware. ::: #### Create Vault & Register Operator 1. [Create a vault](https://app.holesky.symbiotic.fi/create) using `wstETH` as collateral. - Sample Vault address: `0x0351bE785c8Abfc81e8d8C2b6Ef06A7fc62478a0` - [Creation tx](https://holesky.etherscan.io/tx/0xb28636cca9c561a4308ca9679b487fc2eb3b12850dabc54cd7fbb73cc3d44487) 2. Register operator in [Operator Registry](https://holesky.etherscan.io/address/0x6F75a4ffF97326A00e52662d82EA4FdE86a2C548) - [Sample tx](https://holesky.etherscan.io/tx/0x5ec21081d3f7f4b0a6f7abcb78a54d63fc8739be4f2e1be6f82324bcc8c6404e) 3. Opt operator into: - [Network](https://holesky.etherscan.io/tx/0x19ef569b223f8876ccd508cde00fb1cb27744fcf07424314a08cebea66a2cd20) - [Vault](https://holesky.etherscan.io/tx/0x72f68941e84b62f5f55282c60aaaeb5bfa706c803961713c9cbe9224e93d3bd2) 4. Allocate shares: - [Sample tx](https://holesky.etherscan.io/tx/0x492c5a337775e2914abbdf521883acd7d84380db4512d2c8cae8c7b0116d8fd5) 5. Submit 3 PRs with metadata (network, vault, operator) to the [metadata-holesky](https://github.com/symbioticfi/metadata-holesky/) repo. Examples: [78](https://github.com/symbioticfi/metadata-holesky/pull/78), [79](https://github.com/symbioticfi/metadata-holesky/pull/79), [80](https://github.com/symbioticfi/metadata-holesky/pull/80) #### Vault Opt-In (Network) 1. Opt-in to vault by calling `setMaxNetworkLimit(0, 1e18)` - [Sample tx](https://holesky.etherscan.io/tx/0x010ba1ccd0aec56a38dc664358bbead3eb2b3e48961b42dc14cffa1b0cf5a698) 2. From emitted event, extract `subnetwork ID` 3. **Vault Admin:** accept opt-in by calling `setNetworkLimit` - [Sample tx](https://holesky.etherscan.io/tx/0xe7a15e5961081d067964a554f2a5f0ff32dfe415b2848b832e665d81fca9b136) #### Deploy Rewards Contract 1. Use [DefaultStakerRewardsFactory](https://holesky.etherscan.io/address/0x58e80fa5eb938525f2ca80c5bde724d7a99a7892#writeContract) to create `DefaultStakerRewards` contract (can be deployed by a Vault Admin or a Network) - [Sample tx](https://holesky.etherscan.io/tx/0x4a9a56943a54179e89bf8c28e28bc5ada3d925d1964ee4907f22e8d1ccc45d7b) 2. Submit rewards metadata PR - [Example](https://github.com/symbioticfi/metadata-holesky/pull/85) #### Distribute Rewards - Increase token allowance - [Sample tx](https://holesky.etherscan.io/tx/0xd05afbd3d2cacda412c17f9a4ca08bf91c51efc429e5dd77d1cad3ace84177b9) - Call `distributeRewards()` - [Sample tx](https://holesky.etherscan.io/address/0x3CBc80E19d558a4012CfE93dD724c1a52ad41EF5#writeContract) :::warning On mainnet, call to `distributeRewards()` should be done from within your middleware contract. ::: ##### Encode `data` parameter - To reproduce manually, use [ABI encoder](https://adibas03.github.io/online-ethereum-abi-encoder-decoder/encode) to cook it with: - Input types: `uint48,uint256,bytes,bytes` - Input values: `1752766520,1000,0x,0x` - `timestamp` - use current timestamp - `maxAdminShare` (10%) - anti-frontrun protection - `bytes` inputs are [hints](/integrate/builders-researchers/hints) (set to `0x`) - To reproduce in Solidity: ```solidity [DistributeRewards.s.sol] address rewardsContract = 0x3CBc80E19d558a4012CfE93dD724c1a52ad41EF5; address network = 0x0351bE785c8Abfc81e8d8C2b6Ef06A7fc62478a0; address token = 0x5FbDB2315678afecb367f032d93F642f64180aa3; uint256 amount = 1000000000000000000; uint48 timestamp = 1752766520; uint256 maxAdminFee = 1000; bytes memory activeSharesHint = new bytes(0); bytes memory activeStakeHint = new bytes(0); bytes memory data = abi.encode(timestamp, maxAdminFee, activeSharesHint, activeStakeHint); IDefaultStakerRewards(rewardsContract).distributeRewards(network, token, amount, data); ``` This gives the `data` parameter: ```bash [Expected output] 0x00000000000000000000000000000000000000000000000000000000687942a500000000000000000000000000000000000000000000000000000000000003e8000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 ``` - [Sample tx](https://holesky.etherscan.io/tx/0x842094f4c3b9f4b368daa3d6160239144f41c338e1dc176a904a12b486015423) :::info To identify that rewards were distributed in the past, open a [Vault Page](https://app.holesky.symbiotic.fi/vault/0x132A3c9c2403662d89DF034b8B11c145b90d0ddA). Find the overall Vault Reward data and rewards claimed earlier in the corresponding section. ::: ![rewards-vault.png](/guides/img/rewards/rewards-vault.png) #### User Flow - [Acquire wstETH](https://stake-holesky.testnet.fi/wrap) - [Sample tx](https://holesky.etherscan.io/tx/0x2e4031b92696e1c1eb8e53e24f30981f76e90c45a40b4169ec5d4b7c4e60a5fe) - Deposit to Vault (via UI) - [Tx 1](https://holesky.etherscan.io/tx/0x7238e1ac735564ab09189fcd41497112e978d2fe933bad282a624ae040744df2) - [Tx 2](https://holesky.etherscan.io/tx/0x58c1f88de345da80f9e1a16304932113f6f2baa0deedee63a7c945fc8114676f) - Claim Rewards (after next distribution) - Use the [Symbiotic Dashboard (Rewards tab)](https://app.holesky.symbiotic.fi/vault/0x0351bE785c8Abfc81e8d8C2b6Ef06A7fc62478a0) ![rewards-claim.png](/guides/img/rewards/rewards-claim.png) :::: ## Operator Rewards Since the rewards contracts are not a part of the core contracts, we allow users to provide their own implementations. Here are three example implementations: 1. The network performs off-chain calculations to determine the reward distributions. After calculating the rewards, the network executes batch transfers to distribute the rewards in a consolidated manner. 2. The network performs off-chain calculations to determine rewards and generates a Merkle tree, allowing operators to claim their rewards. 3. The network performs on-chain reward calculations within its middleware to determine the distribution of rewards. We provide a default implementation of the operator rewards, which is represented by a simple Merkle tree rewards distribution, where each leaf represents a recipient (an operator’s treasury address) and the total amount of tokens earned for the whole period. Code: [`DefaultOperatorRewards`](https://github.com/symbioticfi/rewards/blob/main/src/contracts/defaultOperatorRewards/DefaultOperatorRewards.sol) :::info An unlimited number of networks can use one `DefaultOperatorRewards` contract in favor of an unlimited number of operators. ::: Factory deployment: [`DefaultOperatorRewardsFactory`](/get-started/resources/addresses#rewards) ### Counterparties - **Network:** 1. Calculates a Merkle root for the rewards distribution (we’ve implemented a [CLI](https://github.com/symbioticfi/rewards/blob/main/specs/OperatorRewards.md#cli) for that purpose) 2. Distributes the rewards via `distributeRewards()` - **Operator:** 1. Claims the rewards via `claimRewards()` by the usage of a Merkle proof (it can be got with the help of [CLI](https://github.com/symbioticfi/rewards/blob/main/specs/OperatorRewards.md#cli)) ## Notes - In production, middleware logic should be implemented in a contract. - This guide uses testnet (Holešky) with simplified EOAs for ease of reproduction. - Vault curators are typically responsible for reward contract deployment and share allocations. ## Next Steps
} href="/integrate/networks/slashing" /> } href="/integrate/networks/relay-onchain" />
--- ## /integrate/networks/slashing import { Card1 } from "../../../components/Card1"; # Slashing [Read Learn first](/learn/core-concepts/slashing) Slashing is a penalty mechanism enforced by a network to deter operators from breaking their commitments. Such violations may include failing to complete tasks properly or accurately. Slashing typically results in the burning or redistribution of the operator’s staked funds. ## **Slasher Module** Each Symbiotic Vault has an immutably set Slasher module implementation. In general, there are three possible implementation choices: 1. **No Slasher** - no slashing can occur within the Vault 2. **Instant Slasher (`TYPE = 0`)** - allows networks to immediately slash funds in a FIFO order 3. **Veto Slasher (`TYPE = 1`)** - supports a veto process over a pre-defined veto period, where designated **Resolvers** can cancel the slashing request Each Slasher module contains a `slashableStake(subnetwork, operator, captureTimestamp, hints)` function that returns an amount of collateral still slashable for the given `captureTimestamp` at the current moment. :::warning The provided slashable collateral amount may be inaccurate in practice in case of usage of **restaking** by the vault (hence, multiple network may slash the same amount of collateral). ::: :::info During the slashing request execution, the funds are transferred to an immutably set `Vault.burner()`. ::: ### Slashing Guarantees Each Symbiotic Vault has an epoch duration (can be obtained via `Vault.epochDuration()`), that determines the withdrawal delay and, also, provides a period during which the slashing guarantees are held. Hence, the following inequality must hold:
executeSlashTimestamp - captureTimestamp \<= epochDuration
### Slasher (Type 0) Slasher performs an instant execution of the slashing request when received and validated. ```solidity [NetworkSlasher.sol] import {IVault} from "@symbioticfi/core/src/interfaces/vault/IVault.sol"; import {ISlasher} from "@symbioticfi/core/src/interfaces/slasher/ISlasher.sol"; import {Subnetwork} from "@symbioticfi/core/src/contracts/libraries/Subnetwork.sol"; address slasher = IVault(vault).slasher(); bytes32 subnetwork = Subnetwork.subnetwork(NETWORK, IDENTIFIER); ISlasher(slasher).slash( subnetwork, operator, amount, captureTimestamp, hints ) ``` Parameters: - `subnetwork` - full identifier of the subnetwork (address of the network concatenated with the uint96 identifier) - `operator` - address of the operator - `amount` - amount of the collateral to slash - `captureTimestamp` - time point when the stake was captured - `hints` - hints for checkpoints' indexes :::info `NetworkMiddlewareService.middleware(network)` should call this function. ::: ### VetoSlasher (Type 1) The flow consists of three stages: 1. Request Slashing 2. Veto Slashing 3. Execute Slashing (if not vetoed) Let’s assume the veto duration period is set to **5 days** and the epoch duration is set to **7 days**. ::::steps #### Day 1 - Request Slashing ```solidity [NetworkSlasher.sol] import {IVault} from "@symbioticfi/core/src/interfaces/vault/IVault.sol"; import {IVetoSlasher} from "@symbioticfi/core/src/interfaces/slasher/IVetoSlasher.sol"; import {Subnetwork} from "@symbioticfi/core/src/contracts/libraries/Subnetwork.sol"; address slasher = IVault(vault).slasher(); bytes32 subnetwork = Subnetwork.subnetwork(NETWORK, IDENTIFIER); uint256 slashIndex = IVetoSlasher(slasher).requestSlash( subnetwork, operator, amount, captureTimestamp, hints ) ``` This call succeeds only if the following inequality holds:
requestSlashTimestamp + vetoDuration - captureTimestamp \<= epochDuration
:::info `NetworkMiddlewareService.middleware(network)` should call this function. ::: #### Days 1 to 5 - Veto Slashing ```solidity [Resolver] IVetoSlasher(slasher).vetoSlash(slashIndex, hints) ``` :::info `VetoSlasher.resolver(subnetwork, hint)` should call this function. ::: #### Days 6 to 7 - Execute Slashing If the slashing request wasn't vetoed: ```solidity [NetworkSlasher.sol] IVetoSlasher(slasher).executeSlash( slashIndex, hints ) ``` :::info `NetworkMiddlewareService.middleware(network)` should call this function. ::: :::: ## Resolvers If the Vault has a VetoSlasher type, there is a veto phase, whose duration is set during the vault's deployment, when the resolver can veto the request. The resolver can be set by Network via `IVetoSlasher(slasher).setResolver(identifier, resolver, hints)`. :::note First time when the resolver is set, it is applied immediately. Otherwise, the update is applied after `VetoSlasher.resolverSetEpochsDelay()` epochs. ::: ## Next Steps
} href="/integrate/networks/relay-onchain" />
--- ## /integrate/networks/submit-metadata import { Card1 } from "../../../components/Card1"; # Submit Metadata [Symbiotic UI](https://app.symbiotic.fi/deposit) provides users with accurate and up-to-date information about various data regarding TVL, allocations, relations between Curators, Vaults, Operators and Networks, etc. However, for the mentioned counterparties to be easily accessible and visible on the UI - their metadata should should be submitted to the corresponding repositories. Once, the metadata is submitted, it should be reviewed and merged by the Symbiotic team. After that the new data starts to be shown publicly on the UI. ## Add a New Entity Template ### Choose a Repository | Chain | URL | | ------- | -------------------------------------------------------------------------------------------------- | | Mainnet | [https://github.com/symbioticfi/metadata-mainnet](https://github.com/symbioticfi/metadata-mainnet) | | Hoodi | [https://github.com/symbioticfi/metadata-hoodi](https://github.com/symbioticfi/metadata-hoodi) | | Sepolia | [https://github.com/symbioticfi/metadata-sepolia](https://github.com/symbioticfi/metadata-sepolia) | | Holešky | [https://github.com/symbioticfi/metadata-holesky](https://github.com/symbioticfi/metadata-holesky) | ### Repository Structure The repository is organized as follows: ``` repository/ ├── vaults/ │ ├── 0x
/ │ │ ├── info.json │ │ └── logo.png (optional) ├── networks/ ├── operators/ ├── tokens/ ``` Each entity is identified by its Ethereum address (`0x...`), and its data is stored in a folder named after the address. Inside this folder, there must be a file `info.json` containing metadata, and optionally, an icon file `logo.png`. *** ### Steps to Add a New Entity **Note: After your PR is submitted, email your PR link to [verify@symbiotic.fi](mailto\:verify@symbiotic.fi) from your official business email (domain must match that of your entity website) to allow us to confirm your identity ahead of merging your PR.** 1. **Determine the entity type**: - Decide whether the entity belongs to `vaults`, `networks`, `operators`, `tokens` or `points`. - If the entity is a `vault`, please be sure that it's collateral token entity is registered in the `tokens` folder before adding the vault metadata. If not, please add the token first. 2. **Register the entity in the registry**: - Before adding metadata for vaults, networks, or operators, ensure that they are registered in their respective registries. You can find the current registry contract addresses in the [Addresses page](/get-started/resources/addresses). Unregistered entities will not be accepted. 3. **Create a new folder**: - Navigate to the appropriate directory for the entity type. - Create a folder named after the Ethereum address (e.g., `0x1234567890abcdef1234567890abcdef12345678`). 4. **Add the `info.json` file**: - Include metadata in the specified format (see below). 5. **(Optional) Add an icon file**: - If available, include a `logo.png` file with the entity’s logo. Your PR will be reviewed by the Symbiotic team, and if approved, it will be merged into the repository. Please note that the PR will be reviewed only after the entity is checked with automated checks. *** ### File Format: `info.json` The `info.json` file must follow this structure: #### Required Fields - `name` (string): The name of the entity. - `description` (string): A brief description of the entity. - `tags` (array of strings): Tags categorizing the entity. - `links` (array of objects): External links related to the entity. #### Fields for Points - `type` (string): The type of the point (e.g., "network"). - `decimals` (number): The number of decimal places for the point. #### Supported `links` Types Each link should include: - `type`: The type of the link. Supported values are: - `website`: The official website of the entity. - `explorer`: A blockchain explorer link for the entity's Ethereum address or contract. - `docs`: Documentation related to the entity. - `example`: Example use cases or tutorials. - `externalLink`: A link to be shown below the entity's name. - `name`: A user-friendly name for the link. - `url`: The URL of the resource. ### Icon File: `logo.png` (Optional) If you want to include an icon for the entity, follow these guidelines: - **File Name**: `logo.png` - **Dimensions**: 256x256 pixels - **Format**: PNG Place the `logo.png` file in the same folder as the `info.json` file. *** ### Validation Before submitting your PR, ensure the following: 1. The Ethereum address is valid: - It must start with `0x` and be exactly 42 characters long. 2. The `info.json` file is valid: - Use a JSON validator, such as [https://jsonlint.com/](https://jsonlint.com/). 3. The `logo.png` file (if included) meets the size requirement of **256x256 pixels**. *** ### Submitting the Pull Request Once your files are added to the repository, create a Pull Request with the following details: 1. **Entity Type**: Specify the type (vault, network, operator, token). 2. **Ethereum Address**: Provide the address of the entity. 3. **Description**: Summarize the entity’s purpose and data. #### Example PR Description ``` Added new token entity: 0x1234567890abcdef1234567890abcdef12345678 - **Name**: USDT - **Description**: USDT is a stablecoin pegged to the US Dollar, widely used for trading and liquidity in cryptocurrency markets. - **Tags**: stablecoin, usdt - **Links**: - [Website](https://tether.to/) - [Etherscan](https://etherscan.io/token/0xdac17f958d2ee523a2206206994597c13d831ec7) - [Tether Documentation](https://docs.tether.to/) - **CMC ID**: 825 - **Permit Name**: USDT Permit Token - **Permit Version**: 1 - **Icon**: Included (256x256 px) ``` *** ### Review and Approval Your PR will be reviewed to ensure: - The `info.json` file has all required fields and valid data. - The `logo.png` file (if included) meets the requirements. - The metadata is accurate and well-structured. - The submitter of the PR is from the entity in question (verified via an email with your PR link to [verify@symbiotic.fi](mailto\:verify@symbiotic.fi) from your official business email) After approval, your changes will be merged into the repository. ## Add a Network :::steps ##### Create a new folder in the `/networks` directory ##### Create a new json file in the folder with the following structure: ```json [info.json] { "name": "My Network", "description": "My Network is a network that allows you to stake your tokens and earn rewards.", "tags": ["network", "staking"], "links": [{ "type": "website", "name": "Website", "url": "https://mynetwork.com" }] } ``` ##### Save a logo of the Network to `logo.png` of 256x256 pixels size ::: ## Add Points :::steps ##### Create a new folder in the `/points` directory ##### Create a new json file in the folder with the following structure: ```json [info.json] { "name": "My Points", "description": "My Points is a points that allows you to earn rewards.", "tags": ["points", "staking"], "links": [{ "type": "website", "name": "Website", "url": "https://mypoints.com" }] } ``` ##### Save a logo of the Points to `logo.png` of 256x256 pixels size ::: ## Add a Pre-deposit Vault The Vault metadata submission guide is available [inside the section for Curators](/integrate/curators/submit-metadata). ## Next Steps
} href="/integrate/networks/pre-deposit" /> } href="/integrate/networks/rewards" />
--- ## Relay Contracts This file is a merged representation of a subset of the codebase, containing files not matching ignore patterns, combined into a single document by Repomix. The content has been processed where content has been compressed (code blocks are separated by ⋮---- delimiter). # File Summary ## Purpose This file contains a packed representation of a subset of the repository's contents that is considered the most important context. It is designed to be easily consumable by AI systems for analysis, code review, or other automated processes. ## File Format The content is organized as follows: 1. This summary section 2. Repository information 3. Directory structure 4. Repository files (if enabled) 5. Multiple file entries, each consisting of: a. A header with the file path (## File: path/to/file) b. The full contents of the file in a code block ## Usage Guidelines - This file should be treated as read-only. Any changes should be made to the original repository files, not this packed version. - When processing this file, use the file path to distinguish between different files in the repository. - Be aware that this file may contain sensitive information. Handle it with the same level of security as you would the original repository. ## Notes - Some files may have been excluded based on .gitignore rules and Repomix's configuration - Binary files are not included in this packed representation. Please refer to the Repository Structure section for a complete list of file paths, including binary files - Files matching these patterns are excluded: docs/ - Files matching patterns in .gitignore are excluded - Files matching default ignore patterns are excluded - Content has been compressed - code blocks are separated by ⋮---- delimiter - Files are sorted by Git change count (files with more changes are at the bottom) # Directory Structure ``` .github/ ISSUE_TEMPLATE/ BUG_REPORT.yaml FEATURE_IMPROVEMENT.yaml workflows/ pre-commit.yaml test.yaml trufflehog.yml CODEOWNERS PULL_REQUEST_TEMPLATE.md audits/ Bailsec-RelaySmartContracts.pdf Cyfrin-RelayContracts&Network.pdf Sherlock-RelayContracts&Network.pdf SigmaPrime-RelayContracts&Network.pdf StatemindAI-RelayContracts.pdf examples/ MyKeyRegistry.sol MySettlement.sol MyValSetDriver.sol MyVotingPowerProvider.sol script/ examples/ my-relay-deploy.toml MyRelayDeploy.sol utils/ sort_errors.py sort_imports.py relay-deploy.sh RelayDeploy.sol snapshots/ gas.txt sizes.txt src/ interfaces/ modules/ base/ INetworkManager.sol IOzEIP712.sol IPermissionManager.sol common/ permissions/ IOzAccessControl.sol IOzAccessManaged.sol IOzOwnable.sol key-registry/ IKeyRegistry.sol settlement/ sig-verifiers/ zk/ IVerifier.sol ISigVerifier.sol ISigVerifierBlsBn254Simple.sol ISigVerifierBlsBn254ZK.sol ISettlement.sol valset-driver/ IEpochManager.sol IValSetDriver.sol voting-power/ base/ IVotingPowerCalcManager.sol common/ voting-power-calc/ libraries/ AggregatorV3Interface.sol IEqualStakeVPCalc.sol INormalizedTokenDecimalsVPCalc.sol IPricedTokensChainlinkVPCalc.sol IWeightedTokensVPCalc.sol IWeightedVaultsVPCalc.sol extensions/ IBaseRewards.sol IBaseSlashing.sol IMultiToken.sol IOperatorsBlacklist.sol IOperatorsJail.sol IOperatorsWhitelist.sol IOperatorVaults.sol IOpNetVaultAutoDeploy.sol ISharedVaults.sol IVotingPowerProvider.sol libraries/ keys/ KeyBlsBn254.sol KeyEcdsaSecp256k1.sol sigs/ SigBlsBn254.sol SigEcdsaSecp256k1.sol structs/ Checkpoints.sol PersistentSet.sol utils/ BN254.sol InputNormalizer.sol KeyTags.sol Scaler.sol ValSetVerifier.sol modules/ base/ NetworkManager.sol OzEIP712.sol PermissionManager.sol common/ permissions/ OzAccessControl.sol OzAccessManaged.sol OzOwnable.sol key-registry/ KeyRegistry.sol settlement/ sig-verifiers/ libraries/ ExtraDataStorageHelper.sol SigVerifierBlsBn254Simple.sol SigVerifierBlsBn254ZK.sol Settlement.sol valset-driver/ EpochManager.sol ValSetDriver.sol voting-power/ base/ VotingPowerCalcManager.sol common/ voting-power-calc/ libraries/ ChainlinkPriceFeed.sol EqualStakeVPCalc.sol NormalizedTokenDecimalsVPCalc.sol PricedTokensChainlinkVPCalc.sol WeightedTokensVPCalc.sol WeightedVaultsVPCalc.sol extensions/ logic/ BaseRewardsLogic.sol BaseSlashingLogic.sol OpNetVaultAutoDeployLogic.sol BaseRewards.sol BaseSlashing.sol MultiToken.sol OperatorsBlacklist.sol OperatorsJail.sol OperatorsWhitelist.sol OperatorVaults.sol OpNetVaultAutoDeploy.sol SharedVaults.sol logic/ VotingPowerProviderLogic.sol VotingPowerProvider.sol test/ data/ zk/ Verifier_10.sol Verifier_100.sol Verifier_1000.sol genesis_header.json examples/ MyVotingPowerProvider.t.sol helpers/ blsTestGenerator.py BN254G2.sol ed25519TestData.json ed25519TestGenerator.js libraries/ keys/ KeyBlsBn254.t.sol KeyEcdsaSecp256k1.t.sol sigs/ SigBlsBn254.t.sol SigEcdsaSecp256k1.t.sol structs/ Checkpoints.t.sol PersistentSet.t.sol utils/ InputNormalizer.t.sol KeyTag.t.sol ValSetVerifier.t.sol mocks/ KeyBlsBn254Mock.sol KeyEcdsaSecp256k1Mock.sol KeyRegistryWithKey64.sol NoPermissionManager.sol RewarderMock.sol SigVerifierFalseMock.sol SigVerifierMock.sol SlasherMock.sol ValSetVerifierMock.sol VotingPowerProviderFull.sol VotingPowerProviderSemiFull.sol VotingPowerProviderSharedVaults.sol modules/ base/ NetworkManager.t.sol OzEIP712.t.sol PermissionManager.t.sol VotingPowerCalcManager.t.sol common/ permissions/ NoPermissionManager.t.sol OzAccessControl.t.sol OzAccessManaged.t.sol OzOwnable.t.sol key-registry/ KeyRegistry.t.sol settlement/ sig-verifiers/ libraries/ ExtraDataStorageHelper.t.sol SigVerifierBlsBn254Simple.t.sol SigVerifierBlsBn254ZK.t.sol Settlement.t.sol valset-driver/ EpochManager.t.sol ValSetDriver.t.sol voting-power/ common/ voting-power-calc/ NormalizedTokenDecimalsVPCalc.t.sol PricedTokensChainlinkVPCalc.t.sol WeightedTokensVPCalc.t.sol WeightedVaultsVPCalc.t.sol extensions/ BaseRewards.t.sol BaseSlashing.t.sol EqualStakeVPCalc.t.sol MultiToken.t.sol OperatorsBlacklist.t.sol OperatorsJail.t.sol OperatorsWhitelist.t.sol OperatorVaults.t.sol OpNetVaultAutoDeploy.t.sol SharedVaults.t.sol VotingPowerProvider.t.sol InitSetup.sol MasterGenesisSetup.sol MasterSetup.sol .env.example .gitignore .gitmodules .nvmrc .pre-commit-config.yaml .prettierignore .prettierrc codecov.yml CONTRIBUTING.md foundry.lock foundry.toml LICENSE package.json README.md remappings.txt ``` # Files ## File: .github/ISSUE_TEMPLATE/BUG_REPORT.yaml ````yaml name: Bug report description: File a bug report to help us improve the code title: "[Bug]: " labels: ["bug"] body: - type: markdown attributes: value: | Please check that the bug is not already being tracked. - type: textarea attributes: label: Describe the bug description: Provide a clear and concise description of what the bug is and which contracts it affects. validations: required: true - type: textarea attributes: label: Expected Behavior description: Provide a clear and concise description of the desired fix. validations: required: true - type: textarea attributes: label: To Reproduce description: If you have written tests to showcase the bug, what can we run to reproduce the issue? placeholder: "git checkout / forge test --isolate --mt " - type: textarea attributes: label: Additional context description: If there is any additional context needed like a dependency or integrating contract that is affected please describe it below. ```` ## File: .github/ISSUE_TEMPLATE/FEATURE_IMPROVEMENT.yaml ````yaml name: Feature Improvement description: Suggest an improvement. labels: ["triage"] body: - type: markdown attributes: value: | Please ensure that the feature has not already been requested. - type: dropdown attributes: label: Component description: Which area of code does your idea improve? multiple: true options: - Gas Optimization - General design optimization (improving efficiency, cleanliness, or developer experience) - Testing - Documentation - type: textarea attributes: label: Describe the suggested feature and problem it solves. description: Provide a clear and concise description of what feature you would like to see, and what problems it solves. validations: required: true - type: textarea attributes: label: Describe the desired implementation. description: If possible, provide a suggested architecture change or implementation. - type: textarea attributes: label: Describe alternatives. description: If possible, describe the alternatives you've considered, or describe the current functionality and how it may be sub-optimal. - type: textarea attributes: label: Additional context. description: Please list any additional dependencies or integrating contacts that are affected. ```` ## File: .github/workflows/pre-commit.yaml ````yaml # checks that pre-commit hooks pass before allowing to merge a PR name: pre-commit on: pull_request: branches: [main, master, staging, dev, feat/**, fix/**] concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true env: FOUNDRY_PROFILE: ${{ github.event_name == 'push' && 'ci' || 'pr' }} ETH_RPC_URL: ${{ secrets.ETH_RPC_URL }} jobs: pre-commit: runs-on: ubuntu-latest timeout-minutes: 45 steps: - uses: bullfrogsec/bullfrog@1831f79cce8ad602eef14d2163873f27081ebfb3 # v0.8.4 - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: submodules: recursive - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: "3.11" - name: Install Foundry uses: foundry-rs/foundry-toolchain@82dee4ba654bd2146511f85f0d013af94670c4de # v1.4.0 with: version: stable - name: Install pre-commit run: python -m pip install --upgrade pip pre-commit - name: Run pre-commit run: pre-commit run --all-files --color always --show-diff-on-failure env: SKIP: forge-snapshots,doc ```` ## File: .github/workflows/test.yaml ````yaml name: test on: pull_request: branches: [main, master, staging, dev, feat/**, fix/**] push: branches: [main, master, staging, dev] concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true env: FOUNDRY_PROFILE: ${{ github.event_name == 'push' && 'ci' || 'pr' }} ETH_RPC_URL: ${{ secrets.ETH_RPC_URL }} jobs: forge-test: name: Foundry project runs-on: ubuntu-latest timeout-minutes: 180 steps: - uses: bullfrogsec/bullfrog@1831f79cce8ad602eef14d2163873f27081ebfb3 # v0.8.4 - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: submodules: recursive - name: Install Foundry uses: foundry-rs/foundry-toolchain@82dee4ba654bd2146511f85f0d013af94670c4de # v1.4.0 with: version: stable - name: Run Forge fmt check run: forge fmt --check - name: Run Forge tests run: forge test --isolate - name: Run Forge coverage run: | forge coverage --report lcov id: coverage env: COVERAGE: true - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} ```` ## File: .github/workflows/trufflehog.yml ````yaml name: TruffleHog on: pull_request: types: [opened, synchronize, reopened] permissions: contents: read pull-requests: write id-token: write issues: write concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: scan: runs-on: ubuntu-latest timeout-minutes: 15 steps: - uses: bullfrogsec/bullfrog@1831f79cce8ad602eef14d2163873f27081ebfb3 # v0.8.4 - name: Checkout code uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: fetch-depth: 0 - name: TruffleHog OSS id: trufflehog uses: trufflesecurity/trufflehog@0f58ae7c5036094a1e3e750d18772af92821b503 # v3.90.5 with: path: . base: ${{ github.event.pull_request.base.sha }} head: ${{ github.event.pull_request.head.sha }} extra_args: --results=verified,unknown ```` ## File: .github/CODEOWNERS ```` * @symbioticfi/contracts ```` ## File: .github/PULL_REQUEST_TEMPLATE.md ````markdown # Pull Request ## Description Please include a summary of the change and which feature was implemented or which issue was fixed. Also, include relevant motivation and context. List any dependencies that are required for this change. Fixes # (issue) ### How Has This Been Tested? Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration. # Checklist: - [ ] 100% test and branch coverage - [ ] check slither or other analyzer for severe issues - [ ] fuzz and invariant tests (when applicable) --- ### Considerations - I have followed the [contributing guidelines](../CONTRIBUTING.md). - My code follows the style guidelines of this project and I have run `forge fmt` and prettier to ensure the code style is valid - I have performed a self-review of my own code - I have commented my code, particularly in hard-to-understand areas - I have made corresponding changes to the documentation - I have added tests that prove my fix is effective or that my feature works - New and existing unit tests pass locally with my changes ### Additional context Add any other context about the pull request here. ```` ## File: examples/MyKeyRegistry.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {KeyRegistry} from "../src/modules/key-registry/KeyRegistry.sol"; ⋮---- /// @title MyKeyRegistry /// @notice Example implementation of the KeyRegistry contract. contract MyKeyRegistry is KeyRegistry { function initialize(KeyRegistryInitParams memory keyRegistryInitParams) public virtual initializer { ```` ## File: examples/MySettlement.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {OzAccessControl} from "../src/modules/common/permissions/OzAccessControl.sol"; import {Settlement} from "../src/modules/settlement/Settlement.sol"; ⋮---- import {ISettlement} from "../src/interfaces/modules/settlement/ISettlement.sol"; ⋮---- /// @title MySettlement /// @notice Example implementation of the Settlement contract. contract MySettlement is Settlement, OzAccessControl { ⋮---- function initialize(SettlementInitParams memory settlementInitParams, address defaultAdmin) ```` ## File: examples/MyValSetDriver.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {OzAccessControl} from "../src/modules/common/permissions/OzAccessControl.sol"; import {ValSetDriver} from "../src/modules/valset-driver/ValSetDriver.sol"; ⋮---- import {IEpochManager} from "../src/interfaces/modules/valset-driver/IEpochManager.sol"; import {IValSetDriver} from "../src/interfaces/modules/valset-driver/IValSetDriver.sol"; ⋮---- /// @title MyValSetDriver /// @notice Example implementation of the ValSetDriver contract. contract MyValSetDriver is ValSetDriver, OzAccessControl { ⋮---- function initialize(ValSetDriverInitParams memory valSetDriverInitParams, address defaultAdmin) ```` ## File: examples/MyVotingPowerProvider.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {EqualStakeVPCalc} from "../src/modules/voting-power/common/voting-power-calc/EqualStakeVPCalc.sol"; import {OperatorVaults} from "../src/modules/voting-power/extensions/OperatorVaults.sol"; import {OzOwnable} from "../src/modules/common/permissions/OzOwnable.sol"; import {VotingPowerProvider} from "../src/modules/voting-power/VotingPowerProvider.sol"; ⋮---- /// @title MyVotingPowerProvider /// @notice Example implementation of the VotingPowerProvider contract. contract MyVotingPowerProvider is VotingPowerProvider, OzOwnable, EqualStakeVPCalc, OperatorVaults { ⋮---- function initialize( ```` ## File: script/examples/my-relay-deploy.toml ````toml [31337] endpoint_url = "http://127.0.0.1:8545" [31338] endpoint_url = "http://127.0.0.1:8546" [1234567890] endpoint_url = "" keyRegistry = 31337 votingPowerProvider = [31337] settlement = [ 31337, 31338, ] valSetDriver = 31337 ```` ## File: script/examples/MyRelayDeploy.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {SigVerifierBlsBn254Simple} from "../../src/modules/settlement/sig-verifiers/SigVerifierBlsBn254Simple.sol"; import {RelayDeploy} from "../RelayDeploy.sol"; import {IVotingPowerProvider} from "../../src/interfaces/modules/voting-power/IVotingPowerProvider.sol"; import {INetworkManager} from "../../src/interfaces/modules/base/INetworkManager.sol"; import {IOzEIP712} from "../../src/interfaces/modules/base/IOzEIP712.sol"; import {IOzOwnable} from "../../src/interfaces/modules/common/permissions/IOzOwnable.sol"; import {MyVotingPowerProvider} from "../../examples/MyVotingPowerProvider.sol"; import {MyKeyRegistry} from "../../examples/MyKeyRegistry.sol"; import {IKeyRegistry} from "../../src/interfaces/modules/key-registry/IKeyRegistry.sol"; import {MyValSetDriver} from "../../examples/MyValSetDriver.sol"; import {IValSetDriver} from "../../src/interfaces/modules/valset-driver/IValSetDriver.sol"; import {IEpochManager} from "../../src/interfaces/modules/valset-driver/IEpochManager.sol"; import {MySettlement} from "../../examples/MySettlement.sol"; import {ISettlement} from "../../src/interfaces/modules/settlement/ISettlement.sol"; ⋮---- // ./script/relay-deploy.sh ./script/examples/MyRelayDeploy.sol ./script/examples/my-relay-deploy.toml --broadcast ⋮---- contract MyRelayDeploy is RelayDeploy { ⋮---- // Key registry parameters ⋮---- // Voting power parameters ⋮---- // Settlement parameters ⋮---- // ValSet driver parameters ⋮---- function _keyRegistryParams() internal override returns (address implementation, bytes memory initData) { ⋮---- function _votingPowerProviderParams() internal override returns (address implementation, bytes memory initData) { ⋮---- function _settlementParams() internal override returns (address implementation, bytes memory initData) { ⋮---- function _valSetDriverParams() internal override returns (address implementation, bytes memory initData) { ⋮---- function runDeployKeyRegistry() public override { ⋮---- function runDeployVotingPowerProvider() public override { ⋮---- function runDeploySettlement() public override { ⋮---- function runDeployValSetDriver() public override { ```` ## File: script/utils/sort_errors.py ````python #!/usr/bin/env python3 ⋮---- def _error_sort_key(error_line: str) -> str ⋮---- signature = error_line.strip()[len("error ") :] name = signature.split("(", 1)[0].strip() ⋮---- def _extract_entries(block_text: str) -> List[Tuple[int, int, str, int]] ⋮---- entries: List[Tuple[int, int, str, int]] = [] offset = 0 entry_start: Optional[int] = None last_content_end: Optional[int] = None current_error: Optional[str] = None ⋮---- def finalize() -> None ⋮---- entry_start = None last_content_end = None current_error = None ⋮---- newline_idx = block_text.find("\n", offset) ⋮---- line_end = len(block_text) ⋮---- line_end = newline_idx + 1 line = block_text[offset:line_end] stripped = line.strip() ⋮---- last_content_end = line_end offset = line_end ⋮---- entry_start = offset ⋮---- current_error = line.strip() ⋮---- def _sort_error_block(text: str) -> Tuple[str, bool] ⋮---- marker = "/* ERRORS */" search_pos = 0 changed = False ⋮---- marker_idx = text.find(marker, search_pos) ⋮---- block_start = text.find("\n", marker_idx) ⋮---- cursor = block_start first_block_idx: Optional[int] = None last_block_idx = block_start ⋮---- newline_idx = text.find("\n", cursor) ⋮---- line_end = len(text) ⋮---- line = text[cursor:line_end] ⋮---- cursor = line_end ⋮---- first_block_idx = cursor last_block_idx = line_end ⋮---- search_pos = cursor ⋮---- block_text = text[first_block_idx:last_block_idx] entries = _extract_entries(block_text) ⋮---- search_pos = last_block_idx ⋮---- prefix = block_text[:entries[0][0]] suffix = block_text[entries[-1][1]:] sorted_entries = sorted(entries, key=lambda item: (item[2], item[3])) sorted_chunks = [block_text[start:end].rstrip("\n") for start, end, _, _ in sorted_entries] ⋮---- new_block = prefix + "\n\n".join(sorted_chunks) ⋮---- stripped_suffix = suffix.lstrip("\n") ⋮---- text = text[:first_block_idx] + new_block + text[last_block_idx:] changed = True search_pos = first_block_idx + len(new_block) ⋮---- def sort_errors_in_file(path: Path) ⋮---- original = path.read_text(encoding="utf-8") ⋮---- def iter_solidity_files(targets: Iterable[Path]) -> Iterable[Path] ⋮---- def resolve_targets(path_args: Iterable[str]) -> List[Path] ⋮---- defaults = [Path(name) for name in ("src", "examples") if Path(name).exists()] ⋮---- def sort_from_stdin() -> None ⋮---- errors = sys.stdin.read() sorted_errors = sorted(x.strip() for x in errors.splitlines()) ⋮---- def main() -> int ⋮---- parser = argparse.ArgumentParser( ⋮---- args = parser.parse_args() ⋮---- targets = resolve_targets(args.paths) ```` ## File: script/utils/sort_imports.py ````python #!/usr/bin/env python3 ⋮---- FROM_IMPORT_RE = re.compile(r'from\s+["\']([^"\']+)["\']', re.IGNORECASE | re.MULTILINE) DIRECT_IMPORT_RE = re.compile(r'import\s+["\']([^"\']+)["\']', re.IGNORECASE | re.MULTILINE) WHITESPACE_RE = re.compile(r"\s+") ⋮---- @dataclass class ImportEntry ⋮---- start: int end: int text: str path: str order: int ⋮---- def extract_path(import_text: str) -> str ⋮---- match = FROM_IMPORT_RE.search(import_text) ⋮---- match = DIRECT_IMPORT_RE.search(import_text) ⋮---- def collect_import_entries(lines: Sequence[str]) -> List[ImportEntry] ⋮---- entries: List[ImportEntry] = [] index = 0 ⋮---- stripped = lines[index].lstrip() ⋮---- start = index statement_lines = [lines[index].rstrip()] ⋮---- end = index text = "\n".join(statement_lines) path = extract_path(text) ⋮---- def normalize_import_text(import_text: str) -> str ⋮---- """Flatten whitespace so multi-line imports sort identically to single-line ones.""" compact = WHITESPACE_RE.sub(" ", import_text.strip()) compact = compact.replace("{ ", "{").replace(" }", "}") compact = compact.replace("( ", "(").replace(" )", ")") ⋮---- def classify_import(path: str) -> str ⋮---- normalized = path.lstrip("./") lower = normalized.lower() ⋮---- library = normalized.split("/", 1)[0] ⋮---- def build_sorted_block(entries: Sequence[ImportEntry]) -> List[str] ⋮---- grouped: Dict[str, List[ImportEntry]] = defaultdict(list) ⋮---- ordered_groups: List[List[ImportEntry]] = [] ⋮---- external_groups = sorted( ⋮---- block_text = "\n\n".join("\n".join(entry.text for entry in group) for group in ordered_groups) ⋮---- def sort_imports_in_file(path: Path) -> None ⋮---- original_text = path.read_text(encoding="utf-8") has_trailing_newline = original_text.endswith("\n") lines = original_text.splitlines() ⋮---- entries = collect_import_entries(lines) ⋮---- block_start = entries[0].start block_end = entries[-1].end covered_indexes = set() ⋮---- new_block_lines = build_sorted_block(entries) new_lines = lines[:block_start] + new_block_lines + lines[block_end + 1 :] new_text = "\n".join(new_lines) ⋮---- def iter_solidity_files(targets: Iterable[Path]) -> Iterable[Path] ⋮---- def resolve_targets(path_args: Iterable[str]) -> List[Path] ⋮---- defaults = [Path(name) for name in ("src", "examples") if Path(name).exists()] ⋮---- def main() -> int ⋮---- parser = argparse.ArgumentParser( ⋮---- args = parser.parse_args() ⋮---- targets = resolve_targets(args.paths) ```` ## File: script/relay-deploy.sh ````bash #!/usr/bin/env bash set -euo pipefail usage() { cat <<'USAGE' Usage: relay-deploy.sh [forge-script-args...] Arguments: Path to the Forge deployment script (.s.sol) Path to the deployment configuration TOML file [args...] Additional arguments forwarded to every forge script invocation USAGE } if [[ $# -lt 2 ]]; then usage exit 1 fi script_path=$1 shift config_path=$1 shift extra_args=("$@") if [[ ! -f "$script_path" ]]; then echo "Error: script not found at '$script_path'" >&2 exit 1 fi if [[ ! -f "$config_path" ]]; then echo "Error: config not found at '$config_path'" >&2 exit 1 fi for bin in forge python3 cast; do if ! command -v "$bin" >/dev/null 2>&1; then echo "Error: required command '$bin' is not available in PATH" >&2 exit 1 fi done get_contract_chains() { local config_file=$1 local contract_key=$2 python3 - "$config_file" "$contract_key" <<'PY' import sys try: import tomllib # Python 3.11+ except ModuleNotFoundError: # pragma: no cover - fallback for older versions import tomli as tomllib config_path, contract_key = sys.argv[1:3] with open(config_path, "rb") as fh: config = tomllib.load(fh) or {} def extract_chains(raw_value): if isinstance(raw_value, dict): raw_value = raw_value.get("chains") if isinstance(raw_value, list): return [str(item) for item in raw_value if item is not None] if raw_value is None: return [] return [str(raw_value)] contracts_section = {} for key in ("1234567890", 1234567890): value = config.get(key) if isinstance(value, dict): contracts_section = value break else: legacy_contracts = config.get("contracts") if isinstance(legacy_contracts, dict): contracts_section = legacy_contracts chains = extract_chains(contracts_section.get(contract_key)) if not chains: legacy_contracts = config.get("contracts") if isinstance(legacy_contracts, dict): chains = extract_chains(legacy_contracts.get(contract_key)) for chain in chains: print(chain) PY } get_chain_rpc_url() { local config_file=$1 local chain_id=$2 python3 - "$config_file" "$chain_id" <<'PY' import sys try: import tomllib # Python 3.11+ except ModuleNotFoundError: # pragma: no cover import tomli as tomllib config_path, requested_chain = sys.argv[1:3] with open(config_path, "rb") as fh: config = tomllib.load(fh) or {} def normalize_chain_mapping(raw): chains = {} if isinstance(raw, dict): for key, value in raw.items(): key_str = str(key) chains[key_str] = value return chains chains = {} chains.update(normalize_chain_mapping(config.get("chains"))) for key, value in config.items(): if key in ("chains", "contracts") or key in ("0", 0): continue key_str = str(key) if not key_str.isdigit(): continue if isinstance(value, (dict, str)): chains[key_str] = value candidates = [] candidates.append(requested_chain) try: candidates.append(int(requested_chain)) except ValueError: pass candidates.append(str(requested_chain)) entry = None seen = set() for candidate in candidates: key_variants = [] if isinstance(candidate, int): key_variants.extend([candidate, str(candidate)]) else: key_variants.append(candidate) for key in key_variants: key_str = str(key) if key_str in seen: continue seen.add(key_str) if key_str in chains: entry = chains[key_str] break if entry is not None: break if isinstance(entry, dict): url = entry.get("endpoint_url") or entry.get("rpc_url") if url: print(url) elif isinstance(entry, str) and entry: print(entry) PY } createx_address="0xba5Ed099633D3B313e4D5F7bdc1305d3c28ba5Ed" createx_deployer="0xeD456e05CaAb11d66C4c797dD6c1D6f9A7F352b5" createx_tx="0xf92f698085174876e800832dc6c08080b92f1660a06040523060805234801561001457600080fd5b50608051612e3e6100d860003960008181610603015281816107050152818161082b015281816108d50152818161127f01528181611375015281816113e00152818161141f015281816114a7015281816115b3015281816117d20152818161183d0152818161187c0152818161190401528181611ac501528181611c7801528181611ce301528181611d2201528181611daa01528181611fe901528181612206015281816122f20152818161244d015281816124a601526125820152612e3e6000f3fe60806040526004361061018a5760003560e01c806381503da1116100d6578063d323826a1161007f578063e96deee411610059578063e96deee414610395578063f5745aba146103a8578063f9664498146103bb57600080fd5b8063d323826a1461034f578063ddda0acb1461036f578063e437252a1461038257600080fd5b80639c36a286116100b05780639c36a28614610316578063a7db93f214610329578063c3fe107b1461033c57600080fd5b806381503da1146102d0578063890c283b146102e357806398e810771461030357600080fd5b80632f990e3f116101385780636cec2536116101125780636cec25361461027d57806374637a7a1461029d5780637f565360146102bd57600080fd5b80632f990e3f1461023757806331a7c8c81461024a57806342d654fc1461025d57600080fd5b806327fe18221161016957806327fe1822146101f15780632852527a1461020457806328ddd0461461021757600080fd5b8062d84acb1461018f57806326307668146101cb57806326a32fc7146101de575b600080fd5b6101a261019d366004612915565b6103ce565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b6101a26101d9366004612994565b6103e6565b6101a26101ec3660046129db565b610452565b6101a26101ff3660046129db565b6104de565b6101a2610212366004612a39565b610539565b34801561022357600080fd5b506101a2610232366004612a90565b6106fe565b6101a2610245366004612aa9565b61072a565b6101a2610258366004612aa9565b6107bb565b34801561026957600080fd5b506101a2610278366004612b1e565b6107c9565b34801561028957600080fd5b506101a2610298366004612a90565b610823565b3480156102a957600080fd5b506101a26102b8366004612b4a565b61084f565b6101a26102cb3660046129db565b611162565b6101a26102de366004612b74565b6111e8565b3480156102ef57600080fd5b506101a26102fe366004612bac565b611276565b6101a2610311366004612bce565b6112a3565b6101a2610324366004612994565b611505565b6101a2610337366004612c49565b6116f1565b6101a261034a366004612aa9565b611964565b34801561035b57600080fd5b506101a261036a366004612cd9565b6119ed565b6101a261037d366004612c49565b611a17565b6101a2610390366004612bce565b611e0c565b6101a26103a3366004612915565b611e95565b6101a26103b6366004612bce565b611ea4565b6101a26103c9366004612b74565b611f2d565b60006103dd8585858533611a17565b95945050505050565b6000806103f2846120db565b90508083516020850134f59150610408826123d3565b604051819073ffffffffffffffffffffffffffffffffffffffff8416907fb8fda7e00c6b06a2b54e58521bc5894fee35f1090e5a3bb6390bfe2b98b497f790600090a35092915050565b60006104d86104d260408051437fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101406020830152419282019290925260608101919091524260808201524460a08201524660c08201523360e08201526000906101000160405160208183030381529060405280519060200120905090565b836103e6565b92915050565b600081516020830134f090506104f3816123d3565b60405173ffffffffffffffffffffffffffffffffffffffff8216907f4db17dd5e4732fb6da34a148104a592783ca119a1e7bb8829eba6cbadef0b51190600090a2919050565b600080610545856120db565b905060008460601b90506040517f3d602d80600a3d3981f3363d3d373d3d3d363d7300000000000000000000000081528160148201527f5af43d82803e903d91602b57fd5bf300000000000000000000000000000000006028820152826037826000f593505073ffffffffffffffffffffffffffffffffffffffff8316610635576040517fc05cee7a00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001660048201526024015b60405180910390fd5b604051829073ffffffffffffffffffffffffffffffffffffffff8516907fb8fda7e00c6b06a2b54e58521bc5894fee35f1090e5a3bb6390bfe2b98b497f790600090a36000808473ffffffffffffffffffffffffffffffffffffffff1634876040516106a19190612d29565b60006040518083038185875af1925050503d80600081146106de576040519150601f19603f3d011682016040523d82523d6000602084013e6106e3565b606091505b50915091506106f382828961247d565b505050509392505050565b60006104d87f00000000000000000000000000000000000000000000000000000000000000008361084f565b60006107b36107aa60408051437fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101406020830152419282019290925260608101919091524260808201524460a08201524660c08201523360e08201526000906101000160405160208183030381529060405280519060200120905090565b85858533611a17565b949350505050565b60006107b3848484336112a3565b60006040518260005260ff600b53836020527f21c35dbe1b344a2488cf3321d6ce542f8e9f305544ff09e4993a62319a497c1f6040526055600b20601452806040525061d694600052600160345350506017601e20919050565b60006104d8827f00000000000000000000000000000000000000000000000000000000000000006107c9565b600060607f9400000000000000000000000000000000000000000000000000000000000000610887600167ffffffffffffffff612d45565b67ffffffffffffffff16841115610902576040517f3c55ab3b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016600482015260240161062c565b836000036109c7576040517fd60000000000000000000000000000000000000000000000000000000000000060208201527fff00000000000000000000000000000000000000000000000000000000000000821660218201527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606087901b1660228201527f800000000000000000000000000000000000000000000000000000000000000060368201526037015b6040516020818303038152906040529150611152565b607f8411610a60576040517fd60000000000000000000000000000000000000000000000000000000000000060208201527fff0000000000000000000000000000000000000000000000000000000000000080831660218301527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606088901b16602283015260f886901b1660368201526037016109b1565b60ff8411610b1f576040517fd70000000000000000000000000000000000000000000000000000000000000060208201527fff0000000000000000000000000000000000000000000000000000000000000080831660218301527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606088901b1660228301527f8100000000000000000000000000000000000000000000000000000000000000603683015260f886901b1660378201526038016109b1565b61ffff8411610bff576040517fd80000000000000000000000000000000000000000000000000000000000000060208201527fff00000000000000000000000000000000000000000000000000000000000000821660218201527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606087901b1660228201527f820000000000000000000000000000000000000000000000000000000000000060368201527fffff00000000000000000000000000000000000000000000000000000000000060f086901b1660378201526039016109b1565b62ffffff8411610ce0576040517fd90000000000000000000000000000000000000000000000000000000000000060208201527fff00000000000000000000000000000000000000000000000000000000000000821660218201527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606087901b1660228201527f830000000000000000000000000000000000000000000000000000000000000060368201527fffffff000000000000000000000000000000000000000000000000000000000060e886901b166037820152603a016109b1565b63ffffffff8411610dc2576040517fda0000000000000000000000000000000000000000000000000000000000000060208201527fff00000000000000000000000000000000000000000000000000000000000000821660218201527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606087901b1660228201527f840000000000000000000000000000000000000000000000000000000000000060368201527fffffffff0000000000000000000000000000000000000000000000000000000060e086901b166037820152603b016109b1565b64ffffffffff8411610ea5576040517fdb0000000000000000000000000000000000000000000000000000000000000060208201527fff00000000000000000000000000000000000000000000000000000000000000821660218201527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606087901b1660228201527f850000000000000000000000000000000000000000000000000000000000000060368201527fffffffffff00000000000000000000000000000000000000000000000000000060d886901b166037820152603c016109b1565b65ffffffffffff8411610f89576040517fdc0000000000000000000000000000000000000000000000000000000000000060208201527fff00000000000000000000000000000000000000000000000000000000000000821660218201527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606087901b1660228201527f860000000000000000000000000000000000000000000000000000000000000060368201527fffffffffffff000000000000000000000000000000000000000000000000000060d086901b166037820152603d016109b1565b66ffffffffffffff841161106e576040517fdd0000000000000000000000000000000000000000000000000000000000000060208201527fff00000000000000000000000000000000000000000000000000000000000000821660218201527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606087901b1660228201527f870000000000000000000000000000000000000000000000000000000000000060368201527fffffffffffffff0000000000000000000000000000000000000000000000000060c886901b166037820152603e016109b1565b6040517fde0000000000000000000000000000000000000000000000000000000000000060208201527fff00000000000000000000000000000000000000000000000000000000000000821660218201527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606087901b1660228201527f880000000000000000000000000000000000000000000000000000000000000060368201527fffffffffffffffff00000000000000000000000000000000000000000000000060c086901b166037820152603f0160405160208183030381529060405291505b5080516020909101209392505050565b60006104d86111e260408051437fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101406020830152419282019290925260608101919091524260808201524460a08201524660c08201523360e08201526000906101000160405160208183030381529060405280519060200120905090565b83611505565b600061126f61126860408051437fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101406020830152419282019290925260608101919091524260808201524460a08201524660c08201523360e08201526000906101000160405160208183030381529060405280519060200120905090565b8484610539565b9392505050565b600061126f83837f00000000000000000000000000000000000000000000000000000000000000006119ed565b60008451602086018451f090506112b9816123d3565b60405173ffffffffffffffffffffffffffffffffffffffff8216907f4db17dd5e4732fb6da34a148104a592783ca119a1e7bb8829eba6cbadef0b51190600090a26000808273ffffffffffffffffffffffffffffffffffffffff168560200151876040516113279190612d29565b60006040518083038185875af1925050503d8060008114611364576040519150601f19603f3d011682016040523d82523d6000602084013e611369565b606091505b5091509150816113c9577f0000000000000000000000000000000000000000000000000000000000000000816040517fa57ca23900000000000000000000000000000000000000000000000000000000815260040161062c929190612d94565b73ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001631156114fb578373ffffffffffffffffffffffffffffffffffffffff167f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163160405160006040518083038185875af1925050503d8060008114611495576040519150601f19603f3d011682016040523d82523d6000602084013e61149a565b606091505b509092509050816114fb577f0000000000000000000000000000000000000000000000000000000000000000816040517fc2b3f44500000000000000000000000000000000000000000000000000000000815260040161062c929190612d94565b5050949350505050565b600080611511846120db565b905060006040518060400160405280601081526020017f67363d3d37363d34f03d5260086018f30000000000000000000000000000000081525090506000828251602084016000f5905073ffffffffffffffffffffffffffffffffffffffff81166115e0576040517fc05cee7a00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016600482015260240161062c565b604051839073ffffffffffffffffffffffffffffffffffffffff8316907f2feea65dd4e9f9cbd86b74b7734210c59a1b2981b5b137bd0ee3e208200c906790600090a361162c83610823565b935060008173ffffffffffffffffffffffffffffffffffffffff1634876040516116569190612d29565b60006040518083038185875af1925050503d8060008114611693576040519150601f19603f3d011682016040523d82523d6000602084013e611698565b606091505b505090506116a681866124ff565b60405173ffffffffffffffffffffffffffffffffffffffff8616907f4db17dd5e4732fb6da34a148104a592783ca119a1e7bb8829eba6cbadef0b51190600090a25050505092915050565b6000806116fd876120db565b9050808651602088018651f59150611714826123d3565b604051819073ffffffffffffffffffffffffffffffffffffffff8416907fb8fda7e00c6b06a2b54e58521bc5894fee35f1090e5a3bb6390bfe2b98b497f790600090a36000808373ffffffffffffffffffffffffffffffffffffffff168660200151886040516117849190612d29565b60006040518083038185875af1925050503d80600081146117c1576040519150601f19603f3d011682016040523d82523d6000602084013e6117c6565b606091505b509150915081611826577f0000000000000000000000000000000000000000000000000000000000000000816040517fa57ca23900000000000000000000000000000000000000000000000000000000815260040161062c929190612d94565b73ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000163115611958578473ffffffffffffffffffffffffffffffffffffffff167f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163160405160006040518083038185875af1925050503d80600081146118f2576040519150601f19603f3d011682016040523d82523d6000602084013e6118f7565b606091505b50909250905081611958577f0000000000000000000000000000000000000000000000000000000000000000816040517fc2b3f44500000000000000000000000000000000000000000000000000000000815260040161062c929190612d94565b50505095945050505050565b60006107b36119e460408051437fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101406020830152419282019290925260608101919091524260808201524460a08201524660c08201523360e08201526000906101000160405160208183030381529060405280519060200120905090565b858585336116f1565b6000604051836040820152846020820152828152600b8101905060ff815360559020949350505050565b600080611a23876120db565b905060006040518060400160405280601081526020017f67363d3d37363d34f03d5260086018f30000000000000000000000000000000081525090506000828251602084016000f5905073ffffffffffffffffffffffffffffffffffffffff8116611af2576040517fc05cee7a00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016600482015260240161062c565b604051839073ffffffffffffffffffffffffffffffffffffffff8316907f2feea65dd4e9f9cbd86b74b7734210c59a1b2981b5b137bd0ee3e208200c906790600090a3611b3e83610823565b935060008173ffffffffffffffffffffffffffffffffffffffff1687600001518a604051611b6c9190612d29565b60006040518083038185875af1925050503d8060008114611ba9576040519150601f19603f3d011682016040523d82523d6000602084013e611bae565b606091505b50509050611bbc81866124ff565b60405173ffffffffffffffffffffffffffffffffffffffff8616907f4db17dd5e4732fb6da34a148104a592783ca119a1e7bb8829eba6cbadef0b51190600090a260608573ffffffffffffffffffffffffffffffffffffffff1688602001518a604051611c299190612d29565b60006040518083038185875af1925050503d8060008114611c66576040519150601f19603f3d011682016040523d82523d6000602084013e611c6b565b606091505b50909250905081611ccc577f0000000000000000000000000000000000000000000000000000000000000000816040517fa57ca23900000000000000000000000000000000000000000000000000000000815260040161062c929190612d94565b73ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000163115611dfe578673ffffffffffffffffffffffffffffffffffffffff167f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163160405160006040518083038185875af1925050503d8060008114611d98576040519150601f19603f3d011682016040523d82523d6000602084013e611d9d565b606091505b50909250905081611dfe577f0000000000000000000000000000000000000000000000000000000000000000816040517fc2b3f44500000000000000000000000000000000000000000000000000000000815260040161062c929190612d94565b505050505095945050505050565b60006103dd611e8c60408051437fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101406020830152419282019290925260608101919091524260808201524460a08201524660c08201523360e08201526000906101000160405160208183030381529060405280519060200120905090565b868686866116f1565b60006103dd85858585336116f1565b60006103dd611f2460408051437fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101406020830152419282019290925260608101919091524260808201524460a08201524660c08201523360e08201526000906101000160405160208183030381529060405280519060200120905090565b86868686611a17565b6000808360601b90506040517f3d602d80600a3d3981f3363d3d373d3d3d363d7300000000000000000000000081528160148201527f5af43d82803e903d91602b57fd5bf3000000000000000000000000000000000060288201526037816000f092505073ffffffffffffffffffffffffffffffffffffffff8216612016576040517fc05cee7a00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016600482015260240161062c565b60405173ffffffffffffffffffffffffffffffffffffffff8316907f4db17dd5e4732fb6da34a148104a592783ca119a1e7bb8829eba6cbadef0b51190600090a26000808373ffffffffffffffffffffffffffffffffffffffff1634866040516120809190612d29565b60006040518083038185875af1925050503d80600081146120bd576040519150601f19603f3d011682016040523d82523d6000602084013e6120c2565b606091505b50915091506120d282828861247d565b50505092915050565b60008060006120e9846125b3565b9092509050600082600281111561210257612102612e02565b1480156121205750600081600281111561211e5761211e612e02565b145b1561215e57604080513360208201524691810191909152606081018590526080016040516020818303038152906040528051906020012092506123cc565b600082600281111561217257612172612e02565b1480156121905750600181600281111561218e5761218e612e02565b145b156121b0576121a9338560009182526020526040902090565b92506123cc565b60008260028111156121c4576121c4612e02565b03612233576040517f13b3a2a100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016600482015260240161062c565b600182600281111561224757612247612e02565b1480156122655750600081600281111561226357612263612e02565b145b1561227e576121a9468560009182526020526040902090565b600182600281111561229257612292612e02565b1480156122b0575060028160028111156122ae576122ae612e02565b145b1561231f576040517f13b3a2a100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016600482015260240161062c565b61239a60408051437fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101406020830152419282019290925260608101919091524260808201524460a08201524660c08201523360e08201526000906101000160405160208183030381529060405280519060200120905090565b84036123a657836123c9565b604080516020810186905201604051602081830303815290604052805190602001205b92505b5050919050565b73ffffffffffffffffffffffffffffffffffffffff8116158061240b575073ffffffffffffffffffffffffffffffffffffffff81163b155b1561247a576040517fc05cee7a00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016600482015260240161062c565b50565b82158061249f575073ffffffffffffffffffffffffffffffffffffffff81163b155b156124fa577f0000000000000000000000000000000000000000000000000000000000000000826040517fa57ca23900000000000000000000000000000000000000000000000000000000815260040161062c929190612d94565b505050565b811580612520575073ffffffffffffffffffffffffffffffffffffffff8116155b80612540575073ffffffffffffffffffffffffffffffffffffffff81163b155b156125af576040517fc05cee7a00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016600482015260240161062c565b5050565b600080606083901c3314801561261057508260141a60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167f0100000000000000000000000000000000000000000000000000000000000000145b1561262057506000905080915091565b606083901c3314801561265a57507fff00000000000000000000000000000000000000000000000000000000000000601484901a60f81b16155b1561266b5750600090506001915091565b33606084901c036126825750600090506002915091565b606083901c1580156126db57508260141a60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167f0100000000000000000000000000000000000000000000000000000000000000145b156126ec5750600190506000915091565b606083901c15801561272557507fff00000000000000000000000000000000000000000000000000000000000000601484901a60f81b16155b1561273557506001905080915091565b606083901c61274a5750600190506002915091565b8260141a60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167f0100000000000000000000000000000000000000000000000000000000000000036127a55750600290506000915091565b8260141a60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166000036127e15750600290506001915091565b506002905080915091565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f83011261282c57600080fd5b813567ffffffffffffffff80821115612847576128476127ec565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190828211818310171561288d5761288d6127ec565b816040528381528660208588010111156128a657600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000604082840312156128d857600080fd5b6040516040810181811067ffffffffffffffff821117156128fb576128fb6127ec565b604052823581526020928301359281019290925250919050565b60008060008060a0858703121561292b57600080fd5b84359350602085013567ffffffffffffffff8082111561294a57600080fd5b6129568883890161281b565b9450604087013591508082111561296c57600080fd5b506129798782880161281b565b92505061298986606087016128c6565b905092959194509250565b600080604083850312156129a757600080fd5b82359150602083013567ffffffffffffffff8111156129c557600080fd5b6129d18582860161281b565b9150509250929050565b6000602082840312156129ed57600080fd5b813567ffffffffffffffff811115612a0457600080fd5b6107b38482850161281b565b803573ffffffffffffffffffffffffffffffffffffffff81168114612a3457600080fd5b919050565b600080600060608486031215612a4e57600080fd5b83359250612a5e60208501612a10565b9150604084013567ffffffffffffffff811115612a7a57600080fd5b612a868682870161281b565b9150509250925092565b600060208284031215612aa257600080fd5b5035919050565b600080600060808486031215612abe57600080fd5b833567ffffffffffffffff80821115612ad657600080fd5b612ae28783880161281b565b94506020860135915080821115612af857600080fd5b50612b058682870161281b565b925050612b1585604086016128c6565b90509250925092565b60008060408385031215612b3157600080fd5b82359150612b4160208401612a10565b90509250929050565b60008060408385031215612b5d57600080fd5b612b6683612a10565b946020939093013593505050565b60008060408385031215612b8757600080fd5b612b9083612a10565b9150602083013567ffffffffffffffff8111156129c557600080fd5b60008060408385031215612bbf57600080fd5b50508035926020909101359150565b60008060008060a08587031215612be457600080fd5b843567ffffffffffffffff80821115612bfc57600080fd5b612c088883890161281b565b95506020870135915080821115612c1e57600080fd5b50612c2b8782880161281b565b935050612c3b86604087016128c6565b915061298960808601612a10565b600080600080600060c08688031215612c6157600080fd5b85359450602086013567ffffffffffffffff80821115612c8057600080fd5b612c8c89838a0161281b565b95506040880135915080821115612ca257600080fd5b50612caf8882890161281b565b935050612cbf87606088016128c6565b9150612ccd60a08701612a10565b90509295509295909350565b600080600060608486031215612cee57600080fd5b8335925060208401359150612b1560408501612a10565b60005b83811015612d20578181015183820152602001612d08565b50506000910152565b60008251612d3b818460208701612d05565b9190910192915050565b67ffffffffffffffff828116828216039080821115612d8d577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b5092915050565b73ffffffffffffffffffffffffffffffffffffffff831681526040602082015260008251806040840152612dcf816060850160208701612d05565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016060019392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fdfea164736f6c6343000817000a1ca005f70bf8a1493291468f36ef23b05eb3a4f1807f6b4022942a4104b7537bfc36a029528c0c29546c81e7d78b0277ef87031541bdc96427b246ecedb6d74cd3ed62" ensure_createx_deployed() { local rpc_url=$1 local existing_code if ! existing_code=$(cast code "$createx_address" --rpc-url "$rpc_url" 2>/dev/null); then echo "Warning: failed to fetch CreateX code on ${rpc_url}; skipping bootstrap." >&2 return fi if [[ "$existing_code" == "0x" || "$existing_code" == "0x0" ]]; then echo "Bootstrapping CreateX on ${rpc_url}" >&2 cast rpc --rpc-url "$rpc_url" anvil_setBalance "$createx_deployer" 10000000000000000000 cast rpc --rpc-url "$rpc_url" anvil_setNonce "$createx_deployer" 0x0 cast publish "$createx_tx" --rpc-url "$rpc_url" fi } run_contract_deploy() { local contract_key=$1 local signature=$2 local description=$3 local chains=() while IFS= read -r line; do [[ -n "$line" ]] && chains+=("$line") done < <(get_contract_chains "$config_path" "$contract_key") if [[ ${#chains[@]} -eq 0 ]]; then echo "Skipping ${description}: no chains configured." return fi for chain_id in "${chains[@]}"; do local endpoint_url endpoint_url=$(get_chain_rpc_url "$config_path" "$chain_id") if [[ -z "$endpoint_url" ]]; then echo "Warning: no endpoint_url configured for chain ${chain_id}; skipping ${description}." >&2 continue fi ensure_createx_deployed "$endpoint_url" echo "Running ${description} on chain ${chain_id} (rpc: ${endpoint_url})" cmd=(forge script "$script_path" --sig "$signature" --chain-id "$chain_id" --rpc-url "$endpoint_url") if [[ ${#extra_args[@]} -gt 0 ]]; then cmd+=("${extra_args[@]}") fi "${cmd[@]}" done } run_contract_deploy "keyRegistry" "runDeployKeyRegistry()" "KeyRegistry deployment" run_contract_deploy "votingPowerProvider" "runDeployVotingPowerProvider()" "VotingPowerProvider deployment" run_contract_deploy "settlement" "runDeploySettlement()" "Settlement deployment" run_contract_deploy "valSetDriver" "runDeployValSetDriver()" "ValSetDriver deployment" ```` ## File: script/RelayDeploy.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {Vm, VmSafe} from "forge-std/Vm.sol"; import {Script, console2} from "forge-std/Script.sol"; import {Config} from "forge-std/Config.sol"; import {Variable} from "forge-std/LibVariable.sol"; ⋮---- import {CreateXWrapper} from "@symbioticfi/core/script/utils/CreateXWrapper.sol"; import {Logs} from "@symbioticfi/core/script/utils/Logs.sol"; import {SymbioticCoreConstants} from "@symbioticfi/core/test/integration/SymbioticCoreConstants.sol"; import {SymbioticCoreInit} from "@symbioticfi/core/script/integration/SymbioticCoreInit.sol"; import "@symbioticfi/core/test/integration/SymbioticCoreImports.sol"; ⋮---- import {TransparentUpgradeableProxy} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; ⋮---- import {IOpNetVaultAutoDeploy} from "../src/interfaces/modules/voting-power/extensions/IOpNetVaultAutoDeploy.sol"; import {VotingPowerProvider} from "../src/modules/voting-power/VotingPowerProvider.sol"; import {IValSetDriver} from "../src/interfaces/modules/valset-driver/IValSetDriver.sol"; ⋮---- /** * @title RelayDeploy * @notice Abstract base contract for deploying relay contracts using CREATE3 * @dev This contract provides a standardized deployment pattern for relay contracts * * The contract supports both guarded and non-guarded salt deployments. * See https://github.com/pcaversaccio/createx?tab=readme-ov-file#security-considerations * * This script requires a deployed CreateX instance. */ abstract contract RelayDeploy is SymbioticCoreInit, Config, CreateXWrapper { ⋮---- modifier loadConfig() { ⋮---- modifier withBroadcast() { ⋮---- modifier withoutBroadcast() { ⋮---- /** * @notice Returns deployment parameters for the KeyRegistry contract * @dev Must be implemented by concrete deployment contracts * @return implementation The implementation contract address * @return initData The initialization data for the proxy */ function _keyRegistryParams() internal virtual returns (address implementation, bytes memory initData); ⋮---- /** * @notice Returns deployment parameters for the VotingPowerProvider contract * @dev Must be implemented by concrete deployment contracts * @return implementation The implementation contract address * @return initData The initialization data for the proxy */ function _votingPowerProviderParams() internal virtual returns (address implementation, bytes memory initData); ⋮---- /** * @notice Returns deployment parameters for the Settlement contract * @dev Must be implemented by concrete deployment contracts * @return implementation The implementation contract address * @return initData The initialization data for the proxy */ function _settlementParams() internal virtual returns (address implementation, bytes memory initData); ⋮---- /** * @notice Returns deployment parameters for the ValSetDriver contract * @dev Must be implemented by concrete deployment contracts * @return implementation The implementation contract address * @return initData The initialization data for the proxy */ function _valSetDriverParams() internal virtual returns (address implementation, bytes memory initData); ⋮---- function runDeployKeyRegistry() public virtual; ⋮---- function runDeployVotingPowerProvider() public virtual; ⋮---- function runDeploySettlement() public virtual; ⋮---- function runDeployValSetDriver() public virtual; ⋮---- function getCore() public withoutBroadcast loadConfig returns (SymbioticCoreConstants.Core memory) { ⋮---- function getKeyRegistry() ⋮---- function getVotingPowerProvider() public virtual withoutBroadcast loadConfig returns (address) { ⋮---- function getVotingPowerProviders() ⋮---- function getSettlement() public virtual withoutBroadcast loadConfig returns (address) { ⋮---- function getSettlements() ⋮---- function getValSetDriver() ⋮---- /** * @notice Deploy the KeyRegistry contract using CREATE3 * @dev Deploys a transparent upgradeable proxy for the KeyRegistry * @param proxyOwner The owner of the proxy contract * @param isDeployerGuarded Whether to deploy with guarded salt for enhanced security * @return The address of the deployed KeyRegistry contract */ function deployKeyRegistry(address proxyOwner, bool isDeployerGuarded, bytes11 salt) ⋮---- /** * @notice Deploy the VotingPowerProvider contract using CREATE3 * @dev Deploys a transparent upgradeable proxy for the VotingPowerProvider * @param proxyOwner The owner of the proxy contract * @param isDeployerGuarded Whether to deploy with guarded salt for enhanced security * @return The address of the deployed VotingPowerProvider contract */ function deployVotingPowerProvider(address proxyOwner, bool isDeployerGuarded, bytes11 salt) ⋮---- // Validate deployment ⋮---- /** * @notice Deploy the Settlement contract using CREATE3 * @dev Deploys a transparent upgradeable proxy for the Settlement * @param proxyOwner The owner of the proxy contract * @param isDeployerGuarded Whether to deploy with guarded salt for enhanced security * @return The address of the deployed Settlement contract */ function deploySettlement(address proxyOwner, bool isDeployerGuarded, bytes11 salt) ⋮---- /** * @notice Deploy the ValSetDriver contract using CREATE3 * @dev Deploys a transparent upgradeable proxy for the ValSetDriver * @param proxyOwner The owner of the proxy contract * @param isDeployerGuarded Whether to deploy with guarded salt for enhanced security * @return The address of the deployed ValSetDriver contract */ function deployValSetDriver(address proxyOwner, bool isDeployerGuarded, bytes11 salt) ⋮---- /** * @notice Internal function to deploy a contract using CREATE3 with optional initialization * @dev Creates a transparent upgradeable proxy and optionally initializes it * @param salt The CREATE3 salt for deterministic deployment * @param implementation The implementation contract address * @param initData The initialization data for the proxy (empty bytes if no initialization) * @param owner The owner of the proxy contract * @param isDeployerGuarded Whether to use guarded salt deployment * @return The address of the deployed contract */ function _deployContract( ```` ## File: snapshots/gas.txt ```` No files changed, compilation skipped Ran 3 tests for test/modules/common/permissions/OzAccessManaged.t.sol:OzAccessManagedTest [PASS] testCannotChangeAuthority() (gas: 32030) [PASS] testProtectedAction_RevertsForNonAdmin() (gas: 40731) [PASS] testProtectedAction_SucceedsForAdmin() (gas: 40292) Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 6.27ms (892.37µs CPU time) Ran 4 tests for test/modules/common/permissions/OzOwnable.t.sol:OzOwnableTest [PASS] testProtectedAction_RevertsForNonOwner() (gas: 34468) [PASS] testProtectedAction_SucceedsForOwner() (gas: 34042) [PASS] testReinitializeReverts() (gas: 34167) [PASS] testTransferOwnership() (gas: 91093) Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 6.27ms (903.63µs CPU time) Ran 6 tests for test/modules/common/permissions/OzAccessControl.t.sol:OzAccessControlTest [PASS] testChangeRoleForProtectedFunction() (gas: 137387) [PASS] testGetRoleForFunctionSelector() (gas: 64891) [PASS] testProtectedFunction_RevertIfCallerDoesNotHaveRole() (gas: 36907) [PASS] testSetNoRoleForSelector() (gas: 92605) [PASS] test_Location() (gas: 458) [PASS] test_ProtectedFunction_DefaultAdminCanCall() (gas: 31147) Suite result: ok. 6 passed; 0 failed; 0 skipped; finished in 6.31ms (868.33µs CPU time) Ran 5 tests for test/modules/voting-power/common/voting-power-calc/PricedTokensChainlinkVPCalc.t.sol:PricedTokensChainlinkVPCalcTest [FAIL: vm.createSelectFork: environment variable `ETH_RPC_URL` not found] test_ChainlinkCalcTracksRealPrice() (gas: 3466) [FAIL: vm.createSelectFork: environment variable `ETH_RPC_URL` not found] test_ChainlinkCalcTracksRealPriceHistorical() (gas: 8108) [FAIL: vm.createSelectFork: environment variable `ETH_RPC_URL` not found] test_ChainlinkCalcTracksRealPriceHistoricalZero() (gas: 8131) [FAIL: vm.createSelectFork: environment variable `ETH_RPC_URL` not found] test_ChainlinkCalcTracksRealPriceStale() (gas: 3400) [FAIL: vm.createSelectFork: environment variable `ETH_RPC_URL` not found] test_ChainlinkCalcTracksRealPriceWithInvert() (gas: 3400) Suite result: FAILED. 0 passed; 5 failed; 0 skipped; finished in 6.74ms (1.07ms CPU time) Ran 2 tests for test/modules/base/PermissionManager.t.sol:PermissionManagerTest [PASS] test_ProtectedAction_RevertIfNotOwner() (gas: 32486) [PASS] test_ProtectedAction_SucceedsForOwner() (gas: 28627) Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 285.29µs (24.00µs CPU time) Ran 5 tests for test/modules/base/NetworkManager.t.sol:NetworkManagerTest [PASS] test_DefaultsBeforeInit() (gas: 18077) [PASS] test_InitializeAndCheckGetters() (gas: 95114) [PASS] test_Location() (gas: 522) [PASS] test_ReinitializeReverts() (gas: 104707) [PASS] test_RevertNetworkManager_InvalidNetwork() (gas: 123081) Suite result: ok. 5 passed; 0 failed; 0 skipped; finished in 348.08µs (87.21µs CPU time) Ran 1 test for test/modules/common/permissions/NoPermissionManager.t.sol:NoPermissionManagerTest [PASS] test_NoPermissionCheck() (gas: 29615) Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 214.58µs (9.96µs CPU time) Ran 18 tests for test/modules/valset-driver/EpochManager.t.sol:EpochManagerTest [PASS] test_AdvanceTimeAndCheckEpoch() (gas: 207469) [PASS] test_DirectSetEpochDuration() (gas: 244617) [PASS] test_GetCurrentEpochDurationData() (gas: 161233) [PASS] test_GetCurrentValue_MultipleCheckpoints() (gas: 245317) [PASS] test_GetCurrentValue_NoCheckpoint() (gas: 10727) [PASS] test_GetCurrentValue_SingleCheckpoint() (gas: 97941) [PASS] test_GetEpochDurationAndStart() (gas: 421185) [PASS] test_GetEpochDurationDataByIndex() (gas: 152442) [PASS] test_GetEpochDurationDataByTimestamp() (gas: 152822) [PASS] test_GetEpochIndex() (gas: 152449) [PASS] test_GetEpochIndex_RevertIfTooOldTimestamp() (gas: 165031) [PASS] test_Initialize_RevertOnPastTimestamp() (gas: 54021) [PASS] test_Initialize_RevertOnZeroEpochDuration() (gas: 53671) [PASS] test_Initialize_SetsEpochDuration() (gas: 228758) [PASS] test_Initialize_SetsEpochDuration_WithZeroTimestamp() (gas: 204726) [PASS] test_SerializeDeserializeEpochDurationData() (gas: 9810) [PASS] test_SetEpochDuration_RevertIfIndexLessThanCurrent() (gas: 291563) [PASS] test_SetEpochDuration_RevertOnZeroDuration() (gas: 180257) Suite result: ok. 18 passed; 0 failed; 0 skipped; finished in 7.36ms (2.21ms CPU time) Ran 1 test for test/modules/voting-power/extensions/EqualStakeVPCalc.t.sol:EqualStakeVPCalcTest [PASS] test_create() (gas: 143) Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 291.67µs (4.67µs CPU time) Ran 8 tests for test/modules/settlement/Settlement.t.sol:SettlementRawTest [PASS] testCommitValSetHeader_Basic() (gas: 1082819) [PASS] testInitParams() (gas: 29336) [PASS] testSetGenesis_Permission() (gas: 383545) [PASS] testSetGenesis_Revert_ValSetHeaderAlreadySubmitted() (gas: 240426) [PASS] testVersion() (gas: 5714) [PASS] test_commitValSetHeader_VerificationFailed() (gas: 931578) [PASS] test_setSigVerifier() (gas: 321900) [PASS] test_setSigVerifier_Revert_InvalidSigVerifier() (gas: 34441) Suite result: ok. 8 passed; 0 failed; 0 skipped; finished in 1.54ms (993.29µs CPU time) Ran 14 tests for test/modules/valset-driver/ValSetDriver.t.sol:ValSetDriverTest [PASS] test_AddRemoveQuorumThreshold() (gas: 441186) [PASS] test_AddRemoveSettlement() (gas: 466129) [PASS] test_AddRemoveVotingPowerProvider() (gas: 348594) [PASS] test_GetValSetConfig() (gas: 130897) [PASS] test_InitialConfig() (gas: 351786) [PASS] test_Location() (gas: 589) [PASS] test_PermissionChecks() (gas: 276042) [PASS] test_SetKeysProvider() (gas: 97383) [PASS] test_SetNumAggregators() (gas: 638425) [PASS] test_SetNumCommitters() (gas: 638430) [PASS] test_SetVerificationType() (gas: 75644) [PASS] test_TimeBasedConfig() (gas: 116652) [PASS] test_TimeBasedQueries() (gas: 366953) [PASS] test_UpdateAllConfigs() (gas: 1052365) Suite result: ok. 14 passed; 0 failed; 0 skipped; finished in 3.75ms (3.13ms CPU time) Ran 8 tests for test/libraries/structs/PersistentSet.t.sol:PersistentSetTest [PASS] test_AddressSetAddRemoveAndContains() (gas: 204274) [PASS] test_AddressSetAllValues() (gas: 185014) [PASS] test_AddressSetLengthAndValuesAt() (gas: 239766) [PASS] test_Bytes32SetAddRemoveAndContains() (gas: 221727) [PASS] test_Bytes32SetAllValues() (gas: 184889) [PASS] test_Bytes32SetValuesAt() (gas: 245622) [PASS] test_LargeAddressSetExceed256Elements() (gas: 16698398) [PASS] test_RevertPersistentSet_InvalidKey() (gas: 184062) Suite result: ok. 8 passed; 0 failed; 0 skipped; finished in 11.38ms (5.93ms CPU time) Ran 4 tests for test/modules/base/VotingPowerCalcManager.t.sol:VotingPowerCalcManagerTest [PASS] testReInitializeReverts() (gas: 31722) [PASS] testStakeToVotingPower() (gas: 6387) [PASS] testStakeToVotingPowerAt() (gas: 9400) [PASS] testWithExtraData() (gas: 6595) Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 272.67µs (46.83µs CPU time) Ran 5 tests for test/libraries/utils/ValSetVerifier.t.sol:ValSetVerifierDataTest [PASS] test_VerifyIsActive() (gas: 425714) [PASS] test_VerifyKey() (gas: 535277) [PASS] test_VerifyOperator() (gas: 423626) [PASS] test_VerifyVault() (gas: 688276) [PASS] test_VerifyVotingPower() (gas: 423627) Suite result: ok. 5 passed; 0 failed; 0 skipped; finished in 3.10ms (2.81ms CPU time) Ran 5 tests for test/modules/base/OzEIP712.t.sol:OzEIP712Test [PASS] test_HashTypedDataV4() (gas: 121509) [PASS] test_InitializeSetsDomain() (gas: 125433) [PASS] test_Location() (gas: 525) [PASS] test_ReInitialize() (gas: 133758) [PASS] test_SignatureRecovery() (gas: 121973) Suite result: ok. 5 passed; 0 failed; 0 skipped; finished in 14.70ms (9.26ms CPU time) Ran 12 tests for test/libraries/keys/KeyEcdsaSecp256k1.t.sol:KeyEcdsaSecp256k1Test [PASS] test_DeserializeRevertsIfNot20Bytes() (gas: 10139) [PASS] test_Equal() (gas: 20457) [PASS] test_EqualFalse() (gas: 20456) [PASS] test_FromBytesRevertsIfNot20Bytes() (gas: 10138) [PASS] test_FromBytesRevertsInvalidBytes() (gas: 12982) [PASS] test_FuzzSerializeDeserialize(address) (runs: 1000, μ: 1171, ~: 1171) [PASS] test_FuzzToBytesFromBytes(address) (runs: 1000, μ: 1513, ~: 1513) [PASS] test_FuzzWrapUnwrap(address) (runs: 1000, μ: 685, ~: 685) [PASS] test_SerializeDeserialize() (gas: 4798) [PASS] test_ToBytesFromBytes() (gas: 5282) [PASS] test_WrapUnwrap() (gas: 4363) [PASS] test_ZeroKey() (gas: 5910) Suite result: ok. 12 passed; 0 failed; 0 skipped; finished in 28.40ms (23.25ms CPU time) Ran 4 tests for test/libraries/sigs/SigBlsBn254.t.sol:SigBlsBn254Test [PASS] test_BLSRegisterOperator() (gas: 1121825) [PASS] test_BLSRegisterOperatorInvalid() (gas: 1121897) [PASS] test_InvalidMessageLength() (gas: 7664) [PASS] test_ZeroKey() (gas: 5008) Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 16.31ms (16.07ms CPU time) Ran 7 tests for test/modules/settlement/sig-verifiers/libraries/ExtraDataStorageHelper.t.sol:ExtraDataStorageHelperTest [PASS] testFuzz_Uniqueness(uint32,uint32,uint8,uint8,bytes32,bytes32,uint256,uint256) (runs: 1000, μ: 6484, ~: 6566) [PASS] test_BaseKey() (gas: 1081) [PASS] test_IndexedKey() (gas: 4680) [PASS] test_IndexedTagOnlyKey() (gas: 4441) [PASS] test_SimpleKey() (gas: 1018) [PASS] test_TagOnlyKey() (gas: 1151) [PASS] test_TaggedKey() (gas: 1572) Suite result: ok. 7 passed; 0 failed; 0 skipped; finished in 26.38ms (26.11ms CPU time) Ran 12 tests for test/modules/key-registry/KeyRegistry.t.sol:KeyRegistryTest [PASS] test_GetKeysAt_TimeCheckpoints() (gas: 835723) [PASS] test_GetKeysOperators_MultipleOperators() (gas: 1026730) [PASS] test_GetOperator_UnknownKey() (gas: 8664) [PASS] test_Location() (gas: 633) [PASS] test_SetBLSKey() (gas: 856175) [PASS] test_SetECDSAKey() (gas: 482827) [PASS] test_SetECDSAKey_RevertOnInvalidSignature() (gas: 59183) [PASS] test_SetKey64() (gas: 488767) [PASS] test_SetKey_AlreadyUsedKeyDifferentOperator() (gas: 395671) [PASS] test_SetKey_RevertOnInvalidKeyType() (gas: 40960) [PASS] test_SetKey_SameOperatorDifferentTags() (gas: 616254) [PASS] test_SetKey_SameOperatorSameTag_Overwrite() (gas: 497188) Suite result: ok. 12 passed; 0 failed; 0 skipped; finished in 5.91ms (5.39ms CPU time) Ran 6 tests for test/libraries/utils/InputNormalizer.t.sol:InputNormalizerTest [PASS] test_normalizeDoubleDimEmpty() (gas: 1701) [PASS] test_normalizeDoubleDimExact() (gas: 7134) [PASS] test_normalizeDoubleDimMismatchRevert() (gas: 10039) [PASS] test_normalizeSingleDimEmpty() (gas: 2037) [PASS] test_normalizeSingleDimExact() (gas: 6924) [PASS] test_normalizeSingleDimMismatchRevert() (gas: 9196) Suite result: ok. 6 passed; 0 failed; 0 skipped; finished in 312.25µs (94.42µs CPU time) Ran 12 tests for test/libraries/utils/KeyTag.t.sol:KeyTagTest [PASS] test_AddMultiple() (gas: 1857) [PASS] test_ContainsAddRemove() (gas: 1141) [PASS] test_DeserializeBitmask() (gas: 31921) [PASS] test_GetKeyTagInvalidIdentifier() (gas: 4264) [PASS] test_GetKeyTagInvalidType() (gas: 4180) [PASS] test_GetKeyTagValid() (gas: 453) [PASS] test_GetTag() (gas: 441) [PASS] test_GetTagRevertWhenTooLarge() (gas: 4046) [PASS] test_GetType() (gas: 380) [PASS] test_GetTypeRevertWhenTooLarge() (gas: 4081) [PASS] test_SerializeRevertOnDuplicate() (gas: 6095) [PASS] test_SerializeUniqueKeyTags() (gas: 3469) Suite result: ok. 12 passed; 0 failed; 0 skipped; finished in 370.71µs (153.58µs CPU time) Ran 5 tests for test/libraries/sigs/SigEcdsaSecp256k1.t.sol:SigEcdsaSecp256k1Test [PASS] test_CorrectSignature() (gas: 13094) [PASS] test_FuzzVerification(uint256,bytes) (runs: 1000, μ: 16849, ~: 16825) [PASS] test_IncorrectSignature() (gas: 22938) [PASS] test_InvalidMessageLength() (gas: 6500) [PASS] test_ZeroKey() (gas: 2104) Suite result: ok. 5 passed; 0 failed; 0 skipped; finished in 166.36ms (166.14ms CPU time) Ran 11 tests for test/modules/voting-power/extensions/OperatorsWhitelist.t.sol:OperatorsWhitelistTest [PASS] test_DisableWhitelistAndRegister() (gas: 188486) [PASS] test_DisableWhitelistAndRegisterOperatorVault() (gas: 468611) [PASS] test_Location() (gas: 569) [PASS] test_RegisterOperator_RevertIfNotWhitelisted() (gas: 36811) [PASS] test_SetWhitelistStatus_RevertIfAlreadySet() (gas: 133365) [PASS] test_SetWhitelistStatus_RevertIfNotWhitelisted() (gas: 36503) [PASS] test_UnwhitelistOperator_RegisteredOperatorGetsUnregistered() (gas: 306437) [PASS] test_UnwhitelistOperator_RevertIfNotWhitelisted() (gas: 34355) [PASS] test_WhitelistEnabledByDefault() (gas: 7738) [PASS] test_WhitelistOperatorAndRegister() (gas: 220687) [PASS] test_WhitelistOperator_RevertIfAlreadyWhitelisted() (gas: 80347) Suite result: ok. 11 passed; 0 failed; 0 skipped; finished in 188.63ms (3.05ms CPU time) Ran 12 tests for test/modules/voting-power/extensions/OpNetVaultAutoDeploy.t.sol:OpNetVaultAutoDeployTest [PASS] test_AutoDeployOnRegister() (gas: 1755847) [PASS] test_AutoDeployOnRegister_SetMaxNetworkLimitHook() (gas: 1522149) [PASS] test_AutoDeployOnRegister_WithoutSlasher() (gas: 1288671) [PASS] test_BasicFlags() (gas: 33675) [PASS] test_Location() (gas: 547) [PASS] test_SetAutoDeployConfig_InvalidBurnerHook() (gas: 83764) [PASS] test_SetAutoDeployConfig_InvalidBurnerParamsWithSlasher() (gas: 81640) [PASS] test_SetAutoDeployConfig_InvalidCollateral() (gas: 39635) [PASS] test_SetAutoDeployConfig_InvalidEpochDurationLessThanMinVaultEpochDuration() (gas: 59745) [PASS] test_SetAutoDeployConfig_InvalidEpochDurationZero() (gas: 39940) [PASS] test_SetAutoDeployConfig_InvalidWithSlasher() (gas: 48729) [PASS] test_SetAutoDeployStatus() (gas: 59408) Suite result: ok. 12 passed; 0 failed; 0 skipped; finished in 191.57ms (4.10ms CPU time) Ran 10 tests for test/modules/voting-power/extensions/BaseSlashing.t.sol:BaseSlashingTest [PASS] test_ExecuteSlashVaul_NotVetoSlasher() (gas: 489962) [PASS] test_ExecuteSlashVault_NoSlasher() (gas: 1398945) [PASS] test_Location() (gas: 569) [PASS] test_RevertWhen_SlashVault_NoSlashing() (gas: 497850) [PASS] test_RevertWhen_SlashVault_UnknownSlasherType() (gas: 513933) [PASS] test_SlashVault() (gas: 918317) [PASS] test_SlashVaultUnsafe() (gas: 1851089) [PASS] test_SlashVault_EpochDurationPassed() (gas: 517298) [PASS] test_SlashVault_VetoSlasher() (gas: 3614815) [PASS] test_SlashVault_WithHints() (gas: 887970) Suite result: ok. 10 passed; 0 failed; 0 skipped; finished in 198.67ms (6.86ms CPU time) Ran 3 tests for test/modules/voting-power/extensions/BaseRewards.t.sol:BaseRewardsTest [PASS] test_Location() (gas: 569) [PASS] test_OperatorRewards() (gas: 981074) [PASS] test_StakerRewards() (gas: 1266470) Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 200.37ms (1.95ms CPU time) Ran 21 tests for test/libraries/keys/KeyBlsBn254.t.sol:KeyBlsBn254Test [PASS] test_DeserializeEmptyBytesIsIdentity() (gas: 893) [PASS] test_DeserializeRevertsInvalidLength() (gas: 10314) [PASS] test_Equal() (gas: 14779) [PASS] test_EqualFalse() (gas: 19066) [PASS] test_FromBytesRevertsInvalidBytes() (gas: 13146) [PASS] test_FromBytesRevertsInvalidLength() (gas: 10338) [PASS] test_FuzzSerializeDeserialize(uint256) (runs: 1000, μ: 5798, ~: 8321) [PASS] test_FuzzSerializeDeserializeNonZeroNegate(uint256) (runs: 1000, μ: 6079, ~: 9120) [PASS] test_FuzzToBytesFromBytes(uint256) (runs: 1000, μ: 3892, ~: 4987) [PASS] test_FuzzWrapUnwrap(uint256) (runs: 1000, μ: 3056, ~: 3440) [PASS] test_OutOfBounds() (gas: 27427) [PASS] test_SerializeDeserializeIdentity() (gas: 1399) [PASS] test_SerializeDeserializeNonZero() (gas: 8155) [PASS] test_SerializeDeserializeNonZeroNegate() (gas: 8997) [PASS] test_SerializeRevertsInvalidKey() (gas: 12594) [PASS] test_ToBytesFromBytesIdentity() (gas: 2264) [PASS] test_ToBytesFromBytesNonZero() (gas: 4799) [PASS] test_WrapRevertsInvalidKey(uint256) (runs: 1000, μ: 12833, ~: 12833) [PASS] test_WrapUnwrapIdentity() (gas: 839) [PASS] test_WrapUnwrapNonZero() (gas: 3231) [PASS] test_ZeroKey() (gas: 6278) Suite result: ok. 21 passed; 0 failed; 0 skipped; finished in 170.96ms (170.69ms CPU time) Ran 6 tests for test/modules/voting-power/extensions/OperatorsJail.t.sol:OperatorsJailTest [PASS] test_BasicEnvironment() (gas: 10198) [PASS] test_JailOperator() (gas: 512213) [PASS] test_JailOperator_RevertIfAlreadyJailed() (gas: 134944) [PASS] test_Location() (gas: 526) [PASS] test_UnjailOperator() (gas: 273471) [PASS] test_UnjailOperator_RevertIfNotJailed() (gas: 34416) Suite result: ok. 6 passed; 0 failed; 0 skipped; finished in 210.46ms (6.77ms CPU time) Ran 2 tests for test/modules/voting-power/extensions/SharedVaults.t.sol:SharedVaultsTest [PASS] test_RegisterSharedVault_OnlyOwnerCanCall() (gas: 180177) [PASS] test_RegisterUnregisterSharedVault_VaultManagerSide() (gas: 277358) Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 210.68ms (635.79µs CPU time) Ran 1 test for test/modules/voting-power/extensions/OperatorVaults.t.sol:OperatorVaultsTest [PASS] test_RegisterOperatorVault_OnlyOwnerCanCall() (gas: 1992389) Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 221.74ms (795.79µs CPU time) Ran 2 tests for test/modules/voting-power/extensions/MultiToken.t.sol:MultiTokenTest [PASS] test_RegisterToken_OnlyOwnerCanCall() (gas: 85980) [PASS] test_RegisterUnregisterToken_VaultManagerSide() (gas: 187414) Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 216.04ms (514.96µs CPU time) Ran 13 tests for test/modules/settlement/sig-verifiers/SigVerifierBlsBn254ZK.t.sol:SigVerifierBlsBn254ZKTest [PASS] test_Create() (gas: 4410955) [PASS] test_FalseQuorumThreshold() (gas: 6971559) [PASS] test_RevertInvalidLength() (gas: 4273) [PASS] test_RevertInvalidTotalActiveValidators() (gas: 7225027) [PASS] test_Revert_InvalidMaxValidators() (gas: 4411164) [PASS] test_Revert_InvalidMaxValidatorsOrder() (gas: 4411206) [PASS] test_Revert_InvalidMessageLength() (gas: 4428613) [PASS] test_Revert_InvalidProofLength() (gas: 4434737) [PASS] test_Revert_InvalidVerifier() (gas: 2943085) [PASS] test_Revert_UnsupportedKeyTag() (gas: 4428462) [PASS] test_ZeroValidators() (gas: 7240530) [PASS] test_verifyQuorumSig() (gas: 7338033) [PASS] test_verifyQuorumSig_FalseZkProof() (gas: 17595493375392676910) Suite result: ok. 13 passed; 0 failed; 0 skipped; finished in 207.48ms (39.24ms CPU time) Ran 6 tests for test/modules/voting-power/extensions/OperatorsBlacklist.t.sol:OperatorsBlacklistTest [PASS] test_BasicEnvironment() (gas: 10071) [PASS] test_BlacklistOperator() (gas: 314932) [PASS] test_BlacklistOperator_RevertIfAlreadyBlacklisted() (gas: 93498) [PASS] test_Location() (gas: 504) [PASS] test_UnblacklistOperator() (gas: 250902) [PASS] test_UnblacklistOperator_RevertIfNotBlacklisted() (gas: 34324) Suite result: ok. 6 passed; 0 failed; 0 skipped; finished in 198.72ms (2.75ms CPU time) Ran 4 tests for test/modules/voting-power/common/voting-power-calc/WeightedVaultsVPCalc.t.sol:WeightedVaultsVPCalcTest [PASS] test_CheckStakesVaultWeight() (gas: 85079230) [PASS] test_GetVaultWeightAt_UsesHistoricalVaultWeight() (gas: 6758546) [PASS] test_SetVaultWeight_RevertIfTooLarge() (gas: 99612) [PASS] test_StakeToVotingPowerAt_UsesHistoricalVaultWeight() (gas: 7976122) Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 234.21ms (49.09ms CPU time) Ran 21 tests for test/examples/MyVotingPowerProvider.t.sol:MyVotingPowerProviderTest [PASS] testGetOperatorsAt_withTime() (gas: 465284) [PASS] test_CheckStakes() (gas: 101206176) [PASS] test_DistributeRewards() (gas: 207) [PASS] test_IncreaseNonce() (gas: 64127) [PASS] test_IsOperatorRegisteredAt_withTime() (gas: 190985) [PASS] test_RegisterOperator() (gas: 1730463) [PASS] test_RegisterOperatorValid() (gas: 162784) [PASS] test_RegisterOperatorVault() (gas: 1896716) [PASS] test_RegisterOperatorVaultExternal() (gas: 1776681) [PASS] test_RegisterOperatorVault_RevertIfOperatorNotRegistered() (gas: 1342433) [PASS] test_RegisterOperator_RevertIfAlreadyRegistered() (gas: 192924) [PASS] test_RegisterOperator_RevertIfNotEntity() (gas: 41922) [PASS] test_SlashVault_InstantSlasher() (gas: 252) [PASS] test_SlashVault_RevertIfNoSlasher() (gas: 251) [PASS] test_SlashVault_VetoSlasherFlow() (gas: 188) [PASS] test_SlashingData() (gas: 45917) [PASS] test_UnregisterOperator() (gas: 281328) [PASS] test_UnregisterOperator_RevertIfNotRegistered() (gas: 40281) [PASS] test_registerOperatorWithSignature() (gas: 1641531) [PASS] test_registerOperatorWithSignature_RevertIfInvalidSig() (gas: 1214036) [PASS] test_unregisterOperatorWithSignature() (gas: 284862) Suite result: ok. 21 passed; 0 failed; 0 skipped; finished in 283.43ms (88.04ms CPU time) Ran 3 tests for test/modules/voting-power/common/voting-power-calc/WeightedTokensVPCalc.t.sol:WeightedTokensVPCalcTest [PASS] test_CheckStakesTokenWeight() (gas: 89189896) [PASS] test_SetTokenWeight_RevertIfTooLarge() (gas: 99727) [PASS] test_StakeToVotingPowerAt_UsesHistoricalTokenWeightAndNormalization() (gas: 8161652) Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 307.35ms (75.05ms CPU time) Ran 30 tests for test/modules/voting-power/VotingPowerProvider.t.sol:VotingPowerProviderTest [PASS] testGetOperatorsAt_withTime() (gas: 436503) [PASS] test_CheckStakes() (gas: 318490684) [PASS] test_DistributeRewards() (gas: 229) [PASS] test_IncreaseNonce() (gas: 63999) [PASS] test_IsOperatorRegisteredAt_withTime() (gas: 168206) [PASS] test_Location() (gas: 611) [PASS] test_RegisterOperator() (gas: 1845486) [PASS] test_RegisterOperatorValid() (gas: 137749) [PASS] test_RegisterOperatorVault() (gas: 1984637) [PASS] test_RegisterOperatorVaultExternal() (gas: 1888865) [PASS] test_RegisterOperatorVault_RevertIfOperatorNotRegistered() (gas: 1453363) [PASS] test_RegisterOperator_RevertIfAlreadyRegistered() (gas: 169881) [PASS] test_RegisterOperator_RevertIfNotEntity() (gas: 41446) [PASS] test_RegisterSharedVault() (gas: 609131) [PASS] test_RegisterSharedVault_RevertIfInvalidVault() (gas: 41387) [PASS] test_RegisterSharedVault_RevertIfTokenNotRegistered() (gas: 11634350) [PASS] test_RegisterToken() (gas: 517267) [PASS] test_RegisterToken_RevertOnZeroAddress() (gas: 35174) [PASS] test_SlashVault_InstantSlasher() (gas: 185) [PASS] test_SlashVault_RevertIfNoSlasher() (gas: 273) [PASS] test_SlashVault_VetoSlasherFlow() (gas: 277) [PASS] test_SlashingData() (gas: 120491) [PASS] test_UnregisterOperator() (gas: 256356) [PASS] test_UnregisterOperator_RevertIfNotRegistered() (gas: 39873) [PASS] test_UnregisterToken() (gas: 232892) [PASS] test_ValidateVault() (gas: 1315114) [PASS] test_ValidateVaultSlashingFailsIfLessThanMinVaultEpochDuration() (gas: 1306034) [PASS] test_registerOperatorWithSignature() (gas: 1753924) [PASS] test_registerOperatorWithSignature_RevertIfInvalidSig() (gas: 1213952) [PASS] test_unregisterOperatorWithSignature() (gas: 285011) Suite result: ok. 30 passed; 0 failed; 0 skipped; finished in 548.65ms (337.19ms CPU time) Ran 14 tests for test/modules/settlement/sig-verifiers/SigVerifierBlsBn254Simple.t.sol:SigVerifierBlsBn254SimpleTest [PASS] test_FalseQuorumThreshold() (gas: 30731605) [PASS] test_FalseValidatorSet() (gas: 34771549) [PASS] test_RevertInvalidMessageLength() (gas: 34766028) [PASS] test_RevertInvalidNonSignerIndex() (gas: 34770513) [PASS] test_RevertInvalidNonSignersOrder() (gas: 34790079) [PASS] test_RevertInvalidProofLength() (gas: 34760466) [PASS] test_RevertInvalidProofOffset() (gas: 34785281) [PASS] test_RevertTooManyValidators() (gas: 34766010) [PASS] test_RevertUnsupportedKeyTag() (gas: 34765824) [PASS] test_Revert_InvalidNonSignersOrder() (gas: 34781415) [PASS] test_ZeroValidators() (gas: 18160576) [PASS] test_verifyQuorumSig1() (gas: 35000314) [PASS] test_verifyQuorumSig2() (gas: 39374545) [PASS] test_verifyQuorumSig3() (gas: 33359383) Suite result: ok. 14 passed; 0 failed; 0 skipped; finished in 1.94s (1.70s CPU time) Ran 3 tests for test/modules/voting-power/common/voting-power-calc/NormalizedTokenDecimalsVPCalc.t.sol:NormalizedTokenDecimalsVPCalcTest [PASS] test_CheckStakes_18() (gas: 84803926) [PASS] test_CheckStakes_24() (gas: 84819127) [PASS] test_CheckStakes_8() (gas: 84819864) Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 6.93s (144.85ms CPU time) Ran 10 tests for test/libraries/structs/Checkpoints.t.sol:CheckpointsTrace256Test [PASS] testAt(uint48[],uint256[],uint32) (runs: 1000, μ: 8337268, ~: 8750320) [PASS] testLatest(uint48[],uint256[]) (runs: 1000, μ: 8356459, ~: 8891083) [PASS] testLatestCheckpoint(uint48[],uint256[]) (runs: 1000, μ: 8385751, ~: 8902772) [PASS] testLength(uint48[],uint256[]) (runs: 1000, μ: 8106193, ~: 8621765) [PASS] testLookup(uint48[],uint256[],uint48) (runs: 1000, μ: 8188515, ~: 8720919) [PASS] testPop(uint48[],uint256[]) (runs: 1000, μ: 4105280, ~: 3693909) [PASS] testPush(uint48[],uint256[],uint48) (runs: 1000, μ: 8626515, ~: 9065594) [PASS] testUpperLookupRecentCheckpoint(uint48[],uint256[],uint48) (runs: 1000, μ: 8273169, ~: 8831078) [PASS] testUpperLookupRecentCheckpointWithHint(uint48[],uint256[],uint48,uint32) (runs: 1000, μ: 7969843, ~: 8404782) [PASS] testUpperLookupRecentWithHint(uint48[],uint256[],uint48,uint32) (runs: 1000, μ: 7948317, ~: 8473184) Suite result: ok. 10 passed; 0 failed; 0 skipped; finished in 8.02s (33.52s CPU time) Ran 10 tests for test/libraries/structs/Checkpoints.t.sol:CheckpointsTrace512Test [PASS] testAt(uint48[],uint256[],uint32) (runs: 1000, μ: 12497237, ~: 13221764) [PASS] testLatest(uint48[],uint256[]) (runs: 1000, μ: 11878733, ~: 12418264) [PASS] testLatestCheckpoint(uint48[],uint256[]) (runs: 1000, μ: 11978852, ~: 12721837) [PASS] testLength(uint48[],uint256[]) (runs: 1000, μ: 11826008, ~: 12374852) [PASS] testLookup(uint48[],uint256[],uint48) (runs: 1000, μ: 11626488, ~: 12269187) [PASS] testPop(uint48[],uint256[]) (runs: 1000, μ: 6041219, ~: 5252925) [PASS] testPush(uint48[],uint256[],uint48) (runs: 1000, μ: 12758244, ~: 13258136) [PASS] testUpperLookupRecentCheckpoint(uint48[],uint256[],uint48) (runs: 1000, μ: 12017920, ~: 12695010) [PASS] testUpperLookupRecentCheckpointWithHint(uint48[],uint256[],uint48,uint32) (runs: 1000, μ: 11951614, ~: 12578711) [PASS] testUpperLookupRecentWithHint(uint48[],uint256[],uint48,uint32) (runs: 1000, μ: 11876758, ~: 12681553) Suite result: ok. 10 passed; 0 failed; 0 skipped; finished in 9.53s (35.90s CPU time) Ran 10 tests for test/libraries/structs/Checkpoints.t.sol:CheckpointsTrace208Test [PASS] testAt(uint48[],uint208[],uint32) (runs: 1000, μ: 4418581, ~: 4659634) [PASS] testLatest(uint48[],uint208[]) (runs: 1000, μ: 4389648, ~: 4660768) [PASS] testLatestCheckpoint(uint48[],uint208[]) (runs: 1000, μ: 4312608, ~: 4568256) [PASS] testLength(uint48[],uint208[]) (runs: 1000, μ: 4327551, ~: 4563549) [PASS] testLookup(uint48[],uint208[],uint48) (runs: 1000, μ: 4273568, ~: 4511401) [PASS] testPop(uint48[],uint208[]) (runs: 1000, μ: 2340183, ~: 2053897) [PASS] testPush(uint48[],uint208[],uint48) (runs: 1000, μ: 4737182, ~: 5059570) [PASS] testUpperLookupRecentCheckpoint(uint48[],uint208[],uint48) (runs: 1000, μ: 4500541, ~: 4805784) [PASS] testUpperLookupRecentCheckpointWithHint(uint48[],uint208[],uint48,uint32) (runs: 1000, μ: 4176160, ~: 4402590) [PASS] testUpperLookupRecentWithHint(uint48[],uint208[],uint48,uint32) (runs: 1000, μ: 4176408, ~: 4357005) Suite result: ok. 10 passed; 0 failed; 0 skipped; finished in 9.97s (25.74s CPU time) ╭---------------------------------------------------+-----------------+--------+--------+--------+---------╮ | examples/MyKeyRegistry.sol:MyKeyRegistry Contract | | | | | | +==========================================================================================================+ | Deployment Cost | Deployment Size | | | | | |---------------------------------------------------+-----------------+--------+--------+--------+---------| | 3353463 | 15288 | | | | | |---------------------------------------------------+-----------------+--------+--------+--------+---------| | | | | | | | |---------------------------------------------------+-----------------+--------+--------+--------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |---------------------------------------------------+-----------------+--------+--------+--------+---------| | hashTypedDataV4 | 6730 | 6730 | 6730 | 6730 | 4356 | |---------------------------------------------------+-----------------+--------+--------+--------+---------| | initialize | 100690 | 100690 | 100690 | 100690 | 141 | |---------------------------------------------------+-----------------+--------+--------+--------+---------| | setKey | 414935 | 418370 | 417209 | 453694 | 4356 | ╰---------------------------------------------------+-----------------+--------+--------+--------+---------╯ ╭-------------------------------------------------+-----------------+--------+--------+--------+---------╮ | examples/MySettlement.sol:MySettlement Contract | | | | | | +========================================================================================================+ | Deployment Cost | Deployment Size | | | | | |-------------------------------------------------+-----------------+--------+--------+--------+---------| | 2660648 | 12086 | | | | | |-------------------------------------------------+-----------------+--------+--------+--------+---------| | | | | | | | |-------------------------------------------------+-----------------+--------+--------+--------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |-------------------------------------------------+-----------------+--------+--------+--------+---------| | SET_GENESIS_ROLE | 316 | 316 | 316 | 316 | 40 | |-------------------------------------------------+-----------------+--------+--------+--------+---------| | VALIDATOR_SET_VERSION | 293 | 293 | 293 | 293 | 13 | |-------------------------------------------------+-----------------+--------+--------+--------+---------| | getExtraDataAt | 2699 | 2699 | 2699 | 2699 | 29 | |-------------------------------------------------+-----------------+--------+--------+--------+---------| | getLastCommittedHeaderEpoch | 2417 | 2417 | 2417 | 2417 | 16 | |-------------------------------------------------+-----------------+--------+--------+--------+---------| | getSigVerifier | 7624 | 7624 | 7624 | 7624 | 31 | |-------------------------------------------------+-----------------+--------+--------+--------+---------| | getTotalVotingPowerFromValSetHeaderAt | 2666 | 2666 | 2666 | 2666 | 5 | |-------------------------------------------------+-----------------+--------+--------+--------+---------| | grantRole | 51664 | 51664 | 51664 | 51664 | 40 | |-------------------------------------------------+-----------------+--------+--------+--------+---------| | initialize | 244584 | 244584 | 244584 | 244584 | 40 | |-------------------------------------------------+-----------------+--------+--------+--------+---------| | setGenesis | 156404 | 173786 | 174424 | 174436 | 28 | |-------------------------------------------------+-----------------+--------+--------+--------+---------| | verifyQuorumSig | 15379 | 43893 | 15918 | 218376 | 9 | |-------------------------------------------------+-----------------+--------+--------+--------+---------| | verifyQuorumSigAt | 217091 | 232502 | 236873 | 243542 | 3 | ╰-------------------------------------------------+-----------------+--------+--------+--------+---------╯ ╭-----------------------------------------------------+-----------------+---------+---------+---------+---------╮ | examples/MyValSetDriver.sol:MyValSetDriver Contract | | | | | | +===============================================================================================================+ | Deployment Cost | Deployment Size | | | | | |-----------------------------------------------------+-----------------+---------+---------+---------+---------| | 3767660 | 18845 | | | | | |-----------------------------------------------------+-----------------+---------+---------+---------+---------| | | | | | | | |-----------------------------------------------------+-----------------+---------+---------+---------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |-----------------------------------------------------+-----------------+---------+---------+---------+---------| | MAX_QUORUM_THRESHOLD | 306 | 306 | 306 | 306 | 13 | |-----------------------------------------------------+-----------------+---------+---------+---------+---------| | getCurrentEpoch | 5862 | 5862 | 5862 | 5862 | 13 | |-----------------------------------------------------+-----------------+---------+---------+---------+---------| | getCurrentEpochStart | 7438 | 7438 | 7438 | 7438 | 13 | |-----------------------------------------------------+-----------------+---------+---------+---------+---------| | getEpochStart | 6115 | 6115 | 6115 | 6115 | 43 | |-----------------------------------------------------+-----------------+---------+---------+---------+---------| | getQuorumThresholds | 10812 | 10812 | 10812 | 10812 | 13 | |-----------------------------------------------------+-----------------+---------+---------+---------+---------| | getRequiredHeaderKeyTag | 4867 | 4867 | 4867 | 4867 | 13 | |-----------------------------------------------------+-----------------+---------+---------+---------+---------| | initialize | 1332424 | 1332432 | 1332436 | 1332436 | 40 | ╰-----------------------------------------------------+-----------------+---------+---------+---------+---------╯ ╭-------------------------------------------------------------------+-----------------+---------+---------+---------+---------╮ | examples/MyVotingPowerProvider.sol:MyVotingPowerProvider Contract | | | | | | +=============================================================================================================================+ | Deployment Cost | Deployment Size | | | | | |-------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | 2857916 | 13188 | | | | | |-------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | | | | | | | |-------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |-------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | NETWORK | 2449 | 2449 | 2449 | 2449 | 32 | |-------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | OPERATOR_REGISTRY | 261 | 261 | 261 | 261 | 45 | |-------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | SUBNETWORK | 661 | 2230 | 2661 | 2661 | 288 | |-------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | SUBNETWORK_IDENTIFIER | 2436 | 2436 | 2436 | 2436 | 32 | |-------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | VAULT_FACTORY | 306 | 306 | 306 | 306 | 38 | |-------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getOperatorStakes | 78880 | 78880 | 78880 | 78880 | 32 | |-------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getOperatorStakesAt | 85178 | 85178 | 85178 | 85178 | 32 | |-------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getOperatorVaults | 14584 | 15370 | 15370 | 16157 | 2 | |-------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getOperatorVaultsAt | 15293 | 15293 | 15293 | 15293 | 1 | |-------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getOperatorVotingPowers | 91190 | 91845 | 91845 | 92501 | 64 | |-------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getOperatorVotingPowersAt | 98147 | 98803 | 98803 | 99459 | 64 | |-------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getOperators | 14012 | 16294 | 14798 | 21567 | 4 | |-------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getOperatorsAt | 19709 | 21300 | 21300 | 22891 | 2 | |-------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getSlashingData | 8251 | 8251 | 8251 | 8251 | 8 | |-------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getSlashingDataAt | 10150 | 10328 | 10328 | 10507 | 2 | |-------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getVotingPowers | 2485344 | 2485344 | 2485344 | 2485344 | 1 | |-------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getVotingPowersAt | 2719064 | 2719064 | 2719064 | 2719064 | 1 | |-------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | hashTypedDataV4 | 6786 | 6786 | 6786 | 6786 | 3 | |-------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | initialize | 293992 | 293992 | 293992 | 293992 | 22 | |-------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | invalidateOldSignatures | 43532 | 43532 | 43532 | 43532 | 1 | |-------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | isOperatorRegistered | 8422 | 9187 | 8422 | 10718 | 9 | |-------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | isOperatorRegisteredAt | 6709 | 8348 | 9168 | 9168 | 3 | |-------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | isOperatorVaultRegistered(address) | 8435 | 8894 | 8435 | 10731 | 5 | |-------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | isOperatorVaultRegistered(address,address) | 8756 | 9138 | 8756 | 11052 | 6 | |-------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | isOperatorVaultRegisteredAt(address,address,uint48) | 9558 | 9558 | 9558 | 9558 | 1 | |-------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | isOperatorVaultRegisteredAt(address,uint48) | 9120 | 9120 | 9120 | 9120 | 1 | |-------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | nonces | 2662 | 2662 | 2662 | 2662 | 5 | |-------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | registerOperator | 30726 | 113167 | 108840 | 143040 | 44 | |-------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | registerOperatorVault | 86465 | 233307 | 236467 | 270667 | 38 | |-------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | registerOperatorWithSignature | 39115 | 98985 | 98985 | 158856 | 2 | |-------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | stakeToVotingPower | 870 | 870 | 870 | 870 | 96 | |-------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | stakeToVotingPowerAt | 961 | 961 | 961 | 961 | 96 | |-------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | unregisterOperator | 27152 | 61651 | 78901 | 78901 | 3 | |-------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | unregisterOperatorVault | 125247 | 125355 | 125355 | 125463 | 2 | |-------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | unregisterOperatorWithSignature | 94671 | 94671 | 94671 | 94671 | 1 | ╰-------------------------------------------------------------------+-----------------+---------+---------+---------+---------╯ ╭----------------------------------------------+-----------------+-------+--------+-------+---------╮ | lib/core/test/mocks/Token.sol:Token Contract | | | | | | +===================================================================================================+ | Deployment Cost | Deployment Size | | | | | |----------------------------------------------+-----------------+-------+--------+-------+---------| | 519682 | 3161 | | | | | |----------------------------------------------+-----------------+-------+--------+-------+---------| | | | | | | | |----------------------------------------------+-----------------+-------+--------+-------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |----------------------------------------------+-----------------+-------+--------+-------+---------| | approve | 46306 | 46356 | 46366 | 46366 | 488 | |----------------------------------------------+-----------------+-------+--------+-------+---------| | balanceOf | 559 | 1980 | 2559 | 2559 | 1695 | |----------------------------------------------+-----------------+-------+--------+-------+---------| | decimals | 176 | 176 | 176 | 176 | 692 | |----------------------------------------------+-----------------+-------+--------+-------+---------| | totalSupply | 2325 | 2325 | 2325 | 2325 | 709 | |----------------------------------------------+-----------------+-------+--------+-------+---------| | transfer | 51553 | 51553 | 51553 | 51553 | 2 | ╰----------------------------------------------+-----------------+-------+--------+-------+---------╯ ╭----------------------------------------------+-----------------+--------+--------+--------+---------╮ | lib/network/src/Network.sol:Network Contract | | | | | | +=====================================================================================================+ | Deployment Cost | Deployment Size | | | | | |----------------------------------------------+-----------------+--------+--------+--------+---------| | 2726533 | 12607 | | | | | |----------------------------------------------+-----------------+--------+--------+--------+---------| | | | | | | | |----------------------------------------------+-----------------+--------+--------+--------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |----------------------------------------------+-----------------+--------+--------+--------+---------| | execute | 70058 | 70058 | 70058 | 70058 | 12 | |----------------------------------------------+-----------------+--------+--------+--------+---------| | initialize | 312525 | 312525 | 312525 | 312525 | 12 | |----------------------------------------------+-----------------+--------+--------+--------+---------| | schedule | 64876 | 64876 | 64876 | 64876 | 12 | ╰----------------------------------------------+-----------------+--------+--------+--------+---------╯ ╭-------------------------------------------------------------------------------------------------------+-----------------+-------+--------+--------+---------╮ | src/modules/settlement/sig-verifiers/SigVerifierBlsBn254Simple.sol:SigVerifierBlsBn254Simple Contract | | | | | | +=============================================================================================================================================================+ | Deployment Cost | Deployment Size | | | | | |-------------------------------------------------------------------------------------------------------+-----------------+-------+--------+--------+---------| | 0 | 4974 | | | | | |-------------------------------------------------------------------------------------------------------+-----------------+-------+--------+--------+---------| | | | | | | | |-------------------------------------------------------------------------------------------------------+-----------------+-------+--------+--------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |-------------------------------------------------------------------------------------------------------+-----------------+-------+--------+--------+---------| | AGGREGATED_PUBLIC_KEY_G1_HASH | 161 | 161 | 161 | 161 | 15 | |-------------------------------------------------------------------------------------------------------+-----------------+-------+--------+--------+---------| | VALIDATOR_SET_HASH_KECCAK256_HASH | 183 | 183 | 183 | 183 | 15 | |-------------------------------------------------------------------------------------------------------+-----------------+-------+--------+--------+---------| | verifyQuorumSig | 1265 | 52186 | 8494 | 181913 | 15 | ╰-------------------------------------------------------------------------------------------------------+-----------------+-------+--------+--------+---------╯ ╭-----------------------------------------------------------------------------------------------+-----------------+---------------------+--------+----------------------+---------╮ | src/modules/settlement/sig-verifiers/SigVerifierBlsBn254ZK.sol:SigVerifierBlsBn254ZK Contract | | | | | | +=================================================================================================================================================================================+ | Deployment Cost | Deployment Size | | | | | |-----------------------------------------------------------------------------------------------+-----------------+---------------------+--------+----------------------+---------| | 0 | 4094 | | | | | |-----------------------------------------------------------------------------------------------+-----------------+---------------------+--------+----------------------+---------| | | | | | | | |-----------------------------------------------------------------------------------------------+-----------------+---------------------+--------+----------------------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |-----------------------------------------------------------------------------------------------+-----------------+---------------------+--------+----------------------+---------| | TOTAL_ACTIVE_VALIDATORS_HASH | 205 | 205 | 205 | 205 | 15 | |-----------------------------------------------------------------------------------------------+-----------------+---------------------+--------+----------------------+---------| | VALIDATOR_SET_HASH_MIMC_HASH | 227 | 227 | 227 | 227 | 13 | |-----------------------------------------------------------------------------------------------+-----------------+---------------------+--------+----------------------+---------| | verifyQuorumSig | 1281 | 2199436671923268638 | 15113 | 17595493375385706077 | 8 | ╰-----------------------------------------------------------------------------------------------+-----------------+---------------------+--------+----------------------+---------╯ ╭------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------╮ | src/modules/voting-power/extensions/logic/BaseRewardsLogic.sol:BaseRewardsLogic Contract | | | | | | +=================================================================================================================================================+ | Deployment Cost | Deployment Size | | | | | |------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | 321585 | 1658 | | | | | |------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | | | | | | | |------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | distributeOperatorRewards | 147122 | 147122 | 147122 | 147122 | 1 | |------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | distributeStakerRewards | 215666 | 215666 | 215666 | 215666 | 1 | ╰------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------╯ ╭--------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------╮ | src/modules/voting-power/extensions/logic/BaseSlashingLogic.sol:BaseSlashingLogic Contract | | | | | | +===================================================================================================================================================+ | Deployment Cost | Deployment Size | | | | | |--------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | 878339 | 4439 | | | | | |--------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | | | | | | | |--------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |--------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | executeSlashVault | 12081 | 115521 | 29372 | 391259 | 4 | |--------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | slashVault | 12235 | 171484 | 79920 | 373690 | 9 | ╰--------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------╯ ╭------------------------------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------╮ | src/modules/voting-power/extensions/logic/OpNetVaultAutoDeployLogic.sol:OpNetVaultAutoDeployLogic Contract | | | | | | +=================================================================================================================================================================+ | Deployment Cost | Deployment Size | | | | | |------------------------------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | 1139807 | 5745 | | | | | |------------------------------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | | | | | | | |------------------------------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |------------------------------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | getAutoDeployConfig | 5052 | 5052 | 5052 | 5052 | 1 | |------------------------------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | getAutoDeployedVault | 2588 | 2588 | 2588 | 2588 | 10 | |------------------------------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | isAutoDeployEnabled | 2393 | 2393 | 2393 | 2393 | 6 | |------------------------------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | isSetMaxNetworkLimitHookEnabled | 437 | 937 | 437 | 2437 | 4 | |------------------------------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | setAutoDeployStatus | 6508 | 19333 | 23608 | 23608 | 4 | |------------------------------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | setSetMaxNetworkLimitHookStatus | 23613 | 23613 | 23613 | 23613 | 1 | ╰------------------------------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------╯ ╭-----------------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------╮ | src/modules/voting-power/logic/VotingPowerProviderLogic.sol:VotingPowerProviderLogic Contract | | | | | | +=========================================================================================================================================================+ | Deployment Cost | Deployment Size | | | | | |-----------------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | 3129075 | 15680 | | | | | |-----------------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | | | | | | | |-----------------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |-----------------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | _validateVault | 35606 | 40104 | 40104 | 44603 | 2 | |-----------------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getOperatorStake | 77113 | 77113 | 77113 | 77113 | 96 | |-----------------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getOperatorStakeAt | 84068 | 84068 | 84068 | 84068 | 96 | |-----------------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getOperatorStakes | 74403 | 178283 | 178283 | 282163 | 64 | |-----------------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getOperatorStakesAt | 80612 | 195639 | 195639 | 310667 | 64 | |-----------------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getOperatorVaults | 10435 | 10462 | 10435 | 12266 | 201 | |-----------------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getOperatorVaultsAt | 10968 | 10968 | 10968 | 10968 | 2 | |-----------------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getOperatorVaultsLength | 2694 | 2694 | 2694 | 2694 | 1 | |-----------------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getOperatorVotingPower | 14717 | 65425 | 78190 | 88025 | 384 | |-----------------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getOperatorVotingPowerAt | 15017 | 69461 | 95724 | 95724 | 298 | |-----------------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getOperatorVotingPowers | 86090 | 249173 | 252252 | 315078 | 2148 | |-----------------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getOperatorVotingPowersAt | 92953 | 219506 | 219506 | 346060 | 128 | |-----------------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getOperators | 10120 | 12402 | 11035 | 17417 | 8 | |-----------------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getOperatorsAt | 15619 | 17081 | 17081 | 18543 | 4 | |-----------------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getOperatorsLength | 2424 | 2424 | 2424 | 2424 | 3 | |-----------------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getSharedVaults | 10097 | 21955 | 24691 | 24691 | 10 | |-----------------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getSharedVaultsAt | 10793 | 10793 | 10793 | 10793 | 1 | |-----------------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getSharedVaultsLength | 2448 | 2448 | 2448 | 2448 | 1 | |-----------------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getSlashingData | 925 | 4708 | 4925 | 4925 | 222 | |-----------------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getSlashingDataAt | 5974 | 6455 | 6331 | 8786 | 14 | |-----------------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getTokens | 19264 | 19264 | 19264 | 19264 | 1 | |-----------------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getTokensAt | 7797 | 14473 | 14618 | 20862 | 4 | |-----------------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getTokensLength | 2484 | 2484 | 2484 | 2484 | 3 | |-----------------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getVotingPowers | 2398854 | 3265574 | 3750354 | 5646383 | 49 | |-----------------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getVotingPowersAt | 2660793 | 4658079 | 4658079 | 6655366 | 2 | |-----------------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | isOperatorRegistered | 2810 | 5309 | 5046 | 7342 | 36 | |-----------------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | isOperatorRegisteredAt | 3142 | 4781 | 5601 | 5601 | 6 | |-----------------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | isOperatorVaultRegistered(address) | 5069 | 5834 | 5069 | 7365 | 15 | |-----------------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | isOperatorVaultRegistered(address,address) | 5199 | 5552 | 5199 | 7495 | 13 | |-----------------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | isOperatorVaultRegisteredAt(address,address,uint48) | 5878 | 5878 | 5878 | 5878 | 2 | |-----------------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | isOperatorVaultRegisteredAt(address,uint48) | 5599 | 5599 | 5599 | 5599 | 2 | |-----------------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | isSharedVaultRegistered | 5090 | 5855 | 5090 | 7386 | 3 | |-----------------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | isSharedVaultRegisteredAt | 5622 | 5622 | 5622 | 5622 | 1 | |-----------------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | isTokenRegistered | 4996 | 5761 | 4996 | 7292 | 3 | |-----------------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | isTokenRegisteredAt | 8429 | 8429 | 8429 | 8429 | 1 | |-----------------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | registerOperator | 6552 | 64356 | 62495 | 96695 | 1392 | |-----------------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | registerOperatorVault | 17136 | 206040 | 208990 | 243212 | 251 | |-----------------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | registerSharedVault | 6648 | 118148 | 111583 | 145827 | 135 | |-----------------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | registerToken | 426 | 73088 | 90466 | 90466 | 16 | |-----------------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | setSlashingData | 9808 | 15374 | 9808 | 32074 | 4 | |-----------------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | unregisterOperator | 2924 | 44748 | 54313 | 54313 | 12 | |-----------------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | unregisterOperatorVault | 34188 | 97072 | 107553 | 107553 | 7 | |-----------------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | unregisterSharedVault | 7390 | 38628 | 54247 | 54247 | 3 | |-----------------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | unregisterToken | 7405 | 42547 | 54262 | 54262 | 4 | ╰-----------------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------╯ ╭-------------------------------------------------+-----------------+---------------------+---------------------+----------------------+---------╮ | test/data/zk/Verifier_100.sol:Verifier Contract | | | | | | +================================================================================================================================================+ | Deployment Cost | Deployment Size | | | | | |-------------------------------------------------+-----------------+---------------------+---------------------+----------------------+---------| | 1435489 | 6421 | | | | | |-------------------------------------------------+-----------------+---------------------+---------------------+----------------------+---------| | | | | | | | |-------------------------------------------------+-----------------+---------------------+---------------------+----------------------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |-------------------------------------------------+-----------------+---------------------+---------------------+----------------------+---------| | verifyProof | 309915 | 8797746687692979367 | 8797746687692979367 | 17595493375385648819 | 2 | ╰-------------------------------------------------+-----------------+---------------------+---------------------+----------------------+---------╯ ╭----------------------------------------------------------------+-----------------+------+--------+------+---------╮ | test/libraries/sigs/SigBlsBn254.t.sol:SigBlsBn254Test Contract | | | | | | +===================================================================================================================+ | Deployment Cost | Deployment Size | | | | | |----------------------------------------------------------------+-----------------+------+--------+------+---------| | 2386169 | 11754 | | | | | |----------------------------------------------------------------+-----------------+------+--------+------+---------| | | | | | | | |----------------------------------------------------------------+-----------------+------+--------+------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |----------------------------------------------------------------+-----------------+------+--------+------+---------| | verify | 1799 | 1799 | 1799 | 1799 | 1 | ╰----------------------------------------------------------------+-----------------+------+--------+------+---------╯ ╭----------------------------------------------------------------------------+-----------------+------+--------+------+---------╮ | test/libraries/sigs/SigEcdsaSecp256k1.t.sol:SigEcdsaSecp256k1Test Contract | | | | | | +===============================================================================================================================+ | Deployment Cost | Deployment Size | | | | | |----------------------------------------------------------------------------+-----------------+------+--------+------+---------| | 1610499 | 7880 | | | | | |----------------------------------------------------------------------------+-----------------+------+--------+------+---------| | | | | | | | |----------------------------------------------------------------------------+-----------------+------+--------+------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |----------------------------------------------------------------------------+-----------------+------+--------+------+---------| | verify | 1775 | 1775 | 1775 | 1775 | 1 | ╰----------------------------------------------------------------------------+-----------------+------+--------+------+---------╯ ╭---------------------------------------------------------------------------+-----------------+-------+--------+-------+---------╮ | test/libraries/structs/Checkpoints.t.sol:CheckpointsTrace208Test Contract | | | | | | +================================================================================================================================+ | Deployment Cost | Deployment Size | | | | | |---------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | 2713553 | 13389 | | | | | |---------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | | | | | | | |---------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |---------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | pop | 23586 | 23586 | 23586 | 23586 | 2 | |---------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | push | 26412 | 26536 | 26496 | 26736 | 256 | ╰---------------------------------------------------------------------------+-----------------+-------+--------+-------+---------╯ ╭---------------------------------------------------------------------------+-----------------+-------+--------+-------+---------╮ | test/libraries/structs/Checkpoints.t.sol:CheckpointsTrace256Test Contract | | | | | | +================================================================================================================================+ | Deployment Cost | Deployment Size | | | | | |---------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | 2738984 | 13516 | | | | | |---------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | | | | | | | |---------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |---------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | pop | 23596 | 23596 | 23596 | 23596 | 3 | |---------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | push | 29733 | 29866 | 29793 | 30129 | 256 | ╰---------------------------------------------------------------------------+-----------------+-------+--------+-------+---------╯ ╭---------------------------------------------------------------------------+-----------------+-------+--------+-------+---------╮ | test/libraries/structs/Checkpoints.t.sol:CheckpointsTrace512Test Contract | | | | | | +================================================================================================================================+ | Deployment Cost | Deployment Size | | | | | |---------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | 3141073 | 15524 | | | | | |---------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | | | | | | | |---------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |---------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | pop | 23674 | 23674 | 23674 | 23674 | 2 | |---------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | push | 32861 | 32881 | 32885 | 32885 | 256 | ╰---------------------------------------------------------------------------+-----------------+-------+--------+-------+---------╯ ╭-----------------------------------------------------------------------+-----------------+-------+--------+-------+---------╮ | test/libraries/structs/PersistentSet.t.sol:PersistentSetTest Contract | | | | | | +============================================================================================================================+ | Deployment Cost | Deployment Size | | | | | |-----------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | 2778830 | 13715 | | | | | |-----------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | | | | | | | |-----------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |-----------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | remove | 26607 | 48119 | 48119 | 69632 | 2 | ╰-----------------------------------------------------------------------+-----------------+-------+--------+-------+---------╯ ╭-------------------------------------------------------------------------+-----------------+------+--------+------+---------╮ | test/libraries/utils/InputNormalizer.t.sol:InputNormalizerTest Contract | | | | | | +============================================================================================================================+ | Deployment Cost | Deployment Size | | | | | |-------------------------------------------------------------------------+-----------------+------+--------+------+---------| | 1602692 | 7841 | | | | | |-------------------------------------------------------------------------+-----------------+------+--------+------+---------| | | | | | | | |-------------------------------------------------------------------------+-----------------+------+--------+------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |-------------------------------------------------------------------------+-----------------+------+--------+------+---------| | normalizeDoubleDim | 2940 | 2940 | 2940 | 2940 | 1 | |-------------------------------------------------------------------------+-----------------+------+--------+------+---------| | normalizeSingleDim | 2361 | 2361 | 2361 | 2361 | 1 | ╰-------------------------------------------------------------------------+-----------------+------+--------+------+---------╯ ╭-------------------------------------------------------+-----------------+------+--------+------+---------╮ | test/libraries/utils/KeyTag.t.sol:KeyTagTest Contract | | | | | | +==========================================================================================================+ | Deployment Cost | Deployment Size | | | | | |-------------------------------------------------------+-----------------+------+--------+------+---------| | 1494374 | 7300 | | | | | |-------------------------------------------------------+-----------------+------+--------+------+---------| | | | | | | | |-------------------------------------------------------+-----------------+------+--------+------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |-------------------------------------------------------+-----------------+------+--------+------+---------| | getKeyTag | 552 | 582 | 582 | 613 | 2 | |-------------------------------------------------------+-----------------+------+--------+------+---------| | getTag | 482 | 482 | 482 | 482 | 1 | |-------------------------------------------------------+-----------------+------+--------+------+---------| | getType | 483 | 483 | 483 | 483 | 1 | |-------------------------------------------------------+-----------------+------+--------+------+---------| | serialize | 1787 | 1787 | 1787 | 1787 | 1 | ╰-------------------------------------------------------+-----------------+------+--------+------+---------╯ ╭---------------------------------------------------------------------------+-----------------+-------+--------+-------+---------╮ | test/libraries/utils/ValSetVerifier.t.sol:ValSetVerifierContract Contract | | | | | | +================================================================================================================================+ | Deployment Cost | Deployment Size | | | | | |---------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | 539296 | 2276 | | | | | |---------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | | | | | | | |---------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |---------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | verifyIsActive | 56160 | 56301 | 56160 | 57120 | 7 | |---------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | verifyKey | 70130 | 70404 | 70130 | 71090 | 7 | |---------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | verifyOperator | 55860 | 56005 | 55860 | 56820 | 7 | |---------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | verifyVault | 78930 | 79177 | 78960 | 79890 | 8 | |---------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | verifyVotingPower | 55860 | 56005 | 55860 | 56820 | 7 | ╰---------------------------------------------------------------------------+-----------------+-------+--------+-------+---------╯ ╭---------------------------------------------------------+-----------------+------+--------+------+---------╮ | test/mocks/KeyBlsBn254Mock.sol:KeyBlsBn254Mock Contract | | | | | | +============================================================================================================+ | Deployment Cost | Deployment Size | | | | | |---------------------------------------------------------+-----------------+------+--------+------+---------| | 628154 | 2687 | | | | | |---------------------------------------------------------+-----------------+------+--------+------+---------| | | | | | | | |---------------------------------------------------------+-----------------+------+--------+------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |---------------------------------------------------------+-----------------+------+--------+------+---------| | deserialize | 828 | 828 | 828 | 828 | 1 | |---------------------------------------------------------+-----------------+------+--------+------+---------| | equal | 1180 | 1193 | 1193 | 1207 | 2 | |---------------------------------------------------------+-----------------+------+--------+------+---------| | fromBytes | 807 | 1379 | 1379 | 1952 | 2 | |---------------------------------------------------------+-----------------+------+--------+------+---------| | wrap | 788 | 1022 | 1021 | 1182 | 264 | |---------------------------------------------------------+-----------------+------+--------+------+---------| | zeroKey | 562 | 562 | 562 | 562 | 1 | ╰---------------------------------------------------------+-----------------+------+--------+------+---------╯ ╭---------------------------------------------------------------------+-----------------+------+--------+------+---------╮ | test/mocks/KeyEcdsaSecp256k1Mock.sol:KeyEcdsaSecp256k1Mock Contract | | | | | | +========================================================================================================================+ | Deployment Cost | Deployment Size | | | | | |---------------------------------------------------------------------+-----------------+------+--------+------+---------| | 347774 | 1390 | | | | | |---------------------------------------------------------------------+-----------------+------+--------+------+---------| | | | | | | | |---------------------------------------------------------------------+-----------------+------+--------+------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |---------------------------------------------------------------------+-----------------+------+--------+------+---------| | deserialize | 755 | 755 | 755 | 755 | 1 | |---------------------------------------------------------------------+-----------------+------+--------+------+---------| | equal | 837 | 837 | 837 | 837 | 2 | |---------------------------------------------------------------------+-----------------+------+--------+------+---------| | fromBytes | 776 | 1087 | 1087 | 1399 | 2 | |---------------------------------------------------------------------+-----------------+------+--------+------+---------| | wrap | 575 | 575 | 575 | 575 | 4 | |---------------------------------------------------------------------+-----------------+------+--------+------+---------| | zeroKey | 374 | 374 | 374 | 374 | 1 | ╰---------------------------------------------------------------------+-----------------+------+--------+------+---------╯ ╭---------------------------------------------------+-----------------+--------+--------+--------+---------╮ | test/mocks/RewarderMock.sol:RewarderMock Contract | | | | | | +==========================================================================================================+ | Deployment Cost | Deployment Size | | | | | |---------------------------------------------------+-----------------+--------+--------+--------+---------| | 211160 | 758 | | | | | |---------------------------------------------------+-----------------+--------+--------+--------+---------| | | | | | | | |---------------------------------------------------+-----------------+--------+--------+--------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |---------------------------------------------------+-----------------+--------+--------+--------+---------| | distributeOperatorRewards | 154018 | 154018 | 154018 | 154018 | 1 | |---------------------------------------------------+-----------------+--------+--------+--------+---------| | distributeStakerRewards | 222446 | 222446 | 222446 | 222446 | 1 | ╰---------------------------------------------------+-----------------+--------+--------+--------+---------╯ ╭-------------------------------------------------------------------+-----------------+------+--------+------+---------╮ | test/mocks/SigVerifierFalseMock.sol:SigVerifierFalseMock Contract | | | | | | +======================================================================================================================+ | Deployment Cost | Deployment Size | | | | | |-------------------------------------------------------------------+-----------------+------+--------+------+---------| | 179999 | 614 | | | | | |-------------------------------------------------------------------+-----------------+------+--------+------+---------| | | | | | | | |-------------------------------------------------------------------+-----------------+------+--------+------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |-------------------------------------------------------------------+-----------------+------+--------+------+---------| | verifyQuorumSig | 1093 | 1093 | 1093 | 1093 | 1 | ╰-------------------------------------------------------------------+-----------------+------+--------+------+---------╯ ╭---------------------------------------------------------+-----------------+------+--------+------+---------╮ | test/mocks/SigVerifierMock.sol:SigVerifierMock Contract | | | | | | +============================================================================================================+ | Deployment Cost | Deployment Size | | | | | |---------------------------------------------------------+-----------------+------+--------+------+---------| | 180215 | 615 | | | | | |---------------------------------------------------------+-----------------+------+--------+------+---------| | | | | | | | |---------------------------------------------------------+-----------------+------+--------+------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |---------------------------------------------------------+-----------------+------+--------+------+---------| | verifyQuorumSig | 1094 | 1094 | 1094 | 1094 | 10 | ╰---------------------------------------------------------+-----------------+------+--------+------+---------╯ ╭-------------------------------------------------+-----------------+--------+--------+--------+---------╮ | test/mocks/SlasherMock.sol:SlasherMock Contract | | | | | | +========================================================================================================+ | Deployment Cost | Deployment Size | | | | | |-------------------------------------------------+-----------------+--------+--------+--------+---------| | 326654 | 1292 | | | | | |-------------------------------------------------+-----------------+--------+--------+--------+---------| | | | | | | | |-------------------------------------------------+-----------------+--------+--------+--------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |-------------------------------------------------+-----------------+--------+--------+--------+---------| | executeSlashVault | 44234 | 146097 | 61846 | 416462 | 4 | |-------------------------------------------------+-----------------+--------+--------+--------+---------| | slashVault | 45374 | 202802 | 114874 | 400244 | 9 | ╰-------------------------------------------------+-----------------+--------+--------+--------+---------╯ ╭---------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------╮ | test/mocks/VotingPowerProviderSemiFull.sol:VotingPowerProviderSemiFull Contract | | | | | | +===========================================================================================================================================+ | Deployment Cost | Deployment Size | | | | | |---------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | 3709156 | 17124 | | | | | |---------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | | | | | | | |---------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |---------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | NETWORK | 2443 | 2443 | 2443 | 2443 | 6 | |---------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | OPERATOR_REGISTRY | 350 | 350 | 350 | 350 | 1124 | |---------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | SUBNETWORK | 719 | 1136 | 719 | 2719 | 9931 | |---------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | VAULT_FACTORY | 284 | 284 | 284 | 284 | 121 | |---------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | distributeOperatorRewards | 24854 | 24854 | 24854 | 24854 | 1 | |---------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | distributeStakerRewards | 27110 | 27110 | 27110 | 27110 | 1 | |---------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getOperatorVotingPowers | 258357 | 258357 | 258357 | 258357 | 2020 | |---------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getRewarder | 2432 | 2432 | 2432 | 2432 | 4 | |---------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getSharedVaults | 29142 | 29142 | 29142 | 29142 | 8 | |---------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getSlasher | 2519 | 2519 | 2519 | 2519 | 4 | |---------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getSlashingData | 8273 | 8273 | 8273 | 8273 | 3 | |---------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getVotingPowers | 2456108 | 3310040 | 3840067 | 3840067 | 47 | |---------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | initialize | 345805 | 345805 | 345805 | 345805 | 40 | |---------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | registerOperator | 113472 | 114689 | 113472 | 147672 | 1124 | |---------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | registerSharedVault | 138549 | 149883 | 138549 | 172749 | 121 | |---------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | setRewarder | 25218 | 36288 | 36288 | 47358 | 4 | |---------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | setSlasher | 25228 | 32460 | 30268 | 47368 | 11 | |---------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | slashVault | 25676 | 25676 | 25676 | 25676 | 1 | |---------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | stakeToVotingPower | 915 | 915 | 915 | 915 | 9924 | ╰---------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------╯ ╭--------------------------------------------------------------------+-----------------+-------+--------+-------+---------╮ | test/modules/base/NetworkManager.t.sol:TestNetworkManager Contract | | | | | | +=========================================================================================================================+ | Deployment Cost | Deployment Size | | | | | |--------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | 346454 | 1384 | | | | | |--------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | | | | | | | |--------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |--------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | NETWORK | 2329 | 2329 | 2329 | 2329 | 2 | |--------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | SUBNETWORK | 2572 | 2572 | 2572 | 2572 | 2 | |--------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | SUBNETWORK_IDENTIFIER | 2435 | 2435 | 2435 | 2435 | 2 | |--------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | initialize | 24220 | 55579 | 69627 | 69639 | 5 | ╰--------------------------------------------------------------------+-----------------+-------+--------+-------+---------╯ ╭--------------------------------------------------------+-----------------+-------+--------+-------+---------╮ | test/modules/base/OzEIP712.t.sol:TestOzEIP712 Contract | | | | | | +=============================================================================================================+ | Deployment Cost | Deployment Size | | | | | |--------------------------------------------------------+-----------------+-------+--------+-------+---------| | 607189 | 2590 | | | | | |--------------------------------------------------------+-----------------+-------+--------+-------+---------| | | | | | | | |--------------------------------------------------------+-----------------+-------+--------+-------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |--------------------------------------------------------+-----------------+-------+--------+-------+---------| | eip712Domain | 10880 | 10880 | 10880 | 10880 | 1 | |--------------------------------------------------------+-----------------+-------+--------+-------+---------| | hashTypedDataV4 | 6652 | 6652 | 6652 | 6652 | 2 | |--------------------------------------------------------+-----------------+-------+--------+-------+---------| | hashTypedDataV4CrossChain | 6543 | 6543 | 6543 | 6543 | 1 | |--------------------------------------------------------+-----------------+-------+--------+-------+---------| | initialize | 25314 | 84794 | 99667 | 99667 | 5 | ╰--------------------------------------------------------+-----------------+-------+--------+-------+---------╯ ╭--------------------------------------------------------------------------+-----------------+-------+--------+-------+---------╮ | test/modules/base/PermissionManager.t.sol:TestPermissionManager Contract | | | | | | +===============================================================================================================================+ | Deployment Cost | Deployment Size | | | | | |--------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | 177603 | 603 | | | | | |--------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | | | | | | | |--------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |--------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | initialize | 67820 | 67820 | 67820 | 67820 | 2 | |--------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | protectedAction | 23348 | 23394 | 23394 | 23440 | 2 | ╰--------------------------------------------------------------------------+-----------------+-------+--------+-------+---------╯ ╭------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------╮ | test/modules/base/VotingPowerCalcManager.t.sol:TestVotingPowerCalcManager Contract | | | | | | +=========================================================================================================================================+ | Deployment Cost | Deployment Size | | | | | |------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | 250232 | 939 | | | | | |------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | | | | | | | |------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | initialize | 23666 | 58589 | 67320 | 67320 | 5 | |------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | stakeToVotingPower | 774 | 786 | 786 | 798 | 2 | |------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | stakeToVotingPowerAt | 880 | 880 | 880 | 880 | 1 | ╰------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------╯ ╭--------------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------╮ | test/modules/common/permissions/NoPermissionManager.t.sol:TestNoPermissionManager Contract | | | | | | +=================================================================================================================================================+ | Deployment Cost | Deployment Size | | | | | |--------------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | 125551 | 362 | | | | | |--------------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | | | | | | | |--------------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |--------------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | actionRequiringNoPermission | 21161 | 21161 | 21161 | 21161 | 1 | |--------------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | initialize | 45141 | 45141 | 45141 | 45141 | 1 | ╰--------------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------╯ ╭------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------╮ | test/modules/common/permissions/OzAccessControl.t.sol:TestOzAccessControl Contract | | | | | | +=========================================================================================================================================+ | Deployment Cost | Deployment Size | | | | | |------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | 428368 | 1763 | | | | | |------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | | | | | | | |------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | ADMIN_ROLE | 304 | 304 | 304 | 304 | 1 | |------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | getRole | 2640 | 2640 | 2640 | 2640 | 2 | |------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | grantRole | 51417 | 51417 | 51417 | 51417 | 1 | |------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | initialize | 73689 | 73689 | 73689 | 73689 | 6 | |------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | protectedFunction | 25889 | 25915 | 25889 | 25954 | 5 | |------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | setSelectorRole | 27977 | 41499 | 48261 | 48261 | 3 | ╰------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------╯ ╭------------------------------------------------------------------------------+-----------------+------+--------+------+---------╮ | test/modules/common/permissions/OzAccessManaged.t.sol:MockAuthority Contract | | | | | | +=================================================================================================================================+ | Deployment Cost | Deployment Size | | | | | |------------------------------------------------------------------------------+-----------------+------+--------+------+---------| | 133454 | 424 | | | | | |------------------------------------------------------------------------------+-----------------+------+--------+------+---------| | | | | | | | |------------------------------------------------------------------------------+-----------------+------+--------+------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |------------------------------------------------------------------------------+-----------------+------+--------+------+---------| | canCall | 2629 | 2629 | 2629 | 2629 | 2 | ╰------------------------------------------------------------------------------+-----------------+------+--------+------+---------╯ ╭------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------╮ | test/modules/common/permissions/OzAccessManaged.t.sol:TestOzAccessManaged Contract | | | | | | +=========================================================================================================================================+ | Deployment Cost | Deployment Size | | | | | |------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | 453845 | 1881 | | | | | |------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | | | | | | | |------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | initialize | 23962 | 58212 | 69629 | 69629 | 4 | |------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | protectedAction | 29746 | 29784 | 29784 | 29822 | 2 | ╰------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------╯ ╭------------------------------------------------------------------------+-----------------+-------+--------+-------+---------╮ | test/modules/common/permissions/OzOwnable.t.sol:TestOzOwnable Contract | | | | | | +=============================================================================================================================+ | Deployment Cost | Deployment Size | | | | | |------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | 263112 | 999 | | | | | |------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | | | | | | | |------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | initialize | 23940 | 60684 | 69871 | 69871 | 5 | |------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | protectedAction | 23395 | 23421 | 23421 | 23447 | 4 | |------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | transferOwnership | 28412 | 28412 | 28412 | 28412 | 1 | ╰------------------------------------------------------------------------+-----------------+-------+--------+-------+---------╯ ╭----------------------------------------------------------------------+-----------------+--------+--------+--------+---------╮ | test/modules/key-registry/KeyRegistry.t.sol:TestKeyRegistry Contract | | | | | | +=============================================================================================================================+ | Deployment Cost | Deployment Size | | | | | |----------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | 3714257 | 16956 | | | | | |----------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | | | | | | | |----------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |----------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getKey | 781 | 6428 | 8559 | 10714 | 9 | |----------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getKeyAt | 956 | 5869 | 5178 | 11556 | 6 | |----------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getKeyTags | 35892 | 35892 | 35892 | 35892 | 3 | |----------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getKeyTagsAt | 36726 | 37254 | 36726 | 39181 | 5 | |----------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getKeys() | 107285 | 107285 | 107285 | 107285 | 1 | |----------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getKeys(address) | 44674 | 47588 | 44674 | 53418 | 3 | |----------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getKeysAt(address,uint48) | 48594 | 52075 | 52075 | 55556 | 2 | |----------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getKeysAt(uint48) | 111136 | 111136 | 111136 | 111136 | 1 | |----------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getKeysOperators | 17334 | 17334 | 17334 | 17334 | 1 | |----------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getKeysOperatorsAt | 18549 | 18549 | 18549 | 18549 | 1 | |----------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getKeysOperatorsLength | 2439 | 2439 | 2439 | 2439 | 1 | |----------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getOperator | 2989 | 2995 | 2995 | 3001 | 4 | |----------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | hashTypedDataV4 | 6752 | 6752 | 6752 | 6752 | 13 | |----------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | initialize | 100160 | 100160 | 100160 | 100160 | 12 | |----------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | setKey | 31211 | 225048 | 293623 | 449515 | 16 | ╰----------------------------------------------------------------------+-----------------+--------+--------+--------+---------╯ ╭------------------------------------------------------------------+-----------------+--------+--------+--------+---------╮ | test/modules/settlement/Settlement.t.sol:TestSettlement Contract | | | | | | +=========================================================================================================================+ | Deployment Cost | Deployment Size | | | | | |------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | 2401040 | 10886 | | | | | |------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | | | | | | | |------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | VALIDATOR_SET_VERSION | 249 | 249 | 249 | 249 | 9 | |------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | commitValSetHeader | 26385 | 94056 | 54835 | 193392 | 14 | |------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getCaptureTimestampFromValSetHeader | 4728 | 4728 | 4728 | 4728 | 1 | |------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getCaptureTimestampFromValSetHeaderAt | 2676 | 2676 | 2676 | 2676 | 1 | |------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getExtraData | 4768 | 4768 | 4768 | 4768 | 1 | |------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getExtraDataAt | 2655 | 2655 | 2655 | 2655 | 1 | |------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getLastCommittedHeaderEpoch | 2417 | 2417 | 2417 | 2417 | 2 | |------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getQuorumThresholdFromValSetHeader | 4699 | 4699 | 4699 | 4699 | 1 | |------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getQuorumThresholdFromValSetHeaderAt | 2603 | 2603 | 2603 | 2603 | 1 | |------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getRequiredKeyTagFromValSetHeader | 4730 | 4730 | 4730 | 4730 | 1 | |------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getRequiredKeyTagFromValSetHeaderAt | 2654 | 2654 | 2654 | 2654 | 1 | |------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getSigVerifier | 4700 | 5553 | 4700 | 10354 | 10 | |------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getSigVerifierAt | 6140 | 6958 | 6140 | 8595 | 3 | |------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getTotalVotingPowerFromValSetHeader | 4633 | 4633 | 4633 | 4633 | 1 | |------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getTotalVotingPowerFromValSetHeaderAt | 2644 | 2644 | 2644 | 2644 | 1 | |------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getValSetHeader | 11830 | 11830 | 11830 | 11830 | 1 | |------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getValSetHeaderAt | 9633 | 9633 | 9633 | 9633 | 1 | |------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getValSetHeaderHash | 11842 | 11842 | 11842 | 11842 | 1 | |------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getValSetHeaderHashAt | 9786 | 9786 | 9786 | 9786 | 1 | |------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getValidatorsSszMRootFromValSetHeader | 4635 | 4635 | 4635 | 4635 | 1 | |------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getValidatorsSszMRootFromValSetHeaderAt | 2647 | 2647 | 2647 | 2647 | 1 | |------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getVersionFromValSetHeader | 4675 | 4675 | 4675 | 4675 | 1 | |------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getVersionFromValSetHeaderAt | 2622 | 2622 | 2622 | 2622 | 1 | |------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | initialize | 124545 | 159328 | 159328 | 194112 | 16 | |------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | isValSetHeaderCommittedAt | 2614 | 2614 | 2614 | 2614 | 3 | |------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | setGenesis | 25641 | 107018 | 147068 | 147068 | 6 | |------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | setSigVerifier | 23864 | 46268 | 57470 | 57470 | 3 | |------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | verifyQuorumSigAt | 3887 | 3887 | 3887 | 3887 | 1 | ╰------------------------------------------------------------------+-----------------+--------+--------+--------+---------╯ ╭-------------------------------------------------------------------------+-----------------+--------+--------+--------+---------╮ | test/modules/valset-driver/EpochManager.t.sol:TestEpochManager Contract | | | | | | +================================================================================================================================+ | Deployment Cost | Deployment Size | | | | | |-------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | 988967 | 4355 | | | | | |-------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | | | | | | | |-------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |-------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | deserializeEpochDurationData | 632 | 632 | 632 | 632 | 1 | |-------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getCurrentEpoch | 2597 | 5167 | 5863 | 5863 | 10 | |-------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getCurrentEpochDuration | 5544 | 5544 | 5544 | 5544 | 1 | |-------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getCurrentEpochDurationData | 2529 | 4055 | 4055 | 5581 | 2 | |-------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getCurrentEpochStart | 7409 | 7409 | 7409 | 7409 | 2 | |-------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getCurrentValuePublic | 2614 | 6491 | 5496 | 8270 | 11 | |-------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getEpochDuration | 5772 | 6999 | 6999 | 8227 | 2 | |-------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getEpochDurationDataByIndex | 5792 | 5792 | 5792 | 5792 | 2 | |-------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getEpochDurationDataByTimestamp | 5842 | 5842 | 5842 | 5842 | 1 | |-------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getEpochIndex | 5374 | 5815 | 6036 | 6036 | 3 | |-------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getEpochStart | 6039 | 7266 | 7266 | 8494 | 2 | |-------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getNextEpoch | 5208 | 6041 | 6041 | 6875 | 6 | |-------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getNextEpochDuration | 5169 | 5809 | 5793 | 7793 | 8 | |-------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getNextEpochStart | 5249 | 8463 | 9793 | 14120 | 7 | |-------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | initialize | 44826 | 124127 | 137341 | 137341 | 14 | |-------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | pushTestCheckpoint | 51895 | 59250 | 59250 | 66606 | 4 | |-------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | serializeEpochDurationData | 701 | 701 | 701 | 701 | 1 | |-------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | setEpochDuration(uint48) | 33754 | 59387 | 40422 | 91169 | 5 | |-------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | setEpochDuration(uint48,uint48,uint48) | 82394 | 82394 | 82394 | 82394 | 1 | ╰-------------------------------------------------------------------------+-----------------+--------+--------+--------+---------╯ ╭-------------------------------------------------------------------------+-----------------+---------+---------+---------+---------╮ | test/modules/valset-driver/ValSetDriver.t.sol:TestValSetDriver Contract | | | | | | +===================================================================================================================================+ | Deployment Cost | Deployment Size | | | | | |-------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | 3639013 | 16609 | | | | | |-------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | | | | | | | |-------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |-------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | addQuorumThreshold | 24252 | 44576 | 25534 | 102986 | 4 | |-------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | addSettlement | 24275 | 40523 | 24368 | 103030 | 5 | |-------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | addVotingPowerProvider | 24284 | 56252 | 26630 | 103033 | 5 | |-------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getConfig | 120171 | 120171 | 120171 | 120171 | 4 | |-------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getConfigAt | 128433 | 129486 | 128433 | 130892 | 7 | |-------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getKeysProvider | 7428 | 7428 | 7428 | 7428 | 2 | |-------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getKeysProviderAt | 8281 | 8281 | 8281 | 8281 | 1 | |-------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getMaxValidatorsCount | 4882 | 4882 | 4882 | 4882 | 2 | |-------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getMaxValidatorsCountAt | 5715 | 6534 | 5715 | 8174 | 3 | |-------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getMaxVotingPower | 7122 | 7122 | 7122 | 7122 | 3 | |-------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getMaxVotingPowerAt | 7909 | 8892 | 7909 | 10368 | 5 | |-------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getMinInclusionVotingPower | 7056 | 7056 | 7056 | 7056 | 2 | |-------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getMinInclusionVotingPowerAt | 7887 | 8706 | 7887 | 10346 | 3 | |-------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getNumAggregators | 4858 | 4858 | 4858 | 4858 | 3 | |-------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getNumAggregatorsAt | 5714 | 6943 | 6943 | 8173 | 2 | |-------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getNumCommitters | 4881 | 4881 | 4881 | 4881 | 3 | |-------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getNumCommittersAt | 5670 | 6899 | 6899 | 8129 | 2 | |-------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getQuorumThresholds | 18665 | 19336 | 19336 | 20007 | 2 | |-------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getQuorumThresholdsAt | 19835 | 19835 | 19835 | 19835 | 1 | |-------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getRequiredHeaderKeyTag | 4823 | 4823 | 4823 | 4823 | 1 | |-------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getRequiredHeaderKeyTagAt | 5681 | 6910 | 6910 | 8140 | 2 | |-------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getRequiredKeyTags | 35784 | 35878 | 35878 | 35972 | 2 | |-------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getRequiredKeyTagsAt | 36600 | 37545 | 36788 | 39247 | 3 | |-------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getSettlements | 10828 | 16484 | 18668 | 19956 | 3 | |-------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getSettlementsAt | 19841 | 19841 | 19841 | 19841 | 1 | |-------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getVerificationType | 4890 | 4890 | 4890 | 4890 | 2 | |-------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getVerificationTypeAt | 5704 | 6933 | 6933 | 8163 | 2 | |-------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getVotingPowerProviders | 18669 | 24871 | 26509 | 27797 | 4 | |-------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getVotingPowerProvidersAt | 19908 | 19908 | 19908 | 19908 | 1 | |-------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | initialize | 1066319 | 1066319 | 1066319 | 1066319 | 14 | |-------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | isQuorumThresholdRegistered | 3187 | 4305 | 4305 | 5423 | 2 | |-------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | isQuorumThresholdRegisteredAt | 5979 | 5979 | 5979 | 5979 | 1 | |-------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | isSettlementRegistered | 3145 | 4263 | 4263 | 5381 | 2 | |-------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | isSettlementRegisteredAt | 5962 | 5962 | 5962 | 5962 | 1 | |-------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | isVotingPowerProviderRegistered | 3124 | 4614 | 5360 | 5360 | 3 | |-------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | isVotingPowerProviderRegisteredAt | 3419 | 5157 | 6026 | 6026 | 3 | |-------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | removeQuorumThreshold | 24227 | 44734 | 31271 | 78704 | 3 | |-------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | removeSettlement | 24253 | 44767 | 31288 | 78760 | 3 | |-------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | removeVotingPowerProvider | 24286 | 44799 | 31321 | 78790 | 3 | |-------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | setKeysProvider | 24252 | 30298 | 30298 | 36345 | 2 | |-------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | setMaxValidatorsCount | 23869 | 37231 | 32780 | 55046 | 3 | |-------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | setMaxVotingPower | 23791 | 51087 | 35277 | 80553 | 5 | |-------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | setMinInclusionVotingPower | 52419 | 66513 | 66513 | 80607 | 2 | |-------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | setNumAggregators | 23827 | 33614 | 32715 | 54981 | 5 | |-------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | setNumCommitters | 23826 | 33619 | 32725 | 54991 | 5 | |-------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | setRequiredHeaderKeyTag | 32796 | 43929 | 43929 | 55062 | 2 | |-------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | setRequiredKeyTags | 35608 | 46269 | 46269 | 56930 | 2 | |-------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | setVerificationType | 23822 | 37142 | 32669 | 54935 | 3 | ╰-------------------------------------------------------------------------+-----------------+---------+---------+---------+---------╯ ╭--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------╮ | test/modules/voting-power/VotingPowerProvider.t.sol:TestVotingPowerProvider Contract | | | | | | +================================================================================================================================================+ | Deployment Cost | Deployment Size | | | | | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | 3260870 | 15051 | | | | | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | | | | | | | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | NETWORK | 2427 | 2427 | 2427 | 2427 | 33 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | OPERATOR_REGISTRY | 328 | 328 | 328 | 328 | 46 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | SUBNETWORK | 683 | 1602 | 683 | 2683 | 1536 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | SUBNETWORK_IDENTIFIER | 2502 | 2502 | 2502 | 2502 | 32 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | VAULT_FACTORY | 306 | 306 | 306 | 306 | 58 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getOperatorStake | 80662 | 80662 | 80662 | 80662 | 96 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getOperatorStakeAt | 87663 | 87663 | 87663 | 87663 | 96 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getOperatorStakes | 288005 | 288005 | 288005 | 288005 | 32 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getOperatorStakesAt | 316687 | 316687 | 316687 | 316687 | 32 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getOperatorVaults | 14584 | 15370 | 15370 | 16157 | 2 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getOperatorVaultsAt | 15250 | 15250 | 15250 | 15250 | 1 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getOperatorVaultsLength | 6016 | 6016 | 6016 | 6016 | 1 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getOperatorVotingPower | 18893 | 55547 | 55547 | 92201 | 192 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getOperatorVotingPowerAt | 19342 | 73146 | 100049 | 100049 | 288 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getOperatorVotingPowers | 320341 | 320998 | 320998 | 321655 | 64 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getOperatorVotingPowersAt | 351395 | 352052 | 352052 | 352709 | 64 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getOperators | 14057 | 16339 | 14843 | 21612 | 4 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getOperatorsAt | 19754 | 21345 | 21345 | 22936 | 2 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getOperatorsLength | 5597 | 5597 | 5597 | 5597 | 3 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getSharedVaults | 14077 | 14863 | 14863 | 15650 | 2 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getSharedVaultsAt | 14929 | 14929 | 14929 | 14929 | 1 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getSharedVaultsLength | 5623 | 5623 | 5623 | 5623 | 1 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getSlashingData | 8251 | 8251 | 8251 | 8251 | 12 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getSlashingDataAt | 10551 | 11778 | 11778 | 13006 | 2 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getTokens | 23199 | 23199 | 23199 | 23199 | 1 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getTokensAt | 11697 | 18631 | 18905 | 25020 | 4 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getTokensLength | 5613 | 5613 | 5613 | 5613 | 3 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getVotingPowers | 5752113 | 5752113 | 5752113 | 5752113 | 1 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | getVotingPowersAt | 6761210 | 6761210 | 6761210 | 6761210 | 1 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | hashTypedDataV4 | 6743 | 6743 | 6743 | 6743 | 3 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | initialize | 178640 | 181555 | 178640 | 269031 | 31 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | invalidateOldSignatures | 43554 | 43554 | 43554 | 43554 | 1 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | isOperatorRegistered | 8488 | 9253 | 8488 | 10784 | 9 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | isOperatorRegisteredAt | 6687 | 8326 | 9146 | 9146 | 3 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | isOperatorVaultRegistered(address) | 8435 | 8894 | 8435 | 10731 | 5 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | isOperatorVaultRegistered(address,address) | 8712 | 9094 | 8712 | 11008 | 6 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | isOperatorVaultRegisteredAt(address,address,uint48) | 9470 | 9470 | 9470 | 9470 | 1 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | isOperatorVaultRegisteredAt(address,uint48) | 9120 | 9120 | 9120 | 9120 | 1 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | isSharedVaultRegistered | 8466 | 8466 | 8466 | 8466 | 1 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | isSharedVaultRegisteredAt | 9188 | 9188 | 9188 | 9188 | 1 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | isTokenRegistered | 8373 | 8373 | 8373 | 8373 | 1 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | isTokenRegisteredAt | 11996 | 11996 | 11996 | 11996 | 1 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | nonces | 2598 | 2598 | 2598 | 2598 | 5 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | registerOperator() | 143163 | 143163 | 143163 | 143163 | 4 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | registerOperator(address) | 31090 | 90354 | 87175 | 121375 | 41 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | registerOperatorVault | 42340 | 213918 | 234213 | 268413 | 44 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | registerOperatorWithSignature | 39159 | 99068 | 99068 | 158978 | 2 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | registerSharedVault | 31138 | 90142 | 72657 | 170550 | 12 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | registerToken | 24886 | 100171 | 115181 | 115181 | 14 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | setSlashingData | 56782 | 56782 | 56782 | 56782 | 1 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | stakeToVotingPower | 893 | 893 | 893 | 893 | 480 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | stakeToVotingPowerAt | 961 | 961 | 961 | 961 | 576 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | unregisterOperator() | 78857 | 78857 | 78857 | 78857 | 1 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | unregisterOperator(address) | 27461 | 50763 | 50763 | 74065 | 2 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | unregisterOperatorVault | 123003 | 123111 | 123111 | 123219 | 2 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | unregisterOperatorWithSignature | 94671 | 94671 | 94671 | 94671 | 1 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | unregisterSharedVault | 32143 | 53179 | 53179 | 74215 | 2 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | unregisterToken | 32135 | 61711 | 74207 | 78791 | 3 | |--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| | validateVault | 39049 | 43547 | 43547 | 48046 | 2 | ╰--------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------╯ ╭-----------------------------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------╮ | test/modules/voting-power/common/voting-power-calc/NormalizedTokenDecimalsVPCalc.t.sol:MockToken Contract | | | | | | +================================================================================================================================================================+ | Deployment Cost | Deployment Size | | | | | |-----------------------------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | 543826 | 3105 | | | | | |-----------------------------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | | | | | | | |-----------------------------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |-----------------------------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | approve | 46294 | 46315 | 46318 | 46318 | 162 | |-----------------------------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | balanceOf | 559 | 2074 | 2559 | 2559 | 669 | |-----------------------------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | decimals | 182 | 182 | 182 | 182 | 165 | |-----------------------------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| | totalSupply | 2325 | 2325 | 2325 | 2325 | 345 | ╰-----------------------------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------╯ ╭-------------------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------╮ | test/modules/voting-power/common/voting-power-calc/NormalizedTokenDecimalsVPCalc.t.sol:TestVotingPowerProvider Contract | | | | | | +================================================================================================================================================================================+ | Deployment Cost | Deployment Size | | | | | |-------------------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | 3413163 | 15755 | | | | | |-------------------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | | | | | | | |-------------------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |-------------------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | NETWORK | 2494 | 2494 | 2494 | 2494 | 96 | |-------------------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | OPERATOR_REGISTRY | 306 | 306 | 306 | 306 | 96 | |-------------------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | SUBNETWORK | 2661 | 2661 | 2661 | 2661 | 192 | |-------------------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | SUBNETWORK_IDENTIFIER | 2480 | 2480 | 2480 | 2480 | 96 | |-------------------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | VAULT_FACTORY | 306 | 306 | 306 | 306 | 96 | |-------------------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getOperatorVaults | 14584 | 14584 | 14584 | 14584 | 96 | |-------------------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getOperatorVotingPower | 81966 | 82238 | 82371 | 82377 | 96 | |-------------------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getSlashingData | 8251 | 8251 | 8251 | 8251 | 96 | |-------------------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | initialize | 178618 | 223813 | 223813 | 269009 | 6 | |-------------------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | registerOperator | 87153 | 88221 | 87153 | 121353 | 96 | |-------------------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | registerOperatorVault | 234179 | 235257 | 234191 | 268391 | 96 | |-------------------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | stakeToVotingPower | 6535 | 6807 | 6940 | 6946 | 96 | ╰-------------------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------╯ ╭----------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------╮ | test/modules/voting-power/common/voting-power-calc/WeightedTokensVPCalc.t.sol:TestVotingPowerProvider Contract | | | | | | +=======================================================================================================================================================================+ | Deployment Cost | Deployment Size | | | | | |----------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | 3833106 | 17697 | | | | | |----------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | | | | | | | |----------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |----------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | NETWORK | 2427 | 2427 | 2427 | 2427 | 33 | |----------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | OPERATOR_REGISTRY | 328 | 328 | 328 | 328 | 33 | |----------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | SUBNETWORK | 2661 | 2661 | 2661 | 2661 | 102 | |----------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | SUBNETWORK_IDENTIFIER | 2524 | 2524 | 2524 | 2524 | 33 | |----------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | VAULT_FACTORY | 306 | 306 | 306 | 306 | 33 | |----------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getOperatorVaults | 14584 | 14584 | 14584 | 14584 | 64 | |----------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getOperatorVotingPower | 87024 | 88169 | 88169 | 89315 | 64 | |----------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getOperatorVotingPowerAt | 93614 | 96260 | 96388 | 98843 | 5 | |----------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getSlashingData | 8251 | 8251 | 8251 | 8251 | 33 | |----------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | initialize | 178640 | 214796 | 178640 | 269031 | 5 | |----------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | registerOperator | 87197 | 89269 | 87197 | 121397 | 33 | |----------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | registerOperatorVault | 234201 | 236283 | 234213 | 268413 | 33 | |----------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | setTokenWeight | 22209 | 56411 | 68502 | 68682 | 5 | |----------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | stakeToVotingPower | 11571 | 12716 | 12716 | 13862 | 64 | |----------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | stakeToVotingPowerAt | 11737 | 14383 | 14511 | 16966 | 5 | ╰----------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------╯ ╭----------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------╮ | test/modules/voting-power/common/voting-power-calc/WeightedVaultsVPCalc.t.sol:TestVotingPowerProvider Contract | | | | | | +=======================================================================================================================================================================+ | Deployment Cost | Deployment Size | | | | | |----------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | 3688414 | 17028 | | | | | |----------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | | | | | | | |----------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |----------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | NETWORK | 2427 | 2427 | 2427 | 2427 | 34 | |----------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | OPERATOR_REGISTRY | 306 | 306 | 306 | 306 | 34 | |----------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | SUBNETWORK | 2661 | 2661 | 2661 | 2661 | 71 | |----------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | SUBNETWORK_IDENTIFIER | 2502 | 2502 | 2502 | 2502 | 34 | |----------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | VAULT_FACTORY | 306 | 306 | 306 | 306 | 34 | |----------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getOperatorVaults | 14584 | 14584 | 14584 | 14584 | 33 | |----------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getOperatorVotingPower | 78905 | 78976 | 78905 | 81190 | 32 | |----------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getOperatorVotingPowerAt | 85516 | 88162 | 88290 | 90745 | 5 | |----------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getSlashingData | 8251 | 8251 | 8251 | 8251 | 34 | |----------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getVaultWeightAt | 3097 | 6120 | 5871 | 8326 | 6 | |----------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | initialize | 178618 | 217357 | 178618 | 269009 | 7 | |----------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | registerOperator | 87153 | 90170 | 87153 | 121353 | 34 | |----------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | registerOperatorVault | 234201 | 237228 | 234213 | 268413 | 34 | |----------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | setVaultWeight | 22140 | 57779 | 68433 | 68661 | 7 | |----------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | stakeToVotingPower | 3474 | 3545 | 3474 | 5759 | 32 | |----------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | stakeToVotingPowerAt | 3639 | 6285 | 6413 | 8868 | 5 | ╰----------------------------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------╯ ╭-------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------╮ | test/modules/voting-power/extensions/MultiToken.t.sol:TestMultiToken Contract | | | | | | +======================================================================================================================================+ | Deployment Cost | Deployment Size | | | | | |-------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | 2700660 | 12461 | | | | | |-------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | | | | | | | |-------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |-------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | initialize | 269030 | 269030 | 269030 | 269030 | 2 | |-------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | isTokenRegistered | 8372 | 9520 | 9520 | 10668 | 2 | |-------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | registerToken | 80730 | 80730 | 80730 | 80730 | 2 | |-------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | unregisterToken | 78801 | 78801 | 78801 | 78801 | 1 | ╰-------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------╯ ╭---------------------------------------------------------------------------------------------------+-----------------+--------+---------+---------+---------╮ | test/modules/voting-power/extensions/OpNetVaultAutoDeploy.t.sol:TestOpNetVaultAutoDeploy Contract | | | | | | +============================================================================================================================================================+ | Deployment Cost | Deployment Size | | | | | |---------------------------------------------------------------------------------------------------+-----------------+--------+---------+---------+---------| | 3278762 | 15203 | | | | | |---------------------------------------------------------------------------------------------------+-----------------+--------+---------+---------+---------| | | | | | | | |---------------------------------------------------------------------------------------------------+-----------------+--------+---------+---------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |---------------------------------------------------------------------------------------------------+-----------------+--------+---------+---------+---------| | NETWORK | 413 | 1413 | 1413 | 2413 | 6 | |---------------------------------------------------------------------------------------------------+-----------------+--------+---------+---------+---------| | OPERATOR_REGISTRY | 306 | 306 | 306 | 306 | 4 | |---------------------------------------------------------------------------------------------------+-----------------+--------+---------+---------+---------| | SUBNETWORK | 2712 | 2712 | 2712 | 2712 | 1 | |---------------------------------------------------------------------------------------------------+-----------------+--------+---------+---------+---------| | VAULT_CONFIGURATOR | 327 | 327 | 327 | 327 | 3 | |---------------------------------------------------------------------------------------------------+-----------------+--------+---------+---------+---------| | VAULT_FACTORY | 284 | 284 | 284 | 284 | 3 | |---------------------------------------------------------------------------------------------------+-----------------+--------+---------+---------+---------| | getAutoDeployConfig | 9118 | 9118 | 9118 | 9118 | 1 | |---------------------------------------------------------------------------------------------------+-----------------+--------+---------+---------+---------| | getAutoDeployedVault | 6024 | 6024 | 6024 | 6024 | 5 | |---------------------------------------------------------------------------------------------------+-----------------+--------+---------+---------+---------| | getOperatorVaults | 14562 | 14955 | 14562 | 16135 | 4 | |---------------------------------------------------------------------------------------------------+-----------------+--------+---------+---------+---------| | getSlashingData | 1751 | 3917 | 1751 | 8251 | 18 | |---------------------------------------------------------------------------------------------------+-----------------+--------+---------+---------+---------| | initialize | 329544 | 329544 | 329544 | 329544 | 12 | |---------------------------------------------------------------------------------------------------+-----------------+--------+---------+---------+---------| | isAutoDeployEnabled | 5567 | 5567 | 5567 | 5567 | 2 | |---------------------------------------------------------------------------------------------------+-----------------+--------+---------+---------+---------| | isSetMaxNetworkLimitHookEnabled | 5655 | 5655 | 5655 | 5655 | 1 | |---------------------------------------------------------------------------------------------------+-----------------+--------+---------+---------+---------| | registerOperator | 78448 | 958443 | 1178938 | 1397450 | 4 | |---------------------------------------------------------------------------------------------------+-----------------+--------+---------+---------+---------| | setAutoDeployConfig | 26834 | 34105 | 35955 | 40939 | 7 | |---------------------------------------------------------------------------------------------------+-----------------+--------+---------+---------+---------| | setAutoDeployStatus | 30961 | 43786 | 48061 | 48061 | 4 | |---------------------------------------------------------------------------------------------------+-----------------+--------+---------+---------+---------| | setSetMaxNetworkLimitHookStatus | 48077 | 48077 | 48077 | 48077 | 1 | |---------------------------------------------------------------------------------------------------+-----------------+--------+---------+---------+---------| | setSlashingData | 34482 | 34482 | 34482 | 34482 | 3 | |---------------------------------------------------------------------------------------------------+-----------------+--------+---------+---------+---------| | unregisterOperator | 78879 | 78879 | 78879 | 78879 | 1 | |---------------------------------------------------------------------------------------------------+-----------------+--------+---------+---------+---------| | unregisterOperatorVault | 128129 | 128129 | 128129 | 128129 | 1 | ╰---------------------------------------------------------------------------------------------------+-----------------+--------+---------+---------+---------╯ ╭---------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------╮ | test/modules/voting-power/extensions/OperatorVaults.t.sol:TestOperatorVaults Contract | | | | | | +==============================================================================================================================================+ | Deployment Cost | Deployment Size | | | | | |---------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | 2875023 | 13282 | | | | | |---------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | | | | | | | |---------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |---------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | OPERATOR_REGISTRY | 283 | 283 | 283 | 283 | 1 | |---------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | VAULT_FACTORY | 328 | 328 | 328 | 328 | 2 | |---------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getSlashingData | 8251 | 8251 | 8251 | 8251 | 1 | |---------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | initialize | 268986 | 268986 | 268986 | 268986 | 1 | |---------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | isOperatorVaultRegistered | 8457 | 10179 | 10753 | 10753 | 4 | |---------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | registerOperator | 143118 | 143118 | 143118 | 143118 | 1 | |---------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | registerOperatorVault | 24556 | 151263 | 158545 | 270689 | 3 | |---------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | unregisterOperatorVault(address) | 49385 | 49385 | 49385 | 49385 | 1 | |---------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | unregisterOperatorVault(address,address) | 24600 | 75031 | 75031 | 125463 | 2 | ╰---------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------╯ ╭-----------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------╮ | test/modules/voting-power/extensions/OperatorsBlacklist.t.sol:TestOperatorsBlacklist Contract | | | | | | +======================================================================================================================================================+ | Deployment Cost | Deployment Size | | | | | |-----------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | 2900473 | 13385 | | | | | |-----------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | | | | | | | |-----------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |-----------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | OPERATOR_REGISTRY | 283 | 283 | 283 | 283 | 2 | |-----------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | blacklistOperator | 24118 | 56516 | 51266 | 99414 | 4 | |-----------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getSlashingData | 8251 | 8251 | 8251 | 8251 | 6 | |-----------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | initialize | 268986 | 268986 | 268986 | 268986 | 6 | |-----------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | isOperatorBlacklisted | 2619 | 2619 | 2619 | 2619 | 5 | |-----------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | isOperatorRegistered | 8422 | 9187 | 8422 | 10718 | 3 | |-----------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | registerOperator | 23635 | 104821 | 145415 | 145415 | 3 | |-----------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | unblacklistOperator | 23541 | 23838 | 23838 | 24136 | 2 | ╰-----------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------╯ ╭-------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------╮ | test/modules/voting-power/extensions/OperatorsJail.t.sol:TestOperatorsJail Contract | | | | | | +============================================================================================================================================+ | Deployment Cost | Deployment Size | | | | | |-------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | 2951948 | 13623 | | | | | |-------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | | | | | | | |-------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |-------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | OPERATOR_REGISTRY | 283 | 283 | 283 | 283 | 3 | |-------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getOperatorJailedUntil | 2666 | 2666 | 2666 | 2666 | 5 | |-------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | initialize | 268986 | 268986 | 268986 | 268986 | 6 | |-------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | isOperatorJailed | 2713 | 2713 | 2713 | 2713 | 7 | |-------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | isOperatorRegistered | 8422 | 9187 | 8422 | 10718 | 3 | |-------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | jailOperator | 22400 | 47399 | 43071 | 99769 | 6 | |-------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | registerOperator | 23685 | 86571 | 94556 | 145465 | 5 | |-------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | unjailOperator | 23592 | 23889 | 23889 | 24187 | 2 | ╰-------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------╯ ╭-----------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------╮ | test/modules/voting-power/extensions/OperatorsWhitelist.t.sol:TestOperatorsWhitelist Contract | | | | | | +======================================================================================================================================================+ | Deployment Cost | Deployment Size | | | | | |-----------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | 3002526 | 13857 | | | | | |-----------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | | | | | | | |-----------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |-----------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | OPERATOR_REGISTRY | 327 | 327 | 327 | 327 | 4 | |-----------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | VAULT_FACTORY | 328 | 328 | 328 | 328 | 1 | |-----------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | getSlashingData | 8251 | 8251 | 8251 | 8251 | 11 | |-----------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | initialize | 292872 | 292872 | 292872 | 292872 | 11 | |-----------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | isOperatorRegistered | 8443 | 9017 | 8443 | 10739 | 4 | |-----------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | isOperatorVaultRegistered(address) | 8457 | 8457 | 8457 | 8457 | 1 | |-----------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | isOperatorVaultRegistered(address,address) | 8734 | 8734 | 8734 | 8734 | 1 | |-----------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | isOperatorWhitelisted | 2686 | 2686 | 2686 | 2686 | 2 | |-----------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | isWhitelistEnabled | 2401 | 2401 | 2401 | 2401 | 4 | |-----------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | registerOperator | 25797 | 106270 | 145394 | 147621 | 6 | |-----------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | registerOperatorVault | 268468 | 268468 | 268468 | 268468 | 1 | |-----------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | setWhitelistStatus | 23091 | 26973 | 23433 | 45003 | 6 | |-----------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | unwhitelistOperator | 24114 | 51888 | 51888 | 79663 | 2 | |-----------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | whitelistOperator | 24096 | 40079 | 45407 | 45407 | 4 | ╰-----------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------╯ ╭-----------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------╮ | test/modules/voting-power/extensions/SharedVaults.t.sol:TestSharedVaults Contract | | | | | | +==========================================================================================================================================+ | Deployment Cost | Deployment Size | | | | | |-----------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | 2722913 | 12564 | | | | | |-----------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | | | | | | | |-----------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |-----------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | VAULT_FACTORY | 328 | 328 | 328 | 328 | 2 | |-----------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | initialize | 269008 | 269008 | 269008 | 269008 | 2 | |-----------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | isSharedVaultRegistered | 8465 | 9613 | 9613 | 10761 | 2 | |-----------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | registerSharedVault | 170594 | 170594 | 170594 | 170594 | 2 | |-----------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| | unregisterSharedVault | 74215 | 74215 | 74215 | 74215 | 1 | ╰-----------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------╯ Ran 42 test suites in 10.74s (40.30s CPU time): 334 tests passed, 5 failed, 0 skipped (339 total tests) Failing tests: Encountered 5 failing tests in test/modules/voting-power/common/voting-power-calc/PricedTokensChainlinkVPCalc.t.sol:PricedTokensChainlinkVPCalcTest [FAIL: vm.createSelectFork: environment variable `ETH_RPC_URL` not found] test_ChainlinkCalcTracksRealPrice() (gas: 3466) [FAIL: vm.createSelectFork: environment variable `ETH_RPC_URL` not found] test_ChainlinkCalcTracksRealPriceHistorical() (gas: 8108) [FAIL: vm.createSelectFork: environment variable `ETH_RPC_URL` not found] test_ChainlinkCalcTracksRealPriceHistoricalZero() (gas: 8131) [FAIL: vm.createSelectFork: environment variable `ETH_RPC_URL` not found] test_ChainlinkCalcTracksRealPriceStale() (gas: 3400) [FAIL: vm.createSelectFork: environment variable `ETH_RPC_URL` not found] test_ChainlinkCalcTracksRealPriceWithInvert() (gas: 3400) Encountered a total of 5 failing tests, 334 tests succeeded ```` ## File: snapshots/sizes.txt ```` No files changed, compilation skipped ╭------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------╮ | Contract | Runtime Size (B) | Initcode Size (B) | Runtime Margin (B) | Initcode Margin (B) | +====================================================================================================================================================================================================+ | Address | 44 | 94 | 24,532 | 49,058 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | AuthorityUtils | 44 | 94 | 24,532 | 49,058 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | BN254 | 44 | 94 | 24,532 | 49,058 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | BN254G2 | 44 | 94 | 24,532 | 49,058 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | BaseRewardsLogic | 1,606 | 1,658 | 22,970 | 47,494 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | BaseSlashingLogic | 4,387 | 4,439 | 20,189 | 44,713 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | Bytes | 44 | 94 | 24,532 | 49,058 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | ChainlinkPriceFeed | 6,072 | 6,124 | 18,504 | 43,028 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | Checkpoints (lib/core/src/contracts/libraries/Checkpoints.sol) | 44 | 94 | 24,532 | 49,058 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | Checkpoints (lib/openzeppelin-contracts/contracts/utils/structs/Checkpoints.sol) | 44 | 94 | 24,532 | 49,058 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | Checkpoints (src/libraries/structs/Checkpoints.sol) | 44 | 94 | 24,532 | 49,058 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | Create2 | 44 | 94 | 24,532 | 49,058 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | CreateXWrapper | 2,764 | 2,792 | 21,812 | 46,360 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | ECDSA | 44 | 94 | 24,532 | 49,058 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | ERC1967Proxy | 122 | 935 | 24,454 | 48,217 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | ERC1967Utils | 44 | 94 | 24,532 | 49,058 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | ERC4626Math | 44 | 94 | 24,532 | 49,058 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | EnumerableSet | 44 | 94 | 24,532 | 49,058 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | Errors | 44 | 94 | 24,532 | 49,058 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | ExtraDataStorageHelper | 123 | 173 | 24,453 | 48,979 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | FeeOnTransferToken | 1,785 | 3,197 | 22,791 | 45,955 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | InputNormalizer | 44 | 94 | 24,532 | 49,058 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | KeyBlsBn254 | 44 | 94 | 24,532 | 49,058 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | KeyBlsBn254Mock | 2,659 | 2,687 | 21,917 | 46,465 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | KeyEcdsaSecp256k1 | 44 | 94 | 24,532 | 49,058 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | KeyEcdsaSecp256k1Mock | 1,362 | 1,390 | 23,214 | 47,762 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | KeyRegistry | 14,970 | 14,998 | 9,606 | 34,154 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | KeyRegistryWithKey64 | 16,359 | 16,387 | 8,217 | 32,765 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | KeyTags | 44 | 94 | 24,532 | 49,058 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | Logs | 4,290 | 4,342 | 20,286 | 44,810 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | Math | 44 | 94 | 24,532 | 49,058 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | MessageHashUtils | 44 | 94 | 24,532 | 49,058 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | MockAuthority | 258 | 392 | 24,318 | 48,760 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | MockToken (test/modules/voting-power/common/voting-power-calc/NormalizedTokenDecimalsVPCalc.t.sol) | 1,757 | 2,881 | 22,819 | 46,271 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | MockToken (test/modules/voting-power/common/voting-power-calc/WeightedTokensVPCalc.t.sol) | 1,757 | 2,881 | 22,819 | 46,271 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | MockToken (test/modules/voting-power/common/voting-power-calc/WeightedVaultsVPCalc.t.sol) | 1,757 | 2,881 | 22,819 | 46,271 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | MyKeyRegistry | 15,260 | 15,288 | 9,316 | 33,864 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | MySettlement | 12,058 | 12,086 | 12,518 | 37,066 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | MyValSetDriver | 18,817 | 18,845 | 5,759 | 30,307 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | MyVotingPowerProvider | 12,956 | 13,124 | 11,620 | 36,028 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | Network | 12,351 | 12,543 | 12,225 | 36,609 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | OpNetVaultAutoDeployLogic | 5,693 | 5,745 | 18,883 | 43,407 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | Panic | 44 | 94 | 24,532 | 49,058 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | PersistentSet | 44 | 94 | 24,532 | 49,058 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | ProxyAdmin | 977 | 1,213 | 23,599 | 47,939 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | RewarderMock | 730 | 758 | 23,846 | 48,394 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | SafeCast | 44 | 94 | 24,532 | 49,058 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | SafeERC20 | 44 | 94 | 24,532 | 49,058 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | Scaler | 44 | 94 | 24,532 | 49,058 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | SigBlsBn254 | 44 | 94 | 24,532 | 49,058 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | SigEcdsaSecp256k1 | 44 | 94 | 24,532 | 49,058 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | SigVerifierBlsBn254Simple | 4,946 | 4,974 | 19,630 | 44,178 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | SigVerifierBlsBn254ZK | 2,694 | 3,774 | 21,882 | 45,378 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | SigVerifierFalseMock | 586 | 614 | 23,990 | 48,538 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | SigVerifierMock | 587 | 615 | 23,989 | 48,537 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | SignatureChecker | 44 | 94 | 24,532 | 49,058 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | SignedMath | 44 | 94 | 24,532 | 49,058 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | Simulation | 44 | 94 | 24,532 | 49,058 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | SlasherMock | 1,264 | 1,292 | 23,312 | 47,860 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | StorageSlot | 44 | 94 | 24,532 | 49,058 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | Strings | 44 | 94 | 24,532 | 49,058 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | Subnetwork | 44 | 94 | 24,532 | 49,058 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | SymbioticCoreBytecode | 44 | 94 | 24,532 | 49,058 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | SymbioticCoreConstants | 44 | 94 | 24,532 | 49,058 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | SymbioticUtils | 80 | 109 | 24,496 | 49,043 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | TestEpochManager | 4,327 | 4,355 | 20,249 | 44,797 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | TestKeyRegistry | 16,928 | 16,956 | 7,648 | 32,196 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | TestMultiToken | 12,229 | 12,397 | 12,347 | 36,755 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | TestNetworkManager | 1,356 | 1,384 | 23,220 | 47,768 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | TestNoPermissionManager | 334 | 362 | 24,242 | 48,790 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | TestOpNetVaultAutoDeploy | 14,899 | 15,107 | 9,677 | 34,045 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | TestOperatorVaults | 12,916 | 13,218 | 11,660 | 35,934 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | TestOperatorsBlacklist | 13,153 | 13,321 | 11,423 | 35,831 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | TestOperatorsJail | 13,391 | 13,559 | 11,185 | 35,593 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | TestOperatorsWhitelist | 13,625 | 13,793 | 10,951 | 35,359 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | TestOzAccessControl | 1,735 | 1,763 | 22,841 | 47,389 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | TestOzAccessManaged | 1,853 | 1,881 | 22,723 | 47,271 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | TestOzEIP712 | 2,562 | 2,590 | 22,014 | 46,562 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | TestOzOwnable | 971 | 999 | 23,605 | 48,153 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | TestPermissionManager | 575 | 603 | 24,001 | 48,549 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | TestSettlement | 10,858 | 10,886 | 13,718 | 38,266 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | TestSharedVaults | 12,332 | 12,500 | 12,244 | 36,652 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | TestValSetDriver | 16,581 | 16,609 | 7,995 | 32,543 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | TestVotingPowerCalcManager | 911 | 939 | 23,665 | 48,213 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | TestVotingPowerProvider (test/modules/voting-power/VotingPowerProvider.t.sol) | 14,819 | 14,987 | 9,757 | 34,165 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | TestVotingPowerProvider (test/modules/voting-power/common/voting-power-calc/NormalizedTokenDecimalsVPCalc.t.sol) | 15,523 | 15,691 | 9,053 | 33,461 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | TestVotingPowerProvider (test/modules/voting-power/common/voting-power-calc/PricedTokensChainlinkVPCalc.t.sol) | 19,206 | 19,374 | 5,370 | 29,778 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | TestVotingPowerProvider (test/modules/voting-power/common/voting-power-calc/WeightedTokensVPCalc.t.sol) | 17,465 | 17,633 | 7,111 | 31,519 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | TestVotingPowerProvider (test/modules/voting-power/common/voting-power-calc/WeightedVaultsVPCalc.t.sol) | 16,796 | 16,964 | 7,780 | 32,188 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | Time | 44 | 94 | 24,532 | 49,058 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | TimelockControllerUpgradeable | 7,683 | 7,711 | 16,893 | 41,441 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | Token | 1,723 | 3,065 | 22,853 | 46,087 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | TransparentUpgradeableProxy | 1,074 | 3,447 | 23,502 | 45,705 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | ValSetVerifier | 44 | 94 | 24,532 | 49,058 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | ValSetVerifierContract | 2,248 | 2,276 | 22,328 | 46,876 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | ValSetVerifierMock | 1,170 | 1,198 | 23,406 | 47,954 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | Verifier (test/data/zk/Verifier_10.sol) | 6,391 | 6,419 | 18,185 | 42,733 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | Verifier (test/data/zk/Verifier_100.sol) | 6,393 | 6,421 | 18,183 | 42,731 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | Verifier (test/data/zk/Verifier_1000.sol) | 6,391 | 6,419 | 18,185 | 42,733 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | VotingPowerProviderFull | 24,286 | 24,494 | 290 | 24,658 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | VotingPowerProviderLogic | 15,628 | 15,680 | 8,948 | 33,472 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | VotingPowerProviderSemiFull | 16,892 | 17,060 | 7,684 | 32,092 | |------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | VotingPowerProviderSharedVaults | 12,819 | 12,987 | 11,757 | 36,165 | ╰------------------------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------╯ ```` ## File: src/interfaces/modules/base/INetworkManager.sol ```` // SPDX-License-Identifier: MIT ⋮---- /** * @title INetworkManager * @notice Interface for the NetworkManager contract. */ interface INetworkManager { /** * @notice Reverts when the network is zero address. */ ⋮---- /** * @notice The storage of the NetworkManager contract. * @param _network The address of the network. * @param _subnetworkID The identifier of the subnetwork. * @dev The whole set of contracts supports only a single subnetwork per network. * @custom:storage-location erc7201:symbiotic.storage.NetworkManager */ ⋮---- /** * @notice The parameters for the initialization of the NetworkManager contract. * @param network The address of the network. * @param subnetworkId The identifier of the subnetwork. * @dev `network` is not obligated to be registered in NetworkRegistry contract, it can be any non-zero address. */ ⋮---- /** * @notice Emitted during the NetworkManager initialization. * @param network The address of the network. * @param subnetworkId The identifier of the subnetwork. */ event InitSubnetwork(address network, uint96 subnetworkId); ⋮---- /** * @notice Returns the address of the network. * @return The address of the network. */ function NETWORK() external view returns (address); ⋮---- /** * @notice Returns the identifier of the subnetwork. * @return The identifier of the subnetwork. */ function SUBNETWORK_IDENTIFIER() external view returns (uint96); ⋮---- /** * @notice Returns the subnetwork (a concatenation of the network and the subnetwork ID). * @return The subnetwork. */ function SUBNETWORK() external view returns (bytes32); ```` ## File: src/interfaces/modules/base/IOzEIP712.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {IERC5267} from "@openzeppelin/contracts/interfaces/IERC5267.sol"; ⋮---- /** * @title IOzEIP712 * @notice Interface for the OzEIP712 contract. */ interface IOzEIP712 is IERC5267 { /** * @notice The parameters for the initialization of the OzEIP712 contract. * @param name The name for EIP712. * @param version The version for EIP712. */ ⋮---- /** * @notice Emitted during the OzEIP712 initialization. * @param name The name for EIP712. * @param version The version for EIP712. */ event InitEIP712(string name, string version); ⋮---- /** * @notice Returns the EIP712 hash of the typed data. * @param structHash The hash of the typed data struct. * @return The EIP712 formatted hash. */ function hashTypedDataV4(bytes32 structHash) external view returns (bytes32); ⋮---- /** * @notice Wraps the `structHash` to the EIP712 format for cross-chain usage. * @param structHash The hash of the typed data struct. * @return The EIP712 formatted hash. * @dev It doesn't include `chainId` and `verifyingContract` fields for the domain separator. */ function hashTypedDataV4CrossChain(bytes32 structHash) external view returns (bytes32); ```` ## File: src/interfaces/modules/base/IPermissionManager.sol ```` // SPDX-License-Identifier: MIT ⋮---- /** * @title IPermissionManager * @notice Interface for the PermissionManager contract. */ interface IPermissionManager {} ```` ## File: src/interfaces/modules/common/permissions/IOzAccessControl.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {IPermissionManager} from "../../../modules/base/IPermissionManager.sol"; ⋮---- import {IAccessControl} from "@openzeppelin/contracts/access/IAccessControl.sol"; ⋮---- /** * @title IOzAccessControl * @notice Interface for the OzAccessControl contract. */ interface IOzAccessControl { /** * @notice The storage of the OzAccessControl contract. * @param _selectorRoles The mapping from the function selector to the required role. * @custom:storage-location erc7201:symbiotic.storage.OzAccessControl */ ⋮---- /** * @notice Emitted when the required role is set for a selector. * @param selector The function selector. * @param role The required role. */ event SetSelectorRole(bytes4 indexed selector, bytes32 indexed role); ⋮---- /** * @notice Returns the required role for a selector. * @param selector The function selector. * @return The required role. */ function getRole(bytes4 selector) external view returns (bytes32); ```` ## File: src/interfaces/modules/common/permissions/IOzAccessManaged.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {IPermissionManager} from "../../../modules/base/IPermissionManager.sol"; ⋮---- import {IAccessManaged} from "@openzeppelin/contracts/access/manager/IAccessManaged.sol"; ⋮---- /** * @title IOzAccessManaged * @notice Interface for the OzAccessManaged contract. */ interface IOzAccessManaged { /** * @notice The parameters for the initialization of the OzAccessManaged contract. * @param authority The address of the authority that will check the access. */ ```` ## File: src/interfaces/modules/common/permissions/IOzOwnable.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {IPermissionManager} from "../../../modules/base/IPermissionManager.sol"; ⋮---- /** * @title IOzOwnable * @notice Interface for the OzOwnable contract. */ interface IOzOwnable { /** * @notice The parameters for the initialization of the OzOwnable contract. * @param owner The address of the owner. */ ```` ## File: src/interfaces/modules/key-registry/IKeyRegistry.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {IOzEIP712} from "../../modules/base/IOzEIP712.sol"; ⋮---- import {Checkpoints} from "../../../libraries/structs/Checkpoints.sol"; import {PersistentSet} from "../../../libraries/structs/PersistentSet.sol"; ⋮---- /** * @title IKeyRegistry * @notice Interface for the KeyRegistry contract. */ interface IKeyRegistry { /** * @notice Reverts when the key is already used by another operator or with another tag. */ ⋮---- /** * @notice Reverts when the key ownership signature is invalid. */ ⋮---- /** * @notice Reverts when the key type is not supported. */ ⋮---- /** * @notice The storage of the KeyRegistry contract. * @param _keys32 The mapping from the operator and the key tag to the 32 bytes key. * @param _keys64 The mapping from the operator and the key tag to the 64 bytes key. * @param _operatorByKeyHash The mapping from the key hash to the operator. * @param _operatorByTypeAndKeyHash The mapping from the key type and the key hash to the operator. * @param _operatorByTagAndKeyHash The mapping from the key type and the key hash to the operator. * @param _operators The set of operators with registered keys. * @param _operatorKeyTags The mapping from the operator to the registered key tags. * @custom:storage-location erc7201:symbiotic.storage.KeyRegistry */ ⋮---- /** * @notice The parameters for the initialization of the KeyRegistry contract. * @param ozEip712InitParams The parameters for the initialization of the OzEIP712 contract. */ ⋮---- /** * @notice The key with the tag and the payload. * @param tag The tag of the key. * @param payload The payload of the key. */ ⋮---- /** * @notice The operator with the keys. * @param operator The address of the operator. * @param keys The operator's keys. */ ⋮---- /** * @notice Emitted when the key is set. * @param operator The address of the operator. * @param tag The tag of the key. * @param key The payload of the key. * @param extraData The extra data of the key (e.g., the G2 key for BLS keys). */ event SetKey(address indexed operator, uint8 indexed tag, bytes indexed key, bytes extraData); ⋮---- /** * @notice Returns the operator's keys at a specific timestamp. * @param operator The address of the operator. * @param timestamp The timestamp. * @return The operator's keys. */ function getKeysAt(address operator, uint48 timestamp) external view returns (Key[] memory); ⋮---- /** * @notice Returns the current operator's keys. * @param operator The address of the operator. * @return The operator's keys. */ function getKeys(address operator) external view returns (Key[] memory); ⋮---- /** * @notice Returns the key at a specific timestamp. * @param operator The address of the operator. * @param tag The tag of the key. * @param timestamp The timestamp. * @return The key. * @dev Will return a zero key if the key is not found (e.g., abi.encode(address(0)) for ECDSA keys). */ function getKeyAt(address operator, uint8 tag, uint48 timestamp) external view returns (bytes memory); ⋮---- /** * @notice Returns the current key. * @param operator The address of the operator. * @param tag The tag of the key. * @return The key. * @dev Will return a zero key if the key is not found (e.g., abi.encode(address(0)) for ECDSA keys). */ function getKey(address operator, uint8 tag) external view returns (bytes memory); ⋮---- /** * @notice Returns the operator by the key. * @param key The key. * @return The operator. */ function getOperator(bytes memory key) external view returns (address); ⋮---- /** * @notice Returns the operators with their keys at a specific timestamp. * @param timestamp The timestamp. * @return The operators with their keys. * @dev Different operators may have different numbers of keys and their tags. */ function getKeysAt(uint48 timestamp) external view returns (OperatorWithKeys[] memory); ⋮---- /** * @notice Returns the current operators with their keys. * @return The operators with their keys. * @dev Different operators may have different numbers of keys and their tags. */ function getKeys() external view returns (OperatorWithKeys[] memory); ⋮---- /** * @notice Returns the number of the operators who registered any keys. * @return The number of the operators who registered any keys. */ function getKeysOperatorsLength() external view returns (uint256); ⋮---- /** * @notice Returns the operators who registered any keys until a specific timestamp. * @param timestamp The timestamp. * @return The operators who registered any keys until a specific timestamp. */ function getKeysOperatorsAt(uint48 timestamp) external view returns (address[] memory); ⋮---- /** * @notice Returns the operators who registered any keys. * @return The operators who registered any keys. */ function getKeysOperators() external view returns (address[] memory); ⋮---- /** * @notice Sets a key for a caller. * @param tag The tag of the key. * @param key The payload of the key. * @param signature The signature to verify the key ownership. * @param extraData The extra data of the key (e.g., the G2 key for BLS keys). */ function setKey(uint8 tag, bytes memory key, bytes memory signature, bytes memory extraData) external; ```` ## File: src/interfaces/modules/settlement/sig-verifiers/zk/IVerifier.sol ```` // SPDX-License-Identifier: MIT ⋮---- /** * @title IVerifier * @notice Interface for the gnark verifier contracts. */ interface IVerifier { /** * @notice Verifies a ZK proof for the given input. * @param proof The ZK proof. * @param commitments The commitments. * @param commitmentPok The commitment proof of knowledge. * @param input The circuit public input. * @dev Reverts if the proof is invalid. */ function verifyProof( ```` ## File: src/interfaces/modules/settlement/sig-verifiers/ISigVerifier.sol ```` // SPDX-License-Identifier: MIT ⋮---- /** * @title ISigVerifier * @notice Interface for the signature verifier contracts. */ interface ISigVerifier { /** * @notice Returns the type of the signature verification. * @return The type of the signature verification. */ function VERIFICATION_TYPE() external view returns (uint32); ⋮---- /** * @notice Returns the result of the quorum signature verification. * @param settlement The address of the Settlement contract. * @param epoch The epoch from which the validator set is to use. * @param message The message to verify. * @param keyTag The tag of the key. * @param quorumThreshold The quorum threshold (in absolute terms). * @param proof The proof (depends on the verification type). * @return The result of the quorum signature verification. */ function verifyQuorumSig( ```` ## File: src/interfaces/modules/settlement/sig-verifiers/ISigVerifierBlsBn254Simple.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {ISigVerifier} from "./ISigVerifier.sol"; ⋮---- /** * @title ISigVerifierBlsBn254Simple * @notice Interface for the SigVerifierBlsBn254Simple contract. */ interface ISigVerifierBlsBn254Simple is ISigVerifier { /** * @notice Reverts when the message length is invalid. */ ⋮---- /** * @notice Reverts when the non-signer index is greater than the number of validators. */ ⋮---- /** * @notice Reverts when the non-signers' indices are not in the correct order. * @dev The indices must be sorted in ascending order. */ ⋮---- /** * @notice Reverts when the proof length is too short. */ ⋮---- /** * @notice Reverts when the proof offset is invalid. */ ⋮---- /** * @notice Reverts when the number of validators exceeds the maximum allowed for this verification mechanism. */ ⋮---- /** * @notice Reverts when the verification is not supported for the given key tag. */ ⋮---- /** * @notice Returns the marker for extra data fetching of the validator set keccak256 hash. * @return The marker for extra data fetching of the validator set keccak256 hash. */ function VALIDATOR_SET_HASH_KECCAK256_HASH() external view returns (bytes32); ⋮---- /** * @notice Returns the marker for extra data fetching of the aggregated public key G1. * @return The marker for extra data fetching of the aggregated public key G1. * @dev The public key is compressed to one bytes32 slot. */ function AGGREGATED_PUBLIC_KEY_G1_HASH() external view returns (bytes32); ⋮---- /** * @notice Returns the maximum allowed number of validators for this verification mechanism. * @return The maximum allowed number of validators for this verification mechanism. * @dev The maximum exists because each non-signer's index is encoded as a 2 bytes value. */ function MAX_VALIDATORS() external view returns (uint256); ```` ## File: src/interfaces/modules/settlement/sig-verifiers/ISigVerifierBlsBn254ZK.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {ISigVerifier} from "./ISigVerifier.sol"; ⋮---- /** * @title ISigVerifierBlsBn254ZK * @notice Interface for the SigVerifierBlsBn254ZK contract. */ interface ISigVerifierBlsBn254ZK is ISigVerifier { /** * @notice Reverts when the number of verifiers and max validators is not the same or zero. */ ⋮---- /** * @notice Reverts when the maximum supported number of validators is zero. */ ⋮---- /** * @notice Reverts when the maximum supported numbers of validators is not in the correct order. * @dev The maximum supported numbers of validators must be in ascending order. */ ⋮---- /** * @notice Reverts when the message length is invalid. */ ⋮---- /** * @notice Reverts when the proof length is invalid. */ ⋮---- /** * @notice Reverts when the proof offset is invalid. */ ⋮---- /** * @notice Reverts when the total active validators is greater than the maximum supported. */ ⋮---- /** * @notice Reverts when the verifier is zero address. */ ⋮---- /** * @notice Reverts when the verification is not supported for the given key tag. */ ⋮---- /** * @notice Returns the marker for extra data fetching of the total active validators. * @return The marker for extra data fetching of the total active validators. */ function TOTAL_ACTIVE_VALIDATORS_HASH() external view returns (bytes32); ⋮---- /** * @notice Returns the marker for extra data fetching of the validator set MiMC hash. * @return The marker for extra data fetching of the validator set MiMC hash. */ function VALIDATOR_SET_HASH_MIMC_HASH() external view returns (bytes32); ⋮---- /** * @notice Returns the verifier at the given index. * @param index The index of the verifier. * @return The verifier at the given index. */ function verifiers(uint256 index) external view returns (address); ⋮---- /** * @notice Returns the maximum supported number of validators for the verifier at the given index. * @param index The index of the verifier. * @return The maximum supported number of validators for the verifier at the given index. */ function maxValidators(uint256 index) external view returns (uint256); ```` ## File: src/interfaces/modules/settlement/ISettlement.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {INetworkManager} from "../../modules/base/INetworkManager.sol"; import {IOzEIP712} from "../../modules/base/IOzEIP712.sol"; ⋮---- import {Checkpoints} from "../../../libraries/structs/Checkpoints.sol"; ⋮---- /** * @title ISettlement * @notice Interface for the Settlement contract. */ interface ISettlement { /** * @notice Reverts when the extra data key is duplicated. */ ⋮---- /** * @notice Reverts when the capture timestamp is less than or equal to the capture timestamp of the latest committed header, * or greater than or equal to the current timestamp. */ ⋮---- /** * @notice Reverts when the proposed during the commit epoch is less than or equal to the latest committed one. */ ⋮---- /** * @notice Reverts when the new quorum signature verifier is zero. */ ⋮---- /** * @notice Reverts when the validator set SSZ root is zero. */ ⋮---- /** * @notice Reverts when the version to be committed is not the same as the version inside the contract. * @dev Can be triggered during the upgrades. */ ⋮---- /** * @notice Reverts when the quorum threshold is greater than the total voting power. */ ⋮---- /** * @notice Reverts when the validator set header is already committed for the proposed epoch. */ ⋮---- /** * @notice Reverts when the quorum signature verification fails. */ ⋮---- /** * @notice The storage of the Settlement contract. * @param _lastCommittedHeaderEpoch The epoch of the last committed header. * @param _sigVerifier The address of the quorum signature verifier. * @param _valSetHeader The mapping from the epoch to the validator set header. * @param _extraData The mapping from the epoch and the key to the extra data. * @custom:storage-location ERC-7201 slot: erc7201:symbiotic.storage.Settlement. */ ⋮---- /** * @notice The parameters for the initialization of the Settlement contract. * @param networkManagerInitParams The parameters for the initialization of the NetworkManager. * @param ozEip712InitParams The parameters for the initialization of the OzEIP712. * @param sigVerifier The address of the quorum signature verifier. */ ⋮---- /** * @notice The validator set header. * @param version The version of the validator set header. * @param requiredKeyTag The required key tag for the validator set header using which the next header will be committed. * @param epoch The epoch of the validator set. * @param captureTimestamp The capture timestamp of the validator set. * @param quorumThreshold The quorum threshold of the validator set header which will need to be reached to commit the next header. * @param totalVotingPower The total voting power of the validator set. * @param validatorsSszMRoot The validator set SSZ root. */ ⋮---- /** * @notice The extra data. * @param key The key to store the extra data with. * @param value The value of the extra data. * @dev This key-value storage is fully flexible and can be used to store any data (e.g., verification-specific aggregated data). */ ⋮---- /** * @notice Emitted during the Settlement initialization. * @param sigVerifier The address of the quorum signature verifier. */ event InitSigVerifier(address sigVerifier); ⋮---- /** * @notice Emitted when the quorum signature verifier is set. * @param sigVerifier The address of the quorum signature verifier. * @dev The new verifier will be "committed" only in the next epoch. */ event SetSigVerifier(address sigVerifier); ⋮---- /** * @notice Emitted when the genesis is set. * @param valSetHeader The validator set header. * @param extraData The extra data. */ event SetGenesis(ValSetHeader valSetHeader, ExtraData[] extraData); ⋮---- /** * @notice Emitted when the validator set header is committed. * @param valSetHeader The validator set header. * @param extraData The extra data. */ event CommitValSetHeader(ValSetHeader valSetHeader, ExtraData[] extraData); ⋮---- /** * @notice Returns the version of the validator set. * @return The version of the validator set. */ function VALIDATOR_SET_VERSION() external view returns (uint8); ⋮---- /** * @notice Returns the quorum signature verifier at the given epoch. * @param epoch The epoch. * @param hint The hint for the quorum signature verifier. * @return The quorum signature verifier at the given epoch. */ function getSigVerifierAt(uint48 epoch, bytes memory hint) external view returns (address); ⋮---- /** * @notice Returns the quorum signature verifier. * @return The quorum signature verifier. */ function getSigVerifier() external view returns (address); ⋮---- /** * @notice Returns the epoch of the last committed validator set header. * @return The epoch of the last committed validator set header. */ function getLastCommittedHeaderEpoch() external view returns (uint48); ⋮---- /** * @notice Returns if the validator set header is committed at the given epoch. * @param epoch The epoch. * @return True if the validator set header is committed at the given epoch. */ function isValSetHeaderCommittedAt(uint48 epoch) external view returns (bool); ⋮---- /** * @notice Returns the hash of the validator set header at the given epoch. * @param epoch The epoch. * @return The hash of the validator set header at the given epoch. */ function getValSetHeaderHashAt(uint48 epoch) external view returns (bytes32); ⋮---- /** * @notice Returns the hash of the last committed validator set header. * @return The hash of the last committed validator set header. */ function getValSetHeaderHash() external view returns (bytes32); ⋮---- /** * @notice Returns the validator set header at the given epoch. * @param epoch The epoch. * @return The validator set header at the given epoch. */ function getValSetHeaderAt(uint48 epoch) external view returns (ValSetHeader memory); ⋮---- /** * @notice Returns the last committed validator set header. * @return The last committed validator set header. */ function getValSetHeader() external view returns (ValSetHeader memory); ⋮---- /** * @notice Returns the version of the validator set header at the given epoch. * @param epoch The epoch. * @return The version of the validator set header at the given epoch. */ function getVersionFromValSetHeaderAt(uint48 epoch) external view returns (uint8); ⋮---- /** * @notice Returns the version from the last committed validator set header. * @return The version from the last committed validator set header. */ function getVersionFromValSetHeader() external view returns (uint8); ⋮---- /** * @notice Returns the required key tag from the validator set header at the given epoch. * @param epoch The epoch. * @return The required key tag from the validator set header at the given epoch. */ function getRequiredKeyTagFromValSetHeaderAt(uint48 epoch) external view returns (uint8); ⋮---- /** * @notice Returns the required key tag from the last committed validator set header. * @return The required key tag from the last committed validator set header. */ function getRequiredKeyTagFromValSetHeader() external view returns (uint8); ⋮---- /** * @notice Returns the capture timestamp from the validator set header at the given epoch. * @param epoch The epoch. * @return The capture timestamp from the validator set header at the given epoch. */ function getCaptureTimestampFromValSetHeaderAt(uint48 epoch) external view returns (uint48); ⋮---- /** * @notice Returns the capture timestamp from the last committed validator set header. * @return The capture timestamp from the last committed validator set header. */ function getCaptureTimestampFromValSetHeader() external view returns (uint48); ⋮---- /** * @notice Returns the quorum threshold from the validator set header at the given epoch. * @param epoch The epoch. * @return The quorum threshold from the validator set header at the given epoch. */ function getQuorumThresholdFromValSetHeaderAt(uint48 epoch) external view returns (uint256); ⋮---- /** * @notice Returns the quorum threshold from the last committed validator set header. * @return The quorum threshold from the last committed validator set header. */ function getQuorumThresholdFromValSetHeader() external view returns (uint256); ⋮---- /** * @notice Returns the total voting power from the validator set header at the given epoch. * @param epoch The epoch. * @return The total voting power from the validator set header at the given epoch. */ function getTotalVotingPowerFromValSetHeaderAt(uint48 epoch) external view returns (uint256); ⋮---- /** * @notice Returns the total voting power from the last committed validator set header. * @return The total voting power from the last committed validator set header. */ function getTotalVotingPowerFromValSetHeader() external view returns (uint256); ⋮---- /** * @notice Returns the validator set SSZ root from the validator set header at the given epoch. * @param epoch The epoch. * @return The validator set SSZ root from the validator set header at the given epoch. */ function getValidatorsSszMRootFromValSetHeaderAt(uint48 epoch) external view returns (bytes32); ⋮---- /** * @notice Returns the validator set SSZ root from the last committed validator set header. * @return The validator set SSZ root from the last committed validator set header. */ function getValidatorsSszMRootFromValSetHeader() external view returns (bytes32); ⋮---- /** * @notice Returns the extra data at the given epoch for a certain key. * @param epoch The epoch. * @param key The key. * @return The extra data at the given epoch for a certain key. */ function getExtraDataAt(uint48 epoch, bytes32 key) external view returns (bytes32); ⋮---- /** * @notice Returns the extra data from the last committed epoch for a certain key. * @param key The key. * @return The extra data from the last committed epoch for a certain key. */ function getExtraData(bytes32 key) external view returns (bytes32); ⋮---- /** * @notice Returns the result of the quorum signature verification for the given message at the given epoch. * @param message The message to verify. * @param keyTag The key tag to use for the quorum signature verification. * @param quorumThreshold The quorum threshold to require for the quorum signature verification. * @param proof The proof to verify the quorum signature. * @param epoch The epoch. * @param hint The hint to optimize the signature verifier fetching. * @return The result of the quorum signature verification for the given message at the given epoch. */ function verifyQuorumSigAt( ⋮---- /** * @notice Returns the result of the quorum signature verification for the given message using the last committed validator set header. * @param message The message to verify. * @param keyTag The key tag to use for the quorum signature verification. * @param quorumThreshold The quorum threshold to require for the quorum signature verification. * @param proof The proof to verify the quorum signature. * @return The result of the quorum signature verification for the given message using the last committed validator set header. */ function verifyQuorumSig(bytes memory message, uint8 keyTag, uint256 quorumThreshold, bytes calldata proof) ⋮---- /** * @notice Sets the quorum signature verifier. * @param sigVerifier The address of the quorum signature verifier. * @dev The new verifier will be "committed" only in the next epoch. * @dev The caller must have the needed permission. */ function setSigVerifier(address sigVerifier) external; ⋮---- /** * @notice Sets the genesis validator set header and its extra data. * @param valSetHeader The validator set header. * @param extraData The extra data. * @dev The caller must have the needed permission. * Can be called multiple times. */ function setGenesis(ValSetHeader calldata valSetHeader, ExtraData[] calldata extraData) external; ⋮---- /** * @notice Commits the validator set header and its extra data. * @param header The validator set header. * @param extraData The extra data. * @param proof The proof to verify the quorum signature. * @dev The caller can be anyone, the call is validated by verification of the validator set's attestation. */ function commitValSetHeader(ValSetHeader calldata header, ExtraData[] calldata extraData, bytes calldata proof) ```` ## File: src/interfaces/modules/valset-driver/IEpochManager.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {Checkpoints} from "../../../libraries/structs/Checkpoints.sol"; ⋮---- /** * @title IEpochManager * @notice Interface for the EpochManager contract. */ interface IEpochManager { /** * @notice Reverts when the epoch duration is zero. */ ⋮---- /** * @notice Reverts when the initial epoch duration timestamp is less than the current timestamp. */ ⋮---- /** * @notice Reverts when the timestamp is too old. */ ⋮---- /** * @notice The storage of the EpochManager contract. * @param _epochDurationDataByTimestamp The epoch duration data checkpointed by timestamps. * @param _epochDurationDataByIndex The epoch duration data checkpointed by epoch indexes. * @custom:storage-location erc7201:symbiotic.storage.EpochManager */ ⋮---- /** * @notice The parameters for the initialization of the EpochManager contract. * @param epochDuration The epoch duration. * @param epochDurationTimestamp The initial epoch duration timestamp. */ ⋮---- /** * @notice Emitted during the initialization of the EpochManager contract. * @param epochDuration The epoch duration. * @param epochDurationTimestamp The initial epoch duration timestamp. */ event InitEpochDuration(uint48 epochDuration, uint48 epochDurationTimestamp); ⋮---- /** * @notice Emitted when the epoch duration is set. * @param epochDuration The epoch duration. * @dev The new duration will be "committed" only in the next epoch. */ event SetEpochDuration(uint48 epochDuration); ⋮---- /** * @notice Returns the current epoch. * @return The current epoch. */ function getCurrentEpoch() external view returns (uint48); ⋮---- /** * @notice Returns the current epoch duration. * @return The current epoch duration. */ function getCurrentEpochDuration() external view returns (uint48); ⋮---- /** * @notice Returns the current epoch start. * @return The current epoch start. */ function getCurrentEpochStart() external view returns (uint48); ⋮---- /** * @notice Returns the next epoch. * @return The next epoch. */ function getNextEpoch() external view returns (uint48); ⋮---- /** * @notice Returns the next epoch duration. * @return The next epoch duration. */ function getNextEpochDuration() external view returns (uint48); ⋮---- /** * @notice Returns the next epoch start. * @return The next epoch start. */ function getNextEpochStart() external view returns (uint48); ⋮---- /** * @notice Returns the epoch index at the given timestamp. * @param timestamp The timestamp. * @return The epoch index at the given timestamp. */ function getEpochIndex(uint48 timestamp) external view returns (uint48); ⋮---- /** * @notice Returns the epoch duration of the given epoch. * @param epoch The epoch. * @return The epoch duration of the given epoch. */ function getEpochDuration(uint48 epoch) external view returns (uint48); ⋮---- /** * @notice Returns the epoch start of the given epoch. * @param epoch The epoch. * @return The epoch start of the given epoch. */ function getEpochStart(uint48 epoch) external view returns (uint48); ⋮---- /** * @notice Sets the epoch duration. * @param epochDuration The epoch duration. * @dev The new duration will be "committed" only in the next epoch. * The caller must have the needed permission. */ function setEpochDuration(uint48 epochDuration) external; ```` ## File: src/interfaces/modules/valset-driver/IValSetDriver.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {IEpochManager} from "./IEpochManager.sol"; import {INetworkManager} from "../../modules/base/INetworkManager.sol"; ⋮---- import {Checkpoints} from "../../../libraries/structs/Checkpoints.sol"; import {PersistentSet} from "../../../libraries/structs/PersistentSet.sol"; ⋮---- /** * @title IValSetDriver * @notice Interface for the ValSetDriver contract. */ interface IValSetDriver { /** * @notice Reverts when the cross-chain address with the same chain ID is already added. */ ⋮---- /** * @notice Reverts when the cross-chain address is either zero or has zero chain ID. */ ⋮---- /** * @notice Reverts when the maximum active validators count is zero. */ ⋮---- /** * @notice Reverts when the quorum threshold is greater than the maximum quorum threshold. * @dev The maximum quorum threshold is 1e18 = 100%. */ ⋮---- /** * @notice Reverts when the quorum threshold with the same key tag is already added. */ ⋮---- /** * @notice Reverts when the subject is not added but was tried to be removed. */ ⋮---- /** * @notice Reverts when the number of aggregators is zero. */ ⋮---- /** * @notice Reverts when the number of committers is zero. */ ⋮---- /** * @notice The storage of the ValSetDriver contract. * @param _isVotingPowerProviderChainAdded The mapping from the chain ID to the voting power provider chain added status. * @param _votingPowerProviders The set of the voting power providers. * @param _keysProvider The checkpoint of the keys provider. * @param _isSettlementChainAdded The mapping from the chain ID to the settlement chain added status. * @param _settlements The set of the settlements. * @param _verificationType The checkpoint of the verification type. * @param _maxVotingPower The checkpoint of the maximum voting power. * @param _minInclusionVotingPower The checkpoint of the minimum inclusion voting power. * @param _maxValidatorsCount The checkpoint of the maximum active validators count. * @param _requiredKeyTags The checkpoint of the required key tags. * @param _requiredHeaderKeyTag The checkpoint of the required header key tag. * @param _isQuorumThresholdKeyTagAdded The mapping from the key tag to the quorum threshold key tag added status. * @param _quorumThresholds The set of the quorum thresholds. * @param _numAggregators The checkpoint of the number of aggregators. * @param _numCommitters The checkpoint of the number of committers. * @custom:storage-location ERC-7201 slot: erc7201:symbiotic.storage.ValSetDriver. */ ⋮---- /** * @notice The parameters for the initialization of the ValSetDriver contract. * @param networkManagerInitParams The parameters for the initialization of the NetworkManager contract. * @param epochManagerInitParams The parameters for the initialization of the EpochManager contract. * @param numAggregators The number of aggregators (those who aggregate the validators' signatures * and produce the proof for the verification) at the genesis. * @param numCommitters The number of committers (those who commit some data (e.g., ValSetHeader) * to on-chain) at the genesis. * @param votingPowerProviders The voting power providers (contracts that provide the voting powers of the operators on different chains). * @param keysProvider The keys provider (contract that provides the keys of the operators). * @param settlements The settlements (contracts that enable a verification of the validator set's attestations on different chains). * @param maxVotingPower The maximum voting power for each validator. * @param minInclusionVotingPower The minimum inclusion voting power for the operator to be included in the validator set. * @param maxValidatorsCount The maximum active validators count in the validator set. * @param requiredKeyTags The required key tags to include in the validator set. * @param quorumThresholds The quorum thresholds to use for attestations' verification. * @param requiredHeaderKeyTag The required header key tag to use to maintain the validator set through epochs. * @param verificationType The verification type (e.g., simple on-chain verification, or zk-based one). */ ⋮---- /** * @notice The cross-chain address. * @param chainId The chain ID. * @param addr The address. */ ⋮---- /** * @notice The quorum threshold. * @param keyTag The key tag. * @param quorumThreshold The quorum threshold (percentage). */ ⋮---- /** * @notice The configuration. * @param numAggregators The number of aggregators (those who aggregate the validators' signatures * and produce the proof for the verification). * @param numCommitters The number of committers (those who commit some data (e.g., ValSetHeader) * to on-chain). * @param votingPowerProviders The voting power providers (contracts that provide the voting powers of the operators on different chains). * @param keysProvider The keys provider (contract that provides the keys of the operators). * @param settlements The settlements (contracts that enable a verification of the validator set's attestations on different chains). * @param maxVotingPower The maximum voting power for each validator. * @param minInclusionVotingPower The minimum inclusion voting power for the operator to be included in the validator set. * @param maxValidatorsCount The maximum active validators count in the validator set. * @param requiredKeyTags The required key tags to include in the validator set. * @param quorumThresholds The quorum thresholds to use for attestations' verification. * @param requiredHeaderKeyTag The required header key tag to use to maintain the validator set through epochs. * @param verificationType The verification type (e.g., simple on-chain verification, or zk-based one). */ ⋮---- /** * @notice Emitted when the number of aggregators is set. * @param numAggregators The number of aggregators (those who aggregate the validators' signatures * and produce the proof for the verification). */ event SetNumAggregators(uint208 numAggregators); ⋮---- /** * @notice Emitted when the number of committers is set. * @param numCommitters The number of committers (those who commit some data (e.g., ValSetHeader) * to on-chain). */ event SetNumCommitters(uint208 numCommitters); ⋮---- /** * @notice Emitted when the voting power provider is added. * @param votingPowerProvider The voting power provider (contract that provides the voting powers of the operators on different chains). */ event AddVotingPowerProvider(CrossChainAddress votingPowerProvider); ⋮---- /** * @notice Emitted when the voting power provider is removed. * @param votingPowerProvider The voting power provider (contract that provides the voting powers of the operators on different chains). */ event RemoveVotingPowerProvider(CrossChainAddress votingPowerProvider); ⋮---- /** * @notice Emitted when the keys provider is set. * @param keysProvider The keys provider (contract that provides the keys of the operators). */ event SetKeysProvider(CrossChainAddress keysProvider); ⋮---- /** * @notice Emitted when the settlement is added. * @param settlement The settlement (contract that enable a verification of the validator set's attestations on different chains). */ event AddSettlement(CrossChainAddress settlement); ⋮---- /** * @notice Emitted when the settlement is removed. * @param settlement The settlement (contract that enable a verification of the validator set's attestations on different chains). */ event RemoveSettlement(CrossChainAddress settlement); ⋮---- /** * @notice Emitted when the maximum voting power is set. * @param maxVotingPower The maximum voting power for each validator. */ event SetMaxVotingPower(uint256 maxVotingPower); ⋮---- /** * @notice Emitted when the minimum inclusion voting power is set. * @param minInclusionVotingPower The minimum inclusion voting power for the operator to be included in the validator set. */ event SetMinInclusionVotingPower(uint256 minInclusionVotingPower); ⋮---- /** * @notice Emitted when the maximum active validators count is set. * @param maxValidatorsCount The maximum active validators count in the validator set. */ event SetMaxValidatorsCount(uint208 maxValidatorsCount); ⋮---- /** * @notice Emitted when the required key tags are set. * @param requiredKeyTags The required key tags to include in the validator set. */ event SetRequiredKeyTags(uint8[] requiredKeyTags); ⋮---- /** * @notice Emitted when the quorum threshold is added. * @param quorumThreshold The quorum threshold to use for attestations' verification. */ event AddQuorumThreshold(QuorumThreshold quorumThreshold); ⋮---- /** * @notice Emitted when the required header key tag is set. * @param requiredHeaderKeyTag The required header key tag to use to maintain the validator set through epochs. */ event SetRequiredHeaderKeyTag(uint8 requiredHeaderKeyTag); ⋮---- /** * @notice Emitted when the quorum threshold is removed. * @param quorumThreshold The quorum threshold to use for attestations' verification. */ event RemoveQuorumThreshold(QuorumThreshold quorumThreshold); ⋮---- /** * @notice Emitted when the verification type is set. * @param verificationType The verification type (e.g., simple on-chain verification, or zk-based one). */ event SetVerificationType(uint32 verificationType); ⋮---- /** * @notice Returns the maximum quorum threshold. * @return The maximum quorum threshold. * @dev The maximum quorum threshold is 1e18 = 100%. */ function MAX_QUORUM_THRESHOLD() external view returns (uint248); ⋮---- /** * @notice Returns the configuration at the given timestamp. * @param timestamp The timestamp. * @return The configuration. */ function getConfigAt(uint48 timestamp) external view returns (Config memory); ⋮---- /** * @notice Returns the configuration. * @return The configuration. */ function getConfig() external view returns (Config memory); ⋮---- /** * @notice Returns the number of aggregators (those who aggregate the validators' signatures * and produce the proof for the verification) at the given timestamp. * @param timestamp The timestamp. * @return The number of aggregators. */ function getNumAggregatorsAt(uint48 timestamp) external view returns (uint208); ⋮---- /** * @notice Returns the number of aggregators (those who aggregate the validators' signatures * and produce the proof for the verification). * @return The number of aggregators. */ function getNumAggregators() external view returns (uint208); ⋮---- /** * @notice Returns the number of committers (those who commit some data (e.g., ValSetHeader) * to on-chain) at the given timestamp. * @param timestamp The timestamp. * @return The number of committers. */ function getNumCommittersAt(uint48 timestamp) external view returns (uint208); ⋮---- /** * @notice Returns the number of committers (those who commit some data (e.g., ValSetHeader) * to on-chain). * @return The number of committers. */ function getNumCommitters() external view returns (uint208); ⋮---- /** * @notice Returns if the voting power provider is registered at the given timestamp. * @param votingPowerProvider The voting power provider. * @param timestamp The timestamp. * @return If the voting power provider is registered. */ function isVotingPowerProviderRegisteredAt(CrossChainAddress memory votingPowerProvider, uint48 timestamp) ⋮---- /** * @notice Returns if the voting power provider is registered. * @param votingPowerProvider The voting power provider. * @return If the voting power provider is registered. */ function isVotingPowerProviderRegistered(CrossChainAddress memory votingPowerProvider) external view returns (bool); ⋮---- /** * @notice Returns the voting power providers at the given timestamp. * @param timestamp The timestamp. * @return The voting power providers (contracts that provide the voting powers of the operators on different chains). */ function getVotingPowerProvidersAt(uint48 timestamp) external view returns (CrossChainAddress[] memory); ⋮---- /** * @notice Returns the voting power providers. * @return The voting power providers (contracts that provide the voting powers of the operators on different chains). */ function getVotingPowerProviders() external view returns (CrossChainAddress[] memory); ⋮---- /** * @notice Returns the keys provider at the given timestamp. * @param timestamp The timestamp. * @return The keys provider (contract that provides the keys of the operators). */ function getKeysProviderAt(uint48 timestamp) external view returns (CrossChainAddress memory); ⋮---- /** * @notice Returns the keys provider. * @return The keys provider (contract that provides the keys of the operators). */ function getKeysProvider() external view returns (CrossChainAddress memory); ⋮---- /** * @notice Returns if the settlement is registered at the given timestamp. * @param settlement The settlement. * @param timestamp The timestamp. * @return If the settlement is registered. */ function isSettlementRegisteredAt(CrossChainAddress memory settlement, uint48 timestamp) ⋮---- /** * @notice Returns if the settlement is registered. * @param settlement The settlement. * @return If the settlement is registered. */ function isSettlementRegistered(CrossChainAddress memory settlement) external view returns (bool); ⋮---- /** * @notice Returns the settlements at the given timestamp. * @param timestamp The timestamp. * @return The settlements (contracts that enable a verification of the validator set's attestations on different chains). */ function getSettlementsAt(uint48 timestamp) external view returns (CrossChainAddress[] memory); ⋮---- /** * @notice Returns the settlements. * @return The settlements (contracts that enable a verification of the validator set's attestations on different chains). */ function getSettlements() external view returns (CrossChainAddress[] memory); ⋮---- /** * @notice Returns the maximum voting power at the given timestamp. * @param timestamp The timestamp. * @return The maximum voting power for each validator. */ function getMaxVotingPowerAt(uint48 timestamp) external view returns (uint256); ⋮---- /** * @notice Returns the maximum voting power. * @return The maximum voting power for each validator. */ function getMaxVotingPower() external view returns (uint256); ⋮---- /** * @notice Returns the minimum inclusion voting power at the given timestamp. * @param timestamp The timestamp. * @return The minimum inclusion voting power for the operator to be included in the validator set. */ function getMinInclusionVotingPowerAt(uint48 timestamp) external view returns (uint256); ⋮---- /** * @notice Returns the minimum inclusion voting power. * @return The minimum inclusion voting power for the operator to be included in the validator set. */ function getMinInclusionVotingPower() external view returns (uint256); ⋮---- /** * @notice Returns the maximum active validators count at the given timestamp. * @param timestamp The timestamp. * @return The maximum active validators count in the validator set. */ function getMaxValidatorsCountAt(uint48 timestamp) external view returns (uint208); ⋮---- /** * @notice Returns the maximum active validators count. * @return The maximum active validators count in the validator set. */ function getMaxValidatorsCount() external view returns (uint208); ⋮---- /** * @notice Returns the required key tags at the given timestamp. * @param timestamp The timestamp. * @return The required key tags to include in the validator set. */ function getRequiredKeyTagsAt(uint48 timestamp) external view returns (uint8[] memory); ⋮---- /** * @notice Returns the required key tags. * @return The required key tags to include in the validator set. */ function getRequiredKeyTags() external view returns (uint8[] memory); ⋮---- /** * @notice Returns if the quorum threshold is registered at the given timestamp. * @param quorumThreshold The quorum threshold. * @param timestamp The timestamp. * @return If the quorum threshold is registered. */ function isQuorumThresholdRegisteredAt(QuorumThreshold memory quorumThreshold, uint48 timestamp) ⋮---- /** * @notice Returns if the quorum threshold is registered. * @param quorumThreshold The quorum threshold. * @return If the quorum threshold is registered. */ function isQuorumThresholdRegistered(QuorumThreshold memory quorumThreshold) external view returns (bool); ⋮---- /** * @notice Returns the quorum thresholds at the given timestamp. * @param timestamp The timestamp. * @return The quorum thresholds to use for attestations' verification. */ function getQuorumThresholdsAt(uint48 timestamp) external view returns (QuorumThreshold[] memory); ⋮---- /** * @notice Returns the quorum thresholds. * @return The quorum thresholds to use for attestations' verification. */ function getQuorumThresholds() external view returns (QuorumThreshold[] memory); ⋮---- /** * @notice Returns the required header key tag at the given timestamp. * @param timestamp The timestamp. * @return The required header key tag to use to maintain the validator set through epochs. */ function getRequiredHeaderKeyTagAt(uint48 timestamp) external view returns (uint8); ⋮---- /** * @notice Returns the required header key tag. * @return The required header key tag to use to maintain the validator set through epochs. */ function getRequiredHeaderKeyTag() external view returns (uint8); ⋮---- /** * @notice Returns the verification type at the given timestamp. * @param timestamp The timestamp. * @return The verification type (e.g., simple on-chain verification, or zk-based one). */ function getVerificationTypeAt(uint48 timestamp) external view returns (uint32); ⋮---- /** * @notice Returns the verification type. * @return The verification type (e.g., simple on-chain verification, or zk-based one). */ function getVerificationType() external view returns (uint32); ⋮---- /** * @notice Sets the number of aggregators (those who aggregate the validators' signatures * and produce the proof for the verification). * @param numAggregators The number of aggregators. * @dev The caller must have the needed permission. */ function setNumAggregators(uint208 numAggregators) external; ⋮---- /** * @notice Sets the number of committers (those who commit some data (e.g., ValSetHeader) * to on-chain). * @param numCommitters The number of committers. * @dev The caller must have the needed permission. */ function setNumCommitters(uint208 numCommitters) external; ⋮---- /** * @notice Adds a voting power provider. * @param votingPowerProvider The voting power provider (contract that provides the voting powers of the operators on different chains). * @dev The caller must have the needed permission. */ function addVotingPowerProvider(CrossChainAddress memory votingPowerProvider) external; ⋮---- /** * @notice Removes a voting power provider. * @param votingPowerProvider The voting power provider (contract that provides the voting powers of the operators on different chains). * @dev The caller must have the needed permission. */ function removeVotingPowerProvider(CrossChainAddress memory votingPowerProvider) external; ⋮---- /** * @notice Sets the keys provider. * @param keysProvider The keys provider (contract that provides the keys of the operators). * @dev The caller must have the needed permission. */ function setKeysProvider(CrossChainAddress memory keysProvider) external; ⋮---- /** * @notice Adds a settlement. * @param settlement The settlement (contract that enable a verification of the validator set's attestations on different chains). * @dev The caller must have the needed permission. */ function addSettlement(CrossChainAddress memory settlement) external; ⋮---- /** * @notice Removes a settlement. * @param settlement The settlement (contract that enable a verification of the validator set's attestations on different chains). * @dev The caller must have the needed permission. */ function removeSettlement(CrossChainAddress memory settlement) external; ⋮---- /** * @notice Sets the maximum voting power. * @param maxVotingPower The maximum voting power for each validator. * @dev The caller must have the needed permission. */ function setMaxVotingPower(uint256 maxVotingPower) external; ⋮---- /** * @notice Sets the minimum inclusion voting power. * @param minInclusionVotingPower The minimum inclusion voting power for the operator to be included in the validator set. * @dev The caller must have the needed permission. */ function setMinInclusionVotingPower(uint256 minInclusionVotingPower) external; ⋮---- /** * @notice Sets the maximum active validators count. * @param maxValidatorsCount The maximum active validators count in the validator set. * @dev The caller must have the needed permission. */ function setMaxValidatorsCount(uint208 maxValidatorsCount) external; ⋮---- /** * @notice Sets the required key tags. * @param requiredKeyTags The required key tags to include in the validator set. * @dev The caller must have the needed permission. */ function setRequiredKeyTags(uint8[] memory requiredKeyTags) external; ⋮---- /** * @notice Adds a quorum threshold. * @param quorumThreshold The quorum threshold to use for attestations' verification. * @dev The caller must have the needed permission. */ function addQuorumThreshold(QuorumThreshold memory quorumThreshold) external; ⋮---- /** * @notice Removes a quorum threshold. * @param quorumThreshold The quorum threshold to use for attestations' verification. * @dev The caller must have the needed permission. */ function removeQuorumThreshold(QuorumThreshold memory quorumThreshold) external; ⋮---- /** * @notice Sets the required header key tag. * @param requiredHeaderKeyTag The required header key tag to use to maintain the validator set through epochs. * @dev The caller must have the needed permission. */ function setRequiredHeaderKeyTag(uint8 requiredHeaderKeyTag) external; ⋮---- /** * @notice Sets the verification type. * @param verificationType The verification type (e.g., simple on-chain verification, or zk-based one). * @dev The caller must have the needed permission. */ function setVerificationType(uint32 verificationType) external; ```` ## File: src/interfaces/modules/voting-power/base/IVotingPowerCalcManager.sol ```` // SPDX-License-Identifier: MIT ⋮---- /** * @title IVotingPowerCalcManager * @notice Interface for the VotingPowerCalcManager contract. */ interface IVotingPowerCalcManager { /** * @notice Returns the voting power given a `stake` amount of `vault`'s collateral at the certain vault at the given timestamp. * @param vault The vault. * @param stake The stake. * @param extraData The extra data. * @param timestamp The timestamp. * @return The voting power given a `stake` amount of `vault`'s collateral at the certain vault at the given timestamp. */ function stakeToVotingPowerAt(address vault, uint256 stake, bytes memory extraData, uint48 timestamp) ⋮---- /** * @notice Returns the voting power given a `stake` amount of `vault`'s collateral at the certain vault. * @param vault The vault. * @param stake The stake. * @param extraData The extra data. * @return The voting power given a `stake` amount of `vault`'s collateral at the certain vault. */ function stakeToVotingPower(address vault, uint256 stake, bytes memory extraData) external view returns (uint256); ```` ## File: src/interfaces/modules/voting-power/common/voting-power-calc/libraries/AggregatorV3Interface.sol ```` // SPDX-License-Identifier: MIT ⋮---- // solhint-disable-next-line interface-starts-with-i interface AggregatorV3Interface { function decimals() external view returns (uint8); ⋮---- function description() external view returns (string memory); ⋮---- function version() external view returns (uint256); ⋮---- function getRoundData(uint80 _roundId) ⋮---- function latestRoundData() ```` ## File: src/interfaces/modules/voting-power/common/voting-power-calc/IEqualStakeVPCalc.sol ```` // SPDX-License-Identifier: MIT ⋮---- /** * @title IEqualStakeVPCalc * @notice Interface for the EqualStakeVPCalc contract. */ interface IEqualStakeVPCalc {} ```` ## File: src/interfaces/modules/voting-power/common/voting-power-calc/INormalizedTokenDecimalsVPCalc.sol ```` // SPDX-License-Identifier: MIT ⋮---- /** * @title INormalizedTokenDecimalsVPCalc * @notice Interface for the NormalizedTokenDecimalsVPCalc contract. */ interface INormalizedTokenDecimalsVPCalc {} ```` ## File: src/interfaces/modules/voting-power/common/voting-power-calc/IPricedTokensChainlinkVPCalc.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {Checkpoints} from "../../../../../libraries/structs/Checkpoints.sol"; ⋮---- /** * @title IPricedTokensChainlinkVPCalc * @notice Interface for the PricedTokensChainlinkVPCalc contract. */ interface IPricedTokensChainlinkVPCalc { /** * @notice Reverts when the aggregator is zero address. */ ⋮---- /** * @notice The storage of the PricedTokensChainlinkVPCalc contract. * @param _tokenHops The price conversion hops for each token. */ ⋮---- /** * @notice Emitted when the price conversion hops are set for a token. * @param token The token. * @param aggregators The price aggregators. * @param inverts If to invert the fetched prices. * @param stalenessDurations The staleness durations (if too much time passed since the last update). */ event SetTokenHops(address indexed token, address[2] aggregators, bool[2] inverts, uint48[2] stalenessDurations); ⋮---- /** * @notice Returns the price conversion hops for a token at a given timestamp. * @param token The token. * @param timestamp The timestamp. * @return The price conversion hops (price aggregators, invert flags, staleness durations). */ function getTokenHopsAt(address token, uint48 timestamp) ⋮---- /** * @notice Returns the price conversion hops for a token. * @param token The token. * @return The price conversion hops (price aggregators, invert flags, staleness durations). */ function getTokenHops(address token) external view returns (address[2] memory, bool[2] memory, uint48[2] memory); ⋮---- /** * @notice Returns the price for a token at a given timestamp. * @param token The token. * @param timestamp The timestamp. * @return The price. * @dev Returns zero if the data is stale or unavailable. * The price is normalized to the 18 decimals. */ function getTokenPriceAt(address token, uint48 timestamp) external view returns (uint256); ⋮---- /** * @notice Returns the price for a token. * @param token The token. * @return The price. * @dev Returns zero if the data is stale or unavailable. * The price is normalized to the 18 decimals. */ function getTokenPrice(address token) external view returns (uint256); ⋮---- /** * @notice Sets the price conversion hops for a token. * @param token The token. * @param aggregators The price aggregators. * @param inverts If to invert the fetched prices. * @param stalenessDurations The staleness durations (if too much time passed since the last update). */ function setTokenHops( ```` ## File: src/interfaces/modules/voting-power/common/voting-power-calc/IWeightedTokensVPCalc.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {Checkpoints} from "../../../../../libraries/structs/Checkpoints.sol"; ⋮---- /** * @title IWeightedTokensVPCalc * @notice Interface for the WeightedTokensVPCalc contract. */ interface IWeightedTokensVPCalc { /** * @notice Reverts when the weight is too large. */ ⋮---- /** * @notice The storage of the WeightedTokensVPCalc contract. * @param _tokenWeight The weight for each token. */ ⋮---- /** * @notice Emitted when the weight for a token is set. * @param token The token. * @param weight The weight. */ event SetTokenWeight(address indexed token, uint208 weight); ⋮---- /** * @notice Returns the weight for a token at a given timestamp. * @param token The token. * @param timestamp The timestamp. * @return The weight. * @dev Returns 1e12 if the weight wasn't explicitly set yet. * Can return non-zero weight for unregistered tokens. */ function getTokenWeightAt(address token, uint48 timestamp) external view returns (uint208); ⋮---- /** * @notice Returns the weight for a token. * @param token The token. * @return The weight. * @dev Returns 1e12 if the weight wasn't explicitly set yet. * Can return non-zero weight for unregistered tokens. */ function getTokenWeight(address token) external view returns (uint208); ⋮---- /** * @notice Sets the weight for a token. * @param token The token. * @param weight The weight. */ function setTokenWeight(address token, uint208 weight) external; ```` ## File: src/interfaces/modules/voting-power/common/voting-power-calc/IWeightedVaultsVPCalc.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {Checkpoints} from "../../../../../libraries/structs/Checkpoints.sol"; ⋮---- /** * @title IWeightedVaultsVPCalc * @notice Interface for the WeightedVaultsVPCalc contract. */ interface IWeightedVaultsVPCalc { /** * @notice Reverts when the weight is too large. */ ⋮---- /** * @notice The storage of the WeightedVaultsVPCalc contract. * @param _vaultWeight The weight for each vault. */ ⋮---- /** * @notice Emitted when the weight for a vault is set. * @param vault The vault. * @param weight The weight. */ event SetVaultWeight(address indexed vault, uint208 weight); ⋮---- /** * @notice Returns the weight for a vault at a given timestamp. * @param vault The vault. * @param timestamp The timestamp. * @return The weight. * @dev Returns 1e4 if the weight wasn't explicitly set yet. * Can return non-zero weight for unregistered vaults. */ function getVaultWeightAt(address vault, uint48 timestamp) external view returns (uint208); ⋮---- /** * @notice Returns the weight for a vault. * @param vault The vault. * @return The weight. * @dev Returns 1e4 if the weight wasn't explicitly set yet. * Can return non-zero weight for unregistered vaults. */ function getVaultWeight(address vault) external view returns (uint208); ⋮---- /** * @notice Sets the weight for a vault. * @param vault The vault. * @param weight The weight. */ function setVaultWeight(address vault, uint208 weight) external; ```` ## File: src/interfaces/modules/voting-power/extensions/IBaseRewards.sol ```` // SPDX-License-Identifier: MIT ⋮---- /** * @title IBaseRewards * @notice Interface for the BaseRewards contract. */ interface IBaseRewards { /** * @notice Reverts when the caller is not the rewarder. */ ⋮---- /** * @notice The storage of the BaseRewards contract. * @param _rewarder The address of the rewarder. * @custom:storage-location erc7201:symbiotic.storage.BaseRewards */ ⋮---- /** * @notice The parameters for the initialization of the BaseRewards contract. * @param rewarder The address of the rewarder. */ ⋮---- /** * @notice Emitted when the rewarder is set. * @param rewarder The address of the rewarder. */ event SetRewarder(address rewarder); ⋮---- /** * @notice Emitted when the staker rewards are distributed. * @param stakerRewards The address of the staker rewards. * @param token The address of the token. * @param amount The amount of the token. * @param data The data (depends on the staker rewards implementation). */ event DistributeStakerRewards(address indexed stakerRewards, address indexed token, uint256 amount, bytes data); ⋮---- /** * @notice Emitted when the operator rewards are distributed. * @param operatorRewards The address of the operator rewards. * @param token The address of the token. * @param amount The amount of the token. * @param root The Merkle root of the distribution. */ event DistributeOperatorRewards( ⋮---- /** * @notice Returns the address of the rewarder. * @return The address of the rewarder. */ function getRewarder() external view returns (address); ⋮---- /** * @notice Sets the rewarder. * @param rewarder The address of the rewarder. * @dev The caller must have the needed permission. */ function setRewarder(address rewarder) external; ⋮---- /** * @notice Distributes the staker rewards. * @param stakerRewards The address of the staker rewards. * @param token The address of the token. * @param amount The amount of the token. * @param data The data (depends on the staker rewards implementation). * @dev Only the rewarder can call this function. * The funds should be transferred to this contract separately before the call. */ function distributeStakerRewards(address stakerRewards, address token, uint256 amount, bytes memory data) external; ⋮---- /** * @notice Distributes the operator rewards. * @param operatorRewards The address of the operator rewards. * @param token The address of the token. * @param amount The amount of the token. * @param root The Merkle root of the distribution. * @dev Only the rewarder can call this function. * The funds should be transferred to this contract separately before the call. */ function distributeOperatorRewards(address operatorRewards, address token, uint256 amount, bytes32 root) external; ```` ## File: src/interfaces/modules/voting-power/extensions/IBaseSlashing.sol ```` // SPDX-License-Identifier: MIT ⋮---- /** * @title IBaseSlashing * @notice Interface for the BaseSlashing contract. */ interface IBaseSlashing { /** * @notice Reverts when the vault doesn't have a slasher. */ ⋮---- /** * @notice Reverts when the slashing wasn't required at the requested timestamp. */ ⋮---- /** * @notice Reverts when the caller is not the slasher. */ ⋮---- /** * @notice Reverts when the slasher is not a veto slasher. */ ⋮---- /** * @notice Reverts when the slasher type is unsupported. */ ⋮---- /** * @notice The storage of the BaseSlashing contract. * @param _slasher The address of the slasher. * @custom:storage-location erc7201:symbiotic.storage.BaseSlashing */ ⋮---- /** * @notice The parameters for the initialization of the BaseSlashing contract. * @param slasher The address of the slasher. */ ⋮---- /** * @notice The hints to optimize the base slashing. * @param slashingDataHint The hint to optimize the slashing data fetching. * @param slashCoreHints The hints to optimize the slash core. */ ⋮---- /** * @notice The hints to optimize the execute slash. * @param slashingDataHint The hint to optimize the slashing data fetching. * @param executeSlashCoreHints The hints to optimize the execute slash core. */ ⋮---- /** * @notice Emitted when the slasher is set. * @param slasher The address of the slasher. */ event SetSlasher(address slasher); ⋮---- /** * @notice Emitted when the instant slash is executed. * @param slasher The address of the slasher. * @param operator The address of the operator. * @param success The success of the slash. * @param slashedAmount The amount of the slashed tokens. */ event InstantSlash(address indexed slasher, address indexed operator, bool indexed success, uint256 slashedAmount); ⋮---- /** * @notice Emitted when the veto slash is executed. * @param slasher The address of the slasher. * @param operator The address of the operator. * @param success The success of the slash. * @param slashIndex The index of the slash. */ event VetoSlash(address indexed slasher, address indexed operator, bool indexed success, uint256 slashIndex); ⋮---- /** * @notice Emitted when the slash is executed. * @param slasher The address of the slasher. * @param slashIndex The index of the slash. * @param success The success of the slash. * @param slashedAmount The amount of the slashed tokens. */ event ExecuteSlash( ⋮---- /** * @notice Returns the address of the slasher. * @return The address of the slasher. */ function getSlasher() external view returns (address); ⋮---- /** * @notice Sets the slasher. * @param slasher The address of the slasher. * @dev The caller must have the needed permission. */ function setSlasher(address slasher) external; ⋮---- /** * @notice Slashes the vault. * @param timestamp The capture timestamp for the slash. * @param vault The address of the vault. * @param operator The address of the operator. * @param amount The amount of the tokens to be slashed. * @param hints The hints to optimize the vault slashing. * @return success The success of the slash. * @return response The response of the slash. * @dev The function doesn't check the registration statuses. */ function slashVault(uint48 timestamp, address vault, address operator, uint256 amount, bytes memory hints) ⋮---- /** * @notice Executes the slash of the vault. * @param vault The address of the vault. * @param slashIndex The index of the slash. * @param hints The hints to optimize the vault slashing. * @return success The success of the slash. * @return slashedAmount The amount of the slashed tokens. */ function executeSlashVault(address vault, uint256 slashIndex, bytes memory hints) ```` ## File: src/interfaces/modules/voting-power/extensions/IMultiToken.sol ```` // SPDX-License-Identifier: MIT ⋮---- /** * @title IMultiToken * @notice Interface for the MultiToken contract. */ interface IMultiToken { /** * @notice Registers the token. * @param token The address of the token. * @dev The caller must have the needed permission. */ function registerToken(address token) external; ⋮---- /** * @notice Unregisters the token. * @param token The address of the token. * @dev The caller must have the needed permission. */ function unregisterToken(address token) external; ```` ## File: src/interfaces/modules/voting-power/extensions/IOperatorsBlacklist.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {IVotingPowerProvider} from "../IVotingPowerProvider.sol"; ⋮---- /** * @title IOperatorsBlacklist * @notice Interface for the OperatorsBlacklist contract. */ interface IOperatorsBlacklist { /** * @notice Reverts when the operator is not blacklisted. */ ⋮---- /** * @notice Reverts when the operator is already blacklisted. */ ⋮---- /** * @notice The storage of the OperatorsBlacklist contract. * @param _blacklisted The mapping from the operator to the blacklisted operator status. * @custom:storage-location erc7201:symbiotic.storage.OperatorsBlacklist */ ⋮---- /** * @notice Emitted when the operator is blacklisted. * @param operator The address of the operator. */ event BlacklistOperator(address indexed operator); ⋮---- /** * @notice Emitted when the operator is unblacklisted. * @param operator The address of the operator. */ event UnblacklistOperator(address indexed operator); ⋮---- /** * @notice Returns the blacklist status of the operator. * @param operator The address of the operator. * @return The blacklist status of the operator. */ function isOperatorBlacklisted(address operator) external view returns (bool); ⋮---- /** * @notice Blacklists the operator. * @param operator The address of the operator. * @dev The caller must have the needed permission. * The operator will be unregistered if currently registered. */ function blacklistOperator(address operator) external; ⋮---- /** * @notice Unblacklists the operator. * @param operator The address of the operator. * @dev The caller must have the needed permission. */ function unblacklistOperator(address operator) external; ```` ## File: src/interfaces/modules/voting-power/extensions/IOperatorsJail.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {IVotingPowerProvider} from "../IVotingPowerProvider.sol"; ⋮---- /** * @title IOperatorsJail * @notice Interface for the OperatorsJail contract. */ interface IOperatorsJail { /** * @notice Reverts when the operator is already jailed. */ ⋮---- /** * @notice Reverts when the duration is invalid. */ ⋮---- /** * @notice Reverts when the operator is jailed. */ ⋮---- /** * @notice Reverts when the operator is not jailed. */ ⋮---- /** * @notice The storage of the OperatorsJail contract. * @param _jailedUntil The mapping from the operator to the jailed until timestamp. * @custom:storage-location erc7201:symbiotic.storage.OperatorsJail */ ⋮---- /** * @notice Emitted when the operator is jailed. * @param operator The address of the operator. */ event JailOperator(address indexed operator); ⋮---- /** * @notice Emitted when the operator is forcefully unjailed. * @param operator The address of the operator. */ event UnjailOperator(address indexed operator); ⋮---- /** * @notice Returns the jail status of the operator. * @param operator The address of the operator. * @return The jail status of the operator. */ function isOperatorJailed(address operator) external view returns (bool); ⋮---- /** * @notice Returns the timestamp the operator is jailed until. * @param operator The address of the operator. * @return The timestamp the operator is jailed until. */ function getOperatorJailedUntil(address operator) external view returns (uint48); ⋮---- /** * @notice Jails the operator. * @param operator The address of the operator. * @param duration The duration of the jail. * @dev The caller must have the needed permission. * The operator will be unregistered if currently registered. * It is allowed only to extend the jail duration. */ function jailOperator(address operator, uint48 duration) external; ⋮---- /** * @notice Unjails the operator. * @param operator The address of the operator. * @dev The caller must have the needed permission. */ function unjailOperator(address operator) external; ```` ## File: src/interfaces/modules/voting-power/extensions/IOperatorsWhitelist.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {IVotingPowerProvider} from "../IVotingPowerProvider.sol"; ⋮---- /** * @title IOperatorsWhitelist * @notice Interface for the OperatorsWhitelist contract. */ interface IOperatorsWhitelist { /** * @notice Reverts when the whitelist status is already set. */ ⋮---- /** * @notice Reverts when the operator is not whitelisted. */ ⋮---- /** * @notice Reverts when the operator is already whitelisted. */ ⋮---- /** * @notice The storage of the OperatorsWhitelist contract. * @param _whitelisted The mapping from the operator to the whitelisted operator status. * @param _isWhitelistEnabled The status of the whitelist. * @custom:storage-location erc7201:symbiotic.storage.OperatorsWhitelist */ ⋮---- /** * @notice The parameters for the initialization of the OperatorsWhitelist contract. * @param isWhitelistEnabled The status of the whitelist. */ ⋮---- /** * @notice Emitted when the whitelist status is set. * @param status The status of the whitelist. */ event SetWhitelistStatus(bool status); ⋮---- /** * @notice Emitted when the operator is whitelisted. * @param operator The address of the operator. */ event WhitelistOperator(address indexed operator); ⋮---- /** * @notice Emitted when the operator is unwhitelisted. * @param operator The address of the operator. */ event UnwhitelistOperator(address indexed operator); ⋮---- /** * @notice Returns the whitelist status. * @return The whitelist status. */ function isWhitelistEnabled() external view returns (bool); ⋮---- /** * @notice Returns the whitelist status of the operator. * @param operator The address of the operator. * @return The whitelist status of the operator. */ function isOperatorWhitelisted(address operator) external view returns (bool); ⋮---- /** * @notice Sets the whitelist status. * @param status The status of the whitelist. * @dev The caller must have the needed permission. */ function setWhitelistStatus(bool status) external; ⋮---- /** * @notice Whitelists the operator. * @param operator The address of the operator. * @dev The caller must have the needed permission. */ function whitelistOperator(address operator) external; ⋮---- /** * @notice Unwhitelists the operator. * @param operator The address of the operator. * @dev The caller must have the needed permission. * The operator will be unregistered if currently registered and the whitelist is enabled. */ function unwhitelistOperator(address operator) external; ```` ## File: src/interfaces/modules/voting-power/extensions/IOperatorVaults.sol ```` // SPDX-License-Identifier: MIT ⋮---- /** * @title IOperatorVaults * @notice Interface for the OperatorVaults contract. */ interface IOperatorVaults { /** * @notice Registers the operator vault. * @param operator The address of the operator. * @param vault The address of the vault. * @dev The caller must have the needed permission. */ function registerOperatorVault(address operator, address vault) external; ⋮---- /** * @notice Unregisters the operator vault. * @param operator The address of the operator. * @param vault The address of the vault. * @dev The caller must have the needed permission. */ function unregisterOperatorVault(address operator, address vault) external; ⋮---- /** * @notice Unregisters the operator vault. * @param vault The address of the vault. * @dev The caller must be the operator of the vault. */ function unregisterOperatorVault(address vault) external; ```` ## File: src/interfaces/modules/voting-power/extensions/IOpNetVaultAutoDeploy.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {IVotingPowerProvider} from "../IVotingPowerProvider.sol"; ⋮---- /** * @title IOpNetVaultAutoDeploy * @notice Interface for the OpNetVaultAutoDeploy contract. */ interface IOpNetVaultAutoDeploy { /** * @notice Reverts when the burner hook is enabled but the slasher is not. */ ⋮---- /** * @notice Reverts when the collateral is zero address. */ ⋮---- /** * @notice Reverts when the epoch duration is zero or less than the slashing window. */ ⋮---- /** * @notice Reverts when the with slasher is disabled but the slashing window is not zero. */ ⋮---- /** * @notice The storage of the OpNetVaultAutoDeploy contract. * @param _isAutoDeployEnabled The status of the auto deploy. * @param _isSetMaxNetworkLimitHookEnabled The status of the set max network limit hook. * @param _autoDeployedVault The mapping from the operator to the auto deployed vault. * @param _config The configuration of the auto deploy. * @custom:storage-location erc7201:symbiotic.storage.OpNetVaultAutoDeploy */ ⋮---- /** * @notice The parameters for the initialization of the OpNetVaultAutoDeploy contract. * @param isAutoDeployEnabled The status of the auto deploy. * @param config The configuration of the auto deploy. * @param isSetMaxNetworkLimitHookEnabled The status of the set max network limit hook. */ ⋮---- /** * @notice The configuration of the auto deploy. * @param epochDuration The duration of the epoch. * @param collateral The address of the collateral. * @param burner The address of the burner. * @param withSlasher The status of the with slasher. * @param isBurnerHook The status of the burner hook. */ ⋮---- /** * @notice Emitted when the auto deploy status is set. * @param status The status of the auto deploy. */ event SetAutoDeployStatus(bool status); ⋮---- /** * @notice Emitted when the auto deploy config is set. */ event SetAutoDeployConfig(AutoDeployConfig config); ⋮---- /** * @notice Emitted when the set max network limit hook status is set. * @param status The status of the set max network limit hook. */ event SetSetMaxNetworkLimitHookStatus(bool status); ⋮---- /** * @notice Returns the address of the vault configurator. * @return The address of the vault configurator. */ function VAULT_CONFIGURATOR() external view returns (address); ⋮---- /** * @notice Returns the status of the auto deploy. * @return The status of the auto deploy. */ function isAutoDeployEnabled() external view returns (bool); ⋮---- /** * @notice Returns the address of the auto deployed vault of the operator. * @param operator The address of the operator. * @return The address of the auto deployed vault of the operator. */ function getAutoDeployedVault(address operator) external view returns (address); ⋮---- /** * @notice Returns the configuration of the auto deploy. * @return The configuration of the auto deploy. */ function getAutoDeployConfig() external view returns (AutoDeployConfig memory); ⋮---- /** * @notice Returns the status of the set max network limit hook. * @return The status of the set max network limit hook. */ function isSetMaxNetworkLimitHookEnabled() external view returns (bool); ⋮---- /** * @notice Sets the status of the auto deploy. * @param status The status of the auto deploy. * @dev The caller must have the needed permission. */ function setAutoDeployStatus(bool status) external; ⋮---- /** * @notice Sets the configuration of the auto deploy. * @param config The configuration of the auto deploy. * @dev The caller must have the needed permission. */ function setAutoDeployConfig(AutoDeployConfig memory config) external; ⋮---- /** * @notice Sets the status of the set max network limit hook. * @param status The status of the set max network limit hook. * @dev The caller must have the needed permission. */ function setSetMaxNetworkLimitHookStatus(bool status) external; ```` ## File: src/interfaces/modules/voting-power/extensions/ISharedVaults.sol ```` // SPDX-License-Identifier: MIT ⋮---- /** * @title ISharedVaults * @notice Interface for the SharedVaults contract. */ interface ISharedVaults { /** * @notice Registers the shared vault. * @param sharedVault The address of the shared vault. * @dev The caller must have the needed permission. */ function registerSharedVault(address sharedVault) external; ⋮---- /** * @notice Unregisters the shared vault. * @param sharedVault The address of the shared vault. * @dev The caller must have the needed permission. */ function unregisterSharedVault(address sharedVault) external; ```` ## File: src/interfaces/modules/voting-power/IVotingPowerProvider.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {INetworkManager} from "../base/INetworkManager.sol"; import {IOzEIP712} from "../base/IOzEIP712.sol"; ⋮---- import {Checkpoints} from "../../../libraries/structs/Checkpoints.sol"; import {PersistentSet} from "../../../libraries/structs/PersistentSet.sol"; ⋮---- /** * @title IVotingPowerProvider * @notice Interface for the VotingPowerProvider contract. */ interface IVotingPowerProvider { /** * @notice Reverts when the operator is not registered in the OperatorRegistry. */ ⋮---- /** * @notice Reverts when the operator vault is invalid. */ ⋮---- /** * @notice Reverts when the shared vault is invalid. */ ⋮---- /** * @notice Reverts when the signature is invalid. */ ⋮---- /** * @notice Reverts when the token is zero address. */ ⋮---- /** * @notice Reverts when the vault is invalid. */ ⋮---- /** * @notice Reverts when the operator is already registered. */ ⋮---- /** * @notice Reverts when the operator is not registered. */ ⋮---- /** * @notice Reverts when the operator vault is already registered. */ ⋮---- /** * @notice Reverts when the operator vault is not registered. */ ⋮---- /** * @notice Reverts when the shared vault is already registered. */ ⋮---- /** * @notice Reverts when the shared vault is not registered. */ ⋮---- /** * @notice Reverts when the token is already registered. */ ⋮---- /** * @notice Reverts when the token is not registered. */ ⋮---- /** * @notice The types of the delegator. */ ⋮---- /** * @notice The types of the slasher. */ ⋮---- /** * @notice The storage of the VotingPowerProvider contract. * @param _tokens The set of the tokens. * @param _operators The set of the operators. * @param _sharedVaults The set of the shared vaults. * @param _allOperatorVaults The set of the all operator vaults. * @param _operatorVaults The mapping from the operator to the set of the operator vaults. * @param _slashingData The slashing data (if to require slasher, and a minimum epoch duration). * @custom:storage-location erc7201:symbiotic.storage.VotingPowerProvider */ ⋮---- /** * @notice The parameters for the initialization of the VotingPowerProvider contract. * @param networkManagerInitParams The parameters for the initialization of the NetworkManager contract. * @param ozEip712InitParams The parameters for the initialization of the OzEIP712 contract. * @param requireSlasher If to require slashers. * @param minVaultEpochDuration The minimum epoch duration for the vaults. * @param token The acceptable token (zero address if not applicable). */ ⋮---- /** * @notice The value of the vault. * @param vault The address of the vault. * @param value The value (voting power or stake). */ ⋮---- /** * @notice The voting power of the operator. * @param operator The address of the operator. * @param vaults The voting power of the operator for each vault. */ ⋮---- /** * @notice The extra data for the voting power of the operator. * @param sharedVaultsExtraData The extra data for the shared vaults. * @param operatorVaultsExtraData The extra data for the operator vaults. */ ⋮---- /** * @notice Emitted when the slashing data is set. * @param requireSlasher If to require slashers. * @param minVaultEpochDuration The minimum epoch duration for the vaults. * @dev It doesn't force non-suitable vaults to unregister. */ event SetSlashingData(bool requireSlasher, uint48 minVaultEpochDuration); ⋮---- /** * @notice Emitted when the token is registered. */ event RegisterToken(address indexed token); ⋮---- /** * @notice Emitted when the token is unregistered. * @param token The token. */ event UnregisterToken(address indexed token); ⋮---- /** * @notice Emitted when the operator is registered. * @param operator The operator. */ event RegisterOperator(address indexed operator); ⋮---- /** * @notice Emitted when the operator is unregistered. * @param operator The operator. */ event UnregisterOperator(address indexed operator); ⋮---- /** * @notice Emitted when the shared vault is registered. * @param vault The shared vault. */ event RegisterSharedVault(address indexed vault); ⋮---- /** * @notice Emitted when the shared vault is unregistered. * @param vault The shared vault. */ event UnregisterSharedVault(address indexed vault); ⋮---- /** * @notice Emitted when the operator vault is registered. * @param operator The operator. * @param vault The operator vault. */ event RegisterOperatorVault(address indexed operator, address indexed vault); ⋮---- /** * @notice Emitted when the operator vault is unregistered. * @param operator The operator. * @param vault The operator vault. */ event UnregisterOperatorVault(address indexed operator, address indexed vault); ⋮---- /** * @notice Returns the address of the OperatorRegistry contract. * @return The address of the OperatorRegistry contract. */ function OPERATOR_REGISTRY() external view returns (address); ⋮---- /** * @notice Returns the address of the VaultFactory contract. * @return The address of the VaultFactory contract. */ function VAULT_FACTORY() external view returns (address); ⋮---- /** * @notice Returns the slashing data at a specific timestamp. * @param timestamp The timestamp. * @param hint The hint. * @return requireSlasher If to require slashers. * @return minVaultEpochDuration The minimum epoch duration for the vaults. */ function getSlashingDataAt(uint48 timestamp, bytes memory hint) ⋮---- /** * @notice Returns the slashing data. * @return requireSlasher If to require slashers. * @return minVaultEpochDuration The minimum epoch duration for the vaults. */ function getSlashingData() external view returns (bool requireSlasher, uint48 minVaultEpochDuration); ⋮---- /** * @notice Returns the status of the token registration at a specific timestamp. * @param token The token. * @param timestamp The timestamp. * @return The status of the token registration. */ function isTokenRegisteredAt(address token, uint48 timestamp) external view returns (bool); ⋮---- /** * @notice Returns the status of the token registration. * @param token The token. * @return The status of the token registration. */ function isTokenRegistered(address token) external view returns (bool); ⋮---- /** * @notice Returns the tokens at a specific timestamp. * @param timestamp The timestamp. * @return The tokens. */ function getTokensAt(uint48 timestamp) external view returns (address[] memory); ⋮---- /** * @notice Returns the tokens. * @return The tokens. */ function getTokens() external view returns (address[] memory); ⋮---- /** * @notice Returns the status of the operator registration. * @param operator The operator. * @return The status of the operator registration. */ function isOperatorRegistered(address operator) external view returns (bool); ⋮---- /** * @notice Returns the status of the operator registration at a specific timestamp. * @param operator The operator. * @param timestamp The timestamp. * @return The status of the operator registration. */ function isOperatorRegisteredAt(address operator, uint48 timestamp) external view returns (bool); ⋮---- /** * @notice Returns the operators at a specific timestamp. * @param timestamp The timestamp. * @return The operators. */ function getOperatorsAt(uint48 timestamp) external view returns (address[] memory); ⋮---- /** * @notice Returns the operators. * @return The operators. */ function getOperators() external view returns (address[] memory); ⋮---- /** * @notice Returns the status of the shared vault registration. * @param vault The shared vault. * @return The status of the shared vault registration. */ function isSharedVaultRegistered(address vault) external view returns (bool); ⋮---- /** * @notice Returns the status of the shared vault registration at a specific timestamp. * @param vault The shared vault. * @param timestamp The timestamp. * @return The status of the shared vault registration. */ function isSharedVaultRegisteredAt(address vault, uint48 timestamp) external view returns (bool); ⋮---- /** * @notice Returns the shared vaults at a specific timestamp. * @param timestamp The timestamp. * @return The shared vaults. */ function getSharedVaultsAt(uint48 timestamp) external view returns (address[] memory); ⋮---- /** * @notice Returns the shared vaults. * @return The shared vaults. */ function getSharedVaults() external view returns (address[] memory); ⋮---- /** * @notice Returns the status of the operator vault registration. * @param vault The operator vault. * @return The status of the operator vault registration. */ function isOperatorVaultRegisteredAt(address vault, uint48 timestamp) external view returns (bool); ⋮---- function isOperatorVaultRegistered(address vault) external view returns (bool); ⋮---- /** * @notice Returns the status of the operator vault registration at a specific timestamp. * @param operator The operator. * @param vault The operator vault. * @param timestamp The timestamp. * @return The status of the operator vault registration. */ function isOperatorVaultRegisteredAt(address operator, address vault, uint48 timestamp) external view returns (bool); ⋮---- /** * @notice Returns the status of the operator vault registration. * @param operator The operator. * @param vault The operator vault. * @return The status of the operator vault registration. */ function isOperatorVaultRegistered(address operator, address vault) external view returns (bool); ⋮---- /** * @notice Returns the operator vaults at a specific timestamp. * @param operator The operator. * @param timestamp The timestamp. * @return The operator vaults. */ function getOperatorVaultsAt(address operator, uint48 timestamp) external view returns (address[] memory); ⋮---- /** * @notice Returns the operator vaults. * @param operator The operator. * @return The operator vaults. */ function getOperatorVaults(address operator) external view returns (address[] memory); ⋮---- /** * @notice Returns the vaults with stakes of the operator at a specific timestamp. * @param operator The operator. * @param timestamp The timestamp. * @return The vaults with stakes of the operator. */ function getOperatorStakesAt(address operator, uint48 timestamp) external view returns (VaultValue[] memory); ⋮---- /** * @notice Returns the vaults with stakes of the operator. * @param operator The operator. * @return The vaults with stakes of the operator. */ function getOperatorStakes(address operator) external view returns (VaultValue[] memory); ⋮---- /** * @notice Returns the vaults with voting powers of the operator at a specific timestamp. * @param operator The operator. * @param extraData The extra data. * @param timestamp The timestamp. * @return The vaults with voting powers of the operator. */ function getOperatorVotingPowersAt(address operator, bytes memory extraData, uint48 timestamp) ⋮---- /** * @notice Returns the vaults with voting powers of the operator. * @param operator The operator. * @param extraData The extra data. * @return The vaults with voting powers of the operator. */ function getOperatorVotingPowers(address operator, bytes memory extraData) ⋮---- /** * @notice Returns operators and their vaults with voting powers at a specific timestamp. * @param extraData The extra data. * @param timestamp The timestamp. * @return The operators and their vaults with voting powers. */ function getVotingPowersAt(bytes[] memory extraData, uint48 timestamp) ⋮---- /** * @notice Returns operators and their vaults with voting powers. * @param extraData The extra data. * @return The operators and their vaults with voting powers. */ function getVotingPowers(bytes[] memory extraData) external view returns (OperatorVotingPower[] memory); ⋮---- /** * @notice Registers the caller as an operator. * @dev The caller can be anyone. */ function registerOperator() external; ⋮---- /** * @notice Registers the operator with a signature. * @param operator The operator. * @param signature The signature of the operator. * @dev The caller can be anyone. */ function registerOperatorWithSignature(address operator, bytes memory signature) external; ⋮---- /** * @notice Unregisters the operator. * @dev The caller can be anyone. */ function unregisterOperator() external; ⋮---- /** * @notice Unregisters the operator with a signature. * @param operator The operator. * @param signature The signature of the operator. * @dev The caller can be anyone. */ function unregisterOperatorWithSignature(address operator, bytes memory signature) external; ⋮---- /** * @notice Invalidates the old signatures of the caller. * @dev The caller can be anyone. * Increases the signatures' nonce by one. */ function invalidateOldSignatures() external; ```` ## File: src/libraries/keys/KeyBlsBn254.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {BN254} from "../utils/BN254.sol"; ⋮---- /** * @title KeyBlsBn254 * @notice Library for interacting with BLS public keys on the BN254 curve, including validation, serialization, and compression. * @dev The keys are represented as G1 points on the BN254 curve. */ ⋮---- /** * @notice Reverts when the key bytes are invalid. */ ⋮---- /** * @notice Reverts when the key is invalid. */ ⋮---- /** * @notice The key wrapper. * @param value The G1 public key. */ ⋮---- /** * @notice Wraps a G1 public key. * @param keyRaw The G1 public key. * @return key The wrapped key. * @dev Allows to wrap zero G1 point. */ function wrap(BN254.G1Point memory keyRaw) internal view returns (KEY_BLS_BN254 memory key) { ⋮---- /** * @notice Unwraps a key. * @param key The key. * @return keyRaw The G1 public key. */ function unwrap(KEY_BLS_BN254 memory key) internal view returns (BN254.G1Point memory keyRaw) { ⋮---- /** * @notice Serializes a key. * @param key The key. * @return keySerialized The serialized key. * @dev Compresses G1 point to 32 bytes (255 bits). */ function serialize(KEY_BLS_BN254 memory key) internal view returns (bytes memory keySerialized) { ⋮---- /** * @notice Deserializes a serialized key. * @param keySerialized The serialized key. * @return key The key. */ function deserialize(bytes memory keySerialized) internal view returns (KEY_BLS_BN254 memory key) { ⋮---- /** * @notice Converts a key to bytes. * @param key The key. * @return keyBytes The bytes representation of the key. * @dev It is a bytes representation of the underlying key itself. */ function toBytes(KEY_BLS_BN254 memory key) internal view returns (bytes memory keyBytes) { ⋮---- /** * @notice Converts bytes to a key. * @param keyBytes The bytes representation of the key. * @return key The key. */ function fromBytes(bytes memory keyBytes) internal view returns (KEY_BLS_BN254 memory key) { ⋮---- /** * @notice Returns a zero key. * @return key The zero key. */ function zeroKey() internal view returns (KEY_BLS_BN254 memory key) { ⋮---- /** * @notice Checks if two keys are equal. * @param key1 The first key. * @param key2 The second key. * @return If the keys are equal. */ function equal(KEY_BLS_BN254 memory key1, KEY_BLS_BN254 memory key2) internal view returns (bool) { ```` ## File: src/libraries/keys/KeyEcdsaSecp256k1.sol ```` // SPDX-License-Identifier: MIT ⋮---- /** * @title KeyEcdsaSecp256k1 * @notice Library for interacting with ECDSA public keys on the secp256k1 curve, including validation and serialization. * @dev The keys are represented as addresses. */ ⋮---- /** * @notice Reverts when the key bytes are invalid. */ ⋮---- /** * @notice The key wrapper. * @param value The address. */ ⋮---- /** * @notice Wraps an address. * @param keyRaw The address. * @return key The wrapped key. * @dev Allows to wrap zero address. */ function wrap(address keyRaw) internal view returns (KEY_ECDSA_SECP256K1 memory key) { ⋮---- /** * @notice Unwraps a key. * @param key The key. * @return keyRaw The address. */ function unwrap(KEY_ECDSA_SECP256K1 memory key) internal view returns (address keyRaw) { ⋮---- /** * @notice Serializes a key. * @param key The key. * @return keySerialized The serialized key. * @dev Serializes address to 32 bytes. */ function serialize(KEY_ECDSA_SECP256K1 memory key) internal view returns (bytes memory keySerialized) { ⋮---- /** * @notice Deserializes a serialized key. * @param keySerialized The serialized key. * @return key The key. */ function deserialize(bytes memory keySerialized) internal view returns (KEY_ECDSA_SECP256K1 memory key) { ⋮---- /** * @notice Converts a key to bytes. * @param key The key. * @return keyBytes The bytes representation of the key. * @dev It is a bytes representation of the underlying key itself. */ function toBytes(KEY_ECDSA_SECP256K1 memory key) internal view returns (bytes memory keyBytes) { ⋮---- /** * @notice Converts bytes to a key. * @param keyBytes The bytes representation of the key. * @return key The key. */ function fromBytes(bytes memory keyBytes) internal view returns (KEY_ECDSA_SECP256K1 memory key) { ⋮---- /** * @notice Returns a zero key. * @return key The zero key. */ function zeroKey() internal view returns (KEY_ECDSA_SECP256K1 memory key) { ⋮---- /** * @notice Checks if two keys are equal. * @param key1 The first key. * @param key2 The second key. * @return If the keys are equal. */ function equal(KEY_ECDSA_SECP256K1 memory key1, KEY_ECDSA_SECP256K1 memory key2) internal view returns (bool) { ```` ## File: src/libraries/sigs/SigBlsBn254.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {BN254} from "../utils/BN254.sol"; import {KeyBlsBn254} from "../keys/KeyBlsBn254.sol"; ⋮---- /** * @title SigBlsBn254 * @notice Library for verifying BLS signatures on the BN254 curve. */ ⋮---- /** * @notice Reverts when the message length is invalid. */ ⋮---- /** * @notice Verify a BLS signature. * @param keyBytes The encoded G1 public key. * @param message The encoded message hash to verify. * @param signature The encoded G1 signature. * @param extraData The encoded G2 public key. * @return If the signature is valid. * @dev Burns the whole gas if pairing precompile fails. * Returns false if the key is zero G1 point. */ function verify(bytes memory keyBytes, bytes memory message, bytes memory signature, bytes memory extraData) ⋮---- /** * @notice Verify a BLS signature. * @param keyG1 The G1 public key. * @param messageHash The message hash to verify. * @param signatureG1 The G1 signature. * @param keyG2 The G2 public key. * @return If the signature is valid. * @dev Burns the whole gas if pairing precompile fails. * Returns false if the key is zero G1 point. */ function verify( ```` ## File: src/libraries/sigs/SigEcdsaSecp256k1.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {KeyEcdsaSecp256k1} from "../keys/KeyEcdsaSecp256k1.sol"; ⋮---- import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; ⋮---- /** * @title SigEcdsaSecp256k1 * @notice Library for verifying ECDSA signatures on the secp256k1 curve. */ ⋮---- /** * @notice Reverts when the message length is invalid. */ ⋮---- /** * @notice Verify an ECDSA signature. * @param keyBytes The encoded signer address. * @param message The encoded message hash to verify. * @param signature The encoded ECDSA signature. * @return If the signature is valid. * @dev Returns false if the key is zero address. */ function verify( ⋮---- bytes memory /* extraData */ ⋮---- /** * @notice Verify an ECDSA signature. * @param key The signer address. * @param message The message hash to verify. * @param signature The ECDSA signature. * @return If the signature is valid. * @dev Returns false if the key is zero address. */ function verify(address key, bytes32 message, bytes memory signature) internal view returns (bool) { ```` ## File: src/libraries/structs/Checkpoints.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {Checkpoints as OZCheckpoints} from "@openzeppelin/contracts/utils/structs/Checkpoints.sol"; import {Math} from "@openzeppelin/contracts/utils/math/Math.sol"; ⋮---- /** * @title Checkpoints * @notice Library implementing a checkpointing mechanism for values as they change at different points in time. * @dev This library defines the `Trace*` struct, for checkpointing values as they change at different points in * time, and later looking up past values by key. */ ⋮---- /** * @dev Pushes a (`key`, `value`) pair into a Trace208 so that it is stored as the checkpoint. * * Returns previous value and new value. */ function push(Trace208 storage self, uint48 key, uint208 value) internal returns (uint208, uint208) { ⋮---- /** * @dev Returns the value in the last (most recent) checkpoint with a key lower or equal than the search key, or zero * if there is none. */ function upperLookupRecent(Trace208 storage self, uint48 key) internal view returns (uint208) { ⋮---- /** * @dev Returns the value in the last (most recent) checkpoint with a key lower or equal than the search key, or zero * if there is none. * * NOTE: This is a variant of {upperLookupRecent} that can be optimized by getting the hint * (index of the checkpoint with a key lower or equal than the search key). */ function upperLookupRecent(Trace208 storage self, uint48 key, bytes memory hint_) internal view returns (uint208) { ⋮---- /** * @dev Returns whether there is a checkpoint with a key lower or equal than the search key in the structure (i.e. it is not empty), * and if so the key and value in the checkpoint, and its position in the trace. */ function upperLookupRecentCheckpoint(Trace208 storage self, uint48 key) ⋮---- /** * @dev Returns whether there is a checkpoint with a key lower or equal than the search key in the structure (i.e. it is not empty), * and if so the key and value in the checkpoint, and its position in the trace. * * NOTE: This is a variant of {upperLookupRecentCheckpoint} that can be optimized by getting the hint * (index of the checkpoint with a key lower or equal than the search key). */ function upperLookupRecentCheckpoint(Trace208 storage self, uint48 key, bytes memory hint_) ⋮---- /** * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints. */ function latest(Trace208 storage self) internal view returns (uint208) { ⋮---- /** * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value * in the most recent checkpoint. */ function latestCheckpoint(Trace208 storage self) internal view returns (bool, uint48, uint208) { ⋮---- /** * @dev Returns a total number of checkpoints. */ function length(Trace208 storage self) internal view returns (uint256) { ⋮---- /** * @dev Returns checkpoint at a given position. */ function at(Trace208 storage self, uint32 pos) internal view returns (Checkpoint208 memory) { ⋮---- /** * @dev Pops the last (most recent) checkpoint. */ function pop(Trace208 storage self) internal returns (uint208 value) { ⋮---- /** * @dev Pushes a (`key`, `value`) pair into a Trace256 so that it is stored as the checkpoint. * * Returns previous value and new value. */ function push(Trace256 storage self, uint48 key, uint256 value) internal returns (uint256, uint256) { ⋮---- function upperLookupRecent(Trace256 storage self, uint48 key) internal view returns (uint256) { ⋮---- function upperLookupRecent(Trace256 storage self, uint48 key, bytes memory hint_) internal view returns (uint256) { ⋮---- function upperLookupRecentCheckpoint(Trace256 storage self, uint48 key) ⋮---- function upperLookupRecentCheckpoint(Trace256 storage self, uint48 key, bytes memory hint_) ⋮---- function latest(Trace256 storage self) internal view returns (uint256) { ⋮---- function latestCheckpoint(Trace256 storage self) internal view returns (bool exists, uint48 _key, uint256 _value) { ⋮---- function length(Trace256 storage self) internal view returns (uint256) { ⋮---- function at(Trace256 storage self, uint32 pos) internal view returns (Checkpoint256 memory) { ⋮---- function pop(Trace256 storage self) internal returns (uint256 value) { ⋮---- function push(Trace512 storage self, uint48 key, uint256[2] memory value) ⋮---- function upperLookupRecent(Trace512 storage self, uint48 key) internal view returns (uint256[2] memory) { ⋮---- function upperLookupRecent(Trace512 storage self, uint48 key, bytes memory hint_) ⋮---- function upperLookupRecentCheckpoint(Trace512 storage self, uint48 key) ⋮---- function upperLookupRecentCheckpoint(Trace512 storage self, uint48 key, bytes memory hint_) ⋮---- function latest(Trace512 storage self) internal view returns (uint256[2] memory) { ⋮---- function latestCheckpoint(Trace512 storage self) ⋮---- function length(Trace512 storage self) internal view returns (uint256) { ⋮---- function at(Trace512 storage self, uint32 pos) internal view returns (Checkpoint512 memory) { ⋮---- function pop(Trace512 storage self) internal returns (uint256[2] memory value) { ⋮---- /** * @dev Return the index of the last (most recent) checkpoint with a key lower or equal than the search key, or `high` * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive * `high`. * * WARNING: `high` should not be greater than the array's length. */ function _upperBinaryLookup(OZCheckpoints.Checkpoint208[] storage self, uint48 key, uint256 low, uint256 high) ⋮---- /** * @dev Access an element of the array without performing a bounds check. The position is assumed to be within bounds. */ function _unsafeAccess(OZCheckpoints.Checkpoint208[] storage self, uint256 pos) ```` ## File: src/libraries/structs/PersistentSet.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {Checkpoints} from "../structs/Checkpoints.sol"; ⋮---- /** * @title PersistentSet * @notice Library implementing a persistent set using Checkpoints. * @dev The library is optimized towards "write" operations, so, in general, "read" batch operations * like `values()` and `valuesAt()` should not be used on-chain. */ ⋮---- /** * @notice Reverts when the key is too old. */ ⋮---- /** * @notice The status of an element. * @param isAdded If the element was ever added to the set. * @param addedAt The key (e.g., block timestamp or block number) at which the element was firstly added to the set. * @param isRemoved The trace of keys at which the element was removed from the set. */ ⋮---- /** * @notice The set. * @param _elements The elements of the set which were ever added to the set. * @param _statuses The statuses of the elements. * @param _length The number of elements which are currently in the set. */ ⋮---- /** * @notice Adds an element to the set. * @param set The set. * @param key The key to add element at. * @param value The element. * @return If the element was added to the set. * @dev It is possible to add an element only at the same or greater key than the previous one for this value. */ function _add(Set storage set, uint48 key, bytes32 value) private returns (bool) { ⋮---- /** * @notice Removes an element from the set. * @param set The set. * @param key The key to remove element at. * @param value The element. * @return If the element was removed from the set. * @dev It is possible to remove an element only at the same or greater key than the previous one for this value. */ function _remove(Set storage set, uint48 key, bytes32 value) private returns (bool) { ⋮---- /** * @notice Checks if an element is in the set at a given key. * @param set The set. * @param key The key to check element at. * @param value The element. * @param hint The hint to use for the lookup. * @return If the element is in the set at the given key. */ function _containsAt(Set storage set, uint48 key, bytes32 value, bytes memory hint) private view returns (bool) { ⋮---- /** * @notice Checks if an element is in the set at a given key. * @param set The set. * @param key The key to check element at. * @param value The element. * @return If the element is in the set at the given key. */ function _containsAt(Set storage set, uint48 key, bytes32 value) private view returns (bool) { ⋮---- /** * @notice Checks if an element is in the set. * @param set The set. * @param value The element. * @return If the element is in the set. */ function _contains(Set storage set, bytes32 value) private view returns (bool) { ⋮---- /** * @notice Returns the number of elements in the set. * @param set The set. * @return The number of elements in the set. */ function _length(Set storage set) private view returns (uint256) { ⋮---- /** * @notice Returns the elements in the set at a given key. * @param set The set. * @param key The key to get elements at. * @return values_ The elements in the set at the given key. */ function _valuesAt(Set storage set, uint48 key) private view returns (bytes32[] memory values_) { ⋮---- /** * @notice Returns the elements in the set. * @param set The set. * @return values_ The elements in the set. */ function _values(Set storage set) private view returns (bytes32[] memory values_) { ⋮---- // Bytes32Set ⋮---- /** * @notice The set of bytes32 values. * @param _inner The set. */ ⋮---- /** * @notice Adds an element to the set. * @param set The set. * @param key The key to add element at. * @param value The element. * @return If the element was added to the set. */ function add(Bytes32Set storage set, uint48 key, bytes32 value) internal returns (bool) { ⋮---- /** * @notice Removes an element from the set. * @param set The set. * @param key The key to remove element at. * @param value The element. * @return If the element was removed from the set. */ function remove(Bytes32Set storage set, uint48 key, bytes32 value) internal returns (bool) { ⋮---- function containsAt(Bytes32Set storage set, uint48 key, bytes32 value, bytes memory hint) ⋮---- function containsAt(Bytes32Set storage set, uint48 key, bytes32 value) internal view returns (bool) { ⋮---- function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { ⋮---- function length(Bytes32Set storage set) internal view returns (uint256) { ⋮---- /** * @notice Returns the elements in the set at a given key. * @param set The set. * @param key The key to get elements at. * @return result The elements in the set at the given key. */ function valuesAt(Bytes32Set storage set, uint48 key) internal view returns (bytes32[] memory result) { ⋮---- /** * @notice Returns the elements in the set. * @param set The set. * @return result The elements in the set. */ function values(Bytes32Set storage set) internal view returns (bytes32[] memory result) { ⋮---- // AddressSet ⋮---- /** * @notice The set of address values. * @param _inner The set. */ ⋮---- function add(AddressSet storage set, uint48 key, address value) internal returns (bool) { ⋮---- function remove(AddressSet storage set, uint48 key, address value) internal returns (bool) { ⋮---- function containsAt(AddressSet storage set, uint48 key, address value, bytes memory hint) ⋮---- function containsAt(AddressSet storage set, uint48 key, address value) internal view returns (bool) { ⋮---- function contains(AddressSet storage set, address value) internal view returns (bool) { ⋮---- function length(AddressSet storage set) internal view returns (uint256) { ⋮---- function valuesAt(AddressSet storage set, uint48 key) internal view returns (address[] memory result) { ⋮---- function values(AddressSet storage set) internal view returns (address[] memory result) { ```` ## File: src/libraries/utils/BN254.sol ```` // SPDX-License-Identifier: MIT // Original code: https://github.com/Layr-Labs/eigenlayer-middleware/blob/mainnet/src/libraries/BN254.sol // Copyright (c) 2024 LayrLabs Inc. ⋮---- // modulus for the underlying field F_p of the elliptic curve ⋮---- // modulus for the underlying field F_r of the elliptic curve ⋮---- // Encoding of field elements is: X[1] * i + X[0] ⋮---- function generatorG1() internal pure returns (G1Point memory) { ⋮---- // generator of group G2 /// @dev Generator point in F_q2 is of the form: (x0 + ix1, y0 + iy1). ⋮---- /// @notice returns the G2 generator /// @dev mind the ordering of the 1s and 0s! /// this is because of the (unknown to us) convention used in the bn254 pairing precompile contract /// "Elements a * i + b of F_p^2 are encoded as two elements of F_p, (a, b)." /// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-197.md#encoding function generatorG2() internal pure returns (G2Point memory) { ⋮---- // negation of the generator of group G2 ⋮---- function negGeneratorG2() internal pure returns (G2Point memory) { ⋮---- /** * @param p Some point in G1. * @return The negation of `p`, i.e. p.plus(p.negate()) should be zero. */ function negate(G1Point memory p) internal pure returns (G1Point memory) { // The prime q in the base field F_q for G1 ⋮---- /** * @return r the sum of two points of G1 */ function plus(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) { ⋮---- // solium-disable-next-line security/no-inline-assembly ⋮---- // Use "invalid" to make gas estimation work ⋮---- /** * @notice an optimized ecMul implementation that takes O(log_2(s)) ecAdds * @param p the point to multiply * @param s the scalar to multiply by * @dev this function is only safe to use if the scalar is 9 bits or less */ function scalar_mul_tiny(BN254.G1Point memory p, uint16 s) internal view returns (BN254.G1Point memory) { ⋮---- // if s is 1 return p ⋮---- // the accumulated product to return ⋮---- // the 2^n*p to add to the accumulated product in each iteration ⋮---- // value of most significant bit ⋮---- // index of most significant bit ⋮---- //loop until we reach the most significant bit ⋮---- // if the current bit is 1, add the 2^n*p to the accumulated product ⋮---- // double the 2^n*p for the next iteration ⋮---- // increment the index and double the value of the most significant bit ⋮---- // return the accumulated product ⋮---- /** * @return r the product of a point on G1 and a scalar, i.e. * p == p.scalar_mul(1) and p.plus(p) == p.scalar_mul(2) for all * points p. */ function scalar_mul(G1Point memory p, uint256 s) internal view returns (G1Point memory r) { ⋮---- /** * @return The result of computing the pairing check * e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1 * For example, * pairing([P1(), P1().negate()], [P2(), P2()]) should return true. */ function pairing(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) ⋮---- /** * @notice This function is functionally the same as pairing(), however it specifies a gas limit * the user can set, as a precompile may use the entire gas budget if it reverts. */ function safePairing( ⋮---- //Out is the output of the pairing precompile, either 0 or 1 based on whether the two pairings are equal. //Success is true if the precompile actually goes through (aka all inputs are valid) ⋮---- /// @return hashedG1 the keccak256 hash of the G1 Point /// @dev used for BLS signatures function hashG1Point(BN254.G1Point memory pk) internal pure returns (bytes32 hashedG1) { ⋮---- /// @return the keccak256 hash of the G2 Point ⋮---- function hashG2Point(BN254.G2Point memory pk) internal pure returns (bytes32) { ⋮---- /** * @notice adapted from https://github.com/HarryR/solcrypto/blob/master/altbn128.sol */ function hashToG1(bytes32 _x) internal view returns (G1Point memory) { ⋮---- // y^2 == beta ⋮---- /** * Given X, find Y * * where y = sqrt(x^3 + b) * * Returns: (x^3 + b), y */ function findYFromX(uint256 x) internal view returns (uint256, uint256) { // beta = (x^3 + b) % p ⋮---- // y^2 = x^3 + b // this acts like: y = sqrt(beta) = beta^((p+1) / 4) ⋮---- function expMod(uint256 _base, uint256 _exponent, uint256 _modulus) internal view returns (uint256 retval) { ⋮---- input[0] = 0x20; // baseLen = new(big.Int).SetBytes(getData(input, 0, 32)) input[1] = 0x20; // expLen = new(big.Int).SetBytes(getData(input, 32, 32)) input[2] = 0x20; // modLen = new(big.Int).SetBytes(getData(input, 64, 32)) ```` ## File: src/libraries/utils/InputNormalizer.sol ```` // SPDX-License-Identifier: MIT ⋮---- /** * @title InputNormalizer * @notice Library for normalizing input arrays to a given length. */ ⋮---- /** * @notice Reverts when the length of the input is not zero and not equal to the expected length. */ ⋮---- /** * @notice Normalizes an array of bytes to a given length. * @param arr The array of bytes. * @param length The expected length of the array. * @return The normalized array of bytes. */ function normalize(bytes[] memory arr, uint256 length) internal pure returns (bytes[] memory) { ⋮---- /** * @notice Normalizes an array of arrays of bytes to a given length. * @param arr The array of arrays of bytes. * @param length The expected length of the array. * @return The normalized array of arrays of bytes. */ function normalize(bytes[][] memory arr, uint256 length) internal pure returns (bytes[][] memory) { ```` ## File: src/libraries/utils/KeyTags.sol ```` // SPDX-License-Identifier: MIT ⋮---- /** * @title KeyTags * @notice Library for working with key tags which represent the keys' types and arbitrary purpose identifiers. */ ⋮---- /** * @notice Reverts when the key tag is duplicated. */ ⋮---- /** * @notice Reverts when the key type is invalid. */ ⋮---- /** * @notice Reverts when the key tag is invalid. */ ⋮---- /** * @notice The total number of key tags. * @dev 3 bits for type, 4 bits for tag */ ⋮---- /** * @notice The maximum key type. */ ⋮---- /** * @notice The maximum key tag. */ ⋮---- /** * @notice Validates a key tag. * @param keyTag The key tag. */ function validateKeyTag(uint8 keyTag) internal pure { ⋮---- /** * @notice Validates a key type. * @param type_ The key type. */ function validateType(uint8 type_) internal pure { ⋮---- /** * @notice Validates a key tag identifier. * @param tag The key tag identifier. */ function validateTag(uint8 tag) internal pure { ⋮---- /** * @notice Returns a key tag. * @param type_ The key type. * @param tag The key tag identifier. * @return The key tag. */ function getKeyTag(uint8 type_, uint8 tag) internal pure returns (uint8) { ⋮---- /** * @notice Returns a key type. * @param keyTag The key tag. * @return The key type. */ function getType(uint8 keyTag) internal pure returns (uint8) { ⋮---- /** * @notice Returns a key tag identifier. * @param keyTag The key tag. * @return The key tag identifier. */ function getTag(uint8 keyTag) internal pure returns (uint8) { ⋮---- /** * @notice Checks if a key tag is in the serialized key tags. * @param keyTagsSerialized The serialized key tags. * @param keyTag The key tag. * @return If the key tag is in the serialized key tags. */ function contains(uint128 keyTagsSerialized, uint8 keyTag) internal pure returns (bool) { ⋮---- /** * @notice Adds a key tag to the serialized key tags. * @param keyTagsSerialized The serialized key tags. * @param keyTag The key tag. * @return The serialized key tags with the key tag added. * @dev Doesn't revert when the key tag is already in the serialized key tags. */ function add(uint128 keyTagsSerialized, uint8 keyTag) internal pure returns (uint128) { ⋮---- /** * @notice Removes a key tag from the serialized key tags. * @param keyTagsSerialized The serialized key tags. * @param keyTag The key tag. * @return The serialized key tags with the key tag removed. * @dev Doesn't revert when the key tag is not in the serialized key tags. */ function remove(uint128 keyTagsSerialized, uint8 keyTag) internal pure returns (uint128) { ⋮---- /** * @notice Serializes an array of key tags. * @param keyTags The array of key tags. * @return keyTagsSerialized The serialized key tags. * @dev Reverts when the key tags are duplicated. */ function serialize(uint8[] memory keyTags) internal pure returns (uint128 keyTagsSerialized) { ⋮---- /** * @notice Deserializes a serialized key tags. * @param keyTagsSerialized The serialized key tags. * @return keyTags The array of key tags. */ function deserialize(uint128 keyTagsSerialized) internal pure returns (uint8[] memory keyTags) { ```` ## File: src/libraries/utils/Scaler.sol ```` // SPDX-License-Identifier: MIT ⋮---- /** * @title Scaler * @notice Library for scaling values between different decimals and inverting them. */ ⋮---- /** * @notice Scales a value given its decimals to the target decimals. * @param value The value to scale. * @param decimals The base decimals of the value. * @param targetDecimals The target decimals. * @return The scaled value. */ function scale(uint256 value, uint8 decimals, uint8 targetDecimals) internal pure returns (uint256) { ⋮---- /** * @notice Inverts a value given its decimals. * @param value The value to invert. * @param decimals The base decimals of the value. * @return The inverted value. * @dev Reverts if the value is zero. */ function invert(uint256 value, uint8 decimals) internal pure returns (uint256) { ```` ## File: src/libraries/utils/ValSetVerifier.sol ```` // SPDX-License-Identifier: MIT ⋮---- /** * @title ValSetVerifier * @notice Library for verifying the validity of validator set elements. */ ⋮---- /** * @notice The validator's key. * @param tag The key tag. * @param payloadHash The hash of the key. */ ⋮---- /** * @notice The validator's vault. * @param chainId The chain ID. * @param vault The vault address. * @param votingPower The voting power. */ ⋮---- /** * @notice The validator. * @param operator The operator address. * @param votingPower The voting power. * @param isActive If the validator is active. * @param keys The validator's keys. * @param vaults The validator's vaults. * @dev The voting power may not be equal to the sum of the voting powers inside the vaults. */ ⋮---- /** * @notice The validator set. * @param validators The validators in the validator set. */ ⋮---- /** * @notice The Merkle proof. * @param leaf The leaf to prove. * @param proof The proof. */ ⋮---- uint256 internal constant VALIDATOR_SET_TREE_HEIGHT = 0; // 1 element (ceil(log2(1))) ⋮---- uint256 internal constant VALIDATORS_LIST_TREE_HEIGHT = 20; // 1048576 elements (ceil(log2(1048576))) ⋮---- uint256 internal constant VALIDATORS_LIST_MAX_LENGTH = 1_048_576; // 1048576 elements (2 ^ VALIDATORS_LIST_TREE_HEIGHT) ⋮---- uint256 internal constant VALIDATOR_TREE_HEIGHT = 3; // 5 elements (ceil(log2(5))) ⋮---- uint256 internal constant KEY_LIST_TREE_HEIGHT = 7; // 128 elements (ceil(log2(128))) ⋮---- uint256 internal constant KEY_LIST_MAX_LENGTH = 128; // 128 elements (2 ^ KEY_LIST_TREE_HEIGHT) ⋮---- uint256 internal constant VAULT_LIST_TREE_HEIGHT = 10; // 1024 elements (ceil(log2(1024))) ⋮---- uint256 internal constant VAULT_LIST_MAX_LENGTH = 1024; // 1024 elements (2 ^ VAULT_LIST_TREE_HEIGHT) ⋮---- uint256 internal constant KEY_TREE_HEIGHT = 1; // 2 elements (ceil(log2(2))) ⋮---- uint256 internal constant VAULT_TREE_HEIGHT = 2; // 3 elements (ceil(log2(3))) ⋮---- /// @dev The precompile address for SHA-256 ⋮---- uint256 internal constant VALIDATORS_LIST_LOCAL_INDEX = VALIDATOR_SET_VALIDATORS_BASE_INDEX; // to element in ValidatorSet ⋮---- VALIDATORS_LIST_LOCAL_INDEX << (1 + VALIDATORS_LIST_TREE_HEIGHT); // to first element (inclusive), "1" is for the length (for a List) ⋮---- VALIDATOR_ROOT_MIN_LOCAL_INDEX + VALIDATORS_LIST_MAX_LENGTH; // to last element (exclusive) ⋮---- VALIDATOR_SET_TREE_HEIGHT + 1 + VALIDATORS_LIST_TREE_HEIGHT; // (to element in ValidatorSet) + (length) + (to element in validators) ⋮---- uint256 internal constant VALIDATOR_OPERATOR_LOCAL_INDEX = VALIDATOR_OPERATOR_BASE_INDEX; // to element in Validator ⋮---- uint256 internal constant VALIDATOR_OPERATOR_PROOF_EXPECTED_HEIGHT = VALIDATOR_TREE_HEIGHT; // (to element in Validator) ⋮---- uint256 internal constant VALIDATOR_VOTING_POWER_LOCAL_INDEX = VALIDATOR_VOTING_POWER_BASE_INDEX; // to element in Validator ⋮---- uint256 internal constant VALIDATOR_VOTING_POWER_PROOF_EXPECTED_HEIGHT = VALIDATOR_TREE_HEIGHT; // (to element in Validator) ⋮---- uint256 internal constant VALIDATOR_IS_ACTIVE_LOCAL_INDEX = VALIDATOR_IS_ACTIVE_BASE_INDEX; // to element in Validator ⋮---- uint256 internal constant VALIDATOR_IS_ACTIVE_PROOF_EXPECTED_HEIGHT = VALIDATOR_TREE_HEIGHT; // (to element in Validator) ⋮---- uint256 internal constant KEYS_LIST_LOCAL_INDEX = VALIDATOR_KEYS_BASE_INDEX; // to element in Validator ⋮---- uint256 internal constant KEY_ROOT_MIN_LOCAL_INDEX = KEYS_LIST_LOCAL_INDEX << (1 + KEY_LIST_TREE_HEIGHT); // to first element (inclusive), "1" is for the length (for a List) ⋮---- uint256 internal constant KEY_ROOT_MAX_LOCAL_INDEX = KEY_ROOT_MIN_LOCAL_INDEX + KEY_LIST_MAX_LENGTH; // to last element (exclusive) ⋮---- uint256 internal constant KEY_ROOT_PROOF_EXPECTED_HEIGHT = VALIDATOR_TREE_HEIGHT + 1 + KEY_LIST_TREE_HEIGHT; // (to element in Validator) + (length) + (to element in keys) ⋮---- uint256 internal constant VAULTS_LIST_LOCAL_INDEX = VALIDATOR_VAULTS_BASE_INDEX; // to element in Validator ⋮---- uint256 internal constant VAULT_ROOT_MIN_LOCAL_INDEX = VAULTS_LIST_LOCAL_INDEX << (1 + VAULT_LIST_TREE_HEIGHT); // to first element (inclusive), "1" is for the length (for a List) ⋮---- uint256 internal constant VAULT_ROOT_MAX_LOCAL_INDEX = VAULT_ROOT_MIN_LOCAL_INDEX + VAULT_LIST_MAX_LENGTH; // to last element (exclusive) ⋮---- uint256 internal constant VAULT_ROOT_PROOF_EXPECTED_HEIGHT = VALIDATOR_TREE_HEIGHT + 1 + VAULT_LIST_TREE_HEIGHT; // (to element in Validator) + (length) + (to element in vaults) ⋮---- uint256 internal constant KEY_TAG_LOCAL_INDEX = KEY_TAG_BASE_INDEX; // to element in Key ⋮---- uint256 internal constant KEY_TAG_PROOF_EXPECTED_HEIGHT = KEY_TREE_HEIGHT; // (to element in Key) ⋮---- uint256 internal constant KEY_PAYLOAD_HASH_LOCAL_INDEX = KEY_PAYLOAD_HASH_BASE_INDEX; // to element in Key ⋮---- uint256 internal constant KEY_PAYLOAD_HASH_PROOF_EXPECTED_HEIGHT = KEY_TREE_HEIGHT; // (to element in Key) ⋮---- uint256 internal constant VAULT_CHAIN_ID_LOCAL_INDEX = VAULT_CHAIN_ID_BASE_INDEX; // to element in Vault ⋮---- uint256 internal constant VAULT_CHAIN_ID_PROOF_EXPECTED_HEIGHT = VAULT_TREE_HEIGHT; // (to element in Vault) ⋮---- uint256 internal constant VAULT_VAULT_LOCAL_INDEX = VAULT_VAULT_BASE_INDEX; // to element in Vault ⋮---- uint256 internal constant VAULT_VAULT_PROOF_EXPECTED_HEIGHT = VAULT_TREE_HEIGHT; // (to element in Vault) ⋮---- uint256 internal constant VAULT_VOTING_POWER_LOCAL_INDEX = VAULT_VOTING_POWER_BASE_INDEX; // to element in Vault ⋮---- uint256 internal constant VAULT_VOTING_POWER_PROOF_EXPECTED_HEIGHT = VAULT_TREE_HEIGHT; // (to element in Vault) ⋮---- /** * @notice Verifies that the key is in the validator set. * @param validatorRootProof The proof of the validator root. * @param validatorRootLocalIndex The local index of the validator root inside the validator set. * @param validatorSetRoot The validator set root. * @param keyRootProof The proof of the key root. * @param keyRootLocalIndex The local index of the key root inside the validator. * @param keyTagProof The proof of the key tag. * @param keyPayloadHashProof The proof of the key hash. * @return isValid If the key is in the validator set. */ function verifyKey( ⋮---- /** * @notice Verifies that the vault is in the validator set. * @param validatorRootProof The proof of the validator root. * @param validatorRootLocalIndex The local index of the validator root inside the validator set. * @param validatorSetRoot The validator set root. * @param vaultRootProof The proof of the vault root. * @param vaultRootLocalIndex The local index of the vault root inside the validator. * @param vaultChainIdProof The proof of the vault chain ID. * @param vaultVaultProof The proof of the vault address. * @param vaultVotingPowerProof The proof of the vault voting power. * @return isValid If the vault is in the validator set. */ function verifyVault( ⋮---- /** * @notice Verifies that the operator address is in the validator set. * @param validatorRootProof The proof of the validator root. * @param validatorRootLocalIndex The local index of the validator root inside the validator set. * @param validatorSetRoot The validator set root. * @param operatorProof The proof of the operator address. * @return isValid If the operator address is in the validator set. */ function verifyOperator( ⋮---- /** * @notice Verifies that the validator's voting power is in the validator set. * @param validatorRootProof The proof of the validator root. * @param validatorRootLocalIndex The local index of the validator root inside the validator set. * @param validatorSetRoot The validator set root. * @param votingPowerProof The proof of the voting power. * @return isValid If the validator's voting power is in the validator set. */ function verifyVotingPower( ⋮---- /** * @notice Verifies that the validator's activity status is in the validator set. * @param validatorRootProof The proof of the validator root. * @param validatorRootLocalIndex The local index of the validator root inside the validator set. * @param validatorSetRoot The validator set root. * @param isActiveProof The proof of the validator's is active. * @return isValid If the validator is active. */ function verifyIsActive( ⋮---- /** * @notice Verifies that the validator root is in the validator set. * @param validatorRootProof The proof of the validator root. * @param validatorRootLocalIndex The local index of the validator root inside the validator set. * @param validatorSetRoot The validator set root. * @return isValid If the validator root is in the validator set. */ function verifyValidatorRootLocal( ⋮---- /** * @notice Verifies that the operator address is in the validator. * @param validatorOperatorProof The proof of the operator address. * @param validatorRoot The validator root. * @return isValid If the operator address is in the validator. */ function verifyValidatorOperatorLocal(SszProof calldata validatorOperatorProof, bytes32 validatorRoot) ⋮---- /** * @notice Verifies that the validator's voting power is in the validator. * @param validatorVotingPowerProof The proof of the validator's voting power. * @param validatorRoot The validator root. * @return isValid If the validator's voting power is in the validator. */ function verifyValidatorVotingPowerLocal(SszProof calldata validatorVotingPowerProof, bytes32 validatorRoot) ⋮---- /** * @notice Verifies that the validator's activity status is in the validator. * @param validatorIsActiveProof The proof of the validator's activity status. * @param validatorRoot The validator root. * @return isValid If the validator's activity status is in the validator. */ function verifyValidatorIsActiveLocal(SszProof calldata validatorIsActiveProof, bytes32 validatorRoot) ⋮---- /** * @notice Verifies that the key root is in the validator. * @param keyRootProof The proof of the key root. * @param keyRootLocalIndex The local index of the key root inside the validator. * @param validatorRoot The validator root. * @return isValid If the key root is in the validator. */ function verifyValidatorKeyRootLocal( ⋮---- /** * @notice Verifies that the vault root is in the validator. * @param vaultRootProof The proof of the vault root. * @param vaultRootLocalIndex The local index of the vault root inside the validator. * @param validatorRoot The validator root. * @return isValid If the vault root is in the validator. */ function verifyValidatorVaultRootLocal( ⋮---- /** * @notice Verifies that the key tag is in the key. * @param keyTagProof The proof of the key tag. * @param keyRoot The key root. * @return isValid If the key tag is in the key. */ function verifyKeyTagLocal(SszProof calldata keyTagProof, bytes32 keyRoot) internal view returns (bool) { ⋮---- /** * @notice Verifies that the key hash is in the key. * @param keyPayloadHashProof The proof of the key hash. * @param keyRoot The key root. * @return isValid If the key hash is in the key. */ function verifyKeyPayloadHash(SszProof calldata keyPayloadHashProof, bytes32 keyRoot) internal view returns (bool) { ⋮---- /** * @notice Verifies that the vault's chain ID is in the vault. * @param vaultChainIdProof The proof of the vault chain ID. * @param vaultRoot The vault root. * @return isValid If the vault's chain ID is in the vault. */ function verifyVaultChainIdLocal(SszProof calldata vaultChainIdProof, bytes32 vaultRoot) ⋮---- /** * @notice Verifies that the vault address is in the vault. * @param vaultVaultProof The proof of the vault address. * @param vaultRoot The vault root. * @return isValid If the vault address is in the vault. */ function verifyVaultVaultLocal(SszProof calldata vaultVaultProof, bytes32 vaultRoot) internal view returns (bool) { ⋮---- /** * @notice Verifies that the vault's voting power is in the vault. * @param vaultVotingPowerProof The proof of the vault voting power. * @param vaultRoot The vault root. * @return isValid If the vault's voting power is in the vault. */ function verifyVaultVotingPowerLocal(SszProof calldata vaultVotingPowerProof, bytes32 vaultRoot) ⋮---- /** * @notice Processes an inclusion proof with a SHA256 hash. * @param proof The inclusion proof. * @param leaf The leaf to be proven. * @param root The root to reconcile the proof against. * @param localIndex The local index of the leaf. * @param expectedHeight The height of the tree that the proof is for. * @return valid A boolean indicating whether the derived root from the proof matches the `root` provided. * @dev In case of an invalid proof length, we return false which is to be handled by the caller. * In case of a failed SHA-256 call, we revert. */ function processInclusionProofSha256( ⋮---- /// @solidity memory-safe-assembly ⋮---- // let startOffset := add(proof.offset, 32) // But we'll initialize directly in the loop ⋮---- // Div by 2 ⋮---- // Store returndata at 0x00 ⋮---- // Store returndata at 0x20 ```` ## File: src/modules/base/NetworkManager.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {INetworkManager} from "../../interfaces/modules/base/INetworkManager.sol"; ⋮---- import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; ⋮---- import {StaticDelegateCallable} from "@symbioticfi/core/src/contracts/common/StaticDelegateCallable.sol"; import {Subnetwork} from "@symbioticfi/core/src/contracts/libraries/Subnetwork.sol"; ⋮---- /// @title NetworkManager /// @notice Contract for managing the network and subnetwork getters. abstract contract NetworkManager is Initializable, StaticDelegateCallable, INetworkManager { ⋮---- // keccak256(abi.encode(uint256(keccak256("symbiotic.storage.NetworkManager")) - 1)) & ~bytes32(uint256(0xff)) ⋮---- function _getNetworkManagerStorage() internal pure returns (INetworkManager.NetworkManagerStorage storage $) { ⋮---- function __NetworkManager_init(NetworkManagerInitParams memory initParams) internal virtual onlyInitializing { ⋮---- /// @inheritdoc INetworkManager function NETWORK() public view virtual returns (address) { ⋮---- function SUBNETWORK_IDENTIFIER() public view virtual returns (uint96) { ⋮---- function SUBNETWORK() public view virtual returns (bytes32) { ```` ## File: src/modules/base/OzEIP712.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {IOzEIP712} from "../../interfaces/modules/base/IOzEIP712.sol"; ⋮---- import {EIP712Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol"; import {MessageHashUtils} from "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol"; ⋮---- /// @title OzEIP712 /// @notice Contract for EIP712 hashing. abstract contract OzEIP712 is EIP712Upgradeable, IOzEIP712 { ⋮---- function __OzEIP712_init(OzEIP712InitParams memory initParams) internal virtual onlyInitializing { ⋮---- /// @inheritdoc IOzEIP712 function hashTypedDataV4(bytes32 structHash) public view returns (bytes32) { ⋮---- function hashTypedDataV4CrossChain(bytes32 structHash) public view virtual returns (bytes32) { ```` ## File: src/modules/base/PermissionManager.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {IPermissionManager} from "../../interfaces/modules/base/IPermissionManager.sol"; ⋮---- import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; ⋮---- /// @title PermissionManager /// @notice Base contract for managing permissions. abstract contract PermissionManager is Initializable, IPermissionManager { modifier checkPermission() { ⋮---- function _checkPermission() internal virtual; ```` ## File: src/modules/common/permissions/OzAccessControl.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {PermissionManager} from "../../base/PermissionManager.sol"; ⋮---- import {IOzAccessControl} from "../../../interfaces/modules/common/permissions/IOzAccessControl.sol"; ⋮---- import {AccessControlUpgradeable} from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; ⋮---- /// @title OzAccessControl /// @notice Contract for permission management based on OpenZeppelin's AccessControl. abstract contract OzAccessControl is PermissionManager, AccessControlUpgradeable, IOzAccessControl { // keccak256(abi.encode(uint256(keccak256("symbiotic.storage.OzAccessControl")) - 1)) & ~bytes32(uint256(0xff)) ⋮---- function _getOzAccessControlStorage() internal pure returns (OzAccessControlStorage storage $) { ⋮---- function __OzAccessControl_init() internal virtual onlyInitializing { ⋮---- /// @inheritdoc IOzAccessControl function getRole(bytes4 selector) public view virtual returns (bytes32) { ⋮---- /// @inheritdoc PermissionManager function _checkPermission() internal view virtual override { ⋮---- function _setSelectorRole(bytes4 selector, bytes32 role) internal virtual { ```` ## File: src/modules/common/permissions/OzAccessManaged.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {PermissionManager} from "../../base/PermissionManager.sol"; ⋮---- import {IOzAccessManaged} from "../../../interfaces/modules/common/permissions/IOzAccessManaged.sol"; ⋮---- import { AccessManagedUpgradeable } from "@openzeppelin/contracts-upgradeable/access/manager/AccessManagedUpgradeable.sol"; ⋮---- /// @title OzAccessManaged /// @notice Contract for permission management based on OpenZeppelin's AccessManaged. abstract contract OzAccessManaged is PermissionManager, AccessManagedUpgradeable, IOzAccessManaged { function __OzAccessManaged_init(OzAccessManagedInitParams memory initParams) internal virtual onlyInitializing { ⋮---- /// @inheritdoc PermissionManager function _checkPermission() internal virtual override { ```` ## File: src/modules/common/permissions/OzOwnable.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {PermissionManager} from "../../base/PermissionManager.sol"; ⋮---- import {IOzOwnable} from "../../../interfaces/modules/common/permissions/IOzOwnable.sol"; ⋮---- import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; ⋮---- /// @title OzOwnable /// @notice Contract for permission management based on OpenZeppelin's Ownable. abstract contract OzOwnable is PermissionManager, OwnableUpgradeable, IOzOwnable { function __OzOwnable_init(OzOwnableInitParams memory initParams) internal virtual onlyInitializing { ⋮---- /// @inheritdoc PermissionManager function _checkPermission() internal view virtual override { ```` ## File: src/modules/key-registry/KeyRegistry.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {OzEIP712} from "../base/OzEIP712.sol"; ⋮---- import {Checkpoints} from "../../libraries/structs/Checkpoints.sol"; import {KeyBlsBn254} from "../../libraries/keys/KeyBlsBn254.sol"; import {KeyEcdsaSecp256k1} from "../../libraries/keys/KeyEcdsaSecp256k1.sol"; import {KeyTags} from "../../libraries/utils/KeyTags.sol"; import {PersistentSet} from "../../libraries/structs/PersistentSet.sol"; import {SigBlsBn254} from "../../libraries/sigs/SigBlsBn254.sol"; import {SigEcdsaSecp256k1} from "../../libraries/sigs/SigEcdsaSecp256k1.sol"; ⋮---- import { IKeyRegistry, KEY_TYPE_BLS_BN254, KEY_TYPE_ECDSA_SECP256K1 } from "../../interfaces/modules/key-registry/IKeyRegistry.sol"; ⋮---- import {MulticallUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/MulticallUpgradeable.sol"; ⋮---- /// @title KeyRegistry /// @notice Contract for operators' keys management. /// @dev It supports: /// - BLS public keys on BN254 /// - ECDSA public keys on secp256k1 contract KeyRegistry is MulticallUpgradeable, OzEIP712, IKeyRegistry { ⋮---- // keccak256(abi.encode(uint256(keccak256("symbiotic.storage.KeyRegistry")) - 1)) & ~bytes32(uint256(0xff)) ⋮---- function _getKeyRegistryStorage() internal pure returns (KeyRegistryStorage storage $) { ⋮---- function __KeyRegistry_init(KeyRegistryInitParams memory keyRegistryInitParams) public virtual onlyInitializing { ⋮---- /// @inheritdoc IKeyRegistry function getKeyAt(address operator, uint8 tag, uint48 timestamp) public view virtual returns (bytes memory) { ⋮---- function getKey(address operator, uint8 tag) public view virtual returns (bytes memory) { ⋮---- function getOperator(bytes memory key) public view virtual returns (address) { ⋮---- function getKeysAt(address operator, uint48 timestamp) public view virtual returns (Key[] memory keys) { ⋮---- function getKeys(address operator) public view virtual returns (Key[] memory keys) { ⋮---- function getKeysAt(uint48 timestamp) public view virtual returns (OperatorWithKeys[] memory operatorsKeys) { ⋮---- function getKeys() public view virtual returns (OperatorWithKeys[] memory operatorsKeys) { ⋮---- function getKeysOperatorsLength() public view virtual returns (uint256) { ⋮---- function getKeysOperatorsAt(uint48 timestamp) public view virtual returns (address[] memory) { ⋮---- function getKeysOperators() public view virtual returns (address[] memory) { ⋮---- function _getKeyTagsAt(address operator, uint48 timestamp) internal view virtual returns (uint8[] memory) { ⋮---- function _getKeyTags(address operator) internal view virtual returns (uint8[] memory) { ⋮---- function setKey(uint8 tag, bytes memory key, bytes memory signature, bytes memory extraData) public virtual { ⋮---- function _setKey(address operator, uint8 tag, bytes memory key, bytes memory signature, bytes memory extraData) ⋮---- // Disallow usage between different operators // Disallow usage of the same key on the same type on different tags // Allow usage of the old key on the same type and tag ⋮---- function _setKey(address operator, uint8 tag, bytes memory key) internal virtual { ⋮---- function _setKey32(address operator, uint8 tag, bytes memory key) internal { ⋮---- function _setKey64(address operator, uint8 tag, bytes memory key) internal { ⋮---- function _verifyKey( ⋮---- function _getKey32At(address operator, uint8 tag, uint48 timestamp) internal view returns (bytes memory) { ⋮---- function _getKey32(address operator, uint8 tag) internal view returns (bytes memory) { ⋮---- function _getKey64At(address operator, uint8 tag, uint48 timestamp) internal view returns (bytes memory) { ⋮---- function _getKey64(address operator, uint8 tag) internal view returns (bytes memory) { ```` ## File: src/modules/settlement/sig-verifiers/libraries/ExtraDataStorageHelper.sol ```` // SPDX-License-Identifier: MIT ⋮---- /** * @title ExtraDataStorageHelper * @notice Library for convenient and safe extra data storage slots derivation. */ ⋮---- /** * @notice Derives a key from a name hash. * @param nameHash The name hash. * @return The key. * @dev It can be used, e.g., to store some global data like number of validators. */ function getKeyGlobal(bytes32 nameHash) internal pure returns (bytes32) { ⋮---- /** * @notice Derives a key from a key tag and a name hash. * @param keyTag The key tag. * @param nameHash The name hash. * @return The key. * @dev It can be used, e.g., to store some data dependent on the key tag like quorum threshold. */ function getKeyGlobal(uint8 keyTag, bytes32 nameHash) internal pure returns (bytes32) { ⋮---- /** * @notice Derives a key from a key tag, a name hash and an index. * @param keyTag The key tag. * @param nameHash The name hash. * @param index The index. * @return The key. * @dev It can be used, e.g., to store some data dependent on the key tag, which needs more than 1 storage slot (32 bytes), * like aggregated BLS12-381 public key. */ function getKeyGlobal(uint8 keyTag, bytes32 nameHash, uint256 index) internal pure returns (bytes32) { ⋮---- /** * @notice Derives a key from a verification type and a name hash. * @param verificationType The verification type. * @param nameHash The name hash. * @return The key. * @dev It can be used, e.g., to store some data dependent on the verification type like number of validators * with a possibility to have multiple verification types simultaneously without collisions. */ function getKey(uint32 verificationType, bytes32 nameHash) internal pure returns (bytes32) { ⋮---- /** * @notice Derives a key from a verification type, a key tag and a name hash. * @param verificationType The verification type. * @param keyTag The key tag. * @param nameHash The name hash. * @return The key. * @dev It can be used, e.g., to store some data dependent on the verification type and the key tag like quorum threshold * with a possibility to have multiple verification types simultaneously without collisions. */ function getKey(uint32 verificationType, uint8 keyTag, bytes32 nameHash) internal pure returns (bytes32) { ⋮---- /** * @notice Derives a key from a verification type, a key tag, a name hash and an index. * @param verificationType The verification type. * @param keyTag The key tag. * @param nameHash The name hash. * @param index The index. * @return The key. * @dev It can be used, e.g., to store some data dependent on the verification type and the key tag, * which needs more than 1 storage slot (32 bytes), like aggregated BLS12-381 public key * with a possibility to have multiple verification types simultaneously without collisions. */ function getKey(uint32 verificationType, uint8 keyTag, bytes32 nameHash, uint256 index) ```` ## File: src/modules/settlement/sig-verifiers/SigVerifierBlsBn254Simple.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {BN254} from "../../../libraries/utils/BN254.sol"; import {ExtraDataStorageHelper} from "./libraries/ExtraDataStorageHelper.sol"; import {KeyBlsBn254} from "../../../libraries/keys/KeyBlsBn254.sol"; import {KeyTags} from "../../../libraries/utils/KeyTags.sol"; import {SigBlsBn254} from "../../../libraries/sigs/SigBlsBn254.sol"; ⋮---- import {ISettlement} from "../../../interfaces/modules/settlement/ISettlement.sol"; import { ISigVerifierBlsBn254Simple } from "../../../interfaces/modules/settlement/sig-verifiers/ISigVerifierBlsBn254Simple.sol"; import {ISigVerifier} from "../../../interfaces/modules/settlement/sig-verifiers/ISigVerifier.sol"; import {KEY_TYPE_BLS_BN254} from "../../../interfaces/modules/key-registry/IKeyRegistry.sol"; ⋮---- /// @title SigVerifierBlsBn254Simple /// @notice Contract for verifying validator's set attestations based on BLS signatures on the BN254 curve /// by decompressing the whole validator set on-chain. contract SigVerifierBlsBn254Simple is ISigVerifierBlsBn254Simple { ⋮---- /// @inheritdoc ISigVerifier ⋮---- /// @inheritdoc ISigVerifierBlsBn254Simple ⋮---- function verifyQuorumSig( ⋮---- // Proof Structure // 0 : 64 - G1 aggregated signature // 64 : 192 - G2 aggregated public key // 192 : 224+validatorsData.length*64 - encoded data of all active validators for a given `keyTag` // 192 : 224 - number of validators // 224 : 224+validatorsData.length*64 - (bytes32 keySerialized,uint256 votingPower)[] // 224+validatorsData.length*64 (nonSignersOffset) : nonSignersOffset+nonSigners.length*2 - encoded array of 2 bytes non-signer indices (from validatorsData) // nonSignersOffset : nonSignersOffset+nonSigners.length*2 - uint16[] ⋮---- // assuming that the validator set, and, hence, total voting power, were properly committed, // so that the sum of the non-signers' voting powers cannot be greater than the total voting power, // and, hence, cannot overflow ```` ## File: src/modules/settlement/sig-verifiers/SigVerifierBlsBn254ZK.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {BN254} from "../../../libraries/utils/BN254.sol"; import {ExtraDataStorageHelper} from "./libraries/ExtraDataStorageHelper.sol"; import {KeyTags} from "../../../libraries/utils/KeyTags.sol"; ⋮---- import {ISettlement} from "../../../interfaces/modules/settlement/ISettlement.sol"; import {ISigVerifierBlsBn254ZK} from "../../../interfaces/modules/settlement/sig-verifiers/ISigVerifierBlsBn254ZK.sol"; import {ISigVerifier} from "../../../interfaces/modules/settlement/sig-verifiers/ISigVerifier.sol"; import {IVerifier} from "../../../interfaces/modules/settlement/sig-verifiers/zk/IVerifier.sol"; import {KEY_TYPE_BLS_BN254} from "../../../interfaces/modules/key-registry/IKeyRegistry.sol"; ⋮---- /// @title SigVerifierBlsBn254ZK /// @notice Contract for verifying validator's set attestations based on BLS signatures on the BN254 curve /// by decompressing the whole validator set using ZK. contract SigVerifierBlsBn254ZK is ISigVerifierBlsBn254ZK { ⋮---- /// @inheritdoc ISigVerifier ⋮---- /// @inheritdoc ISigVerifierBlsBn254ZK ⋮---- function verifyQuorumSig( ⋮---- // Proof Structure // 0 : 256 - ZK proof (uint256[8]) // 256 : 320 - commitments (uint256[2]) // 320 : 384 - commitmentPok (uint256[2]) // 384 : 416 - voting power of signers (uint256) ⋮---- function _getVerifier(uint256 totalActiveValidators) internal view returns (address) { ```` ## File: src/modules/settlement/Settlement.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {NetworkManager} from "../base/NetworkManager.sol"; import {OzEIP712} from "../base/OzEIP712.sol"; import {PermissionManager} from "../base/PermissionManager.sol"; ⋮---- import {Checkpoints} from "../../libraries/structs/Checkpoints.sol"; import {KeyTags} from "../../libraries/utils/KeyTags.sol"; ⋮---- import {ISettlement} from "../../interfaces/modules/settlement/ISettlement.sol"; import {ISigVerifier} from "../../interfaces/modules/settlement/sig-verifiers/ISigVerifier.sol"; ⋮---- /// @title Settlement /// @notice Contract for processing the validator sets through epochs and allowing verifying their attestations on-chain. abstract contract Settlement is NetworkManager, OzEIP712, PermissionManager, ISettlement { ⋮---- /// @inheritdoc ISettlement ⋮---- // keccak256(abi.encode(uint256(keccak256("symbiotic.storage.Settlement")) - 1)) & ~bytes32(uint256(0xff)) ⋮---- function _getSettlementStorage() internal pure returns (SettlementStorage storage $) { ⋮---- function __Settlement_init(SettlementInitParams memory settlementInitParams) internal virtual onlyInitializing { ⋮---- function getSigVerifierAt(uint48 epoch, bytes memory hint) public view virtual returns (address) { ⋮---- function getSigVerifier() public view virtual returns (address) { ⋮---- function getLastCommittedHeaderEpoch() public view virtual returns (uint48) { ⋮---- function isValSetHeaderCommittedAt(uint48 epoch) public view virtual returns (bool) { ⋮---- function getValSetHeaderHashAt(uint48 epoch) public view returns (bytes32) { ⋮---- function getValSetHeaderHash() public view returns (bytes32) { ⋮---- function getValSetHeaderAt(uint48 epoch) public view virtual returns (ValSetHeader memory) { ⋮---- function getValSetHeader() public view virtual returns (ValSetHeader memory header) { ⋮---- function getVersionFromValSetHeaderAt(uint48 epoch) public view virtual returns (uint8) { ⋮---- function getVersionFromValSetHeader() public view virtual returns (uint8) { ⋮---- function getRequiredKeyTagFromValSetHeaderAt(uint48 epoch) public view virtual returns (uint8) { ⋮---- function getRequiredKeyTagFromValSetHeader() public view virtual returns (uint8) { ⋮---- function getCaptureTimestampFromValSetHeaderAt(uint48 epoch) public view virtual returns (uint48) { ⋮---- function getCaptureTimestampFromValSetHeader() public view virtual returns (uint48) { ⋮---- function getQuorumThresholdFromValSetHeaderAt(uint48 epoch) public view virtual returns (uint256) { ⋮---- function getQuorumThresholdFromValSetHeader() public view virtual returns (uint256) { ⋮---- function getTotalVotingPowerFromValSetHeaderAt(uint48 epoch) public view virtual returns (uint256) { ⋮---- function getTotalVotingPowerFromValSetHeader() public view virtual returns (uint256) { ⋮---- function getValidatorsSszMRootFromValSetHeaderAt(uint48 epoch) public view virtual returns (bytes32) { ⋮---- function getValidatorsSszMRootFromValSetHeader() public view virtual returns (bytes32) { ⋮---- function getExtraDataAt(uint48 epoch, bytes32 key) public view virtual returns (bytes32) { ⋮---- function getExtraData(bytes32 key) public view virtual returns (bytes32) { ⋮---- function verifyQuorumSigAt( ⋮---- function verifyQuorumSig(bytes memory message, uint8 keyTag, uint256 quorumThreshold, bytes calldata proof) ⋮---- function setSigVerifier(address sigVerifier) public virtual checkPermission { ⋮---- function setGenesis(ValSetHeader calldata valSetHeader, ExtraData[] calldata extraData) ⋮---- function commitValSetHeader(ValSetHeader calldata header, ExtraData[] calldata extraData, bytes calldata proof) ⋮---- function _setValSetHeader(ValSetHeader calldata header, ExtraData[] calldata extraData) internal virtual { ⋮---- function _getCurrentValue(Checkpoints.Trace208 storage trace, uint48 currentTimepoint) ```` ## File: src/modules/valset-driver/EpochManager.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {PermissionManager} from "../base/PermissionManager.sol"; ⋮---- import {Checkpoints} from "../../libraries/structs/Checkpoints.sol"; ⋮---- import {IEpochManager} from "../../interfaces/modules/valset-driver/IEpochManager.sol"; ⋮---- /// @title EpochManager /// @notice Contract for managing the epochs state machine. abstract contract EpochManager is PermissionManager, IEpochManager { ⋮---- // keccak256(abi.encode(uint256(keccak256("symbiotic.storage.EpochManager")) - 1)) & ~bytes32(uint256(0xff)) ⋮---- function _getEpochManagerStorage() internal pure returns (EpochManagerStorage storage $) { ⋮---- function __EpochManager_init(EpochManagerInitParams memory initParams) internal virtual onlyInitializing { ⋮---- /// @inheritdoc IEpochManager function getCurrentEpoch() public view virtual returns (uint48) { ⋮---- function getCurrentEpochDuration() public view virtual returns (uint48 epochDuration) { ⋮---- function getCurrentEpochStart() public view virtual returns (uint48) { ⋮---- function getNextEpoch() public view virtual returns (uint48) { ⋮---- function getNextEpochDuration() public view virtual returns (uint48) { ⋮---- function getNextEpochStart() public view virtual returns (uint48) { ⋮---- function getEpochIndex(uint48 timestamp) public view virtual returns (uint48) { ⋮---- function getEpochDuration(uint48 epoch) public view virtual returns (uint48 epochDuration) { ⋮---- function getEpochStart(uint48 epoch) public view virtual returns (uint48) { ⋮---- function setEpochDuration(uint48 epochDuration) public virtual checkPermission { ⋮---- function _setEpochDuration(uint48 epochDuration) internal virtual { ⋮---- function _setEpochDuration(uint48 epochDuration, uint48 epochDurationTimestamp, uint48 epochDurationIndex) ⋮---- function _getEpochDurationDataByTimestamp(uint48 timestamp) internal view virtual returns (uint48, uint48, uint48) { ⋮---- function _getEpochDurationDataByIndex(uint48 index) internal view virtual returns (uint48, uint48, uint48) { ⋮---- function _getCurrentEpochDurationData() internal view virtual returns (uint48, uint48, uint48) { ⋮---- function _getFirstEpochDurationData() internal view virtual returns (uint48, uint48, uint48) { ⋮---- function _serializeEpochDurationData( ⋮---- function _deserializeEpochDurationData(uint208 epochDurationData) ⋮---- function _getCurrentValue(Checkpoints.Trace208 storage trace, uint48 currentTimepoint) ```` ## File: src/modules/valset-driver/ValSetDriver.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {EpochManager} from "./EpochManager.sol"; import {NetworkManager} from "../base/NetworkManager.sol"; ⋮---- import {Checkpoints} from "../../libraries/structs/Checkpoints.sol"; import {KeyTags} from "../../libraries/utils/KeyTags.sol"; import {PersistentSet} from "../../libraries/structs/PersistentSet.sol"; ⋮---- import {IValSetDriver} from "../../interfaces/modules/valset-driver/IValSetDriver.sol"; ⋮---- import {MulticallUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/MulticallUpgradeable.sol"; ⋮---- /// @title ValSetDriver /// @notice Contract for providing various configs and driving data for off-chain services. abstract contract ValSetDriver is EpochManager, NetworkManager, MulticallUpgradeable, IValSetDriver { ⋮---- /// @inheritdoc IValSetDriver ⋮---- // keccak256(abi.encode(uint256(keccak256("symbiotic.storage.ValSetDriver")) - 1)) & ~bytes32(uint256(0xff)) ⋮---- function _getValSetDriverStorage() internal pure returns (ValSetDriverStorage storage $) { ⋮---- function __ValSetDriver_init(ValSetDriverInitParams memory valSetDriverInitParams) ⋮---- function getConfigAt(uint48 timestamp) public view virtual returns (Config memory) { ⋮---- function getConfig() public view virtual returns (Config memory) { ⋮---- function getNumAggregatorsAt(uint48 timestamp) public view virtual returns (uint208) { ⋮---- function getNumAggregators() public view virtual returns (uint208) { ⋮---- function getNumCommittersAt(uint48 timestamp) public view virtual returns (uint208) { ⋮---- function getNumCommitters() public view virtual returns (uint208) { ⋮---- function isVotingPowerProviderRegisteredAt(CrossChainAddress memory votingPowerProvider, uint48 timestamp) ⋮---- function isVotingPowerProviderRegistered(CrossChainAddress memory votingPowerProvider) ⋮---- function getVotingPowerProvidersAt(uint48 timestamp) ⋮---- function getVotingPowerProviders() public view virtual returns (CrossChainAddress[] memory votingPowerProviders) { ⋮---- function getKeysProviderAt(uint48 timestamp) public view virtual returns (CrossChainAddress memory) { ⋮---- function getKeysProvider() public view virtual returns (CrossChainAddress memory) { ⋮---- function isSettlementRegisteredAt(CrossChainAddress memory settlement, uint48 timestamp) ⋮---- function isSettlementRegistered(CrossChainAddress memory settlement) public view virtual returns (bool) { ⋮---- function getSettlementsAt(uint48 timestamp) public view virtual returns (CrossChainAddress[] memory settlements) { ⋮---- function getSettlements() public view virtual returns (CrossChainAddress[] memory settlements) { ⋮---- function getMaxVotingPowerAt(uint48 timestamp) public view virtual returns (uint256) { ⋮---- function getMaxVotingPower() public view virtual returns (uint256) { ⋮---- function getMinInclusionVotingPowerAt(uint48 timestamp) public view virtual returns (uint256) { ⋮---- function getMinInclusionVotingPower() public view virtual returns (uint256) { ⋮---- function getMaxValidatorsCountAt(uint48 timestamp) public view virtual returns (uint208) { ⋮---- function getMaxValidatorsCount() public view virtual returns (uint208) { ⋮---- function getRequiredKeyTagsAt(uint48 timestamp) public view virtual returns (uint8[] memory requiredKeyTags) { ⋮---- function getRequiredKeyTags() public view virtual returns (uint8[] memory requiredKeyTags) { ⋮---- function isQuorumThresholdRegisteredAt(QuorumThreshold memory quorumThreshold, uint48 timestamp) ⋮---- function isQuorumThresholdRegistered(QuorumThreshold memory quorumThreshold) public view virtual returns (bool) { ⋮---- function getQuorumThresholdsAt(uint48 timestamp) ⋮---- function getQuorumThresholds() public view virtual returns (QuorumThreshold[] memory quorumThresholds) { ⋮---- function getRequiredHeaderKeyTagAt(uint48 timestamp) public view virtual returns (uint8) { ⋮---- function getRequiredHeaderKeyTag() public view virtual returns (uint8) { ⋮---- function getVerificationTypeAt(uint48 timestamp) public view virtual returns (uint32) { ⋮---- function getVerificationType() public view virtual returns (uint32) { ⋮---- function setNumAggregators(uint208 numAggregators) public virtual checkPermission { ⋮---- function setNumCommitters(uint208 numCommitters) public virtual checkPermission { ⋮---- function addVotingPowerProvider(CrossChainAddress memory votingPowerProvider) public virtual checkPermission { ⋮---- function removeVotingPowerProvider(CrossChainAddress memory votingPowerProvider) public virtual checkPermission { ⋮---- function setKeysProvider(CrossChainAddress memory keysProvider) public virtual checkPermission { ⋮---- function addSettlement(CrossChainAddress memory settlement) public virtual checkPermission { ⋮---- function removeSettlement(CrossChainAddress memory settlement) public virtual checkPermission { ⋮---- function setMaxVotingPower(uint256 maxVotingPower) public virtual checkPermission { ⋮---- function setMinInclusionVotingPower(uint256 minInclusionVotingPower) public virtual checkPermission { ⋮---- function setMaxValidatorsCount(uint208 maxValidatorsCount) public virtual checkPermission { ⋮---- function setRequiredKeyTags(uint8[] memory requiredKeyTags) public virtual checkPermission { ⋮---- function addQuorumThreshold(QuorumThreshold memory quorumThreshold) public virtual checkPermission { ⋮---- function removeQuorumThreshold(QuorumThreshold memory quorumThreshold) public virtual checkPermission { ⋮---- function setRequiredHeaderKeyTag(uint8 requiredHeaderKeyTag) public virtual checkPermission { ⋮---- function setVerificationType(uint32 verificationType) public virtual checkPermission { ⋮---- function _setNumAggregators(uint208 numAggregators) internal virtual { ⋮---- function _setNumCommitters(uint208 numCommitters) internal virtual { ⋮---- function _addVotingPowerProvider(CrossChainAddress memory votingPowerProvider) internal virtual { ⋮---- function _removeVotingPowerProvider(CrossChainAddress memory votingPowerProvider) internal virtual { ⋮---- function _setKeysProvider(CrossChainAddress memory keysProvider) internal virtual { ⋮---- function _addSettlement(CrossChainAddress memory settlement) internal virtual { ⋮---- function _removeSettlement(CrossChainAddress memory settlement) internal virtual { ⋮---- function _setMaxVotingPower(uint256 maxVotingPower) internal virtual { ⋮---- function _setMinInclusionVotingPower(uint256 minInclusionVotingPower) internal virtual { ⋮---- function _setMaxValidatorsCount(uint208 maxValidatorsCount) internal virtual { ⋮---- function _setRequiredKeyTags(uint8[] memory requiredKeyTags) internal virtual { ⋮---- function _addQuorumThreshold(QuorumThreshold memory quorumThreshold) internal virtual { ⋮---- function _removeQuorumThreshold(QuorumThreshold memory quorumThreshold) internal virtual { ⋮---- function _setRequiredHeaderKeyTag(uint8 requiredHeaderKeyTag) internal virtual { ⋮---- function _setVerificationType(uint32 verificationType) internal virtual { ⋮---- function _validateCrossChainAddress(CrossChainAddress memory crossChainAddress) internal pure virtual { ⋮---- function _serializeCrossChainAddress(CrossChainAddress memory crossChainAddress) ⋮---- function _deserializeCrossChainAddress(bytes32 compressedAddress) ⋮---- function _serializeQuorumThreshold(QuorumThreshold memory quorumThreshold) internal pure virtual returns (bytes32) { ⋮---- function _deserializeQuorumThreshold(bytes32 compressedQuorumThreshold) ```` ## File: src/modules/voting-power/base/VotingPowerCalcManager.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {IVotingPowerCalcManager} from "../../../interfaces/modules/voting-power/base/IVotingPowerCalcManager.sol"; ⋮---- import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; ⋮---- /// @title VotingPowerCalcManager /// @notice Base contract for voting power calculations. abstract contract VotingPowerCalcManager is Initializable, IVotingPowerCalcManager { /// @inheritdoc IVotingPowerCalcManager function stakeToVotingPowerAt(address vault, uint256 stake, bytes memory extraData, uint48 timestamp) ⋮---- function stakeToVotingPower(address vault, uint256 stake, bytes memory extraData) ```` ## File: src/modules/voting-power/common/voting-power-calc/libraries/ChainlinkPriceFeed.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {Scaler} from "../../../../../libraries/utils/Scaler.sol"; ⋮---- import { AggregatorV3Interface } from "../../../../../interfaces/modules/voting-power/common/voting-power-calc/libraries/AggregatorV3Interface.sol"; ⋮---- import {Math} from "@openzeppelin/contracts/utils/math/Math.sol"; ⋮---- /** * @title ChainlinkPriceFeed * @notice Library for fetching prices from Chainlink in a historical manner. * @dev It supports arbitrary aggregators' decimals, an arbitrary number of aggregator hops, and a possibility to invert prices. * It supports most of Chainlink's aggregators through the whole history except the oldest ones not supporting `getRoundData()`. */ ⋮---- /** * @notice Reverts when the length is zero. */ ⋮---- /** * @notice Reverts when the lengths are not equal. */ ⋮---- /** * @notice The offset for the phase in the roundId. */ ⋮---- /** * @notice The number of decimals to normalize the price to. */ ⋮---- /** * @notice The data for a round. * @param roundId The roundId (a concatenation of the phase and the original id). * @param answer The price. * @param startedAt The startedAt (deprecated). * @param updatedAt The updatedAt (the timestamp when the round was updated). * @param answeredInRound The answeredInRound (deprecated). */ ⋮---- /** * @notice Returns the price at a given timestamp using one or two hops. * @param aggregators The price aggregators. * @param timestamp The timestamp. * @param inverts If to invert the fetched prices. * @param stalenessDurations The staleness durations (if too much time passed since the last update). * @return The price. * @dev Returns zero if the data is stale or unavailable. * The price is normalized to the 18 decimals. */ function getPriceAt( ⋮---- /** * @notice Returns the price at a given timestamp using one or more hops. * @param aggregators The price aggregators. * @param timestamp The timestamp. * @param inverts If to invert the fetched prices. * @param stalenessDurations The staleness durations (if too much time passed since the last update). * @return The price. * @dev Returns zero if the data is stale or unavailable. * The price is normalized to the 18 decimals. */ ⋮---- /** * @notice Returns the price at a given timestamp. * @param aggregator The price aggregator. * @param timestamp The timestamp. * @param invert If to invert the fetched price. * @param stalenessDuration The staleness duration (if too much time passed since the last update). * @return The price. * @dev Returns zero if the data is stale or unavailable. * The price is normalized to the 18 decimals. */ function getPriceAt(address aggregator, uint48 timestamp, bool invert, uint48 stalenessDuration) ⋮---- /** * @notice Returns the price data at a given timestamp. * @param aggregator The price aggregator. * @param timestamp The timestamp. * @param invert If to invert the fetched price. * @param stalenessDuration The staleness duration (if too much time passed since the last update). * @return success If the data is available and not stale. * @return roundData The round data. * @dev The answer is normalized to the 18 decimals. */ function getPriceDataAt(address aggregator, uint48 timestamp, bool invert, uint48 stalenessDuration) ⋮---- /** * @notice Returns the round data at a given timestamp. * @param aggregator The price aggregator. * @param timestamp The timestamp. * @return success If the data is available. * @return roundData The round data. */ function getRoundDataAt(address aggregator, uint48 timestamp) ⋮---- // determine the latest phaseId ⋮---- // find a phaseId which contains a needed aggregatorRoundId given the timestamp ⋮---- // find the upper bound for further binary search ⋮---- // find the biggest roundId which which is less than or equal to the timestamp ⋮---- /** * @notice Returns the round data at a given roundId. * @param aggregator The price aggregator. * @param roundId The roundId. * @return success If the data is available. * @return roundData The round data. */ function getRoundData(address aggregator, uint80 roundId) public view returns (bool, RoundData memory roundData) { ⋮---- /** * @notice Returns the latest price using one or two hops. * @param aggregators The price aggregators. * @param inverts If to invert the fetched prices. * @param stalenessDurations The staleness durations (if too much time passed since the last update). * @return The price. * @dev Returns zero if the data is stale or unavailable. * The price is normalized to the 18 decimals. */ function getLatestPrice(address[2] memory aggregators, bool[2] memory inverts, uint48[2] memory stalenessDurations) ⋮---- /** * @notice Returns the latest price using one or more hops. * @param aggregators The price aggregators. * @param inverts If to invert the fetched prices. * @param stalenessDurations The staleness durations (if too much time passed since the last update). * @return The price. * @dev Returns zero if the data is stale or unavailable. * The price is normalized to the 18 decimals. */ function getLatestPrice(address[] memory aggregators, bool[] memory inverts, uint48[] memory stalenessDurations) ⋮---- /** * @notice Returns the latest price. * @param aggregator The price aggregator. * @param invert If to invert the fetched price. * @param stalenessDuration The staleness duration (if too much time passed since the last update). * @return The price. * @dev Returns zero if the data is stale or unavailable. * The price is normalized to the 18 decimals. */ function getLatestPrice(address aggregator, bool invert, uint48 stalenessDuration) public view returns (uint256) { ⋮---- /** * @notice Returns the latest price data. * @param aggregator The price aggregator. * @param invert If to invert the fetched price. * @param stalenessDuration The staleness duration (if too much time passed since the last update). * @return success If the data is available and not stale. * @return roundData The round data. * @dev The answer is normalized to the 18 decimals. */ function getLatestPriceData(address aggregator, bool invert, uint48 stalenessDuration) ⋮---- /** * @notice Returns the latest round data. * @param aggregator The price aggregator. * @return success If the data is available. * @return roundData The round data. */ function getLatestRoundData(address aggregator) public view returns (bool, RoundData memory roundData) { ⋮---- /** * @notice Returns if the round data is stale. * @param timestamp The timestamp. * @param roundData The round data. * @param stalenessDuration The staleness duration (if too much time passed since the last update). * @return If the round data is stale. */ function isStale(uint48 timestamp, RoundData memory roundData, uint48 stalenessDuration) ⋮---- function serializeIds(uint16 phase, uint64 originalId) public pure returns (uint80) { ⋮---- function deserializeIds(uint80 roundId) public pure returns (uint16, uint64) { ⋮---- function toDynamicArrays( ```` ## File: src/modules/voting-power/common/voting-power-calc/EqualStakeVPCalc.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {VotingPowerCalcManager} from "../../base/VotingPowerCalcManager.sol"; ⋮---- import { IEqualStakeVPCalc } from "../../../../interfaces/modules/voting-power/common/voting-power-calc/IEqualStakeVPCalc.sol"; import {IVotingPowerCalcManager} from "../../../../interfaces/modules/voting-power/base/IVotingPowerCalcManager.sol"; ⋮---- /// @title EqualStakeVPCalc /// @notice Contract for calculating the voting power, making it equal to the stake. abstract contract EqualStakeVPCalc is VotingPowerCalcManager, IEqualStakeVPCalc { function __EqualStakeVPCalc_init() internal virtual onlyInitializing {} ⋮---- /// @inheritdoc IVotingPowerCalcManager function stakeToVotingPowerAt( address, /* vault */ ⋮---- bytes memory, /* extraData */ uint48 /* timestamp */ ⋮---- function stakeToVotingPower( ⋮---- bytes memory /* extraData */ ```` ## File: src/modules/voting-power/common/voting-power-calc/NormalizedTokenDecimalsVPCalc.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {EqualStakeVPCalc} from "./EqualStakeVPCalc.sol"; ⋮---- import {Scaler} from "../../../../libraries/utils/Scaler.sol"; ⋮---- import { INormalizedTokenDecimalsVPCalc } from "../../../../interfaces/modules/voting-power/common/voting-power-calc/INormalizedTokenDecimalsVPCalc.sol"; import {IVotingPowerCalcManager} from "../../../../interfaces/modules/voting-power/base/IVotingPowerCalcManager.sol"; ⋮---- import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"; ⋮---- import {IVault} from "@symbioticfi/core/src/interfaces/vault/IVault.sol"; ⋮---- /// @title NormalizedTokenDecimalsVPCalc /// @notice Contract for calculating the voting power, normalizing the stakes in different tokens to the same decimals. abstract contract NormalizedTokenDecimalsVPCalc is EqualStakeVPCalc, INormalizedTokenDecimalsVPCalc { ⋮---- function __NormalizedTokenDecimalsVPCalc_init() internal virtual onlyInitializing {} ⋮---- /// @inheritdoc IVotingPowerCalcManager function stakeToVotingPowerAt(address vault, uint256 stake, bytes memory extraData, uint48 timestamp) ⋮---- function stakeToVotingPower(address vault, uint256 stake, bytes memory extraData) ⋮---- function _getCollateral(address vault) internal view virtual returns (address) { ⋮---- function _normalizeVaultTokenDecimals(address vault, uint256 votingPower) internal view virtual returns (uint256) { ```` ## File: src/modules/voting-power/common/voting-power-calc/PricedTokensChainlinkVPCalc.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {NormalizedTokenDecimalsVPCalc} from "./NormalizedTokenDecimalsVPCalc.sol"; import {PermissionManager} from "../../../base/PermissionManager.sol"; ⋮---- import {ChainlinkPriceFeed} from "./libraries/ChainlinkPriceFeed.sol"; import {Checkpoints} from "../../../../libraries/structs/Checkpoints.sol"; ⋮---- import { IPricedTokensChainlinkVPCalc } from "../../../../interfaces/modules/voting-power/common/voting-power-calc/IPricedTokensChainlinkVPCalc.sol"; import {IVotingPowerCalcManager} from "../../../../interfaces/modules/voting-power/base/IVotingPowerCalcManager.sol"; ⋮---- /// @title PricedTokensChainlinkVPCalc /// @notice Contract for calculating the voting power, pricing the tokens using Chainlink. abstract contract PricedTokensChainlinkVPCalc is ⋮---- // keccak256(abi.encode(uint256(keccak256("symbiotic.storage.PricedTokensChainlinkVPCalc")) - 1)) & ~bytes32(uint256(0xff)) ⋮---- function _getPricedTokensChainlinkVPCalcStorage() ⋮---- function __PricedTokensChainlinkVPCalc_init() internal virtual onlyInitializing {} ⋮---- /// @inheritdoc IPricedTokensChainlinkVPCalc function getTokenHopsAt(address token, uint48 timestamp) ⋮---- function getTokenHops(address token) ⋮---- function getTokenPriceAt(address token, uint48 timestamp) public view virtual override returns (uint256) { ⋮---- function getTokenPrice(address token) public view virtual override returns (uint256) { ⋮---- /// @inheritdoc IVotingPowerCalcManager function stakeToVotingPowerAt(address vault, uint256 stake, bytes memory extraData, uint48 timestamp) ⋮---- function stakeToVotingPower(address vault, uint256 stake, bytes memory extraData) ⋮---- function setTokenHops( ⋮---- function _setTokenHops( ⋮---- function _serializeHop(address aggregator, bool invert, uint48 stalenessDuration) ⋮---- function _serializeHops(address[2] memory aggregators, bool[2] memory inverts, uint48[2] memory stalenessDurations) ⋮---- function _deserializeHop(uint256 hop) ⋮---- function _deserializeHops(uint256[2] memory hops) ```` ## File: src/modules/voting-power/common/voting-power-calc/WeightedTokensVPCalc.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {NormalizedTokenDecimalsVPCalc} from "./NormalizedTokenDecimalsVPCalc.sol"; import {PermissionManager} from "../../../base/PermissionManager.sol"; ⋮---- import {Checkpoints} from "../../../../libraries/structs/Checkpoints.sol"; ⋮---- import {IVotingPowerCalcManager} from "../../../../interfaces/modules/voting-power/base/IVotingPowerCalcManager.sol"; import { IWeightedTokensVPCalc } from "../../../../interfaces/modules/voting-power/common/voting-power-calc/IWeightedTokensVPCalc.sol"; ⋮---- /// @title WeightedTokensVPCalc /// @notice Contract for calculating the voting power, weighting the tokens. abstract contract WeightedTokensVPCalc is NormalizedTokenDecimalsVPCalc, PermissionManager, IWeightedTokensVPCalc { ⋮---- // keccak256(abi.encode(uint256(keccak256("symbiotic.storage.WeightedTokensVPCalc")) - 1)) & ~bytes32(uint256(0xff)) ⋮---- function _getWeightedTokensVPCalcStorage() internal pure returns (WeightedTokensVPCalcStorage storage $) { ⋮---- function __WeightedTokensVPCalc_init() internal virtual onlyInitializing {} ⋮---- /// @inheritdoc IWeightedTokensVPCalc function getTokenWeightAt(address token, uint48 timestamp) public view virtual returns (uint208) { ⋮---- function getTokenWeight(address token) public view virtual returns (uint208) { ⋮---- /// @inheritdoc IVotingPowerCalcManager function stakeToVotingPowerAt(address vault, uint256 stake, bytes memory extraData, uint48 timestamp) ⋮---- function stakeToVotingPower(address vault, uint256 stake, bytes memory extraData) ⋮---- function setTokenWeight(address token, uint208 weight) public virtual checkPermission { ⋮---- function _setTokenWeight(address token, uint208 weight) internal virtual { ```` ## File: src/modules/voting-power/common/voting-power-calc/WeightedVaultsVPCalc.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {EqualStakeVPCalc} from "./EqualStakeVPCalc.sol"; import {PermissionManager} from "../../../base/PermissionManager.sol"; ⋮---- import {Checkpoints} from "../../../../libraries/structs/Checkpoints.sol"; ⋮---- import {IVotingPowerCalcManager} from "../../../../interfaces/modules/voting-power/base/IVotingPowerCalcManager.sol"; import { IWeightedVaultsVPCalc } from "../../../../interfaces/modules/voting-power/common/voting-power-calc/IWeightedVaultsVPCalc.sol"; ⋮---- /// @title WeightedVaultsVPCalc /// @notice Contract for calculating the voting power, weighting the vaults. abstract contract WeightedVaultsVPCalc is EqualStakeVPCalc, PermissionManager, IWeightedVaultsVPCalc { ⋮---- // keccak256(abi.encode(uint256(keccak256("symbiotic.storage.WeightedVaultsVPCalc")) - 1)) & ~bytes32(uint256(0xff)) ⋮---- function _getWeightedVaultsVPCalcStorage() internal pure returns (WeightedVaultsVPCalcStorage storage $) { ⋮---- function __WeightedVaultsVPCalc_init() internal virtual onlyInitializing {} ⋮---- /// @inheritdoc IWeightedVaultsVPCalc function getVaultWeightAt(address vault, uint48 timestamp) public view virtual returns (uint208) { ⋮---- function getVaultWeight(address vault) public view virtual returns (uint208) { ⋮---- /// @inheritdoc IVotingPowerCalcManager function stakeToVotingPowerAt(address vault, uint256 stake, bytes memory extraData, uint48 timestamp) ⋮---- function stakeToVotingPower(address vault, uint256 stake, bytes memory extraData) ⋮---- function setVaultWeight(address vault, uint208 weight) public virtual checkPermission { ⋮---- function _setVaultWeight(address vault, uint208 weight) internal virtual { ```` ## File: src/modules/voting-power/extensions/logic/BaseRewardsLogic.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {IBaseRewards} from "../../../../interfaces/modules/voting-power/extensions/IBaseRewards.sol"; import {INetworkManager} from "../../../../interfaces/modules/base/INetworkManager.sol"; ⋮---- import {SafeERC20, IERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; ⋮---- import { IDefaultOperatorRewards } from "@symbioticfi/rewards/src/interfaces/defaultOperatorRewards/IDefaultOperatorRewards.sol"; import {IStakerRewards} from "@symbioticfi/rewards/src/interfaces/stakerRewards/IStakerRewards.sol"; ⋮---- /** * @title BaseRewardsLogic * @notice Library with bindings for distributing rewards to stakers and operators. */ ⋮---- /** * @notice Distributes staker rewards. * @param stakerRewards The address of the staker rewards contract. * @param token The address of the token to distribute. * @param amount The amount of the token to distribute. * @param data The data to pass to the staker rewards contract. * @dev The funds should be transferred to this contract separately before the call. */ function distributeStakerRewards(address stakerRewards, address token, uint256 amount, bytes memory data) public { ⋮---- /** * @notice Distributes operator rewards. * @param operatorRewards The address of the operator rewards contract. * @param token The address of the token to distribute. * @param amount The amount of the token to distribute. * @param root The root of the distribution Merkle tree. * @dev The funds should be transferred to this contract separately before the call. */ function distributeOperatorRewards(address operatorRewards, address token, uint256 amount, bytes32 root) public { ```` ## File: src/modules/voting-power/extensions/logic/BaseSlashingLogic.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {VotingPowerProviderLogic} from "../../logic/VotingPowerProviderLogic.sol"; ⋮---- import {IBaseSlashing} from "../../../../interfaces/modules/voting-power/extensions/IBaseSlashing.sol"; import {INetworkManager} from "../../../../interfaces/modules/base/INetworkManager.sol"; import {IVotingPowerProvider} from "../../../../interfaces/modules/voting-power/IVotingPowerProvider.sol"; ⋮---- import {IEntity} from "@symbioticfi/core/src/interfaces/common/IEntity.sol"; import {ISlasher as IInstantSlasher} from "@symbioticfi/core/src/interfaces/slasher/ISlasher.sol"; import {IVault} from "@symbioticfi/core/src/interfaces/vault/IVault.sol"; import {IVetoSlasher} from "@symbioticfi/core/src/interfaces/slasher/IVetoSlasher.sol"; ⋮---- /** * @title BaseSlashingLogic * @notice Library with bindings for slashing vaults. */ ⋮---- /** * @notice Slashes a vault. * @param timestamp The capture timestamp. * @param vault The address of the vault to slash. * @param operator The address of the operator to slash. * @param amount The amount of the tokens to slash. * @param hints The hints to optimize gas usage. * @dev It checks if the slashing was required at the given capture timestamp, * and if the slashing request is not stale regarding set `minEpochDuration`. */ function slashVault(uint48 timestamp, address vault, address operator, uint256 amount, bytes memory hints) ⋮---- /** * @notice Slashes a vault. * @param timestamp The capture timestamp. * @param slasher The address of the slasher. * @param operator The address of the operator to slash. * @param amount The amount of the tokens to slash. * @param hints The hints to optimize gas usage. * @dev It checks if the slashing was required at the given capture timestamp, * and if the slashing request is not stale regarding set `minEpochDuration`. */ function slash(uint48 timestamp, address slasher, address operator, uint256 amount, bytes memory hints) ⋮---- /** * @notice Slashes a vault. * @param timestamp The capture timestamp. * @param slasher The address of the slasher. * @param operator The address of the operator to slash. * @param amount The amount of the tokens to slash. * @param hints The hints to optimize gas usage. */ function slashUnsafe(uint48 timestamp, address slasher, address operator, uint256 amount, bytes memory hints) ⋮---- /** * @notice Executes a slash request. * @param vault The address of the vault. * @param slashIndex The index of the slash request. * @param hints The hints to optimize gas usage. * @dev It checks if the slashing request is not stale regarding set `minEpochDuration`. */ function executeSlashVault(address vault, uint256 slashIndex, bytes memory hints) ⋮---- /** * @notice Executes a slash request. * @param slasher The address of the slasher. * @param slashIndex The index of the slash request. * @param hints The hints to optimize gas usage. * @dev It checks if the slashing request is not stale regarding set `minEpochDuration`. */ function executeSlash(address slasher, uint256 slashIndex, bytes memory hints) ⋮---- /** * @notice Executes a slash request. * @param slasher The address of the slasher. * @param slashIndex The index of the slash request. * @param hints The hints to optimize gas usage. */ function executeSlashUnsafe(address slasher, uint256 slashIndex, bytes memory hints) ```` ## File: src/modules/voting-power/extensions/logic/OpNetVaultAutoDeployLogic.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {INetworkManager} from "../../../../interfaces/modules/base/INetworkManager.sol"; import {IOpNetVaultAutoDeploy} from "../../../../interfaces/modules/voting-power/extensions/IOpNetVaultAutoDeploy.sol"; import {IVotingPowerProvider} from "../../../../interfaces/modules/voting-power/IVotingPowerProvider.sol"; ⋮---- import {IBaseDelegator} from "@symbioticfi/core/src/interfaces/delegator/IBaseDelegator.sol"; import {IBaseSlasher} from "@symbioticfi/core/src/interfaces/slasher/IBaseSlasher.sol"; import { IOperatorNetworkSpecificDelegator } from "@symbioticfi/core/src/interfaces/delegator/IOperatorNetworkSpecificDelegator.sol"; import {ISlasher} from "@symbioticfi/core/src/interfaces/slasher/ISlasher.sol"; import {IVaultConfigurator} from "@symbioticfi/core/src/interfaces/IVaultConfigurator.sol"; import {IVaultTokenized} from "@symbioticfi/core/src/interfaces/vault/IVaultTokenized.sol"; import {IVault} from "@symbioticfi/core/src/interfaces/vault/IVault.sol"; import {IVetoSlasher} from "@symbioticfi/core/src/interfaces/slasher/IVetoSlasher.sol"; ⋮---- /** * @title OpNetVaultAutoDeployLogic * @notice Library for auto-deploying vaults. */ ⋮---- // keccak256(abi.encode(uint256(keccak256("symbiotic.storage.OpNetVaultAutoDeploy")) - 1)) & ~bytes32(uint256(0xff)) ⋮---- function _getOpNetVaultAutoDeployStorage() ⋮---- function initialize(IOpNetVaultAutoDeploy.OpNetVaultAutoDeployInitParams memory initParams) public { ⋮---- function isAutoDeployEnabled() public view returns (bool) { ⋮---- function getAutoDeployedVault(address operator) public view returns (address) { ⋮---- function getAutoDeployConfig() public view returns (IOpNetVaultAutoDeploy.AutoDeployConfig memory) { ⋮---- function isSetMaxNetworkLimitHookEnabled() public view returns (bool) { ⋮---- function setAutoDeployStatus(bool status) public { ⋮---- function setAutoDeployConfig(IOpNetVaultAutoDeploy.AutoDeployConfig memory config) public { ⋮---- function setSetMaxNetworkLimitHookStatus(bool status) public { ⋮---- function createVault(address operator) public returns (address vault, address delegator, address slasher) { ⋮---- function setAutoDeployedVault(address operator, address vault) public { ⋮---- function getVaultParams(IOpNetVaultAutoDeploy.AutoDeployConfig memory config) ⋮---- function getDelegatorParams( IOpNetVaultAutoDeploy.AutoDeployConfig memory, /* config */ ⋮---- function getSlasherParams(IOpNetVaultAutoDeploy.AutoDeployConfig memory config) ⋮---- function _validateConfig(IOpNetVaultAutoDeploy.AutoDeployConfig memory config) public view { ⋮---- // ------------------------------------ HELPER FUNCTIONS ------------------------------------ ⋮---- /** * @notice Gets the encoded base vault params. * @param params The vault params. * @return version The version of the vault. * @return params The encoded base vault params. */ function getVaultParams(IVault.InitParams memory params) public view returns (uint64, bytes memory) { ⋮---- /** * @notice Gets the encoded tokenized vault params. * @param baseParams The base vault params. * @param name The name of the tokenized vault. * @param symbol The symbol of the tokenized vault. * @return version The version of the vault. * @return params The encoded tokenized vault params. */ function getVaultTokenizedParams(IVault.InitParams memory baseParams, string memory name, string memory symbol) ⋮---- /** * @notice Gets the encoded operator-network-specific delegator params. * @param operator The operator. * @param defaultAdminRoleHolder The default admin role holder. * @param hook The hook. * @param hookSetRoleHolder The hook set role holder. * @return version The version of the delegator. * @return params The encoded operator-network-specific delegator params. */ function getOperatorNetworkSpecificDelegatorParams( ⋮---- /** * @notice Gets the encoded instant slasher params. * @param isBurnerHook If the burner needs a hook call. * @return version The version of the slasher. * @return params The encoded instant slasher params. */ function getSlasherParams(bool isBurnerHook) public view returns (uint64, bytes memory) { ⋮---- /** * @notice Gets the encoded veto slasher params. * @param isBurnerHook If the burner needs a hook call. * @param vetoDuration The veto duration. * @param resolverSetEpochsDelay The delay in epochs for a resolver to be set. * @return version The version of the slasher. * @return params The encoded veto slasher params. */ function getVetoSlasherParams(bool isBurnerHook, uint48 vetoDuration, uint256 resolverSetEpochsDelay) ⋮---- /** * @notice Creates a vault. * @param version The version of the vault. * @param owner The owner of the vault. * @param vaultParams The vault params. * @param delegatorIndex The index of the delegator. * @param delegatorParams The delegator params. * @param withSlasher If the vault should have a slasher. * @param slasherIndex The index of the slasher. * @param slasherParams The slasher params. * @return vault The address of the vault. * @return delegator The address of the delegator. * @return slasher The address of the slasher. */ function createVault( ```` ## File: src/modules/voting-power/extensions/BaseRewards.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {VotingPowerProvider} from "../VotingPowerProvider.sol"; ⋮---- import {BaseRewardsLogic} from "./logic/BaseRewardsLogic.sol"; ⋮---- import {IBaseRewards} from "../../../interfaces/modules/voting-power/extensions/IBaseRewards.sol"; ⋮---- /// @title BaseRewards /// @notice Base contract for distributing rewards to stakers and operators. abstract contract BaseRewards is VotingPowerProvider, IBaseRewards { modifier onlyRewarder() { ⋮---- function _checkRewarder() internal view virtual { ⋮---- // keccak256(abi.encode(uint256(keccak256("symbiotic.storage.BaseRewards")) - 1)) & ~bytes32(uint256(0xff)) ⋮---- function _getBaseRewardsStorage() internal pure returns (IBaseRewards.BaseRewardsStorage storage $) { ⋮---- function __BaseRewards_init(BaseRewardsInitParams memory initParams) internal virtual onlyInitializing { ⋮---- /// @inheritdoc IBaseRewards function getRewarder() public view virtual returns (address) { ⋮---- function distributeStakerRewards(address stakerRewards, address token, uint256 amount, bytes memory data) ⋮---- function distributeOperatorRewards(address operatorRewards, address token, uint256 amount, bytes32 root) ⋮---- function setRewarder(address rewarder) public virtual checkPermission { ⋮---- function _setRewarder(address rewarder) internal virtual { ```` ## File: src/modules/voting-power/extensions/BaseSlashing.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {VotingPowerProvider} from "../VotingPowerProvider.sol"; ⋮---- import {BaseSlashingLogic} from "./logic/BaseSlashingLogic.sol"; ⋮---- import {IBaseSlashing} from "../../../interfaces/modules/voting-power/extensions/IBaseSlashing.sol"; ⋮---- /// @title BaseSlashing /// @notice Base contract for slashing vaults. abstract contract BaseSlashing is VotingPowerProvider, IBaseSlashing { modifier onlySlasher() { ⋮---- function _checkSlasher() internal view virtual { ⋮---- // keccak256(abi.encode(uint256(keccak256("symbiotic.storage.BaseSlashing")) - 1)) & ~bytes32(uint256(0xff)) ⋮---- function _getBaseSlashingStorage() internal pure returns (IBaseSlashing.BaseSlashingStorage storage $) { ⋮---- function __BaseSlashing_init(BaseSlashingInitParams memory initParams) internal virtual onlyInitializing { ⋮---- /// @inheritdoc IBaseSlashing function getSlasher() public view virtual returns (address) { ⋮---- function slashVault(uint48 timestamp, address vault, address operator, uint256 amount, bytes memory hints) ⋮---- function executeSlashVault(address vault, uint256 slashIndex, bytes memory hints) ⋮---- function setSlasher(address slasher) public virtual checkPermission { ⋮---- function _setSlasher(address slasher) internal virtual { ```` ## File: src/modules/voting-power/extensions/MultiToken.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {VotingPowerProvider} from "../VotingPowerProvider.sol"; ⋮---- import {IMultiToken} from "../../../interfaces/modules/voting-power/extensions/IMultiToken.sol"; ⋮---- /// @title MultiToken /// @notice Contract for registering and unregistering multiple tokens. abstract contract MultiToken is VotingPowerProvider, IMultiToken { function __MultiToken_init() internal virtual onlyInitializing {} ⋮---- /// @inheritdoc IMultiToken function registerToken(address token) public virtual checkPermission { ⋮---- function unregisterToken(address token) public virtual checkPermission { ```` ## File: src/modules/voting-power/extensions/OperatorsBlacklist.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {VotingPowerProvider} from "../VotingPowerProvider.sol"; ⋮---- import {IOperatorsBlacklist} from "../../../interfaces/modules/voting-power/extensions/IOperatorsBlacklist.sol"; ⋮---- /// @title OperatorsBlacklist /// @notice Contract for blacklisting operators. abstract contract OperatorsBlacklist is VotingPowerProvider, IOperatorsBlacklist { // keccak256(abi.encode(uint256(keccak256("symbiotic.storage.OperatorsBlacklist")) - 1)) & ~bytes32(uint256(0xff)) ⋮---- function _getOperatorsBlacklistStorage() internal pure returns (OperatorsBlacklistStorage storage $) { ⋮---- function __OperatorsBlacklist_init() internal virtual onlyInitializing {} ⋮---- /// @inheritdoc IOperatorsBlacklist function isOperatorBlacklisted(address operator) public view virtual returns (bool) { ⋮---- function blacklistOperator(address operator) public virtual checkPermission { ⋮---- function unblacklistOperator(address operator) public virtual checkPermission { ⋮---- function _registerOperatorImpl(address operator) internal virtual override { ```` ## File: src/modules/voting-power/extensions/OperatorsJail.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {VotingPowerProvider} from "../VotingPowerProvider.sol"; ⋮---- import {IOperatorsJail} from "../../../interfaces/modules/voting-power/extensions/IOperatorsJail.sol"; ⋮---- /// @title OperatorsJail /// @notice Contract for jailing (unregistering and not allowing to register) operators for a given duration. abstract contract OperatorsJail is VotingPowerProvider, IOperatorsJail { // keccak256(abi.encode(uint256(keccak256("symbiotic.storage.OperatorsJail")) - 1)) & ~bytes32(uint256(0xff)) ⋮---- function _getOperatorsJailStorage() internal pure returns (OperatorsJailStorage storage $) { ⋮---- function __OperatorsJail_init() internal virtual onlyInitializing {} ⋮---- /// @inheritdoc IOperatorsJail function isOperatorJailed(address operator) public view virtual returns (bool) { ⋮---- function getOperatorJailedUntil(address operator) public view virtual returns (uint48) { ⋮---- function jailOperator(address operator, uint48 duration) public virtual checkPermission { ⋮---- function unjailOperator(address operator) public virtual checkPermission { ⋮---- function _registerOperatorImpl(address operator) internal virtual override { ```` ## File: src/modules/voting-power/extensions/OperatorsWhitelist.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {VotingPowerProvider} from "../VotingPowerProvider.sol"; ⋮---- import {IOperatorsWhitelist} from "../../../interfaces/modules/voting-power/extensions/IOperatorsWhitelist.sol"; ⋮---- /// @title OperatorsWhitelist /// @notice Contract for whitelisting operators. abstract contract OperatorsWhitelist is VotingPowerProvider, IOperatorsWhitelist { // keccak256(abi.encode(uint256(keccak256("symbiotic.storage.OperatorsWhitelist")) - 1)) & ~bytes32(uint256(0xff)) ⋮---- function _getOperatorsWhitelistStorage() internal pure returns (OperatorsWhitelistStorage storage $) { ⋮---- function __OperatorsWhitelist_init(OperatorsWhitelistInitParams memory initParams) ⋮---- /// @inheritdoc IOperatorsWhitelist function isWhitelistEnabled() public view virtual returns (bool) { ⋮---- function isOperatorWhitelisted(address operator) public view virtual returns (bool) { ⋮---- function setWhitelistStatus(bool status) public virtual checkPermission { ⋮---- function whitelistOperator(address operator) public virtual checkPermission { ⋮---- function unwhitelistOperator(address operator) public virtual checkPermission { ⋮---- function _registerOperatorImpl(address operator) internal virtual override { ⋮---- function _setWhitelistStatus(bool status) internal virtual { ```` ## File: src/modules/voting-power/extensions/OperatorVaults.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {VotingPowerProvider} from "../VotingPowerProvider.sol"; ⋮---- import {IOperatorVaults} from "../../../interfaces/modules/voting-power/extensions/IOperatorVaults.sol"; ⋮---- /// @title OperatorVaults /// @notice Contract for registering and unregistering operator vaults. abstract contract OperatorVaults is VotingPowerProvider, IOperatorVaults { function __OperatorVaults_init() internal virtual onlyInitializing {} ⋮---- /// @inheritdoc IOperatorVaults function registerOperatorVault(address operator, address vault) public virtual checkPermission { ⋮---- function unregisterOperatorVault(address operator, address vault) public virtual checkPermission { ⋮---- function unregisterOperatorVault(address vault) public virtual { ```` ## File: src/modules/voting-power/extensions/OpNetVaultAutoDeploy.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {VotingPowerProvider} from "../VotingPowerProvider.sol"; ⋮---- import {OpNetVaultAutoDeployLogic} from "./logic/OpNetVaultAutoDeployLogic.sol"; ⋮---- import {IOpNetVaultAutoDeploy} from "../../../interfaces/modules/voting-power/extensions/IOpNetVaultAutoDeploy.sol"; ⋮---- import {ISetMaxNetworkLimitHook} from "@symbioticfi/network/src/interfaces/ISetMaxNetworkLimitHook.sol"; ⋮---- /// @title OpNetVaultAutoDeploy /// @notice Contract for auto-deploying vaults for operators on their registration. abstract contract OpNetVaultAutoDeploy is VotingPowerProvider, IOpNetVaultAutoDeploy { /// @inheritdoc IOpNetVaultAutoDeploy ⋮---- /// @dev Must be called after __VotingPowerProvider_init(). function __OpNetVaultAutoDeploy_init(OpNetVaultAutoDeployInitParams memory initParams) ⋮---- function isAutoDeployEnabled() public view virtual returns (bool) { ⋮---- function getAutoDeployedVault(address operator) public view virtual returns (address) { ⋮---- function getAutoDeployConfig() public view virtual returns (AutoDeployConfig memory) { ⋮---- function isSetMaxNetworkLimitHookEnabled() public view virtual returns (bool) { ⋮---- function setAutoDeployStatus(bool status) public virtual checkPermission { ⋮---- function setAutoDeployConfig(AutoDeployConfig memory config) public virtual checkPermission { ⋮---- function setSetMaxNetworkLimitHookStatus(bool status) public virtual checkPermission { ⋮---- function _registerOperatorImpl(address operator) internal virtual override { ⋮---- function _unregisterOperatorVaultImpl(address operator, address vault) internal virtual override { ```` ## File: src/modules/voting-power/extensions/SharedVaults.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {VotingPowerProvider} from "../VotingPowerProvider.sol"; ⋮---- import {ISharedVaults} from "../../../interfaces/modules/voting-power/extensions/ISharedVaults.sol"; ⋮---- /// @title SharedVaults /// @notice Contract for registering and unregistering shared vaults. abstract contract SharedVaults is VotingPowerProvider, ISharedVaults { function __SharedVaults_init() internal virtual onlyInitializing {} ⋮---- /// @inheritdoc ISharedVaults function registerSharedVault(address sharedVault) public virtual checkPermission { ⋮---- function unregisterSharedVault(address sharedVault) public virtual checkPermission { ```` ## File: src/modules/voting-power/logic/VotingPowerProviderLogic.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {Checkpoints} from "../../../libraries/structs/Checkpoints.sol"; import {InputNormalizer} from "../../../libraries/utils/InputNormalizer.sol"; import {PersistentSet} from "../../../libraries/structs/PersistentSet.sol"; ⋮---- import {INetworkManager} from "../../../interfaces/modules/base/INetworkManager.sol"; import {IVotingPowerCalcManager} from "../../../interfaces/modules/voting-power/base/IVotingPowerCalcManager.sol"; import {IVotingPowerProvider} from "../../../interfaces/modules/voting-power/IVotingPowerProvider.sol"; ⋮---- import {IBaseDelegator} from "@symbioticfi/core/src/interfaces/delegator/IBaseDelegator.sol"; import {IEntity} from "@symbioticfi/core/src/interfaces/common/IEntity.sol"; import { IOperatorNetworkSpecificDelegator } from "@symbioticfi/core/src/interfaces/delegator/IOperatorNetworkSpecificDelegator.sol"; import {IOperatorSpecificDelegator} from "@symbioticfi/core/src/interfaces/delegator/IOperatorSpecificDelegator.sol"; import {IRegistry} from "@symbioticfi/core/src/interfaces/common/IRegistry.sol"; import {IVault} from "@symbioticfi/core/src/interfaces/vault/IVault.sol"; import {IVetoSlasher} from "@symbioticfi/core/src/interfaces/slasher/IVetoSlasher.sol"; ⋮---- /** * @title VotingPowerProviderLogic * @notice Library-logic of the voting power provider contract. */ ⋮---- // keccak256(abi.encode(uint256(keccak256("symbiotic.storage.VotingPowerProvider")) - 1)) & ~bytes32(uint256(0xff)) ⋮---- function _getVotingPowerProviderStorage() ⋮---- function initialize(IVotingPowerProvider.VotingPowerProviderInitParams memory initParams) public { ⋮---- function getSlashingDataAt(uint48 timestamp, bytes memory hint) public view returns (bool, uint48) { ⋮---- function getSlashingData() public view returns (bool, uint48) { ⋮---- function isTokenRegisteredAt(address token, uint48 timestamp) public view returns (bool) { ⋮---- function isTokenRegistered(address token) public view returns (bool) { ⋮---- function getTokensAt(uint48 timestamp) public view returns (address[] memory) { ⋮---- function getTokens() public view returns (address[] memory) { ⋮---- function getTokensLength() public view returns (uint256) { ⋮---- function isOperatorRegisteredAt(address operator, uint48 timestamp) public view returns (bool) { ⋮---- function isOperatorRegistered(address operator) public view returns (bool) { ⋮---- function getOperatorsAt(uint48 timestamp) public view returns (address[] memory) { ⋮---- function getOperators() public view returns (address[] memory) { ⋮---- function getOperatorsLength() public view returns (uint256) { ⋮---- function isSharedVaultRegisteredAt(address vault, uint48 timestamp) public view returns (bool) { ⋮---- function isSharedVaultRegistered(address vault) public view returns (bool) { ⋮---- function getSharedVaultsAt(uint48 timestamp) public view returns (address[] memory) { ⋮---- function getSharedVaults() public view returns (address[] memory) { ⋮---- function getSharedVaultsLength() public view returns (uint256) { ⋮---- function isOperatorVaultRegisteredAt(address vault, uint48 timestamp) public view returns (bool) { ⋮---- function isOperatorVaultRegistered(address vault) public view returns (bool) { ⋮---- function isOperatorVaultRegisteredAt(address operator, address vault, uint48 timestamp) public view returns (bool) { ⋮---- function isOperatorVaultRegistered(address operator, address vault) public view returns (bool) { ⋮---- function getOperatorVaultsAt(address operator, uint48 timestamp) public view returns (address[] memory) { ⋮---- function getOperatorVaults(address operator) public view returns (address[] memory) { ⋮---- function getOperatorVaultsLength(address operator) public view returns (uint256) { ⋮---- function getOperatorStakeAt(address operator, address vault, uint48 timestamp) public view returns (uint256) { ⋮---- function getOperatorStake(address operator, address vault) public view returns (uint256) { ⋮---- function getOperatorStakesAt(address operator, uint48 timestamp) ⋮---- function getOperatorStakes(address operator) ⋮---- function getOperatorVotingPowerAt(address operator, address vault, bytes memory extraData, uint48 timestamp) ⋮---- function getOperatorVotingPower(address operator, address vault, bytes memory extraData) ⋮---- function getOperatorVotingPowersAt(address operator, bytes memory extraData, uint48 timestamp) ⋮---- function getOperatorVotingPowers(address operator, bytes memory extraData) ⋮---- function getVotingPowersAt(bytes[] memory extraData, uint48 timestamp) ⋮---- function getVotingPowers(bytes[] memory extraData) ⋮---- function setSlashingData(bool requireSlasher, uint48 minVaultEpochDuration) public { ⋮---- function registerToken(address token) public { ⋮---- function unregisterToken(address token) public { ⋮---- function registerOperator(address operator) public { ⋮---- function unregisterOperator(address operator) public { ⋮---- function registerSharedVault(address vault) public { ⋮---- function registerOperatorVault(address operator, address vault) public { ⋮---- function unregisterSharedVault(address vault) public { ⋮---- function unregisterOperatorVault(address operator, address vault) public { ⋮---- function serializeSlashingData(bool requireSlasher, uint48 minVaultEpochDuration) public pure returns (uint208) { ⋮---- function deserializeSlashingData(uint208 slashingData) public pure returns (bool, uint48) { ⋮---- function _validateOperator(address operator) public view returns (bool) { ⋮---- function _validateVault(address vault) public view returns (bool) { ⋮---- function _validateSharedVault(address vault) public view returns (bool) { ⋮---- function _validateOperatorVault(address operator, address vault) public view returns (bool) { ⋮---- function _validateVaultSlashing(address vault) public view returns (bool) { ```` ## File: src/modules/voting-power/VotingPowerProvider.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {NetworkManager} from "../base/NetworkManager.sol"; import {OzEIP712} from "../base/OzEIP712.sol"; import {PermissionManager} from "../base/PermissionManager.sol"; import {VotingPowerCalcManager} from "./base/VotingPowerCalcManager.sol"; ⋮---- import {VotingPowerProviderLogic} from "./logic/VotingPowerProviderLogic.sol"; ⋮---- import {IVotingPowerProvider} from "../../interfaces/modules/voting-power/IVotingPowerProvider.sol"; ⋮---- import {MulticallUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/MulticallUpgradeable.sol"; import {NoncesUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/NoncesUpgradeable.sol"; import {SignatureChecker} from "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol"; ⋮---- /// @title VotingPowerProvider /// @notice Contract for managing tokens, operators, vaults, and their voting powers. abstract contract VotingPowerProvider is ⋮---- /// @inheritdoc IVotingPowerProvider ⋮---- function __VotingPowerProvider_init(VotingPowerProviderInitParams memory votingPowerProviderInitParams) ⋮---- function getSlashingDataAt(uint48 timestamp, bytes memory hint) public view virtual returns (bool, uint48) { ⋮---- function getSlashingData() public view virtual returns (bool, uint48) { ⋮---- function isTokenRegisteredAt(address token, uint48 timestamp) public view virtual returns (bool) { ⋮---- function isTokenRegistered(address token) public view virtual returns (bool) { ⋮---- function getTokensAt(uint48 timestamp) public view virtual returns (address[] memory) { ⋮---- function getTokens() public view virtual returns (address[] memory) { ⋮---- function isOperatorRegisteredAt(address operator, uint48 timestamp) public view virtual returns (bool) { ⋮---- function isOperatorRegistered(address operator) public view virtual returns (bool) { ⋮---- function getOperatorsAt(uint48 timestamp) public view virtual returns (address[] memory) { ⋮---- function getOperators() public view virtual returns (address[] memory) { ⋮---- function isSharedVaultRegisteredAt(address vault, uint48 timestamp) public view virtual returns (bool) { ⋮---- function isSharedVaultRegistered(address vault) public view virtual returns (bool) { ⋮---- function getSharedVaultsAt(uint48 timestamp) public view virtual returns (address[] memory) { ⋮---- function getSharedVaults() public view virtual returns (address[] memory) { ⋮---- function isOperatorVaultRegisteredAt(address vault, uint48 timestamp) public view virtual returns (bool) { ⋮---- function isOperatorVaultRegistered(address vault) public view virtual returns (bool) { ⋮---- function isOperatorVaultRegisteredAt(address operator, address vault, uint48 timestamp) ⋮---- function isOperatorVaultRegistered(address operator, address vault) public view virtual returns (bool) { ⋮---- function getOperatorVaultsAt(address operator, uint48 timestamp) public view virtual returns (address[] memory) { ⋮---- function getOperatorVaults(address operator) public view virtual returns (address[] memory) { ⋮---- function getOperatorStakesAt(address operator, uint48 timestamp) public view virtual returns (VaultValue[] memory) { ⋮---- function getOperatorStakes(address operator) public view virtual returns (VaultValue[] memory) { ⋮---- function getOperatorVotingPowersAt(address operator, bytes memory extraData, uint48 timestamp) ⋮---- function getOperatorVotingPowers(address operator, bytes memory extraData) ⋮---- function getVotingPowersAt(bytes[] memory extraData, uint48 timestamp) ⋮---- function getVotingPowers(bytes[] memory extraData) public view virtual returns (OperatorVotingPower[] memory) { ⋮---- /// @dev Returns the length of the tokens. function _getTokensLength() internal view virtual returns (uint256) { ⋮---- /// @dev Returns the length of the operators. function _getOperatorsLength() internal view virtual returns (uint256) { ⋮---- /// @dev Returns the length of the shared vaults. function _getSharedVaultsLength() internal view virtual returns (uint256) { ⋮---- /// @dev Returns the length of the operator vaults. function _getOperatorVaultsLength(address operator) internal view virtual returns (uint256) { ⋮---- /// @dev Returns the stake of the operator at a specific timestamp. function _getOperatorStakeAt(address operator, address vault, uint48 timestamp) ⋮---- /// @dev Returns the stake of the operator. function _getOperatorStake(address operator, address vault) internal view virtual returns (uint256) { ⋮---- /// @dev Returns the voting power of the operator at a specific timestamp. function _getOperatorVotingPowerAt(address operator, address vault, bytes memory extraData, uint48 timestamp) ⋮---- /// @dev Returns the voting power of the operator. function _getOperatorVotingPower(address operator, address vault, bytes memory extraData) ⋮---- function registerOperator() public virtual { ⋮---- function registerOperatorWithSignature(address operator, bytes memory signature) public virtual { ⋮---- function unregisterOperator() public virtual { ⋮---- function unregisterOperatorWithSignature(address operator, bytes memory signature) public virtual { ⋮---- function invalidateOldSignatures() public virtual { ⋮---- function _setSlashingData(bool requireSlasher, uint48 minVaultEpochDuration) internal virtual { ⋮---- function _registerToken(address token) internal virtual { ⋮---- function _unregisterToken(address token) internal virtual { ⋮---- function _registerOperator(address operator) internal virtual { ⋮---- function _unregisterOperator(address operator) internal virtual { ⋮---- function _registerSharedVault(address vault) internal virtual { ⋮---- function _registerOperatorVault(address operator, address vault) internal virtual { ⋮---- function _unregisterSharedVault(address vault) internal virtual { ⋮---- function _unregisterOperatorVault(address operator, address vault) internal virtual { ⋮---- function _registerOperatorImpl(address operator) internal virtual { ⋮---- function _unregisterOperatorImpl(address operator) internal virtual { ⋮---- function _registerOperatorVaultImpl(address operator, address vault) internal virtual { ⋮---- function _unregisterOperatorVaultImpl(address operator, address vault) internal virtual { ⋮---- function _verifyEIP712(address operator, bytes32 structHash, bytes memory signature) internal view { ```` ## File: test/data/zk/Verifier_10.sol ```` // SPDX-License-Identifier: MIT ⋮---- /// @title Groth16 verifier template. /// @author Remco Bloemen /// @notice Supports verifying Groth16 proofs. Proofs can be in uncompressed /// (256 bytes) and compressed (128 bytes) format. A view function is provided /// to compress proofs. /// @notice See for further explanation. contract Verifier { /// Some of the provided public input values are larger than the field modulus. /// @dev Public input elements are not automatically reduced, as this is can be /// a dangerous source of bugs. ⋮---- /// The proof is invalid. /// @dev This can mean that provided Groth16 proof points are not on their /// curves, that pairing equation fails, or that the proof is not for the /// provided public input. ⋮---- /// The commitment is invalid /// @dev This can mean that provided commitment points and/or proof of knowledge are not on their /// curves, that pairing equation fails, or that the commitment and/or proof of knowledge is not for the /// commitment key. ⋮---- // Addresses of precompiles ⋮---- // Base field Fp order P and scalar field Fr order R. // For BN254 these are computed as follows: // t = 4965661367192848881 // P = 36⋅t⁴ + 36⋅t³ + 24⋅t² + 6⋅t + 1 // R = 36⋅t⁴ + 36⋅t³ + 18⋅t² + 6⋅t + 1 ⋮---- // Extension field Fp2 = Fp[i] / (i² + 1) // Note: This is the complex extension field of Fp with i² = -1. // Values in Fp2 are represented as a pair of Fp elements (a₀, a₁) as a₀ + a₁⋅i. // Note: The order of Fp2 elements is *opposite* that of the pairing contract, which // expects Fp2 elements in order (a₁, a₀). This is also the order in which // Fp2 elements are encoded in the public interface as this became convention. ⋮---- // Constants in Fp ⋮---- // Exponents for inversions and square roots mod P uint256 constant EXP_INVERSE_FP = 0x30644E72E131A029B85045B68181585D97816A916871CA8D3C208C16D87CFD45; // P - 2 uint256 constant EXP_SQRT_FP = 0xC19139CB84C680A6E14116DA060561765E05AA45A1C72A34F082305B61F3F52; // (P + 1) / 4; ⋮---- // Groth16 alpha point in G1 ⋮---- // Groth16 beta point in G2 in powers of i ⋮---- // Groth16 gamma point in G2 in powers of i ⋮---- // Groth16 delta point in G2 in powers of i ⋮---- // Pedersen G point in G2 in powers of i ⋮---- // Pedersen GSigmaNeg point in G2 in powers of i ⋮---- // Constant and public input points ⋮---- /// Negation in Fp. /// @notice Returns a number x such that a + x = 0 in Fp. /// @notice The input does not need to be reduced. /// @param a the base /// @return x the result function negate(uint256 a) internal pure returns (uint256 x) { ⋮---- x = (P - (a % P)) % P; // Modulo is cheaper than branching ⋮---- /// Exponentiation in Fp. /// @notice Returns a number x such that a ^ e = x in Fp. ⋮---- /// @param e the exponent ⋮---- function exp(uint256 a, uint256 e) internal view returns (uint256 x) { ⋮---- // Exponentiation failed. // Should not happen. ⋮---- /// Invertsion in Fp. /// @notice Returns a number x such that a * x = 1 in Fp. ⋮---- /// @notice Reverts with ProofInvalid() if the inverse does not exist /// @param a the input /// @return x the solution function invert_Fp(uint256 a) internal view returns (uint256 x) { ⋮---- // Inverse does not exist. // Can only happen during G2 point decompression. ⋮---- /// Square root in Fp. /// @notice Returns a number x such that x * x = a in Fp. /// @notice Will revert with InvalidProof() if the input is not a square /// or not reduced. /// @param a the square ⋮---- function sqrt_Fp(uint256 a) internal view returns (uint256 x) { ⋮---- // Square root does not exist or a is not reduced. // Happens when G1 point is not on curve. ⋮---- /// Square test in Fp. /// @notice Returns whether a number x exists such that x * x = a in Fp. ⋮---- function isSquare_Fp(uint256 a) internal view returns (bool) { ⋮---- /// Square root in Fp2. /// @notice Fp2 is the complex extension Fp[i]/(i^2 + 1). The input is /// a0 + a1 ⋅ i and the result is x0 + x1 ⋅ i. /// @notice Will revert with InvalidProof() if /// * the input is not a square, /// * the hint is incorrect, or /// * the input coefficients are not reduced. /// @param a0 The real part of the input. /// @param a1 The imaginary part of the input. /// @param hint A hint which of two possible signs to pick in the equation. /// @return x0 The real part of the square root. /// @return x1 The imaginary part of the square root. function sqrt_Fp2(uint256 a0, uint256 a1, bool hint) internal view returns (uint256 x0, uint256 x1) { // If this square root reverts there is no solution in Fp2. ⋮---- // Check result to make sure we found a root. // Note: this also fails if a0 or a1 is not reduced. ⋮---- /// Compress a G1 point. /// @notice Reverts with InvalidProof if the coordinates are not reduced /// or if the point is not on the curve. /// @notice The point at infinity is encoded as (0,0) and compressed to 0. /// @param x The X coordinate in Fp. /// @param y The Y coordinate in Fp. /// @return c The compresed point (x with one signal bit). function compress_g1(uint256 x, uint256 y) internal view returns (uint256 c) { ⋮---- // G1 point not in field. ⋮---- // Point at infinity ⋮---- // Note: sqrt_Fp reverts if there is no solution, i.e. the x coordinate is invalid. ⋮---- // G1 point not on curve. ⋮---- /// Decompress a G1 point. /// @notice Reverts with InvalidProof if the input does not represent a valid point. ⋮---- /// @param c The compresed point (x with one signal bit). /// @return x The X coordinate in Fp. /// @return y The Y coordinate in Fp. function decompress_g1(uint256 c) internal view returns (uint256 x, uint256 y) { // Note that X = 0 is not on the curve since 0³ + 3 = 3 is not a square. // so we can use it to represent the point at infinity. ⋮---- // Point at infinity as encoded in EIP196 and EIP197. ⋮---- // G1 x coordinate not in field. ⋮---- // Note: (x³ + 3) is irreducible in Fp, so it can not be zero and therefore // y can not be zero. // Note: sqrt_Fp reverts if there is no solution, i.e. the point is not on the curve. ⋮---- /// Compress a G2 point. /// @notice Reverts with InvalidProof if the coefficients are not reduced ⋮---- /// @notice The G2 curve is defined over the complex extension Fp[i]/(i^2 + 1) /// with coordinates (x0 + x1 ⋅ i, y0 + y1 ⋅ i). /// @notice The point at infinity is encoded as (0,0,0,0) and compressed to (0,0). /// @param x0 The real part of the X coordinate. /// @param x1 The imaginary poart of the X coordinate. /// @param y0 The real part of the Y coordinate. /// @param y1 The imaginary part of the Y coordinate. /// @return c0 The first half of the compresed point (x0 with two signal bits). /// @return c1 The second half of the compressed point (x1 unmodified). function compress_g2(uint256 x0, uint256 x1, uint256 y0, uint256 y1) ⋮---- // G2 point not in field. ⋮---- // Compute y^2 // Note: shadowing variables and scoping to avoid stack-to-deep. ⋮---- // Determine hint bit // If this sqrt fails the x coordinate is not on the curve. ⋮---- // Recover y ⋮---- /// Decompress a G2 point. ⋮---- /// @param c0 The first half of the compresed point (x0 with two signal bits). /// @param c1 The second half of the compressed point (x1 unmodified). /// @return x0 The real part of the X coordinate. /// @return x1 The imaginary poart of the X coordinate. /// @return y0 The real part of the Y coordinate. /// @return y1 The imaginary part of the Y coordinate. function decompress_g2(uint256 c0, uint256 c1) ⋮---- // Note that X = (0, 0) is not on the curve since 0³ + 3/(9 + i) is not a square. ⋮---- // Point at infinity as encoded in EIP197. ⋮---- // G2 x0 or x1 coefficient not in field. ⋮---- // Note: sqrt_Fp2 reverts if there is no solution, i.e. the point is not on the curve. // Note: (X³ + 3/(9 + i)) is irreducible in Fp2, so y can not be zero. // But y0 or y1 may still independently be zero. ⋮---- /// Compute the public input linear combination. /// @notice Reverts with PublicInputNotInField if the input is not in the field. /// @notice Computes the multi-scalar-multiplication of the public input /// elements and the verification key including the constant term. /// @param input The public inputs. These are elements of the scalar field Fr. /// @param publicCommitments public inputs generated from pedersen commitments. /// @param commitments The Pedersen commitments from the proof. /// @return x The X coordinate of the resulting G1 point. /// @return y The Y coordinate of the resulting G1 point. function publicInputMSM( ⋮---- // Note: The ECMUL precompile does not reject unreduced values, so we check this. // Note: Unrolling this loop does not cost much extra in code-size, the bulk of the // code-size is in the PUB_ constants. // ECMUL has input (x, y, scalar) and output (x', y'). // ECADD has input (x1, y1, x2, y2) and output (x', y'). // We reduce commitments(if any) with constants as the first point argument to ECADD. // We call them such that ecmul output is already in the second point // argument to ECADD so we can have a tight loop. ⋮---- // Either Public input not in field, or verification key invalid. // We assume the contract is correctly generated, so the verification key is valid. ⋮---- /// Compress a proof. /// @notice Will revert with InvalidProof if the curve points are invalid, /// but does not verify the proof itself. /// @param proof The uncompressed Groth16 proof. Elements are in the same order as for /// verifyProof. I.e. Groth16 points (A, B, C) encoded as in EIP-197. /// @param commitments Pedersen commitments from the proof. /// @param commitmentPok proof of knowledge for the Pedersen commitments. /// @return compressed The compressed proof. Elements are in the same order as for /// verifyCompressedProof. I.e. points (A, B, C) in compressed format. /// @return compressedCommitments compressed Pedersen commitments from the proof. /// @return compressedCommitmentPok compressed proof of knowledge for the Pedersen commitments. function compressProof( ⋮---- /// Verify a Groth16 proof with compressed points. /// @notice Reverts with InvalidProof if the proof is invalid or /// with PublicInputNotInField the public input is not reduced. /// @notice There is no return value. If the function does not revert, the /// proof was successfully verified. /// @param compressedProof the points (A, B, C) in compressed format /// matching the output of compressProof. /// @param compressedCommitments compressed Pedersen commitments from the proof. /// @param compressedCommitmentPok compressed proof of knowledge for the Pedersen commitments. /// @param input the public input field elements in the scalar field Fr. /// Elements must be reduced. function verifyCompressedProof( ⋮---- // Commitments ⋮---- // Verify pedersen commitments ⋮---- // Verify the pairing // Note: The precompile expects the F2 coefficients in big-endian order. // Note: The pairing precompile rejects unreduced values, so we won't check that here. // e(A, B) ⋮---- // e(C, -δ) ⋮---- // e(α, -β) ⋮---- // e(L_pub, -γ) ⋮---- // Check pairing equation. ⋮---- // Either proof or verification key invalid. ⋮---- /// Verify an uncompressed Groth16 proof. ⋮---- /// @param proof the points (A, B, C) in EIP-197 format matching the output /// of compressProof. /// @param commitments the Pedersen commitments from the proof. /// @param commitmentPok the proof of knowledge for the Pedersen commitments. ⋮---- function verifyProof( ⋮---- // HashToField ⋮---- calldatacopy(f, commitments, 0x40) // Copy Commitments ⋮---- let f := mload(0x40) // Free memory pointer. ⋮---- // Copy points (A, B, C) to memory. They are already in correct encoding. // This is pairing e(A, B) and G1 of e(C, -δ). ⋮---- // Complete e(C, -δ) and write e(α, -β), e(L_pub, -γ) to memory. // OPT: This could be better done using a single codecopy, but // Solidity (unlike standalone Yul) doesn't provide a way to // to do this. ⋮---- // Also check returned value (both are either 1 or 0). ```` ## File: test/data/zk/Verifier_100.sol ```` // SPDX-License-Identifier: MIT ⋮---- /// @title Groth16 verifier template. /// @author Remco Bloemen /// @notice Supports verifying Groth16 proofs. Proofs can be in uncompressed /// (256 bytes) and compressed (128 bytes) format. A view function is provided /// to compress proofs. /// @notice See for further explanation. contract Verifier { /// Some of the provided public input values are larger than the field modulus. /// @dev Public input elements are not automatically reduced, as this is can be /// a dangerous source of bugs. ⋮---- /// The proof is invalid. /// @dev This can mean that provided Groth16 proof points are not on their /// curves, that pairing equation fails, or that the proof is not for the /// provided public input. ⋮---- /// The commitment is invalid /// @dev This can mean that provided commitment points and/or proof of knowledge are not on their /// curves, that pairing equation fails, or that the commitment and/or proof of knowledge is not for the /// commitment key. ⋮---- // Addresses of precompiles ⋮---- // Base field Fp order P and scalar field Fr order R. // For BN254 these are computed as follows: // t = 4965661367192848881 // P = 36⋅t⁴ + 36⋅t³ + 24⋅t² + 6⋅t + 1 // R = 36⋅t⁴ + 36⋅t³ + 18⋅t² + 6⋅t + 1 ⋮---- // Extension field Fp2 = Fp[i] / (i² + 1) // Note: This is the complex extension field of Fp with i² = -1. // Values in Fp2 are represented as a pair of Fp elements (a₀, a₁) as a₀ + a₁⋅i. // Note: The order of Fp2 elements is *opposite* that of the pairing contract, which // expects Fp2 elements in order (a₁, a₀). This is also the order in which // Fp2 elements are encoded in the public interface as this became convention. ⋮---- // Constants in Fp ⋮---- // Exponents for inversions and square roots mod P uint256 constant EXP_INVERSE_FP = 0x30644E72E131A029B85045B68181585D97816A916871CA8D3C208C16D87CFD45; // P - 2 uint256 constant EXP_SQRT_FP = 0xC19139CB84C680A6E14116DA060561765E05AA45A1C72A34F082305B61F3F52; // (P + 1) / 4; ⋮---- // Groth16 alpha point in G1 ⋮---- // Groth16 beta point in G2 in powers of i ⋮---- // Groth16 gamma point in G2 in powers of i ⋮---- // Groth16 delta point in G2 in powers of i ⋮---- // Pedersen G point in G2 in powers of i ⋮---- // Pedersen GSigmaNeg point in G2 in powers of i ⋮---- // Constant and public input points ⋮---- /// Negation in Fp. /// @notice Returns a number x such that a + x = 0 in Fp. /// @notice The input does not need to be reduced. /// @param a the base /// @return x the result function negate(uint256 a) internal pure returns (uint256 x) { ⋮---- x = (P - (a % P)) % P; // Modulo is cheaper than branching ⋮---- /// Exponentiation in Fp. /// @notice Returns a number x such that a ^ e = x in Fp. ⋮---- /// @param e the exponent ⋮---- function exp(uint256 a, uint256 e) internal view returns (uint256 x) { ⋮---- // Exponentiation failed. // Should not happen. ⋮---- /// Invertsion in Fp. /// @notice Returns a number x such that a * x = 1 in Fp. ⋮---- /// @notice Reverts with ProofInvalid() if the inverse does not exist /// @param a the input /// @return x the solution function invert_Fp(uint256 a) internal view returns (uint256 x) { ⋮---- // Inverse does not exist. // Can only happen during G2 point decompression. ⋮---- /// Square root in Fp. /// @notice Returns a number x such that x * x = a in Fp. /// @notice Will revert with InvalidProof() if the input is not a square /// or not reduced. /// @param a the square ⋮---- function sqrt_Fp(uint256 a) internal view returns (uint256 x) { ⋮---- // Square root does not exist or a is not reduced. // Happens when G1 point is not on curve. ⋮---- /// Square test in Fp. /// @notice Returns whether a number x exists such that x * x = a in Fp. ⋮---- function isSquare_Fp(uint256 a) internal view returns (bool) { ⋮---- /// Square root in Fp2. /// @notice Fp2 is the complex extension Fp[i]/(i^2 + 1). The input is /// a0 + a1 ⋅ i and the result is x0 + x1 ⋅ i. /// @notice Will revert with InvalidProof() if /// * the input is not a square, /// * the hint is incorrect, or /// * the input coefficients are not reduced. /// @param a0 The real part of the input. /// @param a1 The imaginary part of the input. /// @param hint A hint which of two possible signs to pick in the equation. /// @return x0 The real part of the square root. /// @return x1 The imaginary part of the square root. function sqrt_Fp2(uint256 a0, uint256 a1, bool hint) internal view returns (uint256 x0, uint256 x1) { // If this square root reverts there is no solution in Fp2. ⋮---- // Check result to make sure we found a root. // Note: this also fails if a0 or a1 is not reduced. ⋮---- /// Compress a G1 point. /// @notice Reverts with InvalidProof if the coordinates are not reduced /// or if the point is not on the curve. /// @notice The point at infinity is encoded as (0,0) and compressed to 0. /// @param x The X coordinate in Fp. /// @param y The Y coordinate in Fp. /// @return c The compresed point (x with one signal bit). function compress_g1(uint256 x, uint256 y) internal view returns (uint256 c) { ⋮---- // G1 point not in field. ⋮---- // Point at infinity ⋮---- // Note: sqrt_Fp reverts if there is no solution, i.e. the x coordinate is invalid. ⋮---- // G1 point not on curve. ⋮---- /// Decompress a G1 point. /// @notice Reverts with InvalidProof if the input does not represent a valid point. ⋮---- /// @param c The compresed point (x with one signal bit). /// @return x The X coordinate in Fp. /// @return y The Y coordinate in Fp. function decompress_g1(uint256 c) internal view returns (uint256 x, uint256 y) { // Note that X = 0 is not on the curve since 0³ + 3 = 3 is not a square. // so we can use it to represent the point at infinity. ⋮---- // Point at infinity as encoded in EIP196 and EIP197. ⋮---- // G1 x coordinate not in field. ⋮---- // Note: (x³ + 3) is irreducible in Fp, so it can not be zero and therefore // y can not be zero. // Note: sqrt_Fp reverts if there is no solution, i.e. the point is not on the curve. ⋮---- /// Compress a G2 point. /// @notice Reverts with InvalidProof if the coefficients are not reduced ⋮---- /// @notice The G2 curve is defined over the complex extension Fp[i]/(i^2 + 1) /// with coordinates (x0 + x1 ⋅ i, y0 + y1 ⋅ i). /// @notice The point at infinity is encoded as (0,0,0,0) and compressed to (0,0). /// @param x0 The real part of the X coordinate. /// @param x1 The imaginary poart of the X coordinate. /// @param y0 The real part of the Y coordinate. /// @param y1 The imaginary part of the Y coordinate. /// @return c0 The first half of the compresed point (x0 with two signal bits). /// @return c1 The second half of the compressed point (x1 unmodified). function compress_g2(uint256 x0, uint256 x1, uint256 y0, uint256 y1) ⋮---- // G2 point not in field. ⋮---- // Compute y^2 // Note: shadowing variables and scoping to avoid stack-to-deep. ⋮---- // Determine hint bit // If this sqrt fails the x coordinate is not on the curve. ⋮---- // Recover y ⋮---- /// Decompress a G2 point. ⋮---- /// @param c0 The first half of the compresed point (x0 with two signal bits). /// @param c1 The second half of the compressed point (x1 unmodified). /// @return x0 The real part of the X coordinate. /// @return x1 The imaginary poart of the X coordinate. /// @return y0 The real part of the Y coordinate. /// @return y1 The imaginary part of the Y coordinate. function decompress_g2(uint256 c0, uint256 c1) ⋮---- // Note that X = (0, 0) is not on the curve since 0³ + 3/(9 + i) is not a square. ⋮---- // Point at infinity as encoded in EIP197. ⋮---- // G2 x0 or x1 coefficient not in field. ⋮---- // Note: sqrt_Fp2 reverts if there is no solution, i.e. the point is not on the curve. // Note: (X³ + 3/(9 + i)) is irreducible in Fp2, so y can not be zero. // But y0 or y1 may still independently be zero. ⋮---- /// Compute the public input linear combination. /// @notice Reverts with PublicInputNotInField if the input is not in the field. /// @notice Computes the multi-scalar-multiplication of the public input /// elements and the verification key including the constant term. /// @param input The public inputs. These are elements of the scalar field Fr. /// @param publicCommitments public inputs generated from pedersen commitments. /// @param commitments The Pedersen commitments from the proof. /// @return x The X coordinate of the resulting G1 point. /// @return y The Y coordinate of the resulting G1 point. function publicInputMSM( ⋮---- // Note: The ECMUL precompile does not reject unreduced values, so we check this. // Note: Unrolling this loop does not cost much extra in code-size, the bulk of the // code-size is in the PUB_ constants. // ECMUL has input (x, y, scalar) and output (x', y'). // ECADD has input (x1, y1, x2, y2) and output (x', y'). // We reduce commitments(if any) with constants as the first point argument to ECADD. // We call them such that ecmul output is already in the second point // argument to ECADD so we can have a tight loop. ⋮---- // Either Public input not in field, or verification key invalid. // We assume the contract is correctly generated, so the verification key is valid. ⋮---- /// Compress a proof. /// @notice Will revert with InvalidProof if the curve points are invalid, /// but does not verify the proof itself. /// @param proof The uncompressed Groth16 proof. Elements are in the same order as for /// verifyProof. I.e. Groth16 points (A, B, C) encoded as in EIP-197. /// @param commitments Pedersen commitments from the proof. /// @param commitmentPok proof of knowledge for the Pedersen commitments. /// @return compressed The compressed proof. Elements are in the same order as for /// verifyCompressedProof. I.e. points (A, B, C) in compressed format. /// @return compressedCommitments compressed Pedersen commitments from the proof. /// @return compressedCommitmentPok compressed proof of knowledge for the Pedersen commitments. function compressProof( ⋮---- /// Verify a Groth16 proof with compressed points. /// @notice Reverts with InvalidProof if the proof is invalid or /// with PublicInputNotInField the public input is not reduced. /// @notice There is no return value. If the function does not revert, the /// proof was successfully verified. /// @param compressedProof the points (A, B, C) in compressed format /// matching the output of compressProof. /// @param compressedCommitments compressed Pedersen commitments from the proof. /// @param compressedCommitmentPok compressed proof of knowledge for the Pedersen commitments. /// @param input the public input field elements in the scalar field Fr. /// Elements must be reduced. function verifyCompressedProof( ⋮---- // Commitments ⋮---- // Verify pedersen commitments ⋮---- // Verify the pairing // Note: The precompile expects the F2 coefficients in big-endian order. // Note: The pairing precompile rejects unreduced values, so we won't check that here. // e(A, B) ⋮---- // e(C, -δ) ⋮---- // e(α, -β) ⋮---- // e(L_pub, -γ) ⋮---- // Check pairing equation. ⋮---- // Either proof or verification key invalid. ⋮---- /// Verify an uncompressed Groth16 proof. ⋮---- /// @param proof the points (A, B, C) in EIP-197 format matching the output /// of compressProof. /// @param commitments the Pedersen commitments from the proof. /// @param commitmentPok the proof of knowledge for the Pedersen commitments. ⋮---- function verifyProof( ⋮---- // HashToField ⋮---- calldatacopy(f, commitments, 0x40) // Copy Commitments ⋮---- let f := mload(0x40) // Free memory pointer. ⋮---- // Copy points (A, B, C) to memory. They are already in correct encoding. // This is pairing e(A, B) and G1 of e(C, -δ). ⋮---- // Complete e(C, -δ) and write e(α, -β), e(L_pub, -γ) to memory. // OPT: This could be better done using a single codecopy, but // Solidity (unlike standalone Yul) doesn't provide a way to // to do this. ⋮---- // Also check returned value (both are either 1 or 0). ```` ## File: test/data/zk/Verifier_1000.sol ```` // SPDX-License-Identifier: MIT ⋮---- /// @title Groth16 verifier template. /// @author Remco Bloemen /// @notice Supports verifying Groth16 proofs. Proofs can be in uncompressed /// (256 bytes) and compressed (128 bytes) format. A view function is provided /// to compress proofs. /// @notice See for further explanation. contract Verifier { /// Some of the provided public input values are larger than the field modulus. /// @dev Public input elements are not automatically reduced, as this is can be /// a dangerous source of bugs. ⋮---- /// The proof is invalid. /// @dev This can mean that provided Groth16 proof points are not on their /// curves, that pairing equation fails, or that the proof is not for the /// provided public input. ⋮---- /// The commitment is invalid /// @dev This can mean that provided commitment points and/or proof of knowledge are not on their /// curves, that pairing equation fails, or that the commitment and/or proof of knowledge is not for the /// commitment key. ⋮---- // Addresses of precompiles ⋮---- // Base field Fp order P and scalar field Fr order R. // For BN254 these are computed as follows: // t = 4965661367192848881 // P = 36⋅t⁴ + 36⋅t³ + 24⋅t² + 6⋅t + 1 // R = 36⋅t⁴ + 36⋅t³ + 18⋅t² + 6⋅t + 1 ⋮---- // Extension field Fp2 = Fp[i] / (i² + 1) // Note: This is the complex extension field of Fp with i² = -1. // Values in Fp2 are represented as a pair of Fp elements (a₀, a₁) as a₀ + a₁⋅i. // Note: The order of Fp2 elements is *opposite* that of the pairing contract, which // expects Fp2 elements in order (a₁, a₀). This is also the order in which // Fp2 elements are encoded in the public interface as this became convention. ⋮---- // Constants in Fp ⋮---- // Exponents for inversions and square roots mod P uint256 constant EXP_INVERSE_FP = 0x30644E72E131A029B85045B68181585D97816A916871CA8D3C208C16D87CFD45; // P - 2 uint256 constant EXP_SQRT_FP = 0xC19139CB84C680A6E14116DA060561765E05AA45A1C72A34F082305B61F3F52; // (P + 1) / 4; ⋮---- // Groth16 alpha point in G1 ⋮---- // Groth16 beta point in G2 in powers of i ⋮---- // Groth16 gamma point in G2 in powers of i ⋮---- // Groth16 delta point in G2 in powers of i ⋮---- // Pedersen G point in G2 in powers of i ⋮---- // Pedersen GSigmaNeg point in G2 in powers of i ⋮---- // Constant and public input points ⋮---- /// Negation in Fp. /// @notice Returns a number x such that a + x = 0 in Fp. /// @notice The input does not need to be reduced. /// @param a the base /// @return x the result function negate(uint256 a) internal pure returns (uint256 x) { ⋮---- x = (P - (a % P)) % P; // Modulo is cheaper than branching ⋮---- /// Exponentiation in Fp. /// @notice Returns a number x such that a ^ e = x in Fp. ⋮---- /// @param e the exponent ⋮---- function exp(uint256 a, uint256 e) internal view returns (uint256 x) { ⋮---- // Exponentiation failed. // Should not happen. ⋮---- /// Invertsion in Fp. /// @notice Returns a number x such that a * x = 1 in Fp. ⋮---- /// @notice Reverts with ProofInvalid() if the inverse does not exist /// @param a the input /// @return x the solution function invert_Fp(uint256 a) internal view returns (uint256 x) { ⋮---- // Inverse does not exist. // Can only happen during G2 point decompression. ⋮---- /// Square root in Fp. /// @notice Returns a number x such that x * x = a in Fp. /// @notice Will revert with InvalidProof() if the input is not a square /// or not reduced. /// @param a the square ⋮---- function sqrt_Fp(uint256 a) internal view returns (uint256 x) { ⋮---- // Square root does not exist or a is not reduced. // Happens when G1 point is not on curve. ⋮---- /// Square test in Fp. /// @notice Returns whether a number x exists such that x * x = a in Fp. ⋮---- function isSquare_Fp(uint256 a) internal view returns (bool) { ⋮---- /// Square root in Fp2. /// @notice Fp2 is the complex extension Fp[i]/(i^2 + 1). The input is /// a0 + a1 ⋅ i and the result is x0 + x1 ⋅ i. /// @notice Will revert with InvalidProof() if /// * the input is not a square, /// * the hint is incorrect, or /// * the input coefficients are not reduced. /// @param a0 The real part of the input. /// @param a1 The imaginary part of the input. /// @param hint A hint which of two possible signs to pick in the equation. /// @return x0 The real part of the square root. /// @return x1 The imaginary part of the square root. function sqrt_Fp2(uint256 a0, uint256 a1, bool hint) internal view returns (uint256 x0, uint256 x1) { // If this square root reverts there is no solution in Fp2. ⋮---- // Check result to make sure we found a root. // Note: this also fails if a0 or a1 is not reduced. ⋮---- /// Compress a G1 point. /// @notice Reverts with InvalidProof if the coordinates are not reduced /// or if the point is not on the curve. /// @notice The point at infinity is encoded as (0,0) and compressed to 0. /// @param x The X coordinate in Fp. /// @param y The Y coordinate in Fp. /// @return c The compresed point (x with one signal bit). function compress_g1(uint256 x, uint256 y) internal view returns (uint256 c) { ⋮---- // G1 point not in field. ⋮---- // Point at infinity ⋮---- // Note: sqrt_Fp reverts if there is no solution, i.e. the x coordinate is invalid. ⋮---- // G1 point not on curve. ⋮---- /// Decompress a G1 point. /// @notice Reverts with InvalidProof if the input does not represent a valid point. ⋮---- /// @param c The compresed point (x with one signal bit). /// @return x The X coordinate in Fp. /// @return y The Y coordinate in Fp. function decompress_g1(uint256 c) internal view returns (uint256 x, uint256 y) { // Note that X = 0 is not on the curve since 0³ + 3 = 3 is not a square. // so we can use it to represent the point at infinity. ⋮---- // Point at infinity as encoded in EIP196 and EIP197. ⋮---- // G1 x coordinate not in field. ⋮---- // Note: (x³ + 3) is irreducible in Fp, so it can not be zero and therefore // y can not be zero. // Note: sqrt_Fp reverts if there is no solution, i.e. the point is not on the curve. ⋮---- /// Compress a G2 point. /// @notice Reverts with InvalidProof if the coefficients are not reduced ⋮---- /// @notice The G2 curve is defined over the complex extension Fp[i]/(i^2 + 1) /// with coordinates (x0 + x1 ⋅ i, y0 + y1 ⋅ i). /// @notice The point at infinity is encoded as (0,0,0,0) and compressed to (0,0). /// @param x0 The real part of the X coordinate. /// @param x1 The imaginary poart of the X coordinate. /// @param y0 The real part of the Y coordinate. /// @param y1 The imaginary part of the Y coordinate. /// @return c0 The first half of the compresed point (x0 with two signal bits). /// @return c1 The second half of the compressed point (x1 unmodified). function compress_g2(uint256 x0, uint256 x1, uint256 y0, uint256 y1) ⋮---- // G2 point not in field. ⋮---- // Compute y^2 // Note: shadowing variables and scoping to avoid stack-to-deep. ⋮---- // Determine hint bit // If this sqrt fails the x coordinate is not on the curve. ⋮---- // Recover y ⋮---- /// Decompress a G2 point. ⋮---- /// @param c0 The first half of the compresed point (x0 with two signal bits). /// @param c1 The second half of the compressed point (x1 unmodified). /// @return x0 The real part of the X coordinate. /// @return x1 The imaginary poart of the X coordinate. /// @return y0 The real part of the Y coordinate. /// @return y1 The imaginary part of the Y coordinate. function decompress_g2(uint256 c0, uint256 c1) ⋮---- // Note that X = (0, 0) is not on the curve since 0³ + 3/(9 + i) is not a square. ⋮---- // Point at infinity as encoded in EIP197. ⋮---- // G2 x0 or x1 coefficient not in field. ⋮---- // Note: sqrt_Fp2 reverts if there is no solution, i.e. the point is not on the curve. // Note: (X³ + 3/(9 + i)) is irreducible in Fp2, so y can not be zero. // But y0 or y1 may still independently be zero. ⋮---- /// Compute the public input linear combination. /// @notice Reverts with PublicInputNotInField if the input is not in the field. /// @notice Computes the multi-scalar-multiplication of the public input /// elements and the verification key including the constant term. /// @param input The public inputs. These are elements of the scalar field Fr. /// @param publicCommitments public inputs generated from pedersen commitments. /// @param commitments The Pedersen commitments from the proof. /// @return x The X coordinate of the resulting G1 point. /// @return y The Y coordinate of the resulting G1 point. function publicInputMSM( ⋮---- // Note: The ECMUL precompile does not reject unreduced values, so we check this. // Note: Unrolling this loop does not cost much extra in code-size, the bulk of the // code-size is in the PUB_ constants. // ECMUL has input (x, y, scalar) and output (x', y'). // ECADD has input (x1, y1, x2, y2) and output (x', y'). // We reduce commitments(if any) with constants as the first point argument to ECADD. // We call them such that ecmul output is already in the second point // argument to ECADD so we can have a tight loop. ⋮---- // Either Public input not in field, or verification key invalid. // We assume the contract is correctly generated, so the verification key is valid. ⋮---- /// Compress a proof. /// @notice Will revert with InvalidProof if the curve points are invalid, /// but does not verify the proof itself. /// @param proof The uncompressed Groth16 proof. Elements are in the same order as for /// verifyProof. I.e. Groth16 points (A, B, C) encoded as in EIP-197. /// @param commitments Pedersen commitments from the proof. /// @param commitmentPok proof of knowledge for the Pedersen commitments. /// @return compressed The compressed proof. Elements are in the same order as for /// verifyCompressedProof. I.e. points (A, B, C) in compressed format. /// @return compressedCommitments compressed Pedersen commitments from the proof. /// @return compressedCommitmentPok compressed proof of knowledge for the Pedersen commitments. function compressProof( ⋮---- /// Verify a Groth16 proof with compressed points. /// @notice Reverts with InvalidProof if the proof is invalid or /// with PublicInputNotInField the public input is not reduced. /// @notice There is no return value. If the function does not revert, the /// proof was successfully verified. /// @param compressedProof the points (A, B, C) in compressed format /// matching the output of compressProof. /// @param compressedCommitments compressed Pedersen commitments from the proof. /// @param compressedCommitmentPok compressed proof of knowledge for the Pedersen commitments. /// @param input the public input field elements in the scalar field Fr. /// Elements must be reduced. function verifyCompressedProof( ⋮---- // Commitments ⋮---- // Verify pedersen commitments ⋮---- // Verify the pairing // Note: The precompile expects the F2 coefficients in big-endian order. // Note: The pairing precompile rejects unreduced values, so we won't check that here. // e(A, B) ⋮---- // e(C, -δ) ⋮---- // e(α, -β) ⋮---- // e(L_pub, -γ) ⋮---- // Check pairing equation. ⋮---- // Either proof or verification key invalid. ⋮---- /// Verify an uncompressed Groth16 proof. ⋮---- /// @param proof the points (A, B, C) in EIP-197 format matching the output /// of compressProof. /// @param commitments the Pedersen commitments from the proof. /// @param commitmentPok the proof of knowledge for the Pedersen commitments. ⋮---- function verifyProof( ⋮---- // HashToField ⋮---- calldatacopy(f, commitments, 0x40) // Copy Commitments ⋮---- let f := mload(0x40) // Free memory pointer. ⋮---- // Copy points (A, B, C) to memory. They are already in correct encoding. // This is pairing e(A, B) and G1 of e(C, -δ). ⋮---- // Complete e(C, -δ) and write e(α, -β), e(L_pub, -γ) to memory. // OPT: This could be better done using a single codecopy, but // Solidity (unlike standalone Yul) doesn't provide a way to // to do this. ⋮---- // Also check returned value (both are either 1 or 0). ```` ## File: test/data/genesis_header.json ````json { "header": { "version": 1, "validatorsSszMRoot": "0xa1d1e9127339816cd3cc49c40d1b188a4c5056b0cff77137bcf992b070b935d9", "epoch": 0, "requiredKeyTag": 15, "captureTimestamp": 1746024875, "quorumThreshold": 20000000000001, "totalVotingPower": 30000000000000 }, "extraData": [ { "key": "0x7f6185ad9469ee6a9c05e14b4e03be396fc9beb5e6626c77957d25b5b62d83ab", "value": "0x0000000000000000000000000000000000000000000000000000000000000014" }, { "key": "0xd07277185a3cf0575b363bbe652653f46b583ea129748f095887313569ff44b4", "value": "0x221e349ac65d42e4884601fd0ddba2b964bb5055bd96f431458652333ede252a" } ] } ```` ## File: test/examples/MyVotingPowerProvider.t.sol ```` // SPDX-License-Identifier: MIT ⋮---- import "forge-std/Test.sol"; ⋮---- import {VotingPowerProvider} from "../../src/modules/voting-power/VotingPowerProvider.sol"; import {VotingPowerProviderLogic} from "../../src/modules/voting-power/logic/VotingPowerProviderLogic.sol"; import {MultiToken} from "../../src/modules/voting-power/extensions/MultiToken.sol"; import {IVotingPowerProvider} from "../../src/interfaces/modules/voting-power/IVotingPowerProvider.sol"; import {INetworkManager} from "../../src/interfaces/modules/base/INetworkManager.sol"; import {IOzEIP712} from "../../src/interfaces/modules/base/IOzEIP712.sol"; import {NoPermissionManager} from "../../test/mocks/NoPermissionManager.sol"; import {EqualStakeVPCalc} from "../../src/modules/voting-power/common/voting-power-calc/EqualStakeVPCalc.sol"; import {OperatorVaults} from "../../src/modules/voting-power/extensions/OperatorVaults.sol"; import {IOzOwnable} from "../../src/interfaces/modules/common/permissions/IOzOwnable.sol"; ⋮---- import {BN254} from "../../src/libraries/utils/BN254.sol"; import "../InitSetup.sol"; ⋮---- contract MyVotingPowerProviderTest is InitSetupTest { ⋮---- function setUp() public override { ⋮---- // votingPowerProvider.registerToken(initSetupParams.masterChain.tokens[0]); ⋮---- function test_RegisterOperatorValid() public { ⋮---- function test_RegisterOperator_RevertIfNotEntity() public { ⋮---- function test_RegisterOperator_RevertIfAlreadyRegistered() public { ⋮---- function test_UnregisterOperator() public { ⋮---- function test_UnregisterOperator_RevertIfNotRegistered() public { ⋮---- function test_IsOperatorRegisteredAt_withTime() public { ⋮---- function testGetOperatorsAt_withTime() public { ⋮---- function test_SlashingData() public { ⋮---- function test_RegisterOperatorVault() public { ⋮---- function test_RegisterOperatorVault_RevertIfOperatorNotRegistered() public { ⋮---- function test_SlashVault_InstantSlasher() public {} ⋮---- function test_SlashVault_VetoSlasherFlow() public {} ⋮---- function test_SlashVault_RevertIfNoSlasher() public {} ⋮---- function test_DistributeRewards() public {} ⋮---- function test_CheckStakes() public { ⋮---- function test_RegisterOperator() public { ⋮---- function test_RegisterOperatorVaultExternal() public { ⋮---- function test_registerOperatorWithSignature() public { ⋮---- function test_registerOperatorWithSignature_RevertIfInvalidSig() public { ⋮---- function test_IncreaseNonce() public { ⋮---- function test_unregisterOperatorWithSignature() public { ```` ## File: test/helpers/blsTestGenerator.py ````python # used for helped aggregation def get_public_key_G1(secret_key: int) -> Tuple[FQ, FQ, FQ] ⋮---- def get_public_key(secret_key: int) -> Tuple[FQ2, FQ2, FQ2] ⋮---- def sign(message: Tuple[FQ, FQ, FQ], secret_key: int) ⋮---- def aggregate_signatures(signatures: list[Tuple[FQ, FQ, FQ]]) -> Tuple[FQ, FQ, FQ] ⋮---- res = signatures[0] ⋮---- res = add(res, signature) ⋮---- def aggregate_public_keys(pubkeys: list[Tuple[FQ2, FQ2, FQ2]]) -> Tuple[FQ2, FQ2, FQ2] ⋮---- res = pubkeys[0] ⋮---- res = add(res, pubkey) ⋮---- def aggregate_public_keys_G1(pubkeys: list[Tuple[FQ, FQ, FQ]]) -> Tuple[FQ, FQ, FQ] ⋮---- def hash_to_point(data: bytes) ⋮---- x = int.from_bytes(data, byteorder='big') % field_modulus ⋮---- # Check if y^2 == beta ⋮---- x = (x + 1) % field_modulus ⋮---- def find_y_from_x(x: int) -> Tuple[int, int] ⋮---- """ Given x coordinate, find y coordinate on BN254 curve Returns (beta, y) where: beta = x^3 + 3 (mod p) y = sqrt(beta) if it exists """ # Calculate beta = x^3 + 3 mod p beta = (pow(x, 3, field_modulus) + 3) % field_modulus ⋮---- # Calculate y = beta^((p+1)/4) mod p # Using same exponent as in BN254.sol: 0xc19139cb84c680a6e14116da060561765e05aa45a1c72a34f082305b61f3f52 y = pow(beta, 0xc19139cb84c680a6e14116da060561765e05aa45a1c72a34f082305b61f3f52, field_modulus) ⋮---- def sqrt(x_square: int) -> Tuple[int, bool] ⋮---- # Calculate y = x^((p+1)/4) mod p # This is equivalent to finding square root modulo p # where p ≡ 3 (mod 4) exp = (field_modulus + 1) // 4 y = pow(x_square, exp, field_modulus) ⋮---- # Verify y is actually a square root ⋮---- def parse_solc_G1(solc_G1: Tuple[int, int]) ⋮---- def format_G1(g1_element: Tuple[FQ, FQ, FQ]) -> Tuple[FQ, FQ] ⋮---- def format_G2(g2_element: Tuple[FQ2, FQ2, FQ2]) -> Tuple[FQ2, FQ2] ⋮---- def verify(message: bytes, signature: Tuple[FQ, FQ, FQ], public_key: Tuple[FQ2, FQ2, FQ2]) -> bool ⋮---- # Map message to curve point h = hash_to_point(message) ⋮---- # Check e(signature, G2) = e(h, public_key) # Note: signature and h are in G1, while G2 and public_key are in G2 pairing1 = pairing(G2, signature) pairing2 = pairing(public_key, h) ⋮---- def generate_operator_address() -> str ⋮---- # Generate random private key private_key = os.urandom(32) acc = Account.create(private_key) # Pad address to 32 bytes ⋮---- secret_key = 69 ⋮---- public_key = get_public_key(secret_key) public_key_g1 = get_public_key_G1(secret_key) ⋮---- formatted_pubkey = format_G2(public_key) formatted_pubkey_g1 = format_G1(public_key_g1) ⋮---- # Create message hash as done in the contract operator = generate_operator_address() message = eth_abi.encode( ⋮---- message_hash = keccak(message) ⋮---- data = message_hash ⋮---- message = hash_to_point(data) # Generate signature signature = sign(message, secret_key) formatted_sig = format_G1(signature) ⋮---- # Format values for test output ⋮---- # Verify the signature is_valid = verify(data, signature, public_key) ⋮---- # Test vectors test_vectors = { ```` ## File: test/helpers/BN254G2.sol ```` /** * @title Elliptic curve operations on twist points for alt_bn128 * @author Mustafa Al-Bassam (mus@musalbas.com) * @dev Homepage: https://github.com/musalbas/solidity-BN256G2 */ ⋮---- // WARNING: this code is used ONLY for testing purposes, DO NOT USE IN PRODUCTION ⋮---- /** * @notice Add two twist points * @param pt1xx Coefficient 1 of x on point 1 * @param pt1xy Coefficient 2 of x on point 1 * @param pt1yx Coefficient 1 of y on point 1 * @param pt1yy Coefficient 2 of y on point 1 * @param pt2xx Coefficient 1 of x on point 2 * @param pt2xy Coefficient 2 of x on point 2 * @param pt2yx Coefficient 1 of y on point 2 * @param pt2yy Coefficient 2 of y on point 2 * @return (pt3xx, pt3xy, pt3yx, pt3yy) */ function ECTwistAdd( ⋮---- /** * @notice Multiply a twist point by a scalar * @param s Scalar to multiply by * @param pt1xx Coefficient 1 of x * @param pt1xy Coefficient 2 of x * @param pt1yx Coefficient 1 of y * @param pt1yy Coefficient 2 of y * @return (pt2xx, pt2xy, pt2yx, pt2yy) */ function ECTwistMul(uint256 s, uint256 pt1xx, uint256 pt1xy, uint256 pt1yx, uint256 pt1yy) ⋮---- /** * @notice Get the field modulus * @return The field modulus */ function GetFieldModulus() internal pure returns (uint256) { ⋮---- function submod(uint256 a, uint256 b, uint256 n) internal pure returns (uint256) { ⋮---- function _FQ2Mul(uint256 xx, uint256 xy, uint256 yx, uint256 yy) internal pure returns (uint256, uint256) { ⋮---- function _FQ2Muc(uint256 xx, uint256 xy, uint256 c) internal pure returns (uint256, uint256) { ⋮---- function _FQ2Add(uint256 xx, uint256 xy, uint256 yx, uint256 yy) internal pure returns (uint256, uint256) { ⋮---- function _FQ2Sub(uint256 xx, uint256 xy, uint256 yx, uint256 yy) internal pure returns (uint256 rx, uint256 ry) { ⋮---- function _FQ2Div(uint256 xx, uint256 xy, uint256 yx, uint256 yy) internal view returns (uint256, uint256) { ⋮---- function _FQ2Inv(uint256 x, uint256 y) internal view returns (uint256, uint256) { ⋮---- function _isOnCurve(uint256 xx, uint256 xy, uint256 yx, uint256 yy) internal pure returns (bool) { ⋮---- function _modInv(uint256 a, uint256 n) internal view returns (uint256 result) { ⋮---- function _fromJacobian(uint256 pt1xx, uint256 pt1xy, uint256 pt1yx, uint256 pt1yy, uint256 pt1zx, uint256 pt1zy) ⋮---- function _ECTwistAddJacobian(_ECTwistAddJacobianArgs memory $) internal pure returns (uint256[6] memory pt3) { ⋮---- ($.pt2yx, $.pt2yy) = _FQ2Mul($.pt2yx, $.pt2yy, $.pt1zx, $.pt1zy); // U1 = y2 * z1 (pt3[PTYX], pt3[PTYY]) = _FQ2Mul($.pt1yx, $.pt1yy, $.pt2zx, $.pt2zy); // U2 = y1 * z2 ($.pt2xx, $.pt2xy) = _FQ2Mul($.pt2xx, $.pt2xy, $.pt1zx, $.pt1zy); // V1 = x2 * z1 (pt3[PTZX], pt3[PTZY]) = _FQ2Mul($.pt1xx, $.pt1xy, $.pt2zx, $.pt2zy); // V2 = x1 * z2 ⋮---- ($.pt2zx, $.pt2zy) = _FQ2Mul($.pt1zx, $.pt1zy, $.pt2zx, $.pt2zy); // W = z1 * z2 ($.pt1xx, $.pt1xy) = _FQ2Sub($.pt2yx, $.pt2yy, pt3[PTYX], pt3[PTYY]); // U = U1 - U2 ($.pt1yx, $.pt1yy) = _FQ2Sub($.pt2xx, $.pt2xy, pt3[PTZX], pt3[PTZY]); // V = V1 - V2 ($.pt1zx, $.pt1zy) = _FQ2Mul($.pt1yx, $.pt1yy, $.pt1yx, $.pt1yy); // V_squared = V * V ($.pt2yx, $.pt2yy) = _FQ2Mul($.pt1zx, $.pt1zy, pt3[PTZX], pt3[PTZY]); // V_squared_times_V2 = V_squared * V2 ($.pt1zx, $.pt1zy) = _FQ2Mul($.pt1zx, $.pt1zy, $.pt1yx, $.pt1yy); // V_cubed = V * V_squared (pt3[PTZX], pt3[PTZY]) = _FQ2Mul($.pt1zx, $.pt1zy, $.pt2zx, $.pt2zy); // newz = V_cubed * W ($.pt2xx, $.pt2xy) = _FQ2Mul($.pt1xx, $.pt1xy, $.pt1xx, $.pt1xy); // U * U ($.pt2xx, $.pt2xy) = _FQ2Mul($.pt2xx, $.pt2xy, $.pt2zx, $.pt2zy); // U * U * W ($.pt2xx, $.pt2xy) = _FQ2Sub($.pt2xx, $.pt2xy, $.pt1zx, $.pt1zy); // U * U * W - V_cubed ($.pt2zx, $.pt2zy) = _FQ2Muc($.pt2yx, $.pt2yy, 2); // 2 * V_squared_times_V2 ($.pt2xx, $.pt2xy) = _FQ2Sub($.pt2xx, $.pt2xy, $.pt2zx, $.pt2zy); // A = U * U * W - V_cubed - 2 * V_squared_times_V2 (pt3[PTXX], pt3[PTXY]) = _FQ2Mul($.pt1yx, $.pt1yy, $.pt2xx, $.pt2xy); // newx = V * A ($.pt1yx, $.pt1yy) = _FQ2Sub($.pt2yx, $.pt2yy, $.pt2xx, $.pt2xy); // V_squared_times_V2 - A ($.pt1yx, $.pt1yy) = _FQ2Mul($.pt1xx, $.pt1xy, $.pt1yx, $.pt1yy); // U * (V_squared_times_V2 - A) ($.pt1xx, $.pt1xy) = _FQ2Mul($.pt1zx, $.pt1zy, pt3[PTYX], pt3[PTYY]); // V_cubed * U2 (pt3[PTYX], pt3[PTYY]) = _FQ2Sub($.pt1yx, $.pt1yy, $.pt1xx, $.pt1xy); // newy = U * (V_squared_times_V2 - A) - V_cubed * U2 ⋮---- function _ECTwistDoubleJacobian( ⋮---- (pt2xx, pt2xy) = _FQ2Muc(pt1xx, pt1xy, 3); // 3 * x (pt2xx, pt2xy) = _FQ2Mul(pt2xx, pt2xy, pt1xx, pt1xy); // W = 3 * x * x (pt1zx, pt1zy) = _FQ2Mul(pt1yx, pt1yy, pt1zx, pt1zy); // S = y * z (pt2yx, pt2yy) = _FQ2Mul(pt1xx, pt1xy, pt1yx, pt1yy); // x * y (pt2yx, pt2yy) = _FQ2Mul(pt2yx, pt2yy, pt1zx, pt1zy); // B = x * y * S (pt1xx, pt1xy) = _FQ2Mul(pt2xx, pt2xy, pt2xx, pt2xy); // W * W (pt2zx, pt2zy) = _FQ2Muc(pt2yx, pt2yy, 8); // 8 * B (pt1xx, pt1xy) = _FQ2Sub(pt1xx, pt1xy, pt2zx, pt2zy); // H = W * W - 8 * B (pt2zx, pt2zy) = _FQ2Mul(pt1zx, pt1zy, pt1zx, pt1zy); // S_squared = S * S (pt2yx, pt2yy) = _FQ2Muc(pt2yx, pt2yy, 4); // 4 * B (pt2yx, pt2yy) = _FQ2Sub(pt2yx, pt2yy, pt1xx, pt1xy); // 4 * B - H (pt2yx, pt2yy) = _FQ2Mul(pt2yx, pt2yy, pt2xx, pt2xy); // W * (4 * B - H) (pt2xx, pt2xy) = _FQ2Muc(pt1yx, pt1yy, 8); // 8 * y (pt2xx, pt2xy) = _FQ2Mul(pt2xx, pt2xy, pt1yx, pt1yy); // 8 * y * y (pt2xx, pt2xy) = _FQ2Mul(pt2xx, pt2xy, pt2zx, pt2zy); // 8 * y * y * S_squared (pt2yx, pt2yy) = _FQ2Sub(pt2yx, pt2yy, pt2xx, pt2xy); // newy = W * (4 * B - H) - 8 * y * y * S_squared (pt2xx, pt2xy) = _FQ2Muc(pt1xx, pt1xy, 2); // 2 * H (pt2xx, pt2xy) = _FQ2Mul(pt2xx, pt2xy, pt1zx, pt1zy); // newx = 2 * H * S (pt2zx, pt2zy) = _FQ2Mul(pt1zx, pt1zy, pt2zx, pt2zy); // S * S_squared (pt2zx, pt2zy) = _FQ2Muc(pt2zx, pt2zy, 8); // newz = 8 * S * S_squared ⋮---- function _ECTwistMulJacobian( ```` ## File: test/helpers/ed25519TestData.json ````json { "operator": "0xFFa6DD45436695c0185c9E1721638bc951b6853d", "key": "0xf5240b978fc69dc2fdc62775572794e8cd0fd8ac4c0510336fb07232e8086692", "signature": "0x78dd2320878fc2fb9f818d56442926eab183f7b94acfb5eaf5d7a24a018f4c200582b0b0cfc195991e1b827187abd35eb099dda6cd6f3458eb53d086db82c808", "invalidKey": "0xc3e65061bd3c7857f68ab167faa3da83d964d2ec9d2447d367a7cdb4a3256d24", "invalidSignature": "0x4b829ff953a071273aca67046a71a7f2c0d74ab8dcb3636cfeaf6c4a8f3c9ba5a6de5754c5189fc0e38e3df225657043fbfc0786f4b676ffab319bd92af20307" } ```` ## File: test/helpers/ed25519TestGenerator.js ````javascript // Generate random operator address function generateOperatorAddress() { const wallet = ethers.Wallet.createRandom(); ⋮---- // Generate Ed25519 keypair and signature function generateTestData(operatorAddress) { // Generate keypair const privateKey = ed25519.utils.randomPrivateKey(); const publicKey = ed25519.getPublicKey(privateKey); ⋮---- // Create message hash as done in the contract let message = keccak256(Buffer.concat([Buffer.from(operatorAddress.replace("0x", ""), "hex"), publicKey])); ⋮---- // Sign the message const signature = "0x" + bytesToHex(ed25519.sign(message, privateKey)); ⋮---- // Verify the signature const isValid = ed25519.verify( hexToBytes(signature.slice(2)), // Remove 0x prefix ⋮---- throw new Error("Generated signature failed verification"); ⋮---- // Return ABI encoded data const abiCoder = new ethers.AbiCoder(); const key = abiCoder.encode(["bytes32"], ["0x" + bytesToHex(publicKey)]); ⋮---- // Generate invalid test data with mismatched key and signature function generateInvalidTestData(operatorAddress) { // Generate two different keypairs const privateKey1 = ed25519.utils.randomPrivateKey(); const publicKey1 = ed25519.getPublicKey(privateKey1); const privateKey2 = ed25519.utils.randomPrivateKey(); const publicKey2 = ed25519.getPublicKey(privateKey2); ⋮---- // Create message hash with publicKey1 let message = keccak256(Buffer.concat([Buffer.from(operatorAddress.replace("0x", ""), "hex"), publicKey1])); ⋮---- // Sign with privateKey2 (mismatch) const signature = "0x" + bytesToHex(ed25519.sign(message, privateKey2)); ⋮---- // ABI encode publicKey1 ⋮---- const key = abiCoder.encode(["bytes32"], ["0x" + bytesToHex(publicKey1)]); ⋮---- // Generate both valid and invalid test data const operatorAddress = generateOperatorAddress(); const validTestData = generateTestData(operatorAddress); const invalidTestData = generateInvalidTestData(operatorAddress); ⋮---- // Write data to file fs.writeFileSync( ⋮---- JSON.stringify( ```` ## File: test/libraries/keys/KeyBlsBn254.t.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {Test, console2} from "forge-std/Test.sol"; ⋮---- import {KeyBlsBn254} from "../../../src/libraries/keys/KeyBlsBn254.sol"; import {BN254} from "../../../src/libraries/utils/BN254.sol"; ⋮---- import {KeyBlsBn254Mock} from "../../mocks/KeyBlsBn254Mock.sol"; ⋮---- contract KeyBlsBn254Test is Test { ⋮---- function setUp() public { ⋮---- function test_WrapUnwrapIdentity() public { ⋮---- function test_WrapUnwrapNonZero() public { ⋮---- function test_SerializeDeserializeIdentity() public { ⋮---- function test_SerializeDeserializeNonZero() public { ⋮---- function test_SerializeDeserializeNonZeroNegate() public { ⋮---- function test_ToBytesFromBytesIdentity() public { ⋮---- function test_ToBytesFromBytesNonZero() public { ⋮---- function test_FuzzWrapUnwrap(uint256 xIn) public { ⋮---- function test_FuzzSerializeDeserialize(uint256 xIn) public { ⋮---- function test_FuzzSerializeDeserializeNonZeroNegate(uint256 xIn) public { ⋮---- function test_FuzzToBytesFromBytes(uint256 xIn) public { ⋮---- function test_SerializeRevertsInvalidKey() public { ⋮---- function test_DeserializeEmptyBytesIsIdentity() public { ⋮---- function test_DeserializeRevertsInvalidLength() public { ⋮---- function test_FromBytesRevertsInvalidLength() public { ⋮---- function test_FromBytesRevertsInvalidBytes() public { ⋮---- function test_WrapRevertsInvalidKey(uint256 X) public { ⋮---- function test_ZeroKey() public { ⋮---- function test_Equal() public { ⋮---- function test_EqualFalse() public { ⋮---- function test_OutOfBounds() public { ```` ## File: test/libraries/keys/KeyEcdsaSecp256k1.t.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {Test, console2} from "forge-std/Test.sol"; ⋮---- import {KeyEcdsaSecp256k1} from "../../../src/libraries/keys/KeyEcdsaSecp256k1.sol"; ⋮---- import {KeyEcdsaSecp256k1Mock} from "../../mocks/KeyEcdsaSecp256k1Mock.sol"; ⋮---- contract KeyEcdsaSecp256k1Test is Test { ⋮---- function setUp() public { ⋮---- function test_WrapUnwrap() public { ⋮---- function test_SerializeDeserialize() public { ⋮---- function test_ToBytesFromBytes() public { ⋮---- function test_FuzzWrapUnwrap(address rawKey) public { ⋮---- function test_FuzzSerializeDeserialize(address rawKey) public { ⋮---- function test_FuzzToBytesFromBytes(address rawKey) public { ⋮---- function test_FromBytesRevertsIfNot20Bytes() public { ⋮---- function test_DeserializeRevertsIfNot20Bytes() public { ⋮---- function test_FromBytesRevertsInvalidBytes() public { ⋮---- function test_ZeroKey() public { ⋮---- function test_Equal() public { ⋮---- function test_EqualFalse() public { ```` ## File: test/libraries/sigs/SigBlsBn254.t.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {Test, console2} from "forge-std/Test.sol"; ⋮---- import {SigBlsBn254} from "../../../src/libraries/sigs/SigBlsBn254.sol"; import {KeyBlsBn254} from "../../../src/libraries/keys/KeyBlsBn254.sol"; import {BN254} from "../../../src/libraries/utils/BN254.sol"; import {BN254G2} from "../../helpers/BN254G2.sol"; ⋮---- contract SigBlsBn254Test is Test { ⋮---- function getG2Key(uint256 privateKey) public view returns (BN254.G2Point memory) { ⋮---- function test_BLSRegisterOperator() public { ⋮---- function test_BLSRegisterOperatorInvalid() public { ⋮---- function test_ZeroKey() public { ⋮---- function verify(bytes memory keyBytes, bytes memory message, bytes memory signature, bytes memory extraData) ⋮---- function test_InvalidMessageLength() public { ```` ## File: test/libraries/sigs/SigEcdsaSecp256k1.t.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {Test, console2} from "forge-std/Test.sol"; ⋮---- import {SigEcdsaSecp256k1} from "../../../src/libraries/sigs/SigEcdsaSecp256k1.sol"; import {KeyEcdsaSecp256k1} from "../../../src/libraries/keys/KeyEcdsaSecp256k1.sol"; ⋮---- import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; ⋮---- contract SigEcdsaSecp256k1Test is Test { ⋮---- function test_CorrectSignature() public { ⋮---- function test_IncorrectSignature() public { ⋮---- function test_FuzzVerification(uint256 privKey, bytes memory msgData) public { ⋮---- function test_ZeroKey() public { ⋮---- function verify(bytes memory keyBytes, bytes memory message, bytes memory signature, bytes memory extraData) ⋮---- function test_InvalidMessageLength() public { ```` ## File: test/libraries/structs/Checkpoints.t.sol ```` // SPDX-License-Identifier: MIT // This file was procedurally generated from scripts/generate/templates/Checkpoints.t.js. ⋮---- import {Test} from "forge-std/Test.sol"; import {SafeCast} from "@openzeppelin/contracts/utils/math/SafeCast.sol"; import {Checkpoints} from "../../../src/libraries/structs/Checkpoints.sol"; ⋮---- contract CheckpointsTrace208Test is Test { ⋮---- // Maximum gap between keys used during the fuzzing tests: the `_prepareKeys` function with make sure that // key#n+1 is in the [key#n, key#n + _KEY_MAX_GAP] range. ⋮---- // helpers function _boundUint48(uint48 x, uint48 min, uint48 max) internal pure returns (uint48) { ⋮---- function _prepareKeys(uint48[] memory keys, uint48 maxSpread) internal pure { ⋮---- function _prepareKeysUnrepeated(uint48[] memory keys, uint48 maxSpread) internal pure { ⋮---- function _assertLatestCheckpoint(bool exist, uint48 key, uint208 value) internal { ⋮---- // tests function testPush(uint48[] memory keys, uint208[] memory values, uint48 pastKey) public { ⋮---- // initial state ⋮---- // push ⋮---- // check length & latest ⋮---- // used to test reverts function push(uint48 key, uint208 value) external { ⋮---- function testLookup(uint48[] memory keys, uint208[] memory values, uint48 lookup) public { ⋮---- // track expected result of lookups ⋮---- // find the first key that is not smaller than the lookup key ⋮---- function testUpperLookupRecentWithHint( ⋮---- // Build checkpoints ⋮---- // Test upperLookupRecentCheckpoint without hint function testUpperLookupRecentCheckpoint(uint48[] memory keys, uint208[] memory values, uint48 lookup) public { ⋮---- // Expected values ⋮---- // Test function ⋮---- // Test upperLookupRecentCheckpoint with hint function testUpperLookupRecentCheckpointWithHint( ⋮---- // Test latest function testLatest(uint48[] memory keys, uint208[] memory values) public { ⋮---- // Test latestCheckpoint function testLatestCheckpoint(uint48[] memory keys, uint208[] memory values) public { ⋮---- // Test length function testLength(uint48[] memory keys, uint208[] memory values) public { ⋮---- // Test at function testAt(uint48[] memory keys, uint208[] memory values, uint32 index) public { ⋮---- function pop() external { ⋮---- // Test pop function testPop(uint48[] memory keys, uint208[] memory values) public { ⋮---- contract CheckpointsTrace256Test is Test { ⋮---- function _assertLatestCheckpoint(bool exist, uint48 key, uint256 value) internal { ⋮---- function testPush(uint48[] memory keys, uint256[] memory values, uint48 pastKey) public { ⋮---- function push(uint48 key, uint256 value) external { ⋮---- function testLookup(uint48[] memory keys, uint256[] memory values, uint48 lookup) public { ⋮---- function testUpperLookupRecentCheckpoint(uint48[] memory keys, uint256[] memory values, uint48 lookup) public { ⋮---- function testLatest(uint48[] memory keys, uint256[] memory values) public { ⋮---- function testLatestCheckpoint(uint48[] memory keys, uint256[] memory values) public { ⋮---- function testLength(uint48[] memory keys, uint256[] memory values) public { ⋮---- function testAt(uint48[] memory keys, uint256[] memory values, uint32 index) public { ⋮---- function testPop(uint48[] memory keys, uint256[] memory values) public { ⋮---- contract CheckpointsTrace512Test is Test { ⋮---- function _assertEqPair(uint256[2] memory a, uint256[2] memory b) internal { ⋮---- function _assertLatestCheckpointPair(bool exist, uint48 key, uint256[2] memory value) internal { ⋮---- function push(uint48 key, uint256[2] memory value) external { ⋮---- function _safe48(uint256 val) internal pure returns (uint48) { ⋮---- function _getCheckpointAt(uint32 i) internal view returns (uint48, uint256[2] memory) { ```` ## File: test/libraries/structs/PersistentSet.t.sol ```` // SPDX-License-Identifier: MIT ⋮---- import "forge-std/Test.sol"; import {PersistentSet} from "../../../src/libraries/structs/PersistentSet.sol"; import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; ⋮---- contract PersistentSetTest is Test { ⋮---- function setUp() public {} ⋮---- function test_AddressSetAddRemoveAndContains() public { ⋮---- function test_AddressSetLengthAndValuesAt() public { ⋮---- function test_AddressSetAllValues() public { ⋮---- function test_Bytes32SetAddRemoveAndContains() public { ⋮---- function test_Bytes32SetValuesAt() public { ⋮---- function test_Bytes32SetAllValues() public { ⋮---- function test_LargeAddressSetExceed256Elements() public { ⋮---- function remove(uint48 key, address value) public { ⋮---- function test_RevertPersistentSet_InvalidKey() public { ```` ## File: test/libraries/utils/InputNormalizer.t.sol ```` // SPDX-License-Identifier: MIT ⋮---- import "forge-std/Test.sol"; import {InputNormalizer} from "../../../src/libraries/utils/InputNormalizer.sol"; ⋮---- contract InputNormalizerTest is Test { function normalizeSingleDim(bytes[] memory arr, uint256 length) public pure returns (bytes[] memory) { ⋮---- function normalizeDoubleDim(bytes[][] memory arr, uint256 length) public pure returns (bytes[][] memory) { ⋮---- function test_normalizeSingleDimEmpty() public { ⋮---- function test_normalizeSingleDimExact() public { ⋮---- function test_normalizeSingleDimMismatchRevert() public { ⋮---- function test_normalizeDoubleDimEmpty() public { ⋮---- function test_normalizeDoubleDimExact() public { ⋮---- function test_normalizeDoubleDimMismatchRevert() public { ```` ## File: test/libraries/utils/KeyTag.t.sol ```` // SPDX-License-Identifier: MIT ⋮---- import "forge-std/Test.sol"; import {KeyTags} from "../../../src/libraries/utils/KeyTags.sol"; ⋮---- contract KeyTagTest is Test { ⋮---- function setUp() public {} ⋮---- function test_GetKeyTagValid() public { ⋮---- function test_GetKeyTagInvalidType() public { ⋮---- function getKeyTag(uint8 type_, uint8 identifier) public pure returns (uint8) { ⋮---- function test_GetKeyTagInvalidIdentifier() public { ⋮---- function test_GetType() public { ⋮---- function test_GetTag() public { ⋮---- function test_GetTypeRevertWhenTooLarge() public { ⋮---- function getType(uint8 keyTag) public pure returns (uint8) { ⋮---- function test_GetTagRevertWhenTooLarge() public { ⋮---- function getTag(uint8 keyTag) public pure returns (uint8) { ⋮---- function test_ContainsAddRemove() public { ⋮---- function test_AddMultiple() public { ⋮---- function test_SerializeUniqueKeyTags() public { ⋮---- function serialize(uint8[] memory tags) public pure returns (uint128) { ⋮---- function test_SerializeRevertOnDuplicate() public { ⋮---- function test_DeserializeBitmask() public { ```` ## File: test/libraries/utils/ValSetVerifier.t.sol ```` // SPDX-License-Identifier: MIT ⋮---- import "forge-std/Test.sol"; import {ValSetVerifier} from "../../../src/libraries/utils/ValSetVerifier.sol"; import {ValSetVerifierMock} from "../../mocks/ValSetVerifierMock.sol"; ⋮---- contract ValSetVerifierContract { function verifyOperator( ⋮---- function verifyVotingPower( ⋮---- function verifyIsActive( ⋮---- function verifyKey( ⋮---- function verifyValidatorKeyRootLocal( ⋮---- function verifyVault( ⋮---- function verifyValidatorVaultRootLocal( ⋮---- contract ValSetVerifierDataTest is Test { ⋮---- function setUp() public { ⋮---- function test_VerifyOperator() public { ⋮---- function test_VerifyVotingPower() public { ⋮---- function test_VerifyIsActive() public { ⋮---- function test_VerifyKey() public { ⋮---- function test_VerifyVault() public { ⋮---- ValSetVerifier.SszProof({leaf: bytes32(uint256(0x697a) << (256 - 2 * 8)), proof: vaultChainIdArr}); // 0x7a69 = 31337 ```` ## File: test/mocks/KeyBlsBn254Mock.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {BN254} from "../../src/libraries/utils/BN254.sol"; import {KeyBlsBn254} from "../../src/libraries/keys/KeyBlsBn254.sol"; ⋮---- contract KeyBlsBn254Mock { function wrap(BN254.G1Point memory keyRaw) public view returns (KeyBlsBn254.KEY_BLS_BN254 memory key) { ⋮---- function unwrap(KeyBlsBn254.KEY_BLS_BN254 memory key) public view returns (BN254.G1Point memory keyRaw) { ⋮---- function serialize(KeyBlsBn254.KEY_BLS_BN254 memory key) public view returns (bytes memory keySerialized) { ⋮---- function deserialize(bytes memory keySerialized) public view returns (KeyBlsBn254.KEY_BLS_BN254 memory key) { ⋮---- function toBytes(KeyBlsBn254.KEY_BLS_BN254 memory key) public view returns (bytes memory keyBytes) { ⋮---- function fromBytes(bytes memory keyBytes) public view returns (KeyBlsBn254.KEY_BLS_BN254 memory key) { ⋮---- function zeroKey() public view returns (KeyBlsBn254.KEY_BLS_BN254 memory key) { ⋮---- function equal(KeyBlsBn254.KEY_BLS_BN254 memory key1, KeyBlsBn254.KEY_BLS_BN254 memory key2) ```` ## File: test/mocks/KeyEcdsaSecp256k1Mock.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {KeyEcdsaSecp256k1} from "../../src/libraries/keys/KeyEcdsaSecp256k1.sol"; ⋮---- contract KeyEcdsaSecp256k1Mock { function wrap(address keyRaw) public view returns (KeyEcdsaSecp256k1.KEY_ECDSA_SECP256K1 memory key) { ⋮---- function unwrap(KeyEcdsaSecp256k1.KEY_ECDSA_SECP256K1 memory key) public view returns (address keyRaw) { ⋮---- function serialize(KeyEcdsaSecp256k1.KEY_ECDSA_SECP256K1 memory key) ⋮---- function deserialize(bytes memory keySerialized) ⋮---- function toBytes(KeyEcdsaSecp256k1.KEY_ECDSA_SECP256K1 memory key) public view returns (bytes memory keyBytes) { ⋮---- function fromBytes(bytes memory keyBytes) public view returns (KeyEcdsaSecp256k1.KEY_ECDSA_SECP256K1 memory key) { ⋮---- function zeroKey() public view returns (KeyEcdsaSecp256k1.KEY_ECDSA_SECP256K1 memory key) { ⋮---- function equal( ```` ## File: test/mocks/KeyRegistryWithKey64.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {KeyRegistry} from "../../src/modules/key-registry/KeyRegistry.sol"; ⋮---- import {IKeyRegistry} from "../../src/interfaces/modules/key-registry/IKeyRegistry.sol"; ⋮---- import {MulticallUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/MulticallUpgradeable.sol"; ⋮---- import {OzEIP712} from "../../src/modules/base/OzEIP712.sol"; ⋮---- import {Checkpoints} from "../../src/libraries/structs/Checkpoints.sol"; import {InputNormalizer} from "../../src/libraries/utils/InputNormalizer.sol"; import {PersistentSet} from "../../src/libraries/structs/PersistentSet.sol"; ⋮---- import {KeyTags} from "../../src/libraries/utils/KeyTags.sol"; import {KeyBlsBn254} from "../../src/libraries/keys/KeyBlsBn254.sol"; import {KeyEcdsaSecp256k1} from "../../src/libraries/keys/KeyEcdsaSecp256k1.sol"; ⋮---- import {SigBlsBn254} from "../../src/libraries/sigs/SigBlsBn254.sol"; import {SigEcdsaSecp256k1} from "../../src/libraries/sigs/SigEcdsaSecp256k1.sol"; ⋮---- contract KeyRegistryWithKey64 is KeyRegistry { ⋮---- function getKeyAt(address operator, uint8 tag, uint48 timestamp) public view override returns (bytes memory) { ⋮---- function getKey(address operator, uint8 tag) public view override returns (bytes memory) { ⋮---- function _setKey(address operator, uint8 tag, bytes memory key) internal override { ⋮---- function _verifyKey( ```` ## File: test/mocks/NoPermissionManager.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {PermissionManager} from "../../src/modules/base/PermissionManager.sol"; ⋮---- abstract contract NoPermissionManager is PermissionManager { function __NoPermissionManager_init() internal virtual onlyInitializing {} function _checkPermission() internal pure virtual override {} ```` ## File: test/mocks/RewarderMock.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {IBaseRewards} from "../../src/interfaces/modules/voting-power/extensions/IBaseRewards.sol"; ⋮---- contract RewarderMock { function distributeStakerRewards( ⋮---- function distributeOperatorRewards( ```` ## File: test/mocks/SigVerifierFalseMock.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {ISigVerifier} from "../../src/interfaces/modules/settlement/sig-verifiers/ISigVerifier.sol"; ⋮---- contract SigVerifierFalseMock is ISigVerifier { /** * @inheritdoc ISigVerifier */ ⋮---- function verifyQuorumSig( address, /* settlement */ uint48, /* epoch */ bytes memory, /* message */ uint8, /* keyTag */ uint256, /* quorumThreshold */ bytes calldata /* proof */ ```` ## File: test/mocks/SigVerifierMock.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {ISigVerifier} from "../../src/interfaces/modules/settlement/sig-verifiers/ISigVerifier.sol"; ⋮---- contract SigVerifierMock is ISigVerifier { /** * @inheritdoc ISigVerifier */ ⋮---- function verifyQuorumSig( address, /* settlement */ uint48, /* epoch */ bytes memory, /* message */ uint8, /* keyTag */ uint256, /* quorumThreshold */ bytes calldata /* proof */ ```` ## File: test/mocks/SlasherMock.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {IBaseSlashing} from "../../src/interfaces/modules/voting-power/extensions/IBaseSlashing.sol"; ⋮---- contract SlasherMock { function slashVault( ⋮---- function executeSlashVault(address middleware, address vault, uint256 slashIndex, bytes memory hints) ```` ## File: test/mocks/ValSetVerifierMock.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {ValSetVerifier} from "../../src/libraries/utils/ValSetVerifier.sol"; ⋮---- contract ValSetVerifierMock { function verifyOperator( ⋮---- function verifyValidatorRootLocal( ⋮---- function verifyValidatorOperatorLocal(ValSetVerifier.SszProof calldata operatorRootProof, bytes32 validatorSetRoot) ⋮---- function verifyValidatorVaultRootLocal( ⋮---- function verifyVaultVotingPowerLocal(ValSetVerifier.SszProof calldata vaultVotingPowerProof, bytes32 vaultRoot) ```` ## File: test/mocks/VotingPowerProviderFull.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {VotingPowerProvider} from "../../src/modules/voting-power/VotingPowerProvider.sol"; import {OzAccessControl} from "../../src/modules/common/permissions/OzAccessControl.sol"; import {EqualStakeVPCalc} from "../../src/modules/voting-power/common/voting-power-calc/EqualStakeVPCalc.sol"; import {SharedVaults} from "../../src/modules/voting-power/extensions/SharedVaults.sol"; import {OperatorsBlacklist} from "../../src/modules/voting-power/extensions/OperatorsBlacklist.sol"; import {OperatorsWhitelist} from "../../src/modules/voting-power/extensions/OperatorsWhitelist.sol"; import {NetworkManager} from "../../src/modules/base/NetworkManager.sol"; import {OpNetVaultAutoDeploy} from "../../src/modules/voting-power/extensions/OpNetVaultAutoDeploy.sol"; import {OperatorVaults} from "../../src/modules/voting-power/extensions/OperatorVaults.sol"; import {BaseSlashing} from "../../src/modules/voting-power/extensions/BaseSlashing.sol"; import { PricedTokensChainlinkVPCalc } from "../../src/modules/voting-power/common/voting-power-calc/PricedTokensChainlinkVPCalc.sol"; import {WeightedTokensVPCalc} from "../../src/modules/voting-power/common/voting-power-calc/WeightedTokensVPCalc.sol"; import {WeightedVaultsVPCalc} from "../../src/modules/voting-power/common/voting-power-calc/WeightedVaultsVPCalc.sol"; import {VotingPowerCalcManager} from "../../src/modules/voting-power/base/VotingPowerCalcManager.sol"; ⋮---- contract VotingPowerProviderFull is ⋮---- function initialize( ⋮---- function _registerOperatorImpl(address operator) ⋮---- function _unregisterOperatorVaultImpl(address operator, address vault) ⋮---- function stakeToVotingPowerAt(address vault, uint256 stake, bytes memory extraData, uint48 timestamp) ⋮---- function stakeToVotingPower(address vault, uint256 stake, bytes memory extraData) ```` ## File: test/mocks/VotingPowerProviderSemiFull.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {VotingPowerProvider} from "../../src/modules/voting-power/VotingPowerProvider.sol"; import {OzOwnable} from "../../src/modules/common/permissions/OzOwnable.sol"; import {EqualStakeVPCalc} from "../../src/modules/voting-power/common/voting-power-calc/EqualStakeVPCalc.sol"; import {SharedVaults} from "../../src/modules/voting-power/extensions/SharedVaults.sol"; import {MultiToken} from "../../src/modules/voting-power/extensions/MultiToken.sol"; import {OperatorsBlacklist} from "../../src/modules/voting-power/extensions/OperatorsBlacklist.sol"; import {OperatorsWhitelist} from "../../src/modules/voting-power/extensions/OperatorsWhitelist.sol"; import {NetworkManager} from "../../src/modules/base/NetworkManager.sol"; import {OpNetVaultAutoDeploy} from "../../src/modules/voting-power/extensions/OpNetVaultAutoDeploy.sol"; import {OperatorVaults} from "../../src/modules/voting-power/extensions/OperatorVaults.sol"; import {BaseSlashing} from "../../src/modules/voting-power/extensions/BaseSlashing.sol"; import {BaseRewards} from "../../src/modules/voting-power/extensions/BaseRewards.sol"; ⋮---- contract VotingPowerProviderSemiFull is ⋮---- function initialize( ⋮---- function _registerOperatorImpl(address operator) ```` ## File: test/mocks/VotingPowerProviderSharedVaults.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {VotingPowerProvider} from "../../src/modules/voting-power/VotingPowerProvider.sol"; import {OzOwnable} from "../../src/modules/common/permissions/OzOwnable.sol"; import {EqualStakeVPCalc} from "../../src/modules/voting-power/common/voting-power-calc/EqualStakeVPCalc.sol"; import {SharedVaults} from "../../src/modules/voting-power/extensions/SharedVaults.sol"; ⋮---- contract VotingPowerProviderSharedVaults is VotingPowerProvider, OzOwnable, EqualStakeVPCalc, SharedVaults { ⋮---- function initialize( ```` ## File: test/modules/base/NetworkManager.t.sol ```` // SPDX-License-Identifier: MIT ⋮---- import "forge-std/Test.sol"; ⋮---- import {NetworkManager} from "../../../src/modules/base/NetworkManager.sol"; import {INetworkManager} from "../../../src/interfaces/modules/base/INetworkManager.sol"; ⋮---- import {Subnetwork} from "@symbioticfi/core/src/contracts/libraries/Subnetwork.sol"; ⋮---- contract TestNetworkManager is NetworkManager { function initialize(address net, uint96 subID) external initializer { ⋮---- contract NetworkManagerTest is Test { ⋮---- function setUp() public { ⋮---- function test_InitializeAndCheckGetters() public { ⋮---- function test_ReinitializeReverts() public { ⋮---- function test_DefaultsBeforeInit() public { ⋮---- function test_Location() public { ⋮---- function test_RevertNetworkManager_InvalidNetwork() public { ```` ## File: test/modules/base/OzEIP712.t.sol ```` // SPDX-License-Identifier: MIT ⋮---- import "forge-std/Test.sol"; ⋮---- import {OzEIP712} from "../../../src/modules/base/OzEIP712.sol"; import {IOzEIP712} from "../../../src/interfaces/modules/base/IOzEIP712.sol"; import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; ⋮---- contract TestOzEIP712 is OzEIP712 { function initialize(string memory _name, string memory _version) external initializer { ⋮---- contract OzEIP712Test is Test { ⋮---- function setUp() public { ⋮---- function test_InitializeSetsDomain() public { ⋮---- function test_Location() public { ⋮---- function test_HashTypedDataV4() public { ⋮---- function test_SignatureRecovery() public { ⋮---- function test_ReInitialize() public { ```` ## File: test/modules/base/PermissionManager.t.sol ```` // SPDX-License-Identifier: MIT ⋮---- import "forge-std/Test.sol"; import {PermissionManager} from "../../../src/modules/base/PermissionManager.sol"; import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; ⋮---- contract TestPermissionManager is PermissionManager { ⋮---- function initialize(address _owner) external initializer { ⋮---- function _checkPermission() internal view override { ⋮---- function protectedAction() external checkPermission {} ⋮---- contract PermissionManagerTest is Test { ⋮---- function setUp() public { ⋮---- function test_ProtectedAction_SucceedsForOwner() public { ⋮---- function test_ProtectedAction_RevertIfNotOwner() public { ```` ## File: test/modules/base/VotingPowerCalcManager.t.sol ```` // SPDX-License-Identifier: MIT ⋮---- import "forge-std/Test.sol"; import {VotingPowerCalcManager} from "../../../src/modules/voting-power/base/VotingPowerCalcManager.sol"; ⋮---- contract TestVotingPowerCalcManager is VotingPowerCalcManager { ⋮---- function initialize() external initializer { ⋮---- function stakeToVotingPowerAt(address vault, uint256 stake, bytes memory extraData, uint48 timestamp) ⋮---- function stakeToVotingPower(address vault, uint256 stake, bytes memory extraData) ⋮---- contract VotingPowerCalcManagerTest is Test { ⋮---- function setUp() public { ⋮---- function testReInitializeReverts() public { ⋮---- function testStakeToVotingPowerAt() public { ⋮---- // We'll pass in some dummy values for the other arguments. ⋮---- function testStakeToVotingPower() public { ⋮---- function testWithExtraData() public { ```` ## File: test/modules/common/permissions/NoPermissionManager.t.sol ```` // SPDX-License-Identifier: MIT ⋮---- import "forge-std/Test.sol"; import {NoPermissionManager} from "../../../../test/mocks/NoPermissionManager.sol"; ⋮---- contract TestNoPermissionManager is NoPermissionManager { function initialize() external initializer {} ⋮---- function actionRequiringNoPermission() external checkPermission {} ⋮---- contract NoPermissionManagerTest is Test { ⋮---- function setUp() public { ⋮---- function test_NoPermissionCheck() public { ```` ## File: test/modules/common/permissions/OzAccessControl.t.sol ```` // SPDX-License-Identifier: MIT ⋮---- import "forge-std/Test.sol"; import {OzAccessControl} from "../../../../src/modules/common/permissions/OzAccessControl.sol"; import {IOzAccessControl} from "../../../../src/interfaces/modules/common/permissions/IOzAccessControl.sol"; import {AccessControlUpgradeable} from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; ⋮---- contract TestOzAccessControl is OzAccessControl { ⋮---- function initialize() external initializer { ⋮---- function protectedFunction() external checkPermission {} ⋮---- function setSelectorRole(bytes4 selector, bytes32 role) external { ⋮---- contract OzAccessControlTest is Test { ⋮---- function setUp() public { ⋮---- function test_Location() public { ⋮---- function test_ProtectedFunction_DefaultAdminCanCall() public { ⋮---- function testProtectedFunction_RevertIfCallerDoesNotHaveRole() public { ⋮---- function testChangeRoleForProtectedFunction() public { ⋮---- function testGetRoleForFunctionSelector() public { ⋮---- function testSetNoRoleForSelector() public { ```` ## File: test/modules/common/permissions/OzAccessManaged.t.sol ```` // SPDX-License-Identifier: MIT ⋮---- import "forge-std/Test.sol"; import {OzAccessManaged} from "../../../../src/modules/common/permissions/OzAccessManaged.sol"; ⋮---- import {IAuthority} from "@openzeppelin/contracts/access/manager/IAuthority.sol"; ⋮---- contract MockAuthority is IAuthority { ⋮---- function canCall(address caller, address target, bytes4 selector) external view returns (bool) { ⋮---- contract TestOzAccessManaged is OzAccessManaged { function protectedAction() external checkPermission {} ⋮---- function initialize(address authority) external initializer { ⋮---- contract OzAccessManagedTest is Test { ⋮---- function setUp() public { ⋮---- function testProtectedAction_SucceedsForAdmin() public { ⋮---- function testProtectedAction_RevertsForNonAdmin() public { ⋮---- function testCannotChangeAuthority() public { ```` ## File: test/modules/common/permissions/OzOwnable.t.sol ```` // SPDX-License-Identifier: MIT ⋮---- import "forge-std/Test.sol"; import {OzOwnable} from "../../../../src/modules/common/permissions/OzOwnable.sol"; ⋮---- contract TestOzOwnable is OzOwnable { function initialize(address owner_) external initializer { ⋮---- function protectedAction() external checkPermission {} ⋮---- contract OzOwnableTest is Test { ⋮---- function setUp() public { ⋮---- function testProtectedAction_SucceedsForOwner() public { ⋮---- function testProtectedAction_RevertsForNonOwner() public { ⋮---- function testReinitializeReverts() public { ⋮---- function testTransferOwnership() public { ⋮---- testOwnable.protectedAction(); // should succeed ```` ## File: test/modules/key-registry/KeyRegistry.t.sol ```` // SPDX-License-Identifier: MIT ⋮---- import "forge-std/Test.sol"; ⋮---- import {KeyRegistry} from "../../../src/modules/key-registry/KeyRegistry.sol"; import {IKeyRegistry} from "../../../src/interfaces/modules/key-registry/IKeyRegistry.sol"; ⋮---- import {KeyBlsBn254} from "../../../src/libraries/keys/KeyBlsBn254.sol"; import {KeyEcdsaSecp256k1} from "../../../src/libraries/keys/KeyEcdsaSecp256k1.sol"; import {BN254} from "../../../src/libraries/utils/BN254.sol"; import {BN254G2} from "../../helpers/BN254G2.sol"; import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import { KEY_TYPE_BLS_BN254, KEY_TYPE_ECDSA_SECP256K1 } from "../../../src/interfaces/modules/key-registry/IKeyRegistry.sol"; ⋮---- import {IOzEIP712} from "../../../src/interfaces/modules/base/IOzEIP712.sol"; import {KeyTags} from "../../../src/libraries/utils/KeyTags.sol"; ⋮---- import {KeyRegistryWithKey64, KEY_TYPE_KEY64} from "../../mocks/KeyRegistryWithKey64.sol"; ⋮---- contract TestKeyRegistry is KeyRegistryWithKey64 { function initialize(string memory name_, string memory version_) external initializer { ⋮---- function getKeyTagsAt(address operator, uint48 timestamp) public view virtual returns (uint8[] memory) { ⋮---- function getKeyTags(address operator) public view virtual returns (uint8[] memory) { ⋮---- contract KeyRegistryTest is Test { ⋮---- function getG2Key(uint256 privateKey) internal view returns (BN254.G2Point memory) { ⋮---- function setUp() public { ⋮---- function test_SetECDSAKey() public { ⋮---- function test_SetECDSAKey_RevertOnInvalidSignature() public { ⋮---- function test_SetBLSKey() public { ⋮---- function test_SetKey_AlreadyUsedKeyDifferentOperator() public { ⋮---- function test_SetKey_SameOperatorSameTag_Overwrite() public { ⋮---- function test_SetKey_SameOperatorDifferentTags() public { ⋮---- function test_SetKey_RevertOnInvalidKeyType() public { ⋮---- function test_GetOperator_UnknownKey() public { ⋮---- function test_GetKeysOperators_MultipleOperators() public { ⋮---- function test_GetKeysAt_TimeCheckpoints() public { ⋮---- function _registerSimpleECDSA(address operator, uint256 pk, uint8 tagIdentifier) internal { ⋮---- function test_SetKey64() public { ⋮---- function test_Location() public { ```` ## File: test/modules/settlement/sig-verifiers/libraries/ExtraDataStorageHelper.t.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {Test} from "forge-std/Test.sol"; import {ExtraDataStorageHelper} from "src/modules/settlement/sig-verifiers/libraries/ExtraDataStorageHelper.sol"; ⋮---- contract ExtraDataStorageHelperTest is Test { function _randomNameHash(string memory seed) internal pure returns (bytes32) { ⋮---- function test_BaseKey() public { ⋮---- function test_TaggedKey() public { ⋮---- function test_IndexedKey() public { ⋮---- // Check first few indices ⋮---- function testFuzz_Uniqueness( ⋮---- function test_SimpleKey() public { ⋮---- function test_TagOnlyKey() public { ⋮---- function test_IndexedTagOnlyKey() public { ```` ## File: test/modules/settlement/sig-verifiers/SigVerifierBlsBn254Simple.t.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {KeyTags} from "../../../../src/libraries/utils/KeyTags.sol"; import {KeyEcdsaSecp256k1} from "../../../../src/libraries/keys/KeyEcdsaSecp256k1.sol"; import {KeyBlsBn254, BN254} from "../../../../src/libraries/keys/KeyBlsBn254.sol"; import {SigBlsBn254} from "../../../../src/libraries/sigs/SigBlsBn254.sol"; import { KEY_TYPE_BLS_BN254, KEY_TYPE_ECDSA_SECP256K1 } from "../../../../src/interfaces/modules/key-registry/IKeyRegistry.sol"; import { ExtraDataStorageHelper } from "../../../../src/modules/settlement/sig-verifiers/libraries/ExtraDataStorageHelper.sol"; ⋮---- import {BN254G2} from "../../../helpers/BN254G2.sol"; ⋮---- import {ISettlement} from "../../../../src/interfaces/modules/settlement/ISettlement.sol"; import {IOzOwnable} from "../../../../src/interfaces/modules/common/permissions/IOzOwnable.sol"; import {INetworkManager} from "../../../../src/interfaces/modules/base/INetworkManager.sol"; import {IEpochManager} from "../../../../src/interfaces/modules/valset-driver/IEpochManager.sol"; import {IOperatorsWhitelist} from "../../../../src/interfaces/modules/voting-power/extensions/IOperatorsWhitelist.sol"; import {IOzEIP712} from "../../../../src/interfaces/modules/base/IOzEIP712.sol"; import { ISigVerifierBlsBn254Simple } from "../../../../src/interfaces/modules/settlement/sig-verifiers/ISigVerifierBlsBn254Simple.sol"; import {IVotingPowerProvider} from "../../../../src/interfaces/modules/voting-power/IVotingPowerProvider.sol"; ⋮---- import {MasterSetupTest} from "../../../MasterSetup.sol"; ⋮---- import {console2} from "forge-std/console2.sol"; ⋮---- import { SigVerifierBlsBn254Simple } from "../../../../src/modules/settlement/sig-verifiers/SigVerifierBlsBn254Simple.sol"; import "../../../InitSetup.sol"; ⋮---- import {ISigVerifier} from "../../../../src/interfaces/modules/settlement/sig-verifiers/ISigVerifier.sol"; ⋮---- import {Bytes} from "@openzeppelin/contracts/utils/Bytes.sol"; import {Math} from "@openzeppelin/contracts/utils/math/Math.sol"; ⋮---- import {VotingPowerProviderSemiFull} from "../../../mocks/VotingPowerProviderSemiFull.sol"; import {MyKeyRegistry} from "../../../../examples/MyKeyRegistry.sol"; import {MySettlement} from "../../../../examples/MySettlement.sol"; import {MyValSetDriver} from "../../../../examples/MyValSetDriver.sol"; ⋮---- import {IKeyRegistry} from "../../../../src/interfaces/modules/key-registry/IKeyRegistry.sol"; import {IValSetDriver} from "../../../../src/interfaces/modules/valset-driver/IValSetDriver.sol"; ⋮---- contract SigVerifierBlsBn254SimpleTest is MasterSetupTest { ⋮---- function setUp() public override { ⋮---- function test_verifyQuorumSig1() public { ⋮---- function test_verifyQuorumSig2() public { ⋮---- function test_verifyQuorumSig3() public { ⋮---- function test_RevertUnsupportedKeyTag() public { ⋮---- function test_RevertInvalidMessageLength() public { ⋮---- function test_RevertInvalidProofOffset() public { ⋮---- function test_RevertInvalidProofLength() public { ⋮---- function test_ZeroValidators() public { ⋮---- function test_RevertTooManyValidators() public { ⋮---- function test_RevertInvalidNonSignerIndex() public { ⋮---- function test_RevertInvalidNonSignersOrder() public { ⋮---- function test_FalseValidatorSet() public { ⋮---- function test_Revert_InvalidNonSignersOrder() public { ⋮---- function test_FalseQuorumThreshold() public { ⋮---- function loadGenesisSimple() ⋮---- function getValidatorsData() public returns (ValidatorData[] memory validatorsData, uint256[] memory privateKeys) { ```` ## File: test/modules/settlement/sig-verifiers/SigVerifierBlsBn254ZK.t.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {KeyTags} from "../../../../src/libraries/utils/KeyTags.sol"; import {KeyEcdsaSecp256k1} from "../../../../src/libraries/keys/KeyEcdsaSecp256k1.sol"; import {KeyBlsBn254, BN254} from "../../../../src/libraries/keys/KeyBlsBn254.sol"; import {SigBlsBn254} from "../../../../src/libraries/sigs/SigBlsBn254.sol"; import { KEY_TYPE_BLS_BN254, KEY_TYPE_ECDSA_SECP256K1 } from "../../../../src/interfaces/modules/key-registry/IKeyRegistry.sol"; ⋮---- import {BN254G2} from "../../../helpers/BN254G2.sol"; ⋮---- import {ISettlement} from "../../../../src/interfaces/modules/settlement/ISettlement.sol"; ⋮---- import "../../../MasterGenesisSetup.sol"; ⋮---- import {console2} from "forge-std/console2.sol"; import {stdStorage, StdStorage} from "forge-std/Test.sol"; ⋮---- import {SigVerifierBlsBn254ZK} from "../../../../src/modules/settlement/sig-verifiers/SigVerifierBlsBn254ZK.sol"; ⋮---- import {ISigVerifier} from "../../../../src/interfaces/modules/settlement/sig-verifiers/ISigVerifier.sol"; import {IVotingPowerProvider} from "../../../../src/interfaces/modules/voting-power/IVotingPowerProvider.sol"; import { ISigVerifierBlsBn254ZK } from "../../../../src/interfaces/modules/settlement/sig-verifiers/ISigVerifierBlsBn254ZK.sol"; ⋮---- import { ExtraDataStorageHelper } from "../../../../src/modules/settlement/sig-verifiers/libraries/ExtraDataStorageHelper.sol"; ⋮---- import {Bytes} from "@openzeppelin/contracts/utils/Bytes.sol"; import {Math} from "@openzeppelin/contracts/utils/math/Math.sol"; ⋮---- contract SigVerifierBlsBn254ZKTest is MasterGenesisSetupTest { ⋮---- function setUp() public override { ⋮---- function test_Create() public { ⋮---- function test_RevertInvalidLength() public { ⋮---- function test_Revert_InvalidMaxValidators() public { ⋮---- function test_Revert_InvalidVerifier() public { ⋮---- function test_Revert_InvalidMaxValidatorsOrder() public { ⋮---- function test_Revert_UnsupportedKeyTag() public { ⋮---- function test_Revert_InvalidMessageLength() public { ⋮---- function test_Revert_InvalidProofLength() public { ⋮---- function test_FalseQuorumThreshold() public { ⋮---- function test_verifyQuorumSig() public { ⋮---- function test_verifyQuorumSig_FalseZkProof() public { ⋮---- function test_ZeroValidators() public { ⋮---- function test_RevertInvalidTotalActiveValidators() public { ```` ## File: test/modules/settlement/Settlement.t.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {Test} from "forge-std/Test.sol"; ⋮---- import {KeyTags} from "../../../src/libraries/utils/KeyTags.sol"; import {KeyEcdsaSecp256k1} from "../../../src/libraries/keys/KeyEcdsaSecp256k1.sol"; import {KeyBlsBn254, BN254} from "../../../src/libraries/keys/KeyBlsBn254.sol"; import {SigBlsBn254} from "../../../src/libraries/sigs/SigBlsBn254.sol"; ⋮---- import {BN254G2} from "../../helpers/BN254G2.sol"; ⋮---- import {ISettlement} from "../../../src/interfaces/modules/settlement/ISettlement.sol"; ⋮---- import {MasterGenesisSetupTest} from "../../MasterGenesisSetup.sol"; ⋮---- import {console2} from "forge-std/console2.sol"; ⋮---- import {SigVerifierBlsBn254ZK} from "../../../src/modules/settlement/sig-verifiers/SigVerifierBlsBn254ZK.sol"; ⋮---- import {Bytes} from "@openzeppelin/contracts/utils/Bytes.sol"; import {Math} from "@openzeppelin/contracts/utils/math/Math.sol"; import {Settlement} from "../../../src/modules/settlement/Settlement.sol"; ⋮---- import {IOzEIP712} from "../../../src/interfaces/modules/base/IOzEIP712.sol"; import {INetworkManager} from "../../../src/interfaces/modules/base/INetworkManager.sol"; import {SigVerifierMock} from "../../mocks/SigVerifierMock.sol"; import {SigVerifierBlsBn254Simple} from "../../../src/modules/settlement/sig-verifiers/SigVerifierBlsBn254Simple.sol"; import {SigVerifierFalseMock} from "../../mocks/SigVerifierFalseMock.sol"; ⋮---- contract SettlementTest is MasterGenesisSetupTest { ⋮---- function setUp() public override { ⋮---- // function test_commitValSetHeader() public { // (ISettlement.ValSetHeader memory valSetHeader, ISettlement.ExtraData[] memory extraData) = loadGenesis(); ⋮---- // valSetHeader.epoch = 1; // valSetHeader.captureTimestamp = uint48(vm.getBlockTimestamp()) - 1; ⋮---- // bytes32 messageHash = masterSetupParams.master.hashTypedDataV4CrossChain( // keccak256( // abi.encode( // VALSET_HEADER_COMMIT_TYPEHASH, // masterSetupParams.master.SUBNETWORK(), // 0, // keccak256(abi.encode(valSetHeader)), // keccak256(abi.encode(extraData)) // ) // ) // ); ⋮---- // console2.log("messageHash"); // console2.logBytes32(messageHash); ⋮---- // BN254.G1Point memory aggKeyG1; // BN254.G2Point memory aggKeyG2; // BN254.G1Point memory aggSigG1; ⋮---- // for (uint256 i; i < vars.operators.length; ++i) { // BN254.G1Point memory keyG1 = BN254.generatorG1().scalar_mul(vars.operators[i].privateKey); ⋮---- // BN254.G2Point memory keyG2 = getG2Key(vars.operators[i].privateKey); // BN254.G1Point memory messageG1 = BN254.hashToG1(messageHash); // BN254.G1Point memory sigG1 = messageG1.scalar_mul(vars.operators[i].privateKey); // aggSigG1 = aggSigG1.plus(sigG1); // aggKeyG1 = aggKeyG1.plus(keyG1); ⋮---- // if (aggKeyG2.X[0] == 0 && aggKeyG2.X[1] == 0 && aggKeyG2.Y[0] == 0 && aggKeyG2.Y[1] == 0) { // aggKeyG2 = keyG2; // } else { // (uint256 x1, uint256 x2, uint256 y1, uint256 y2) = BN254G2.ECTwistAdd( // aggKeyG2.X[1], // aggKeyG2.X[0], // aggKeyG2.Y[1], // aggKeyG2.Y[0], // keyG2.X[1], // keyG2.X[0], // keyG2.Y[1], // keyG2.Y[0] // ); // aggKeyG2 = BN254.G2Point([x2, x1], [y2, y1]); // } // } ⋮---- // bytes memory zkProof = // hex"0c9d92bd8aac8588329e85aade26354a7b9206e170f0df0ee891c3927e5a58522adf6d35c9649dbf628cfe567bc31647d52cf5ae023c88984cecbf01fb477d492761b1f57ca217b83d1851f3e9276e3a758fe92b0f7022d9610ed51e1d7da1521458461ac568a806eb566e1f177baba0bee7c49bbb225347da8d236def25eb3829f4a51eecc66d28b5c973a943d752aa383cbab591b59406da361cbeac1dfcc22afdfa764b84685fabc31a3e5367ca30c2eaa3480ec44a9f847f952da34df4ca0ec698607fb631abd2939ea85d57c69e097b8cdba0734b21154479dc7c39d2a11d2dec162d71b5fad118e59a9dd6917335f251384a3cb16ed48af9f3dbed8266000000011199b925c505c27fe05e9f75e2a0965aea4b6cdb945a4a481c6bc06bd080da701cd2629a69c1946bcd2695c369de10999ce9ec4f0c51d1f8d265460b4f2646d923e00d2fa0a29d4760394d8da2af4f7545377705157c75b86a20044f792a50b30068fdfeaa3eb3be8444c454fdf3629d902034c84714a652394c35da7fa2fb6f"; ⋮---- // bytes memory proof_ = Bytes.slice(zkProof, 0, 256); // bytes memory commitments = Bytes.slice(zkProof, 260, 324); // bytes memory commitmentPok = Bytes.slice(zkProof, 324, 388); ⋮---- // IVotingPowerProvider.OperatorVotingPower[] memory votingPowers = // masterSetupParams.votingPowerProvider.getVotingPowers(new bytes[](0)); // uint256 signersVotingPower = 0; // for (uint256 i; i < votingPowers.length; ++i) { // for (uint256 j; j < votingPowers[i].vaults.length; ++j) { // signersVotingPower += votingPowers[i].vaults[j].value; ⋮---- // bytes memory fullProof = abi.encodePacked(proof_, commitments, commitmentPok, signersVotingPower); ⋮---- // masterSetupParams.master.commitValSetHeader(valSetHeader, extraData, fullProof, new bytes(0)); // } ⋮---- contract TestSettlement is Settlement { ⋮---- function initialize(SettlementInitParams memory settlementInitParams, address _owner) external initializer { ⋮---- // PermissionManager requirement: function _checkPermission() internal view override { ⋮---- contract SettlementRawTest is Test { ⋮---- function setUp() public { ⋮---- function testVersion() public { ⋮---- function testInitParams() public { ⋮---- function testSetGenesis_Permission() public { ⋮---- function testSetGenesis_Revert_ValSetHeaderAlreadySubmitted() public { ⋮---- function testCommitValSetHeader_Basic() public { ⋮---- // address sigVerifier = address(new SigVerifierBlsBn254Simple()); // vm.prank(owner); // testSettle.setSigVerifier(sigVerifier); ⋮---- function test_setSigVerifier() public { ⋮---- function test_setSigVerifier_Revert_InvalidSigVerifier() public { ⋮---- function test_commitValSetHeader_VerificationFailed() public { ```` ## File: test/modules/valset-driver/EpochManager.t.sol ```` // SPDX-License-Identifier: MIT ⋮---- import "forge-std/Test.sol"; import {NoPermissionManager} from "../../mocks/NoPermissionManager.sol"; import {EpochManager} from "../../../src/modules/valset-driver/EpochManager.sol"; import {IEpochManager} from "../../../src/interfaces/modules/valset-driver/IEpochManager.sol"; import {Checkpoints} from "../../../src/libraries/structs/Checkpoints.sol"; ⋮---- contract TestEpochManager is EpochManager, NoPermissionManager { ⋮---- function initialize(EpochManagerInitParams memory initParams) external initializer { ⋮---- function getEpochDurationDataByTimestamp(uint48 timestamp) public view returns (uint48, uint48, uint48) { ⋮---- function getEpochDurationDataByIndex(uint48 index) public view returns (uint48, uint48, uint48) { ⋮---- function getCurrentEpochDurationData() public view returns (uint48, uint48, uint48) { ⋮---- function setEpochDuration(uint48 epochDuration, uint48 epochDurationTimestamp, uint48 epochDurationIndex) public { ⋮---- function serializeEpochDurationData(uint48 epochDuration, uint48 epochDurationTimestamp, uint48 epochDurationIndex) ⋮---- function deserializeEpochDurationData(uint208 epochDurationData) public pure returns (uint48, uint48, uint48) { ⋮---- function getCurrentValuePublic(uint48 currentTimepoint) public view returns (uint208) { ⋮---- function pushTestCheckpoint(uint48 key, uint208 value) public { ⋮---- contract EpochManagerTest is Test { ⋮---- function setUp() public { ⋮---- function test_Initialize_SetsEpochDuration() public { ⋮---- function test_Initialize_SetsEpochDuration_WithZeroTimestamp() public { ⋮---- function test_Initialize_RevertOnZeroEpochDuration() public { ⋮---- function test_Initialize_RevertOnPastTimestamp() public { ⋮---- function test_AdvanceTimeAndCheckEpoch() public { ⋮---- function test_SetEpochDuration_RevertIfIndexLessThanCurrent() public { ⋮---- function test_SetEpochDuration_RevertOnZeroDuration() public { ⋮---- function test_GetEpochIndex() public { ⋮---- function test_GetEpochIndex_RevertIfTooOldTimestamp() public { ⋮---- function test_GetEpochDurationAndStart() public { ⋮---- function test_SerializeDeserializeEpochDurationData() public { ⋮---- function test_GetEpochDurationDataByTimestamp() public { ⋮---- function test_GetEpochDurationDataByIndex() public { ⋮---- function test_GetCurrentEpochDurationData() public { ⋮---- function test_DirectSetEpochDuration() public { ⋮---- function test_GetCurrentValue_NoCheckpoint() public { ⋮---- function test_GetCurrentValue_SingleCheckpoint() public { ⋮---- function test_GetCurrentValue_MultipleCheckpoints() public { ⋮---- // getCurrentValuePublic is unreliable for cases when there are more than 1 checkpoint in the future ```` ## File: test/modules/valset-driver/ValSetDriver.t.sol ```` // SPDX-License-Identifier: MIT ⋮---- import "forge-std/Test.sol"; ⋮---- import {ValSetDriver} from "../../../src/modules/valset-driver/ValSetDriver.sol"; import {IValSetDriver} from "../../../src/interfaces/modules/valset-driver/IValSetDriver.sol"; ⋮---- import {INetworkManager} from "../../../src/interfaces/modules/base/INetworkManager.sol"; import {IEpochManager} from "../../../src/interfaces/modules/valset-driver/IEpochManager.sol"; ⋮---- contract TestValSetDriver is ValSetDriver { ⋮---- function initialize(IValSetDriver.ValSetDriverInitParams memory initParams, address _owner) external initializer { ⋮---- function _checkPermission() internal view override { ⋮---- contract ValSetDriverTest is Test { ⋮---- function cca(address _addr, uint64 _chainId) internal pure returns (IValSetDriver.CrossChainAddress memory) { ⋮---- function qth(uint8 _keyTag, uint248 _quorumThreshold) internal pure returns (IValSetDriver.QuorumThreshold memory) { ⋮---- function setUp() public { ⋮---- function test_InitialConfig() public { ⋮---- function test_PermissionChecks() public { ⋮---- function test_AddRemoveVotingPowerProvider() public { ⋮---- function test_SetKeysProvider() public { ⋮---- function test_AddRemoveSettlement() public { ⋮---- function test_AddRemoveQuorumThreshold() public { ⋮---- function test_SetVerificationType() public { ⋮---- function test_TimeBasedQueries() public { ⋮---- function test_SetNumAggregators() public { ⋮---- function test_SetNumCommitters() public { ⋮---- function test_Location() public { ⋮---- function test_UpdateAllConfigs() public { ⋮---- function test_TimeBasedConfig() public { ⋮---- function test_GetValSetConfig() public { ```` ## File: test/modules/voting-power/common/voting-power-calc/NormalizedTokenDecimalsVPCalc.t.sol ```` // SPDX-License-Identifier: MIT ⋮---- import "forge-std/Test.sol"; ⋮---- import {VotingPowerProvider} from "../../../../../src/modules/voting-power/VotingPowerProvider.sol"; import {VotingPowerProviderLogic} from "../../../../../src/modules/voting-power/logic/VotingPowerProviderLogic.sol"; import {MultiToken} from "../../../../../src/modules/voting-power/extensions/MultiToken.sol"; import {IVotingPowerProvider} from "../../../../../src/interfaces/modules/voting-power/IVotingPowerProvider.sol"; import {INetworkManager} from "../../../../../src/interfaces/modules/base/INetworkManager.sol"; import {IOzEIP712} from "../../../../../src/interfaces/modules/base/IOzEIP712.sol"; import {NoPermissionManager} from "../../../../../test/mocks/NoPermissionManager.sol"; import {EqualStakeVPCalc} from "../../../../../src/modules/voting-power/common/voting-power-calc/EqualStakeVPCalc.sol"; import { NormalizedTokenDecimalsVPCalc } from "../../../../../src/modules/voting-power/common/voting-power-calc/NormalizedTokenDecimalsVPCalc.sol"; import {OperatorVaults} from "../../../../../src/modules/voting-power/extensions/OperatorVaults.sol"; ⋮---- import {BN254} from "../../../../../src/libraries/utils/BN254.sol"; import "../../../../InitSetup.sol"; ⋮---- contract MockToken is ERC20 { ⋮---- _mint(msg.sender, type(uint128).max); // plenty for tests ⋮---- function decimals() public view override returns (uint8) { ⋮---- contract TestVotingPowerProvider is VotingPowerProvider, NormalizedTokenDecimalsVPCalc, NoPermissionManager { ⋮---- function initialize(IVotingPowerProvider.VotingPowerProviderInitParams memory votingPowerProviderInit) ⋮---- function getTokensLength() external view returns (uint256) { ⋮---- function getOperatorsLength() external view returns (uint256) { ⋮---- function getSharedVaultsLength() external view returns (uint256) { ⋮---- function getOperatorVaultsLength(address operator) external view returns (uint256) { ⋮---- function getOperatorStakeAt(address operator, address vault, uint48 timestamp) external view returns (uint256) { ⋮---- function getOperatorStake(address operator, address vault) external view returns (uint256) { ⋮---- function getOperatorVotingPowerAt(address operator, address vault, bytes memory extraData, uint48 timestamp) ⋮---- function getOperatorVotingPower(address operator, address vault, bytes memory extraData) ⋮---- function registerOperator(address operator) external { ⋮---- function unregisterOperator(address operator) external { ⋮---- function setSlashingData(bool requireSlasher, uint48 minVaultEpochDuration) external { ⋮---- function registerToken(address token) external { ⋮---- function unregisterToken(address token) external { ⋮---- function registerSharedVault(address vault) external { ⋮---- function unregisterSharedVault(address vault) external { ⋮---- function registerOperatorVault(address operator, address vault) external { ⋮---- function unregisterOperatorVault(address operator, address vault) external { ⋮---- function validateVault(address vault) external view returns (bool) { ⋮---- function validateSharedVault(address vault) external view returns (bool) { ⋮---- function validateOperatorVault(address operator, address vault) external view returns (bool) { ⋮---- function validateVaultSlashing(address vault) external view returns (bool) { ⋮---- contract NormalizedTokenDecimalsVPCalcTest is InitSetupTest { ⋮---- function setUp() public override { ⋮---- // votingPowerProvider.registerToken(initSetupParams.masterChain.tokens[0]); ⋮---- function test_CheckStakes_18() public { ⋮---- function test_CheckStakes_24() public { ⋮---- function test_CheckStakes_8() public { ```` ## File: test/modules/voting-power/common/voting-power-calc/PricedTokensChainlinkVPCalc.t.sol ```` // SPDX-License-Identifier: MIT ⋮---- import "forge-std/Test.sol"; ⋮---- import {VotingPowerProvider} from "../../../../../src/modules/voting-power/VotingPowerProvider.sol"; import {VotingPowerProviderLogic} from "../../../../../src/modules/voting-power/logic/VotingPowerProviderLogic.sol"; import {IVotingPowerProvider} from "../../../../../src/interfaces/modules/voting-power/IVotingPowerProvider.sol"; import {INetworkManager} from "../../../../../src/interfaces/modules/base/INetworkManager.sol"; import {IOzEIP712} from "../../../../../src/interfaces/modules/base/IOzEIP712.sol"; ⋮---- import { PricedTokensChainlinkVPCalc } from "../../../../../src/modules/voting-power/common/voting-power-calc/PricedTokensChainlinkVPCalc.sol"; import {NoPermissionManager} from "../../../../../test/mocks/NoPermissionManager.sol"; import { IPricedTokensChainlinkVPCalc } from "../../../../../src/interfaces/modules/voting-power/common/voting-power-calc/IPricedTokensChainlinkVPCalc.sol"; import { ChainlinkPriceFeed } from "../../../../../src/modules/voting-power/common/voting-power-calc/libraries/ChainlinkPriceFeed.sol"; ⋮---- import { AggregatorV3Interface } from "../../../../../src/interfaces/modules/voting-power/common/voting-power-calc/libraries/AggregatorV3Interface.sol"; ⋮---- import "../../../../InitSetup.sol"; ⋮---- contract TestVotingPowerProvider is VotingPowerProvider, PricedTokensChainlinkVPCalc, NoPermissionManager { ⋮---- function initialize(IVotingPowerProvider.VotingPowerProviderInitParams memory votingPowerProviderInit) ⋮---- function getTokensLength() external view returns (uint256) { ⋮---- function getOperatorsLength() external view returns (uint256) { ⋮---- function getSharedVaultsLength() external view returns (uint256) { ⋮---- function getOperatorVaultsLength(address operator) external view returns (uint256) { ⋮---- function getOperatorStakeAt(address operator, address vault, uint48 timestamp) external view returns (uint256) { ⋮---- function getOperatorStake(address operator, address vault) external view returns (uint256) { ⋮---- function getOperatorVotingPowerAt(address operator, address vault, bytes memory extraData, uint48 timestamp) ⋮---- function getOperatorVotingPower(address operator, address vault, bytes memory extraData) ⋮---- function registerOperator(address operator) external { ⋮---- function unregisterOperator(address operator) external { ⋮---- function setSlashingData(bool requireSlasher, uint48 minVaultEpochDuration) external { ⋮---- function registerToken(address token) external { ⋮---- function unregisterToken(address token) external { ⋮---- function registerSharedVault(address vault) external { ⋮---- function unregisterSharedVault(address vault) external { ⋮---- function registerOperatorVault(address operator, address vault) external { ⋮---- function unregisterOperatorVault(address operator, address vault) external { ⋮---- function validateVault(address vault) external view returns (bool) { ⋮---- function validateSharedVault(address vault) external view returns (bool) { ⋮---- function validateOperatorVault(address operator, address vault) external view returns (bool) { ⋮---- function validateVaultSlashing(address vault) external view returns (bool) { ⋮---- contract PricedTokensChainlinkVPCalcTest is InitSetupTest { ⋮---- function setUp() public override {} ⋮---- function test_ChainlinkCalcTracksRealPrice() public { ⋮---- function test_ChainlinkCalcTracksRealPriceWithInvert() public { ⋮---- function test_ChainlinkCalcTracksRealPriceStale() public { ⋮---- function test_ChainlinkCalcTracksRealPriceHistorical() public { ⋮---- function test_ChainlinkCalcTracksRealPriceHistoricalZero() public { ```` ## File: test/modules/voting-power/common/voting-power-calc/WeightedTokensVPCalc.t.sol ```` // SPDX-License-Identifier: MIT ⋮---- import "forge-std/Test.sol"; ⋮---- import {VotingPowerProvider} from "../../../../../src/modules/voting-power/VotingPowerProvider.sol"; import {VotingPowerProviderLogic} from "../../../../../src/modules/voting-power/logic/VotingPowerProviderLogic.sol"; import {MultiToken} from "../../../../../src/modules/voting-power/extensions/MultiToken.sol"; import {IVotingPowerProvider} from "../../../../../src/interfaces/modules/voting-power/IVotingPowerProvider.sol"; import {INetworkManager} from "../../../../../src/interfaces/modules/base/INetworkManager.sol"; import {IOzEIP712} from "../../../../../src/interfaces/modules/base/IOzEIP712.sol"; import {NoPermissionManager} from "../../../../../test/mocks/NoPermissionManager.sol"; import {EqualStakeVPCalc} from "../../../../../src/modules/voting-power/common/voting-power-calc/EqualStakeVPCalc.sol"; import { NormalizedTokenDecimalsVPCalc } from "../../../../../src/modules/voting-power/common/voting-power-calc/NormalizedTokenDecimalsVPCalc.sol"; import { WeightedTokensVPCalc } from "../../../../../src/modules/voting-power/common/voting-power-calc/WeightedTokensVPCalc.sol"; import {OperatorVaults} from "../../../../../src/modules/voting-power/extensions/OperatorVaults.sol"; ⋮---- import { IWeightedTokensVPCalc } from "../../../../../src/interfaces/modules/voting-power/common/voting-power-calc/IWeightedTokensVPCalc.sol"; ⋮---- import {BN254} from "../../../../../src/libraries/utils/BN254.sol"; import "../../../../InitSetup.sol"; ⋮---- contract MockToken is ERC20 { ⋮---- _mint(msg.sender, type(uint128).max); // plenty for tests ⋮---- function decimals() public view override returns (uint8) { ⋮---- contract TestVotingPowerProvider is VotingPowerProvider, WeightedTokensVPCalc, NoPermissionManager { ⋮---- function initialize(IVotingPowerProvider.VotingPowerProviderInitParams memory votingPowerProviderInit) ⋮---- function getTokensLength() external view returns (uint256) { ⋮---- function getOperatorsLength() external view returns (uint256) { ⋮---- function getSharedVaultsLength() external view returns (uint256) { ⋮---- function getOperatorVaultsLength(address operator) external view returns (uint256) { ⋮---- function getOperatorStakeAt(address operator, address vault, uint48 timestamp) external view returns (uint256) { ⋮---- function getOperatorStake(address operator, address vault) external view returns (uint256) { ⋮---- function getOperatorVotingPowerAt(address operator, address vault, bytes memory extraData, uint48 timestamp) ⋮---- function getOperatorVotingPower(address operator, address vault, bytes memory extraData) ⋮---- function registerOperator(address operator) external { ⋮---- function unregisterOperator(address operator) external { ⋮---- function setSlashingData(bool requireSlasher, uint48 minVaultEpochDuration) external { ⋮---- function registerToken(address token) external { ⋮---- function unregisterToken(address token) external { ⋮---- function registerSharedVault(address vault) external { ⋮---- function unregisterSharedVault(address vault) external { ⋮---- function registerOperatorVault(address operator, address vault) external { ⋮---- function unregisterOperatorVault(address operator, address vault) external { ⋮---- function validateVault(address vault) external view returns (bool) { ⋮---- function validateSharedVault(address vault) external view returns (bool) { ⋮---- function validateOperatorVault(address operator, address vault) external view returns (bool) { ⋮---- function validateVaultSlashing(address vault) external view returns (bool) { ⋮---- contract WeightedTokensVPCalcTest is InitSetupTest { ⋮---- function setUp() public override { ⋮---- // votingPowerProvider.registerToken(initSetupParams.masterChain.tokens[0]); ⋮---- function test_CheckStakesTokenWeight() public { ⋮---- function test_SetTokenWeight_RevertIfTooLarge() public { ⋮---- function test_StakeToVotingPowerAt_UsesHistoricalTokenWeightAndNormalization() public { ⋮---- // Make a deposit at t0 ⋮---- // Default weight is 1e12 at t0 ⋮---- // Change weight at t1 and ensure historical query at t0 still uses default weight ⋮---- // Another change at t2 should reflect new weight while t1 stays at previous ```` ## File: test/modules/voting-power/common/voting-power-calc/WeightedVaultsVPCalc.t.sol ```` // SPDX-License-Identifier: MIT ⋮---- import "forge-std/Test.sol"; ⋮---- import {VotingPowerProvider} from "../../../../../src/modules/voting-power/VotingPowerProvider.sol"; import {VotingPowerProviderLogic} from "../../../../../src/modules/voting-power/logic/VotingPowerProviderLogic.sol"; import {MultiToken} from "../../../../../src/modules/voting-power/extensions/MultiToken.sol"; import {IVotingPowerProvider} from "../../../../../src/interfaces/modules/voting-power/IVotingPowerProvider.sol"; import {INetworkManager} from "../../../../../src/interfaces/modules/base/INetworkManager.sol"; import {IOzEIP712} from "../../../../../src/interfaces/modules/base/IOzEIP712.sol"; import {NoPermissionManager} from "../../../../../test/mocks/NoPermissionManager.sol"; import {EqualStakeVPCalc} from "../../../../../src/modules/voting-power/common/voting-power-calc/EqualStakeVPCalc.sol"; import { NormalizedTokenDecimalsVPCalc } from "../../../../../src/modules/voting-power/common/voting-power-calc/NormalizedTokenDecimalsVPCalc.sol"; import { WeightedVaultsVPCalc } from "../../../../../src/modules/voting-power/common/voting-power-calc/WeightedVaultsVPCalc.sol"; import {OperatorVaults} from "../../../../../src/modules/voting-power/extensions/OperatorVaults.sol"; ⋮---- import { IWeightedVaultsVPCalc } from "../../../../../src/interfaces/modules/voting-power/common/voting-power-calc/IWeightedVaultsVPCalc.sol"; ⋮---- import {BN254} from "../../../../../src/libraries/utils/BN254.sol"; import "../../../../InitSetup.sol"; ⋮---- contract MockToken is ERC20 { ⋮---- _mint(msg.sender, type(uint128).max); // plenty for tests ⋮---- function decimals() public view override returns (uint8) { ⋮---- contract TestVotingPowerProvider is VotingPowerProvider, WeightedVaultsVPCalc, NoPermissionManager { ⋮---- function initialize(IVotingPowerProvider.VotingPowerProviderInitParams memory votingPowerProviderInit) ⋮---- function getTokensLength() external view returns (uint256) { ⋮---- function getOperatorsLength() external view returns (uint256) { ⋮---- function getSharedVaultsLength() external view returns (uint256) { ⋮---- function getOperatorVaultsLength(address operator) external view returns (uint256) { ⋮---- function getOperatorStakeAt(address operator, address vault, uint48 timestamp) external view returns (uint256) { ⋮---- function getOperatorStake(address operator, address vault) external view returns (uint256) { ⋮---- function getOperatorVotingPowerAt(address operator, address vault, bytes memory extraData, uint48 timestamp) ⋮---- function getOperatorVotingPower(address operator, address vault, bytes memory extraData) ⋮---- function registerOperator(address operator) external { ⋮---- function unregisterOperator(address operator) external { ⋮---- function setSlashingData(bool requireSlasher, uint48 minVaultEpochDuration) external { ⋮---- function registerToken(address token) external { ⋮---- function unregisterToken(address token) external { ⋮---- function registerSharedVault(address vault) external { ⋮---- function unregisterSharedVault(address vault) external { ⋮---- function registerOperatorVault(address operator, address vault) external { ⋮---- function unregisterOperatorVault(address operator, address vault) external { ⋮---- function validateVault(address vault) external view returns (bool) { ⋮---- function validateSharedVault(address vault) external view returns (bool) { ⋮---- function validateOperatorVault(address operator, address vault) external view returns (bool) { ⋮---- function validateVaultSlashing(address vault) external view returns (bool) { ⋮---- contract WeightedVaultsVPCalcTest is InitSetupTest { ⋮---- function setUp() public override { ⋮---- // votingPowerProvider.registerToken(initSetupParams.masterChain.tokens[0]); ⋮---- function test_CheckStakesVaultWeight() public { ⋮---- function test_SetVaultWeight_RevertIfTooLarge() public { ⋮---- function test_GetVaultWeightAt_UsesHistoricalVaultWeight() public { ⋮---- // At t0, vault weight should be default (1e4) ⋮---- // Change vault weight at t1 ⋮---- // Historical query at t0 should still return default weight ⋮---- // Current query at t1 should return new weight ⋮---- // Another change at t2 ⋮---- // Historical queries should return appropriate weights ⋮---- function test_StakeToVotingPowerAt_UsesHistoricalVaultWeight() public { ⋮---- // Make a deposit at t0 ⋮---- // Default vault weight is 1e4 at t0 ⋮---- // Change vault weight at t1 and ensure historical query at t0 still uses default weight ⋮---- // Another change at t2 should reflect new weight while t1 stays at previous ```` ## File: test/modules/voting-power/extensions/BaseRewards.t.sol ```` // SPDX-License-Identifier: MIT ⋮---- import "forge-std/Test.sol"; ⋮---- import {VotingPowerProvider} from "../../../../src/modules/voting-power/VotingPowerProvider.sol"; import {VotingPowerProviderLogic} from "../../../../src/modules/voting-power/logic/VotingPowerProviderLogic.sol"; import {MultiToken} from "../../../../src/modules/voting-power/extensions/MultiToken.sol"; import {IVotingPowerProvider} from "../../../../src/interfaces/modules/voting-power/IVotingPowerProvider.sol"; import {INetworkManager} from "../../../../src/interfaces/modules/base/INetworkManager.sol"; import {IOzEIP712} from "../../../../src/interfaces/modules/base/IOzEIP712.sol"; import {NoPermissionManager} from "../../../../test/mocks/NoPermissionManager.sol"; import {EqualStakeVPCalc} from "../../../../src/modules/voting-power/common/voting-power-calc/EqualStakeVPCalc.sol"; import {OperatorVaults} from "../../../../src/modules/voting-power/extensions/OperatorVaults.sol"; ⋮---- import {BN254} from "../../../../src/libraries/utils/BN254.sol"; import "../../../MasterSetup.sol"; ⋮---- import {RewarderMock} from "../../../../test/mocks/RewarderMock.sol"; ⋮---- import {SymbioticRewardsBindings} from "@symbioticfi/rewards/test/integration/SymbioticRewardsBindings.sol"; import "@symbioticfi/rewards/test/integration/SymbioticRewardsImports.sol"; ⋮---- contract BaseRewardsTest is MasterSetupTest, SymbioticRewardsBindings { ⋮---- function setUp() public override { ⋮---- function test_StakerRewards() public { ⋮---- function test_OperatorRewards() public { ⋮---- function _initRewards_SymbioticRewards() internal virtual { ⋮---- function test_Location() public { ⋮---- function _getDefaultStakerRewards_SymbioticRewards(address vault, uint256 adminFee, address admin) ⋮---- function _getDefaultOperatorRewards_SymbioticRewards() internal virtual returns (address) { ```` ## File: test/modules/voting-power/extensions/BaseSlashing.t.sol ```` // SPDX-License-Identifier: MIT ⋮---- import "forge-std/Test.sol"; ⋮---- import {VotingPowerProvider} from "../../../../src/modules/voting-power/VotingPowerProvider.sol"; import {VotingPowerProviderLogic} from "../../../../src/modules/voting-power/logic/VotingPowerProviderLogic.sol"; import {MultiToken} from "../../../../src/modules/voting-power/extensions/MultiToken.sol"; import {IVotingPowerProvider} from "../../../../src/interfaces/modules/voting-power/IVotingPowerProvider.sol"; import {INetworkManager} from "../../../../src/interfaces/modules/base/INetworkManager.sol"; import {IOzEIP712} from "../../../../src/interfaces/modules/base/IOzEIP712.sol"; import {NoPermissionManager} from "../../../../test/mocks/NoPermissionManager.sol"; import {EqualStakeVPCalc} from "../../../../src/modules/voting-power/common/voting-power-calc/EqualStakeVPCalc.sol"; import {OperatorVaults} from "../../../../src/modules/voting-power/extensions/OperatorVaults.sol"; import {IEntity} from "lib/core/src/interfaces/common/IEntity.sol"; import {IVault} from "lib/core/src/interfaces/vault/IVault.sol"; ⋮---- import {BN254} from "../../../../src/libraries/utils/BN254.sol"; import "../../../MasterSetup.sol"; ⋮---- import {SlasherMock} from "../../../../test/mocks/SlasherMock.sol"; ⋮---- contract BaseSlashingTest is MasterSetupTest { function setUp() public override { ⋮---- function test_SlashVault() public { ⋮---- function test_SlashVault_WithHints() public { ⋮---- function test_SlashVaultUnsafe() public { ⋮---- function test_SlashVault_VetoSlasher() public { ⋮---- function test_ExecuteSlashVaul_NotVetoSlasher() public { ⋮---- function test_ExecuteSlashVault_NoSlasher() public { ⋮---- function test_RevertWhen_SlashVault_NoSlashing() public { ⋮---- uint48(1), // set timestamp that has no slasher data ⋮---- function test_RevertWhen_SlashVault_UnknownSlasherType() public { ⋮---- // mock the slasher type to be unknown ⋮---- function test_SlashVault_EpochDurationPassed() public { ⋮---- // increase timestamp to pass the minVaultEpochDuration ⋮---- function test_Location() public { ```` ## File: test/modules/voting-power/extensions/EqualStakeVPCalc.t.sol ```` // SPDX-License-Identifier: MIT ⋮---- import "forge-std/Test.sol"; ⋮---- contract EqualStakeVPCalcTest is Test { function setUp() public {} ⋮---- function test_create() public {} ```` ## File: test/modules/voting-power/extensions/MultiToken.t.sol ```` // SPDX-License-Identifier: MIT ⋮---- import "forge-std/Test.sol"; ⋮---- import {MultiToken} from "../../../../src/modules/voting-power/extensions/MultiToken.sol"; import {IMultiToken} from "../../../../src/interfaces/modules/voting-power/extensions/IMultiToken.sol"; import {INetworkManager} from "../../../../src/interfaces/modules/base/INetworkManager.sol"; import {NoPermissionManager} from "../../../../test/mocks/NoPermissionManager.sol"; import {EqualStakeVPCalc} from "../../../../src/modules/voting-power/common/voting-power-calc/EqualStakeVPCalc.sol"; import {IVotingPowerProvider} from "../../../../src/interfaces/modules/voting-power/IVotingPowerProvider.sol"; import {IOzEIP712} from "../../../../src/interfaces/modules/base/IOzEIP712.sol"; import {VotingPowerProvider} from "../../../../src/modules/voting-power/VotingPowerProvider.sol"; import {OperatorVaults} from "../../../../src/modules/voting-power/extensions/OperatorVaults.sol"; ⋮---- import "../../../InitSetup.sol"; ⋮---- contract TestMultiToken is NoPermissionManager, EqualStakeVPCalc, MultiToken { ⋮---- function initialize(IVotingPowerProvider.VotingPowerProviderInitParams memory votingPowerProviderInit) ⋮---- contract MultiTokenTest is InitSetupTest { ⋮---- function setUp() public override { ⋮---- function test_RegisterToken_OnlyOwnerCanCall() public { ⋮---- function test_RegisterUnregisterToken_VaultManagerSide() public { ```` ## File: test/modules/voting-power/extensions/OperatorsBlacklist.t.sol ```` // SPDX-License-Identifier: MIT ⋮---- import "forge-std/Test.sol"; ⋮---- import {OperatorsBlacklist} from "../../../../src/modules/voting-power/extensions/OperatorsBlacklist.sol"; import {VotingPowerProvider} from "../../../../src/modules/voting-power/VotingPowerProvider.sol"; import {NoPermissionManager} from "../../../../test/mocks/NoPermissionManager.sol"; import {EqualStakeVPCalc} from "../../../../src/modules/voting-power/common/voting-power-calc/EqualStakeVPCalc.sol"; ⋮---- import {INetworkManager} from "../../../../src/interfaces/modules/base/INetworkManager.sol"; import {IOperatorsBlacklist} from "../../../../src/interfaces/modules/voting-power/extensions/IOperatorsBlacklist.sol"; import {InitSetupTest} from "../../../InitSetup.sol"; import {MultiToken} from "../../../../src/modules/voting-power/extensions/MultiToken.sol"; import {IVotingPowerProvider} from "../../../../src/interfaces/modules/voting-power/IVotingPowerProvider.sol"; import {IOzEIP712} from "../../../../src/interfaces/modules/base/IOzEIP712.sol"; import {OperatorVaults} from "../../../../src/modules/voting-power/extensions/OperatorVaults.sol"; ⋮---- contract TestOperatorsBlacklist is ⋮---- function initialize(IVotingPowerProvider.VotingPowerProviderInitParams memory votingPowerProviderInit) ⋮---- function _registerOperatorImpl(address operator) internal override(OperatorsBlacklist, VotingPowerProvider) { ⋮---- contract OperatorsBlacklistTest is InitSetupTest { ⋮---- function setUp() public override { ⋮---- // blacklistOps.registerToken(initSetupParams.masterChain.tokens[0]); ⋮---- function test_BasicEnvironment() public { ⋮---- function test_BlacklistOperator() public { ⋮---- function test_BlacklistOperator_RevertIfAlreadyBlacklisted() public { ⋮---- function test_UnblacklistOperator() public { ⋮---- function test_UnblacklistOperator_RevertIfNotBlacklisted() public { ⋮---- function test_Location() public { ```` ## File: test/modules/voting-power/extensions/OperatorsJail.t.sol ```` // SPDX-License-Identifier: MIT ⋮---- import "forge-std/Test.sol"; ⋮---- import {OperatorsJail} from "../../../../src/modules/voting-power/extensions/OperatorsJail.sol"; import {VotingPowerProvider} from "../../../../src/modules/voting-power/VotingPowerProvider.sol"; import {NoPermissionManager} from "../../../../test/mocks/NoPermissionManager.sol"; import {EqualStakeVPCalc} from "../../../../src/modules/voting-power/common/voting-power-calc/EqualStakeVPCalc.sol"; ⋮---- import {MultiToken} from "../../../../src/modules/voting-power/extensions/MultiToken.sol"; import {OperatorVaults} from "../../../../src/modules/voting-power/extensions/OperatorVaults.sol"; import {INetworkManager} from "../../../../src/interfaces/modules/base/INetworkManager.sol"; import {IOperatorsJail} from "../../../../src/interfaces/modules/voting-power/extensions/IOperatorsJail.sol"; import {IVotingPowerProvider} from "../../../../src/interfaces/modules/voting-power/IVotingPowerProvider.sol"; import {IOzEIP712} from "../../../../src/interfaces/modules/base/IOzEIP712.sol"; ⋮---- import {InitSetupTest} from "../../../InitSetup.sol"; ⋮---- contract TestOperatorsJail is OperatorsJail, NoPermissionManager, EqualStakeVPCalc, MultiToken, OperatorVaults { ⋮---- function initialize(IVotingPowerProvider.VotingPowerProviderInitParams memory votingPowerProviderInit) ⋮---- function _registerOperatorImpl(address operator) internal override(OperatorsJail, VotingPowerProvider) { ⋮---- contract OperatorsJailTest is InitSetupTest { ⋮---- function setUp() public override { ⋮---- function test_BasicEnvironment() public { ⋮---- function test_JailOperator() public { ⋮---- function test_JailOperator_RevertIfAlreadyJailed() public { ⋮---- function test_UnjailOperator() public { ⋮---- function test_UnjailOperator_RevertIfNotJailed() public { ⋮---- function test_Location() public { ```` ## File: test/modules/voting-power/extensions/OperatorsWhitelist.t.sol ```` // SPDX-License-Identifier: MIT ⋮---- import "forge-std/Test.sol"; ⋮---- import {IOperatorsWhitelist} from "../../../../src/interfaces/modules/voting-power/extensions/IOperatorsWhitelist.sol"; import "../../../InitSetup.sol"; ⋮---- import {OperatorsWhitelist} from "../../../../src/modules/voting-power/extensions/OperatorsWhitelist.sol"; import {NoPermissionManager} from "../../../../test/mocks/NoPermissionManager.sol"; import {EqualStakeVPCalc} from "../../../../src/modules/voting-power/common/voting-power-calc/EqualStakeVPCalc.sol"; import {INetworkManager} from "../../../../src/interfaces/modules/base/INetworkManager.sol"; import {IVotingPowerProvider} from "../../../../src/interfaces/modules/voting-power/IVotingPowerProvider.sol"; import {MultiToken} from "../../../../src/modules/voting-power/extensions/MultiToken.sol"; import {IOzEIP712} from "../../../../src/interfaces/modules/base/IOzEIP712.sol"; import {VotingPowerProvider} from "../../../../src/modules/voting-power/VotingPowerProvider.sol"; import {OperatorVaults} from "../../../../src/modules/voting-power/extensions/OperatorVaults.sol"; ⋮---- contract TestOperatorsWhitelist is ⋮---- function initialize( ⋮---- function _registerOperatorImpl(address operator) internal override(OperatorsWhitelist, VotingPowerProvider) { ⋮---- contract OperatorsWhitelistTest is Test, InitSetupTest { ⋮---- function setUp() public override { ⋮---- // whitelistOps.registerToken(initSetupParams.masterChain.tokens[0]); ⋮---- function test_WhitelistEnabledByDefault() public { ⋮---- function test_RegisterOperator_RevertIfNotWhitelisted() public { ⋮---- function test_WhitelistOperatorAndRegister() public { ⋮---- function test_WhitelistOperator_RevertIfAlreadyWhitelisted() public { ⋮---- function test_UnwhitelistOperator_RegisteredOperatorGetsUnregistered() public { ⋮---- function test_UnwhitelistOperator_RevertIfNotWhitelisted() public { ⋮---- function test_DisableWhitelistAndRegister() public { ⋮---- function test_SetWhitelistStatus_RevertIfAlreadySet() public { ⋮---- function test_SetWhitelistStatus_RevertIfNotWhitelisted() public { ⋮---- function test_DisableWhitelistAndRegisterOperatorVault() public { ⋮---- function test_Location() public { ```` ## File: test/modules/voting-power/extensions/OperatorVaults.t.sol ```` // SPDX-License-Identifier: MIT ⋮---- import "forge-std/Test.sol"; ⋮---- import {OperatorVaults} from "../../../../src/modules/voting-power/extensions/OperatorVaults.sol"; import {IOperatorVaults} from "../../../../src/interfaces/modules/voting-power/extensions/IOperatorVaults.sol"; import {INetworkManager} from "../../../../src/interfaces/modules/base/INetworkManager.sol"; import {OzOwnable} from "../../../../src/modules/common/permissions/OzOwnable.sol"; import {EqualStakeVPCalc} from "../../../../src/modules/voting-power/common/voting-power-calc/EqualStakeVPCalc.sol"; import {IVotingPowerProvider} from "../../../../src/interfaces/modules/voting-power/IVotingPowerProvider.sol"; import {IOzEIP712} from "../../../../src/interfaces/modules/base/IOzEIP712.sol"; import {VotingPowerProvider} from "../../../../src/modules/voting-power/VotingPowerProvider.sol"; ⋮---- import "../../../InitSetup.sol"; ⋮---- contract TestOperatorVaults is OperatorVaults, OzOwnable, EqualStakeVPCalc { ⋮---- function initialize(IVotingPowerProvider.VotingPowerProviderInitParams memory votingPowerProviderInit) ⋮---- function registerToken(address token) public { ⋮---- contract OperatorVaultsTest is InitSetupTest { ⋮---- function setUp() public override { ⋮---- function test_RegisterOperatorVault_OnlyOwnerCanCall() public { ```` ## File: test/modules/voting-power/extensions/OpNetVaultAutoDeploy.t.sol ```` // SPDX-License-Identifier: MIT ⋮---- import "forge-std/Test.sol"; ⋮---- import {OpNetVaultAutoDeploy} from "../../../../src/modules/voting-power/extensions/OpNetVaultAutoDeploy.sol"; import {VotingPowerProvider} from "../../../../src/modules/voting-power/VotingPowerProvider.sol"; import {NoPermissionManager} from "../../../../test/mocks/NoPermissionManager.sol"; import {EqualStakeVPCalc} from "../../../../src/modules/voting-power/common/voting-power-calc/EqualStakeVPCalc.sol"; import {MultiToken} from "../../../../src/modules/voting-power/extensions/MultiToken.sol"; import {OperatorVaults} from "../../../../src/modules/voting-power/extensions/OperatorVaults.sol"; import {INetworkManager} from "../../../../src/interfaces/modules/base/INetworkManager.sol"; import { IOpNetVaultAutoDeploy } from "../../../../src/interfaces/modules/voting-power/extensions/IOpNetVaultAutoDeploy.sol"; import {IVotingPowerProvider} from "../../../../src/interfaces/modules/voting-power/IVotingPowerProvider.sol"; import {IOzEIP712} from "../../../../src/interfaces/modules/base/IOzEIP712.sol"; import {InitSetupTest} from "../../../InitSetup.sol"; import {IVault} from "@symbioticfi/core/src/interfaces/vault/IVault.sol"; import {IBaseSlasher} from "@symbioticfi/core/src/interfaces/slasher/IBaseSlasher.sol"; import {INetworkMiddlewareService} from "@symbioticfi/core/src/interfaces/service/INetworkMiddlewareService.sol"; import {IBaseDelegator} from "@symbioticfi/core/src/interfaces/delegator/IBaseDelegator.sol"; ⋮---- import {Network} from "@symbioticfi/network/src/Network.sol"; import {INetwork} from "@symbioticfi/network/src/interfaces/INetwork.sol"; ⋮---- contract TestOpNetVaultAutoDeploy is ⋮---- function initialize( ⋮---- function _registerOperatorImpl(address operator) internal override(OpNetVaultAutoDeploy, VotingPowerProvider) { ⋮---- function _unregisterOperatorVaultImpl(address operator, address vault) ⋮---- function setSlashingData(bool requireSlasher, uint48 minVaultEpochDuration) public { ⋮---- contract OpNetVaultAutoDeployTest is Test, InitSetupTest { ⋮---- function setUp() public override { ⋮---- function test_BasicFlags() public { ⋮---- function test_SetAutoDeployStatus() public { ⋮---- function test_SetAutoDeployConfig_InvalidCollateral() public { ⋮---- function test_SetAutoDeployConfig_InvalidEpochDurationZero() public { ⋮---- function test_SetAutoDeployConfig_InvalidEpochDurationLessThanMinVaultEpochDuration() public { ⋮---- function test_SetAutoDeployConfig_InvalidWithSlasher() public { ⋮---- function test_SetAutoDeployConfig_InvalidBurnerHook() public { ⋮---- function test_SetAutoDeployConfig_InvalidBurnerParamsWithSlasher() public { ⋮---- function test_AutoDeployOnRegister() public { ⋮---- function test_AutoDeployOnRegister_WithoutSlasher() public { ⋮---- function test_AutoDeployOnRegister_SetMaxNetworkLimitHook() public { ⋮---- function test_Location() public { ```` ## File: test/modules/voting-power/extensions/SharedVaults.t.sol ```` // SPDX-License-Identifier: MIT ⋮---- import "forge-std/Test.sol"; ⋮---- import {SharedVaults} from "../../../../src/modules/voting-power/extensions/SharedVaults.sol"; import {ISharedVaults} from "../../../../src/interfaces/modules/voting-power/extensions/ISharedVaults.sol"; import {INetworkManager} from "../../../../src/interfaces/modules/base/INetworkManager.sol"; import {NoPermissionManager} from "../../../../test/mocks/NoPermissionManager.sol"; import {EqualStakeVPCalc} from "../../../../src/modules/voting-power/common/voting-power-calc/EqualStakeVPCalc.sol"; import {IVotingPowerProvider} from "../../../../src/interfaces/modules/voting-power/IVotingPowerProvider.sol"; import {IOzEIP712} from "../../../../src/interfaces/modules/base/IOzEIP712.sol"; import {VotingPowerProvider} from "../../../../src/modules/voting-power/VotingPowerProvider.sol"; ⋮---- import "../../../InitSetup.sol"; ⋮---- contract TestSharedVaults is SharedVaults, NoPermissionManager, EqualStakeVPCalc { ⋮---- function initialize(IVotingPowerProvider.VotingPowerProviderInitParams memory votingPowerProviderInit) ⋮---- function registerToken(address token) public { ⋮---- contract SharedVaultsTest is InitSetupTest { ⋮---- function setUp() public override { ⋮---- function test_RegisterSharedVault_OnlyOwnerCanCall() public { // sharedVaults.registerToken(initSetupParams.masterChain.tokens[0]); ⋮---- function test_RegisterUnregisterSharedVault_VaultManagerSide() public { ```` ## File: test/modules/voting-power/VotingPowerProvider.t.sol ```` // SPDX-License-Identifier: MIT ⋮---- import "forge-std/Test.sol"; ⋮---- import {VotingPowerProvider} from "../../../src/modules/voting-power/VotingPowerProvider.sol"; import {VotingPowerProviderLogic} from "../../../src/modules/voting-power/logic/VotingPowerProviderLogic.sol"; import {MultiToken} from "../../../src/modules/voting-power/extensions/MultiToken.sol"; import {IVotingPowerProvider} from "../../../src/interfaces/modules/voting-power/IVotingPowerProvider.sol"; import {INetworkManager} from "../../../src/interfaces/modules/base/INetworkManager.sol"; import {IOzEIP712} from "../../../src/interfaces/modules/base/IOzEIP712.sol"; import {NoPermissionManager} from "../../../test/mocks/NoPermissionManager.sol"; import {EqualStakeVPCalc} from "../../../src/modules/voting-power/common/voting-power-calc/EqualStakeVPCalc.sol"; import {OperatorVaults} from "../../../src/modules/voting-power/extensions/OperatorVaults.sol"; ⋮---- import {BN254} from "../../../src/libraries/utils/BN254.sol"; import "../../InitSetup.sol"; ⋮---- contract TestVotingPowerProvider is VotingPowerProvider, EqualStakeVPCalc, NoPermissionManager { ⋮---- function initialize(IVotingPowerProvider.VotingPowerProviderInitParams memory votingPowerProviderInit) ⋮---- function getTokensLength() external view returns (uint256) { ⋮---- function getOperatorsLength() external view returns (uint256) { ⋮---- function getSharedVaultsLength() external view returns (uint256) { ⋮---- function getOperatorVaultsLength(address operator) external view returns (uint256) { ⋮---- function getOperatorStakeAt(address operator, address vault, uint48 timestamp) external view returns (uint256) { ⋮---- function getOperatorStake(address operator, address vault) external view returns (uint256) { ⋮---- function getOperatorVotingPowerAt(address operator, address vault, bytes memory extraData, uint48 timestamp) ⋮---- function getOperatorVotingPower(address operator, address vault, bytes memory extraData) ⋮---- function registerOperator(address operator) external { ⋮---- function unregisterOperator(address operator) external { ⋮---- function setSlashingData(bool requireSlasher, uint48 minVaultEpochDuration) external { ⋮---- function registerToken(address token) external { ⋮---- function unregisterToken(address token) external { ⋮---- function registerSharedVault(address vault) external { ⋮---- function unregisterSharedVault(address vault) external { ⋮---- function registerOperatorVault(address operator, address vault) external { ⋮---- function unregisterOperatorVault(address operator, address vault) external { ⋮---- function validateVault(address vault) external view returns (bool) { ⋮---- function validateSharedVault(address vault) external view returns (bool) { ⋮---- function validateOperatorVault(address operator, address vault) external view returns (bool) { ⋮---- function validateVaultEpochDuration(address vault) external view returns (bool) { ⋮---- contract VotingPowerProviderTest is InitSetupTest { ⋮---- function setUp() public override { ⋮---- // votingPowerProvider.registerToken(initSetupParams.masterChain.tokens[0]); ⋮---- function test_RegisterOperatorValid() public { ⋮---- function test_RegisterOperator_RevertIfNotEntity() public { ⋮---- function test_RegisterOperator_RevertIfAlreadyRegistered() public { ⋮---- function test_UnregisterOperator() public { ⋮---- function test_UnregisterOperator_RevertIfNotRegistered() public { ⋮---- function test_IsOperatorRegisteredAt_withTime() public { ⋮---- function testGetOperatorsAt_withTime() public { ⋮---- function test_SlashingData() public { ⋮---- function test_RegisterToken() public { ⋮---- function test_RegisterToken_RevertOnZeroAddress() public { ⋮---- function test_UnregisterToken() public { ⋮---- function test_RegisterSharedVault() public { ⋮---- function test_RegisterSharedVault_RevertIfInvalidVault() public { ⋮---- function test_RegisterSharedVault_RevertIfTokenNotRegistered() public { ⋮---- function test_RegisterOperatorVault() public { ⋮---- function test_RegisterOperatorVault_RevertIfOperatorNotRegistered() public { ⋮---- function test_SlashVault_InstantSlasher() public {} ⋮---- function test_SlashVault_VetoSlasherFlow() public {} ⋮---- function test_SlashVault_RevertIfNoSlasher() public {} ⋮---- function test_DistributeRewards() public {} ⋮---- function test_ValidateVault() public { ⋮---- function test_ValidateVaultSlashingFailsIfLessThanMinVaultEpochDuration() public { ⋮---- function test_Location() public { ⋮---- function test_CheckStakes() public { ⋮---- // for (uint256 i; i < initSetupParams.masterChain.tokens.length; ++i) { // vm.startPrank(vars.deployer.addr); // votingPowerProvider.registerToken(initSetupParams.masterChain.tokens[i]); // vm.stopPrank(); // } ⋮---- function test_RegisterOperator() public { ⋮---- function test_RegisterOperatorVaultExternal() public { ⋮---- function test_registerOperatorWithSignature() public { ⋮---- function test_registerOperatorWithSignature_RevertIfInvalidSig() public { ⋮---- function test_IncreaseNonce() public { ⋮---- function test_unregisterOperatorWithSignature() public { ```` ## File: test/InitSetup.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {Test, console2} from "forge-std/Test.sol"; ⋮---- import "@symbioticfi/core/test/integration/SymbioticCoreInit.sol"; ⋮---- import {Token} from "@symbioticfi/core/test/mocks/Token.sol"; ⋮---- import {KeyTags} from "../src/libraries/utils/KeyTags.sol"; import {MyKeyRegistry} from "../examples/MyKeyRegistry.sol"; import {MyVotingPowerProvider} from "../examples/MyVotingPowerProvider.sol"; import {VotingPowerProviderSemiFull} from "../test/mocks/VotingPowerProviderSemiFull.sol"; import {MySettlement} from "../examples/MySettlement.sol"; import {Network} from "@symbioticfi/network/src/Network.sol"; import {MyValSetDriver} from "../examples/MyValSetDriver.sol"; import {KeyEcdsaSecp256k1} from "../src/libraries/keys/KeyEcdsaSecp256k1.sol"; import {KeyBlsBn254, BN254} from "../src/libraries/keys/KeyBlsBn254.sol"; import {KEY_TYPE_BLS_BN254, KEY_TYPE_ECDSA_SECP256K1} from "../src/interfaces/modules/key-registry/IKeyRegistry.sol"; import {BN254G2} from "../test/helpers/BN254G2.sol"; import {IOzEIP712} from "../src/interfaces/modules/base/IOzEIP712.sol"; import {IKeyRegistry} from "../src/interfaces/modules/key-registry/IKeyRegistry.sol"; ⋮---- contract InitSetupTest is SymbioticCoreInit { ⋮---- function setUp() public virtual override { ⋮---- function getOperator(uint256 index) public returns (Vm.Wallet memory operator) { // deterministic operator private key ⋮---- function getStaker(uint256 index) public returns (Vm.Wallet memory staker) { ⋮---- function getNetwork() public returns (Vm.Wallet memory network) { ⋮---- function getDeployer() public returns (Vm.Wallet memory deployer) { ⋮---- function getG2Key(uint256 privateKey) public view returns (BN254.G2Point memory) { ```` ## File: test/MasterGenesisSetup.sol ```` // SPDX-License-Identifier: MIT ⋮---- import "./MasterSetup.sol"; ⋮---- import {Math} from "@openzeppelin/contracts/utils/math/Math.sol"; ⋮---- contract MasterGenesisSetupTest is MasterSetupTest { ⋮---- function setUp() public virtual override { ⋮---- function loadGenesis() ```` ## File: test/MasterSetup.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {Test, console2} from "forge-std/Test.sol"; ⋮---- import {ISettlement} from "../src/interfaces/modules/settlement/ISettlement.sol"; import {IOzOwnable} from "../src/interfaces/modules/common/permissions/IOzOwnable.sol"; import {INetworkManager} from "../src/interfaces/modules/base/INetworkManager.sol"; import {IEpochManager} from "../src/interfaces/modules/valset-driver/IEpochManager.sol"; import {IOzEIP712} from "../src/interfaces/modules/base/IOzEIP712.sol"; import {IValSetDriver} from "../src/interfaces/modules/valset-driver/IValSetDriver.sol"; import {IOperatorsWhitelist} from "../src/interfaces/modules/voting-power/extensions/IOperatorsWhitelist.sol"; import {IVotingPowerProvider} from "../src/interfaces/modules/voting-power/IVotingPowerProvider.sol"; import {IBaseSlashing} from "../src/interfaces/modules/voting-power/extensions/IBaseSlashing.sol"; import {IBaseRewards} from "../src/interfaces/modules/voting-power/extensions/IBaseRewards.sol"; ⋮---- import {KeyTags} from "../src/libraries/utils/KeyTags.sol"; ⋮---- import {SigVerifierMock} from "./mocks/SigVerifierMock.sol"; ⋮---- import {KeyEcdsaSecp256k1} from "../src/libraries/keys/KeyEcdsaSecp256k1.sol"; import {KeyBlsBn254, BN254} from "../src/libraries/keys/KeyBlsBn254.sol"; ⋮---- import {BN254G2} from "./helpers/BN254G2.sol"; import "./InitSetup.sol"; ⋮---- import {SigVerifierBlsBn254ZK} from "../src/modules/settlement/sig-verifiers/SigVerifierBlsBn254ZK.sol"; import {SigVerifierBlsBn254Simple} from "../src/modules/settlement/sig-verifiers/SigVerifierBlsBn254Simple.sol"; import {Verifier as Verifier_10} from "./data/zk/Verifier_10.sol"; import {Verifier as Verifier_100} from "./data/zk/Verifier_100.sol"; import {Verifier as Verifier_1000} from "./data/zk/Verifier_1000.sol"; ⋮---- contract MasterSetupTest is InitSetupTest { ⋮---- function setUp() public virtual override { ⋮---- // for (uint256 i; i < initSetupParams.masterChain.tokens.length; ++i) { // vm.startPrank(vars.deployer.addr); // masterSetupParams.votingPowerProvider.registerToken(initSetupParams.masterChain.tokens[i]); // vm.stopPrank(); // } ```` ## File: .env.example ```` ETH_RPC_URL= ```` ## File: .gitignore ```` # Ignore node_modules and dependencies node_modules *.log yarn-error.log # Ignore build outputs dist out **/__pycache__ # Ignore environment files .env # Ignore version control files docs/autogen/.git docs/autogen/.gitignore # Ignore editor and OS-specific files *.swp *.DS_Store Thumbs.db # Ignore IDE-specific files .idea/ .vscode/ cache/ out/ broadcast/ deployments/ script/logs.txt lcov.info /target /coverage /report .password ```` ## File: .gitmodules ```` [submodule "lib/forge-std"] path = lib/forge-std url = https://github.com/foundry-rs/forge-std [submodule "lib/crypto-lib"] path = lib/crypto-lib url = https://github.com/get-smooth/crypto-lib [submodule "lib/rewards"] path = lib/rewards url = https://github.com/symbioticfi/rewards [submodule "lib/chainlink-evm"] path = lib/chainlink-evm url = https://github.com/smartcontractkit/chainlink-evm [submodule "lib/openzeppelin-contracts"] path = lib/openzeppelin-contracts url = https://github.com/OpenZeppelin/openzeppelin-contracts [submodule "lib/openzeppelin-contracts-upgradeable"] path = lib/openzeppelin-contracts-upgradeable url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable [submodule "lib/network"] path = lib/network url = https://github.com/symbioticfi/network [submodule "lib/core"] path = lib/core url = https://github.com/symbioticfi/core ```` ## File: .nvmrc ```` 20 ```` ## File: .pre-commit-config.yaml ````yaml repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v5.0.0 hooks: - id: mixed-line-ending args: ["--fix=lf"] exclude: "^(docs/autogen|snapshots/)" - id: trailing-whitespace exclude: "^(docs/autogen|snapshots/)" - id: end-of-file-fixer exclude: "^(docs/autogen|snapshots/)" - id: check-merge-conflict - id: check-json exclude: "^(docs/autogen|snapshots/)" - id: check-yaml - repo: local hooks: - id: sort-imports name: Sort imports description: Normalize and sort import statements in Solidity files language: system entry: python3 script/utils/sort_imports.py files: "^(src|examples)/.*\\.sol$" pass_filenames: true - id: sort-errors name: Sort solidity errors description: Alphabetize error declarations in Solidity files language: system entry: python3 script/utils/sort_errors.py files: "^(src|examples)/.*\\.sol$" pass_filenames: true - id: format name: Format solidity code description: Format solidity code with `forge fmt` language: system entry: forge fmt files: '\.sol$' exclude: "^lib/" pass_filenames: true - id: doc name: Generate documentation description: Generate docs with `forge doc` language: system entry: bash -lc 'forge build; rm -rf docs/autogen; forge doc -b -o docs/autogen' pass_filenames: false - id: forge-snapshots name: Update forge snapshots language: system entry: bash -lc 'mkdir -p snapshots; forge build; forge build --sizes | tee snapshots/sizes.txt >/dev/null; forge test --isolate --gas-report | tee snapshots/gas.txt >/dev/null' pass_filenames: false - repo: https://github.com/pre-commit/mirrors-prettier rev: v3.1.0 hooks: - id: prettier name: Format non-solidity files with prettier exclude: "^(docs/autogen|snapshots/)" ```` ## File: .prettierignore ```` foundry.toml out lib/ cache/ docs/autogenerated *.sol deployments/ snapshots/ ```` ## File: .prettierrc ```` { "printWidth": 120, "tabWidth": 2, "useTabs": false, "singleQuote": false, "bracketSpacing": true, "trailingComma": "all", "overrides": [ { "files": "*.sol", "options": { "printWidth": 120, "tabWidth": 4, "useTabs": false, "singleQuote": false, "bracketSpacing": false } }, { "files": "*.json", "options": { "tabWidth": 4 } } ] } ```` ## File: codecov.yml ````yaml codecov: require_ci_to_pass: true coverage: precision: 2 round: down range: "70...100" status: project: default: # basic target: auto threshold: 0% base: auto # advanced if_no_uploads: error if_not_found: success if_ci_failed: error only_pulls: false patch: default: # basic target: auto threshold: 0% base: auto # advanced if_no_uploads: error if_not_found: success if_ci_failed: error only_pulls: false parsers: gcov: branch_detection: conditional: true loop: true method: false macro: false comment: layout: "reach,diff,flags,files,footer" behavior: default require_changes: false require_base: false require_head: true ignore: - "script" - "test" - "src/test" - "src/libraries/utils/BN254.sol" ```` ## File: CONTRIBUTING.md ````markdown # Contributing - [Install](#install) - [Pre-commit Hooks](#pre-commit-hooks) - [Requirements for merge](#requirements-for-merge) - [Branching](#branching) - [Main](#main) - [Audit](#audit) - [Code Practices](#code-practices) - [Code Style](#code-style) - [Solidity Versioning](#solidity-versioning) - [Interfaces](#interfaces) - [NatSpec \& Comments](#natspec--comments) - [Testing](#testing) - [Best Practices](#best-practices) - [IR Compilation](#ir-compilation) - [Gas Metering](#gas-metering) - [Deployment](#deployment) - [Bytecode Hash](#bytecode-hash) - [Dependency Management](#dependency-management) - [Releases](#releases) ## Install Follow these steps to set up your local environment for development: - [Install foundry](https://book.getfoundry.sh/getting-started/installation) - Install dependencies: `forge install` - [Install pre-commit](https://pre-commit.com/#installation) - Install pre commit hooks: `pre-commit install` ## Pre-commit Hooks Follow the [installation steps](#install) to enable pre-commit hooks. To ensure consistency in our formatting `pre-commit` is used to check whether code was formatted properly and the documentation is up to date. Whenever a commit does not meet the checks implemented by pre-commit, the commit will fail and the pre-commit checks will modify the files to make the commits pass. Include these changes in your commit for the next commit attempt to succeed. On pull requests the CI checks whether all pre-commit hooks were run correctly. This repo includes the following pre-commit hooks that are defined in the `.pre-commit-config.yaml`: - `mixed-line-ending`: This hook ensures that all files have the same line endings (LF). - `trailing-whitespace`: Strips trailing spaces from lines so that diffs remain clean and editors don't introduce noise. - `end-of-file-fixer`: Ensures every file ends with a single newline and removes extra blank lines at the end of files. - `check-merge-conflict`: Fails when Git merge conflict markers are present to avoid committing unresolved conflicts. - `check-json`: Validates JSON files and fails fast on malformed syntax. - `check-yaml`: Parses YAML files to verify they are syntactically valid. - `sort-imports`: Normalises and sorts imports according to the rules mentioned in the [Code Style](#code-style) below. - `sort-errors`: Sorts errors according to the rules mentioned in the [Code Style](#code-style) below. - `format`: This hook uses `forge fmt` to format all Solidity files. - `doc`: This hook uses `forge doc` to generate the Solidity documentation. Commit the generated files whenever the documentation changes. - `prettier`: All remaining files are formatted using prettier. ## Requirements for merge In order for a PR to be merged, it must pass the following requirements: - All commits within the PR must be signed - CI must pass (tests, linting, etc.) - New features must be merged with associated tests - Bug fixes must have a corresponding test that fails without the fix - The PR must be approved by at least one maintainer ## Branching This section outlines the branching strategy of this repo. ### Main The main branch is supposed to reflect the deployed state on all networks, if not indicated otherwise inside the README. Only audited code should be merged into main. Сommits from dev branches should be merged into the main branch using a regular merge strategy. The commit messages should follow [the Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/). ### Audit Before an audit, the code should be frozen on a branch dedicated to the audit with the naming convention `audit/`. Each fix in response to an audit finding should be developed as a separate commit. The commit message should look similar to `fix: - `. ## Code Practices ### Code Style The repo follows the official [Solidity Style Guide](https://docs.soliditylang.org/en/latest/style-guide.html). In addition to that, this repo also borrows the following rules from [OpenZeppelin](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/GUIDELINES.md#solidity-conventions): - Internal or private state variables or functions should have an underscore prefix. ```solidity contract TestContract { uint256 private _privateVar; uint256 internal _internalVar; function _testInternal() internal { ... } function _testPrivate() private { ... } } ``` - Naming collisions should be avoided using a single trailing underscore. ```solidity contract TestContract { uint256 public foo; constructor(uint256 foo_) { foo = foo_; } } ``` - Interface names should have a capital I prefix. ```solidity interface IERC777 { ``` - Contracts not intended to be used standalone should be marked abstract, so they are required to be inherited by other contracts. ```solidity abstract contract AccessControl is ..., { ``` - Unchecked arithmetic blocks should contain comments explaining why overflow is guaranteed not to happen or is permissible. If the reason is immediately apparent from the line above the unchecked block, the comment may be omitted. Also, such exceptions/additions exist: - Functions should be grouped according to their visibility and ordered: 1. constructor 2. external 3. public 4. internal 5. private 6. receive function (if exists) 7. fallback function (if exists) - Each contract should be virtually divided into sections by using such separators: 1. /\* CONSTANTS \*/ 2. /\* IMMUTABLES \*/ 3. /\* STATE VARIABLES \*/ 4. /\* MODIFIERS \*/ 5. /\* CONSTRUCTOR \*/ 6. /\* EXTERNAL FUNCTIONS \*/ 7. /\* PUBLIC FUNCTIONS \*/ 8. /\* INTERNAL FUNCTIONS \*/ 9. /\* PRIVATE FUNCTIONS \*/ 10. /\* RECEIVE FUNCTION \*/ 11. /\* FALLBACK FUNCTION \*/ - Each interface should be virtually divided into sections by using such separators: 1. /\* ERRORS \*/ 2. /\* STRUCTS \*/ 3. /\* EVENTS \*/ 4. /\* FUNCTIONS \*/ - Do not use external and private visibilities in most cases. - Events should generally be emitted immediately after the state change that they represent, and should be named the same as the function's name. Some exceptions may be made for gas efficiency if the result doesn't affect the observable ordering of events. ```solidity function _burn(address who, uint256 value) internal { super._burn(who, value); emit Burn(who, value); } ``` - Custom errors should be used whenever possible. The naming should be concise and easy to read. - Imports should be divided into separate groups and ordered alphabetically ascending inside each group: 1. contracts 2. libraries 3. interfaces 4. external files separately ```solidity import {NetworkManager} from "../base/NetworkManager.sol"; import {OzEIP712} from "../base/OzEIP712.sol"; import {PermissionManager} from "../base/PermissionManager.sol"; import {Checkpoints} from "../../libraries/structs/Checkpoints.sol"; import {KeyTags} from "../../libraries/utils/KeyTags.sol"; import {ISettlement} from "../interfaces/modules/settlement/ISettlement.sol"; import {ISigVerifier} from "../interfaces/modules/settlement/sig-verifiers/ISigVerifier.sol"; import {StaticDelegateCallable} from "@symbioticfi/core/src/contracts/common/StaticDelegateCallable.sol"; import {Subnetwork} from "@symbioticfi/core/src/contracts/libraries/Subnetwork.sol"; import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; ``` - In case of comparison with `msg.sender` or `tx.origin`, these keywords should be on the right side of the inequality. ```solidity modifier onlyOwner() internal { if (owner != msg.sender) { revert NotOwner(); } } ``` - Errors should be ordered alphabetically ascending. ```solidity error InsufficientFunds(); error NoAccess(); error NotOwner(); ``` ### Solidity Versioning Contracts that are meant to be deployed should have an explicit version set in the `pragma` statement. ```solidity pragma solidity 0.8.X; ``` Abstract contracts, libraries and interfaces should use the caret (`^`) range operator to specify the version range to ensure better compatibility. ```solidity pragma solidity ^0.X.0; ``` Libraries and abstract contracts using functionality introduced in newer versions of Solidity can use caret range operators with higher path versions (e.g., `^0.8.24` when using transient storage opcodes). For interfaces, it should be considered to use the greater than or equal to (`>=`) range operator to ensure better compatibility with future versions of Solidity. ### Interfaces Every contract MUST implement its corresponding interface that includes all externally callable functions, errors and events. ### NatSpec & Comments Interfaces should be the entry point for all contracts. When exploring a contract within the repository, the interface MUST contain all relevant information to understand the functionality of the contract in the form of NatSpec comments. This includes all externally callable functions, structs, errors and events. The NatSpec documentation MUST be added to the functions, structs, errors and events within the interface. This allows a reader to understand the functionality of a function before moving on to the implementation. The implementing functions MUST point to the NatSpec documentation in the interface using `@inheritdoc`. Internal and private functions shouldn't have NatSpec documentation except for `@dev` comments, whenever more context is needed. Additional comments within a function should only be used to give more context to more complex operations; otherwise, the code should be kept readable and self-explanatory. NatSpec comments in contracts should use a triple slash (`///`) to bring less noise to the implementation, while libraries and interfaces should use `/* */` wrappers. The comments should respect the following rules: - For read functions: `@notice Returns <...>` - For write functions: `@notice ` - For structs: `@notice ` - For errors: `@notice Raised when <...>` - For events: `@notice Emitted when <...>` Each contract/library/interface should have a title comment that should follow such a structure: 1. `@title ` (e.g., `Vault`) 2. `@notice Contract/Library/Interface for <...>.` - also, other variations are possible, e.g.: - `@notice Interface for the Vault contract.` - `@notice Base contract for <...>.` - `@notice Library-logic for <...>.` 3. `@dev <...>` (optional) ## Testing The following testing practices should be followed when writing unit tests for new code. All functions, lines and branches should be tested to result in 100% testing coverage. Fuzz parameters and conditions whenever possible. Extremes should be tested in dedicated edge case and corner case tests. Invariants should be tested in dedicated invariant tests. Differential testing should be used to compare assembly implementations with implementations in Solidity or testing alternative implementations against existing Solidity or non-Solidity code using ffi. New features must be merged with associated tests. Bug fixes should have a corresponding test that fails without the bug fix. ### Best Practices Best practices and naming conventions should be followed as outlined in the [Foundry Book](https://getfoundry.sh/forge/tests/overview). ### IR Compilation All contracts and tests should be compilable without IR whenever possible. ### Gas Metering Gas for function calls should be metered using the built-in `vm.snapshotGasLastCall` function in forge. To meter across multiple calls `vm.startSnapshotGas` and `vm.stopSnapshotGas` can be used. Tests that measure gas should be annotated with `/// forge-config: default.isolate = true` and not be fuzzed to ensure that the gas snapshot is accurate and consistent for CI verification. All external functions should have a gas snapshot test, and diverging paths within a function should have appropriate gas snapshot tests. For more information on gas metering, see the [Forge cheatcodes reference](https://getfoundry.sh/reference/cheatcodes/gas-snapshots/#snapshotgas-cheatcodes). ### Bytecode Hash Bytecode hash should be set to `none` in the `foundry.toml` file to ensure that the bytecode is consistent. ## Dependency Management The preferred way to manage dependencies is using [`forge install`](https://book.getfoundry.sh/forge/dependencies). This ensures that your project uses the correct versions and structure for all external libraries. Also, `npm` and `soldeer` packages should be published to increase coverage of different use-cases. ## Releases Every deployment and change made to contracts after deployment should be accompanied by a tag and release on GitHub. ```` ## File: foundry.lock ```` { "lib/chainlink-evm": { "rev": "448d48945910a0e1fcab5abff555c0f8f3d87070" }, "lib/core": { "tag": { "name": "v1.0.3", "rev": "74c0c6fbd5531a6065cdafdab07840b04a0d2039" } }, "lib/crypto-lib": { "rev": "f2c00ecced1df96fe81894d19a6b8ec754beedb9" }, "lib/forge-std": { "tag": { "name": "v1.11.0", "rev": "8e40513d678f392f398620b3ef2b418648b33e89" } }, "lib/network": { "rev": "8ee834279cb4fb45adfcb5fee4a405f06b3134ca" }, "lib/openzeppelin-contracts": { "tag": { "name": "v5.2.0", "rev": "acd4ff74de833399287ed6b31b4debf6b2b35527" } }, "lib/openzeppelin-contracts-upgradeable": { "tag": { "name": "v5.2.0", "rev": "3d5fa5c24c411112bab47bec25cfa9ad0af0e6e8" } }, "lib/rewards": { "rev": "b5a1f5b46f33f31938fc0116086b3a75e748c8b1" } } ```` ## File: foundry.toml ````toml [profile.default] evm_version = "prague" solc = "0.8.28" optimizer = true optimizer_runs = 200 via_ir = false bytecode_hash = "none" src = "src" out = "out" libs = ["lib"] fs_permissions = [{ access = "read-write", path = "./"}] gas_reports = ["*"] gas_limit = "18446744073709551615" dynamic_test_linking = true ignored_warnings_from = ["test/","script/"] ffi = true [rpc_endpoints] mainnet = "${ETH_RPC_URL}" hoodi = "${ETH_RPC_URL_HOODI}" holesky = "${ETH_RPC_URL_HOLESKY}" sepolia = "${ETH_RPC_URL_SEPOLIA}" [fmt] bracket_spacing = false int_types = "long" line_length = 120 multiline_func_header = "attributes_first" number_underscore = "thousands" quote_style = "double" tab_width = 4 single_line_statement_blocks = "preserve" sort_imports = false contract_new_lines = false override_spacing = false hex_underscore = "preserve" wrap_comments = false [lint] lint_on_build = false exclude_lints = ["asm-keccak256","mixed-case-function","mixed-case-variable","pascal-case-struct","screaming-snake-case-const"] ignore = ["test/**/*.sol","script/**/*.sol","src/interfaces/**/*.sol"] additional_compiler_profiles = [ { name = "test", via_ir = false, optimizer = false }, { name = "via-ir-1", via_ir = true, optimizer = true, optimizer_runs = 1 } ] compilation_restrictions = [ { paths = "test/**", via_ir = false, optimizer = false }, { paths = "{test/mocks/VotingPowerProviderFull.sol}", via_ir = true, optimizer = true, optimizer_runs = 1 } ] [profile.default.fuzz] runs = 1000 max_test_rejects = 262144 [profile.pr.fuzz] runs = 10000 max_test_rejects = 262144 [profile.ci.fuzz] runs = 100000 max_test_rejects = 262144 [profile.debug] via_ir = false optimizer_runs = 200 fuzz.runs = 100 # See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options ```` ## File: LICENSE ```` MIT License Copyright (c) 2024 Symbiotic Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ```` ## File: package.json ````json { "name": "@symbioticfi/relay-contracts", "version": "1.0.0-rc.2", "description": "Symbiotic Relay smart contracts allowing construction of validator set using various mechanics, verification and management of operators' keys of various types, aggregated signatures verification, and validator set's running.", "homepage": "https://symbiotic.fi/relay", "bugs": "https://github.com/symbioticfi/relay-contracts/issues", "license": "MIT", "author": "Symbiotic Team", "files": [ "examples/**/*", "src/**/*", "script/**/*", "test/mocks/**/*" ], "repository": { "type": "git", "url": "https://github.com/symbioticfi/relay-contracts.git" }, "keywords": [ "solidity", "ethereum", "smart", "contracts", "security" ], "dependencies": { "@noble/curves": "^1.3.0", "dotenv": "^16.5.0", "ethereum-cryptography": "^2.1.3", "ethers": "^6.11.1", "@openzeppelin/contracts": "5.2.0", "@openzeppelin/contracts-upgradeable": "5.2.0", "@symbioticfi/core": "1.0.3", "@symbioticfi/rewards": "2.0.0" }, "engines": { "node": ">=18.0.0" } } ```` ## File: README.md ````markdown > [!WARNING] > The SDK is a work in progress and is currently under audits. Breaking changes may occur in SDK updates as well as backward compatibility is not guaranteed. Use with caution. # Symbiotic Relay Smart Contracts [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/symbioticfi/relay-contracts) [![codecov](https://codecov.io/github/symbioticfi/relay-contracts/graph/badge.svg?token=9F5PUM6HB0)](https://codecov.io/github/symbioticfi/relay-contracts) ## Overview Symbiotic Relay is a peer-to-peer side-network designed to collect and aggregate signatures from validators, maintain validator sets on the settlement contract. To achieve that, Symbiotic provides a set of predefined smart contracts, in general, representing the following modules: - [VotingPowerProvider](./src/modules/voting-power/) - provides the basic data regarding operators, vaults and their voting power, it allows constructing various onboarding schemes such as: - [OperatorsWhitelist](./src/modules/voting-power/extensions/OperatorsWhitelist.sol) - only whitelisted operators can register - [OperatorsBlacklist](./src/modules/voting-power/extensions/OperatorsBlacklist.sol) - blacklisted operators are unregistered and are forbidden to return back - [OperatorsJail](./src/modules/voting-power/extensions/OperatorsJail.sol) - operators can be jailed for some amount of time and register back after that - [SharedVaults](./src/modules/voting-power/extensions/SharedVaults.sol) - shared (with other networks) vaults (like the ones with NetworkRestakeDelegator) can be added - [OperatorVaults](./src/modules/voting-power/extensions/OperatorVaults.sol) - vaults that are attached to a single operator can be added - [MultiToken](./src/modules/voting-power/extensions/MultiToken.sol) - possible to add new supported tokens on the go - [OpNetVaultAutoDeploy](./src/modules/voting-power/extensions/OpNetVaultAutoDeploy.sol) - enable auto-creation of the configured by you vault on each operator registration - [VotingPowerCalculators](./src/modules/voting-power/common/voting-power-calc/) - there are several stake-to-votingPower conversion mechanisms you can use separately or combine: - [EqualStakeVPCalc](./src/modules/voting-power/common/voting-power-calc/EqualStakeVPCalc.sol) - voting power is equal to stake - [NormalizedTokenDecimalsVPCalc](./src/modules/voting-power/common/voting-power-calc/NormalizedTokenDecimalsVPCalc.sol) - all tokens' decimals are normalized to 18 - [PricedTokensChainlinkVPCalc](./src/modules/voting-power/common/voting-power-calc/PricedTokensChainlinkVPCalc.sol) - voting power is calculated using Chainlink price feeds - [WeightedTokensVPCalc](./src/modules/voting-power/common/voting-power-calc/WeightedTokensVPCalc.sol) - voting power is affected by configured weights for tokens - [WeightedVaultsVPCalc](./src/modules/voting-power/common/voting-power-calc/WeightedVaultsVPCalc.sol) - voting power is affected by configured weights for vaults - Also, there are ready bindings for [slashing](./src/modules/voting-power/extensions/BaseSlashing.sol) and [rewards](./src/modules/voting-power/extensions/BaseRewards.sol) - [KeyRegistry](./src/modules/key-registry/) - verifies and manages operators' keys; currently, these key types are supported: - [BlsBn254](./src/libraries/keys/KeyBlsBn254.sol) ([signature verification](./src/libraries/sigs/SigBlsBn254.sol)) - [EcdsaSecp256k1](./src/libraries/keys/KeyEcdsaSecp256k1.sol) ([signature verification](./src/libraries/sigs/SigEcdsaSecp256k1.sol)) - [ValSetDriver](./src/modules/valset-driver/) - is used by the off-chain part of the Symbiotic Relay for validator set deriving and maintenance - [Settlement](./src/modules/settlement/) - requires a compressed validator set (header) to be committed each epoch, but allows verifying signatures made by the validator set; currently, it supports the following verification mechanics: - [SimpleVerifier](./src/modules/settlement/sig-verifiers/SigVerifierBlsBn254Simple.sol) - requires the whole validator set to be inputted on the verification, but in a compressed and efficient way, so that it is the best choice to use up to around 125 validators - [ZKVerifier](./src/modules/settlement/sig-verifiers/SigVerifierBlsBn254ZK.sol) - uses ZK verification made with [gnark](https://github.com/Consensys/gnark), allowing larger validator sets with an almost constant verification gas cost ## Examples Can be found [here](./examples/). ## Usage ### Dependencies - Git ([installation](https://git-scm.com/downloads)) - Foundry ([installation](https://getfoundry.sh/introduction/installation/)) ### Prerequisites **Clone the repository** ``` git clone --recurse-submodules https://github.com/symbioticfi/relay-contracts.git ``` ### Deploy Your Relay The deployment tooling can be found at [`script/`](./script/) folder. It consists of [`RelayDeploy.sol`](./script/RelayDeploy.sol) Foundry script template [`relay-deploy.sh`](./script/relay-deploy.sh) bash script (the Relay smart contracts use external libraries for their implementations, so that it's not currently possible to use solely Foundry script for multi-chain deployment). - [`RelayDeploy.sol`](./script/RelayDeploy.sol) - abstract base that wires common Symbiotic core helpers and exposes the four deployment hooks: KeyRegistry, VotingPowerProvider, Settlement, and ValVetDriver - [`relay-deploy.sh`](./script/relay-deploy.sh) - orchestrates per-contract multi-chain deployments (uses Python inside to parse `toml` file) The script deploys Relay modules under [OZ's TransparentUpgradeableProxy](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) using [CreateX](https://github.com/pcaversaccio/createx) (it provides better control for production deployments and more simplified approaches for development). #### Dependencies - Python ([installation](https://www.python.org/downloads/)) #### Deployment 1. Implement your `MyRelayDeploy.sol` ([see example](./script/examples/MyRelayDeploy.sol)) - this Foundry script should include the deployment configuration of your Relay modules - you need to implement all virtual functions of `RelayDeploy.sol` - in constructor, need to input the path of the `toml` file - you are provided with additional helpers such as `getCore()`, `getKeyRegistry()`, `getVotingPowerProvider()`, etc. (see full list in [`RelayDeploy.sol`](./script/RelayDeploy.sol)) 2. Implement your `my-relay-deploy.toml` ([see example](./script/examples/my-relay-deploy.toml)) - this configuration file should include RPC URLs that will be needed for the deployment, and which modules should be deployed on which chains - **do not replace [1234567890] placeholder with endpoint_url = ""** - the contracts are deployed in such order: 1. KeyRegistry 2. VotingPowerProvider 3. Settlement 4. ValSetDriver 3. Execute the deployment script, e.g.: ```bash ./script/relay-deploy.sh ./script/examples/MyRelayDeploy.sol ./script/examples/my-relay-deploy.toml --broadcast --ledger ``` _Basic form is `./script/relay-deploy.sh `_ At the end, your `toml` file will contain the addresses of the deployed Relay modules. ### Build, Test, and Format ``` forge build forge test forge fmt ``` **Configure environment** Create `.env` based on the template: ``` ETH_RPC_URL= ETHERSCAN_API_KEY= ``` ## Security Security audits can be found [here](./audits). ```` ## File: remappings.txt ```` @openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/ @openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/ @symbioticfi/core/=lib/core/ @symbioticfi/network/=lib/network @crypto-lib/=lib/crypto-lib/src/ @symbioticfi/rewards/=lib/rewards/ ```` --- ## Relay (+ Go client) This file is a merged representation of the entire codebase, combined into a single document by Repomix. The content has been processed where content has been compressed (code blocks are separated by ⋮---- delimiter). # File Summary ## Purpose This file contains a packed representation of the entire repository's contents. It is designed to be easily consumable by AI systems for analysis, code review, or other automated processes. ## File Format The content is organized as follows: 1. This summary section 2. Repository information 3. Directory structure 4. Repository files (if enabled) 5. Multiple file entries, each consisting of: a. A header with the file path (## File: path/to/file) b. The full contents of the file in a code block ## Usage Guidelines - This file should be treated as read-only. Any changes should be made to the original repository files, not this packed version. - When processing this file, use the file path to distinguish between different files in the repository. - Be aware that this file may contain sensitive information. Handle it with the same level of security as you would the original repository. ## Notes - Some files may have been excluded based on .gitignore rules and Repomix's configuration - Binary files are not included in this packed representation. Please refer to the Repository Structure section for a complete list of file paths, including binary files - Files matching patterns in .gitignore are excluded - Files matching default ignore patterns are excluded - Content has been compressed - code blocks are separated by ⋮---- delimiter - Files are sorted by Git change count (files with more changes are at the bottom) # Directory Structure ``` .github/ workflows/ build.yaml nightly.yaml release.yaml tests.yaml dependabot.yml api/ client/ examples/ main.go README.md v1/ client.go types.go LICENSE proto/ v1/ api.proto cmd/ relay/ root/ app.go config.go root.go main.go utils/ cmd-helpers/ helpers.go keys/ add.go cmd.go print.go remove.go update.go network/ cmd.go genesis.go info.go printers.go operator/ cmd.go info.go invalidate_old_signatures.go register_key.go register_operator.go register_with_signature.go unregister_operator.go unregister_with_signature.go root/ root.go main.go docs/ api/ v1/ api.swagger.json doc.md index.html cli/ relay/ relay_sidecar.md utils/ utils_keys_add.md utils_keys_list.md utils_keys_remove.md utils_keys_update.md utils_keys.md utils_network_generate-genesis.md utils_network_info.md utils_network.md utils_operator_info.md utils_operator_invalidate-old-signatures.md utils_operator_register-key.md utils_operator_register-operator-with-signature.md utils_operator_register-operator.md utils_operator_register-signature.md utils_operator_unregister-operator-with-signature.md utils_operator_unregister-operator.md utils_operator_unregister-signature.md utils_operator.md utils_version.md utils.md e2e/ scripts/ deploy.sh generate_network.sh genesis-generator.sh sidecar-start.sh tests/ api_test.go epoch_test.go genesis_test.go http_gateway_test.go metadata_test.go setup_test.go sidecar.yaml sign_test.go sync_test.go types_test.go README.md setup.sh hack/ codegen/ generate-client-types.go docgen/ generate-cli-docs.go internal/ client/ p2p/ proto/ v1/ message_grpc.pb.go message.pb.go message.proto broadcast_signature_aggregated_message.go broadcast_signature_generated_message.go discovery_integration_test.go discovery_test.go discovery.go p2p_broadcast_test.go p2p_grpc_handler.go p2p_grpc_send_want_aggregation_proofs_request_test.go p2p_grpc_send_want_aggregation_proofs_request.go p2p_grpc_send_want_signatures_request_test.go p2p_grpc_send_want_signatures_request.go p2p_grpc_test.go p2p_handle_message_test.go p2p_handle_message_unit_test.go p2p_handle_message.go p2p_test.go p2p.go repository/ badger/ proto/ v1/ badger.pb.go badger.proto badger_repository_add_proof.go badger_repository_add_signature.go badger_repository_aggregation_proof_pending_test.go badger_repository_aggregation_proof_test.go badger_repository_aggregation_proof.go badger_repository_network_config_test.go badger_repository_network_config.go badger_repository_proof_commits_test.go badger_repository_proof_commits.go badger_repository_proto_test.go badger_repository_signature_map_test.go badger_repository_signature_map.go badger_repository_signature_request_test.go badger_repository_signature_request.go badger_repository_signature_test.go badger_repository_signature.go badger_repository_test.go badger_repository_transaction_test.go badger_repository_transaction.go badger_repository_validator_set_test.go badger_repository_validator_set.go badger_repository.go cached_repository_test.go cached_repository.go cache/ generic_cache.go entity/ entity_aggregation_proof_sync_test.go entity_error.go entity_signature_map_test.go entity_signature_map.go entity_signature_request.go entity_signature_sync.go p2p_entity.go gen/ api/ v1/ api_grpc.pb.go api.pb.go api.pb.gw.go usecase/ aggregation-policy/ low-cost/ low_cost_policy.go low-latency/ low_latency_policy.go types/ types.go aggregation_policies.go aggregator-app/ mocks/ aggregator_app.go aggregator_app_test.go aggregator_app.go api-server/ mocks/ app_mock.go app.go get_aggregation_proof_v1_test.go get_aggregation_proof_v1.go get_aggregation_proofs_by_epoch_v1_test.go get_aggregation_proofs_by_epoch_v1.go get_aggregation_status_v1_test.go get_aggregation_status_v1.go get_current_epoch_v1_test.go get_current_epoch_v1.go get_last_all_committed_v1_test.go get_last_all_committed_v1.go get_last_committed_v1_test.go get_last_committed_v1.go get_local_validator_v1_test.go get_local_validator_v1.go get_signature_request_ids_by_epoch_v1_test.go get_signature_request_ids_by_epoch_v1.go get_signature_request_v1_test.go get_signature_request_v1.go get_signature_requests_by_epoch_v1_test.go get_signature_requests_by_epoch_v1.go get_signature_v1.go get_signatures_by_epoch_v1_test.go get_signatures_by_epoch_v1.go get_signatures_v1_test.go get_validator_by_address_v1_test.go get_validator_by_address_v1.go get_validator_by_key_v1_test.go get_validator_by_key_v1.go get_validator_set_header_v1_test.go get_validator_set_header_v1.go get_validator_set_v1_test.go get_validator_set_v1.go get_validatorset_metadata_v1_test.go get_validatorset_metadata_v1.go helpers_test.go http_test.go http.go interceptors_test.go interceptors.go listen_proofs_v1_test.go listen_proofs_v1.go listen_signature_v1.go listen_signatures_v1_test.go listen_validator_set_v1_test.go listen_validator_set_v1.go sign_message_v1_test.go sign_message_v1.go broadcaster/ doc.go hub_test.go hub.go entity-processor/ mocks/ entity_processor.go entity_processor_test.go entity_processor.go key-provider/ cache_key_provider.go env_provider.go key_provider.go key_store_provider_test.go key_store_provider.go simple_key_provider.go metrics/ metrics_app.go metrics_grpc.go metrics.go signature-listener/ mocks/ signature_listener_uc.go signature_listener_uc_test.go signature_listener_uc.go signer-app/ mocks/ signer_app.go signer_app_handle_signature_aggregated_message.go signer_app_test.go signer_app.go sync-provider/ sync_provider_build_want_aggregation_proofs_request.go sync_provider_build_want_signatures_map.go sync_provider_handle_want_aggregation_proofs_request.go sync_provider_handle_want_signatures.go sync_provider_process_received_aggregation_proofs.go sync_provider_process_received_signatures.go sync_provider_test.go sync_provider.go sync-runner/ sync_runner.go valset-listener/ valset_generator_handle_agg_proof.go valset_listener_uc.go valset-status-tracker/ status_tracker.go pkg/ log/ context_handler.go log_test.go log.go prettylog.go proof/ circuit.go helpers_test.go helpers.go proof_test.go proof.go server/ interceptors.go metrics_server.go signals/ signal_test.go signal.go symbiotic/ client/ evm/ abi/ IKeyRegistry.abi.json ISettlement.abi.json IValSetDriver.abi.json IVotingPowerProvider.abi.json gen/ keyRegistry.go multicall3.go operatorRegistry.go settlement.go valsetDriver.go votingPowerProvider.go mocks/ eth.go eth_commit_valset_test.go eth_commit_valset.go eth_operator_test.go eth_operator.go eth_set_genesis_test.go eth_set_genesis.go eth_test.go eth_verify_quorum_sig_test.go eth_verify_quorum_sig.go eth.go multicall_test.go multicall.go entity/ entity_test.go entity.go evm_entity.go key_tag_entity_test.go key_tag_entity.go key.go usecase/ aggregator/ aggregator-types/ aggregator.go blsBn254Simple/ aggregator_test.go aggregator.go blsBn254ZK/ aggregator_test.go aggregator.go helpers/ helpers_test.go helpers.go aggregators_test.go aggregators.go crypto/ bls12381Bn254/ key_test.go key.go blsBn254/ key_test.go key.go ecdsaSecp256k1/ key_test.go key.go keys.go ssz/ ssz.go types.go valset-deriver/ mocks/ deriver.go valset_deriver_test.go valset_deriver.go symbiotic.go .dockerignore .env.example .gitignore .gitmodules .golangci.yml buf.badger.gen.yaml buf.gen.yaml buf.lock buf.p2p.gen.yaml buf.yaml CONTRIBUTING.md DEVELOPMENT.md Dockerfile example.config.yaml go.mod Makefile README.md ``` # Files ## File: .github/workflows/build.yaml ````yaml --- name: Build on: workflow_call: inputs: version: type: string description: The version to build, if not provided go version srting is used required: false default: "" jobs: build: name: Build runs-on: group: relay timeout-minutes: 15 steps: - name: Checkout source code uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # pin@v4.3.0 with: fetch-depth: 0 - name: Setup Private Git Repo Access run: | git config --global url.https://x-oauth-basic:${{ secrets.GITHUB_TOKEN }}@github.com/.insteadOf https://github.com/ echo "GOPRIVATE=github.com/symbioticfi/relay" >> $GITHUB_ENV - name: Setup Go uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # pin@v5.5.0 with: go-version: 1.25.3 - name: Get version id: get_version run: | if [ -n "${{ inputs.version }}" ]; then VERSION_INFO=${{ inputs.version }} echo "Version Info: $VERSION_INFO" echo "TAG=$VERSION_INFO" >> $GITHUB_ENV else echo "No version input provided, will auto calculate" fi - name: Build relay utils linux amd64 run: make build-relay-utils OS=linux ARCH=amd64 - name: Upload artifact relay_utils_linux_amd64 uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # pin@v4.6.2 with: name: relay_utils_linux_amd64 path: relay_utils_linux_amd64 - name: Build relay utils linux arm64 run: make build-relay-utils OS=linux ARCH=arm64 - name: Upload artifact relay_utils_linux_arm64 uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # pin@v4.6.2 with: name: relay_utils_linux_arm64 path: relay_utils_linux_arm64 - name: Build relay utils darwin arm64 run: make build-relay-utils OS=darwin ARCH=arm64 - name: Upload artifact relay_utils_darwin_arm64 uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # pin@v4.6.2 with: name: relay_utils_darwin_arm64 path: relay_utils_darwin_arm64 - name: Build relay sidecar linux amd64 run: make build-relay-sidecar OS=linux ARCH=amd64 - name: Upload artifact relay_sidecar_linux_amd64 uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # pin@v4.6.2 with: name: relay_sidecar_linux_amd64 path: relay_sidecar_linux_amd64 - name: Build relay sidecar linux arm64 run: make build-relay-sidecar OS=linux ARCH=arm64 - name: Upload artifact relay_sidecar_linux_arm64 uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # pin@v4.6.2 with: name: relay_sidecar_linux_arm64 path: relay_sidecar_linux_arm64 - name: Build relay sidecar darwin arm64 run: make build-relay-sidecar OS=darwin ARCH=arm64 - name: Upload artifact relay_sidecar_darwin_arm64 uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # pin@v4.6.2 with: name: relay_sidecar_darwin_arm64 path: relay_sidecar_darwin_arm64 - name: Set up Docker Buildx uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1 with: driver-opts: network=host - name: Login to Docker Hub uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_PASSWORD }} - name: Cache Docker layers uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 with: path: /tmp/.buildx-cache key: ${{ runner.os }}-buildx-${{ github.sha }} restore-keys: | ${{ runner.os }}-buildx- - name: Build & Push Images run: make image id: push-image timeout-minutes: 30 env: PUSH_IMAGE: true IMAGE_REPO: symbioticfi/relay PUSH_LATEST: true # push latest for all builds nuightly or stable release - name: Echo image built run: echo "Image built - [${{ steps.push-image.outputs.image }}]" ```` ## File: .github/workflows/nightly.yaml ````yaml --- name: Nightly Build on: schedule: # Run at 03:00 UTC every day (avoiding peak 00:00 congestion) - cron: "0 3 * * *" workflow_dispatch: permissions: contents: write jobs: tests: name: Tests uses: ./.github/workflows/tests.yaml secrets: inherit build: needs: - tests name: Build uses: ./.github/workflows/build.yaml secrets: inherit nightly-release: name: Nightly Release needs: - tests - build runs-on: ubuntu-24.04 timeout-minutes: 5 steps: - name: Checkout source code uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # pin@v4.3.0 with: fetch-depth: 0 - name: Generate nightly tag id: nightly_tag run: | DATE=$(date +%Y%m%d) echo "tag=nightly-$DATE" >> "$GITHUB_OUTPUT" echo "Generated nightly tag: nightly-$DATE" - name: Generate changelog id: changelog run: | # Get the last nightly tag or use a fallback LAST_TAG=$(git tag --list "nightly-*" --sort=-version:refname | head -1) if [ -z "$LAST_TAG" ]; then echo "No previous nightly tag found, using last 10 commits" git log -10 --pretty=format:"- %s (%an)" > CHANGELOG.md else echo "Generating changelog between $LAST_TAG and current commit" git log $LAST_TAG..HEAD --pretty=format:"- %s (%an)" > CHANGELOG.md fi cat CHANGELOG.md - name: Download relay utils artifacts uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # pin@v5.0.0 with: pattern: relay_utils_* merge-multiple: true - name: Download relay sidecar artifacts uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # pin@v5.0.0 with: pattern: relay_sidecar_* merge-multiple: true - name: Create nightly release uses: softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631 # pin@v2.2.2 with: tag_name: ${{ steps.nightly_tag.outputs.tag }} draft: false prerelease: true body_path: CHANGELOG.md files: | relay_utils_linux_amd64 relay_utils_linux_arm64 relay_utils_darwin_arm64 relay_sidecar_linux_amd64 relay_sidecar_linux_arm64 relay_sidecar_darwin_arm64 ```` ## File: .github/workflows/release.yaml ````yaml --- name: Release on: push: tags: - "v*.*.*" permissions: contents: write jobs: tests: name: Tests uses: ./.github/workflows/tests.yaml secrets: inherit build: needs: - tests name: Build uses: ./.github/workflows/build.yaml with: version: ${{ github.ref_name }} secrets: inherit release: name: Release needs: - tests - build runs-on: ubuntu-24.04 timeout-minutes: 5 steps: - name: Checkout source code uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # pin@v4.3.0 with: fetch-depth: 0 - name: Get previous tag id: get_previous_tag run: | echo "tag=$(git describe --tags --abbrev=0 HEAD^)" >> "$GITHUB_OUTPUT" - name: Generate changelog id: changelog run: | echo "Generating changelog between ${{ steps.get_previous_tag.outputs.tag }} and ${{ github.ref_name }}" git log ${{ steps.get_previous_tag.outputs.tag }}..${{ github.ref_name }} --pretty=format:"- %s (%an)" > CHANGELOG.md cat CHANGELOG.md - name: Download relay utils artifacts uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # pin@v5.0.0 with: pattern: relay_utils_* merge-multiple: true - name: Download relay sidecar artifacts uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # pin@v5.0.0 with: pattern: relay_sidecar_* merge-multiple: true - name: Release uses: softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631 # pin@v2.2.2 with: draft: true body_path: CHANGELOG.md files: | relay_utils_linux_amd64 relay_utils_linux_arm64 relay_utils_darwin_arm64 relay_sidecar_linux_amd64 relay_sidecar_linux_arm64 relay_sidecar_darwin_arm64 ```` ## File: .github/workflows/tests.yaml ````yaml --- name: "CI Pipeline" on: pull_request: types: [opened, synchronize, reopened] branches: [dev, main] workflow_call: env: GO_VERSION: "1.25.3" NODE_VERSION: "22" FOUNDRY_VERSION: "v1.3.1" concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: code-quality: name: "Code Quality & Linting" runs-on: ubuntu-24.04 timeout-minutes: 10 steps: - name: "Checkout Repository" uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 with: fetch-depth: 0 - name: "Configure Private Repository Access" run: | git config --global url.https://x-oauth-basic:${{ secrets.GITHUB_TOKEN }}@github.com/.insteadOf https://github.com/ echo "GOPRIVATE=github.com/symbioticfi/relay" >> $GITHUB_ENV - name: "Setup Go Environment" uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 with: go-version: ${{ env.GO_VERSION }} cache: true cache-dependency-path: "go.sum" - name: "Generate Code" run: make generate - name: "Run Code Linting" run: make lint - name: "Verify Code Generation" id: verify-codegen run: | if ! git diff --exit-code; then echo "❌ Code generation produced changes. Please run 'make generate' and commit the changes." echo "changes=true" >> $GITHUB_OUTPUT git diff exit 1 else echo "✅ Code generation verification passed." echo "changes=false" >> $GITHUB_OUTPUT fi unit-tests: name: "Unit Tests" runs-on: ubuntu-24.04 timeout-minutes: 15 needs: [code-quality] steps: - name: "Checkout Repository" uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 with: fetch-depth: 0 - name: "Configure Private Repository Access" run: | git config --global url.https://x-oauth-basic:${{ secrets.GITHUB_TOKEN }}@github.com/.insteadOf https://github.com/ echo "GOPRIVATE=github.com/symbioticfi/relay" >> $GITHUB_ENV - name: "Setup Go Environment" uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 with: go-version: ${{ env.GO_VERSION }} cache: true cache-dependency-path: "go.sum" - name: "Execute Unit Tests" run: make unit-test - name: "Extract Test Coverage" id: coverage run: | if [[ -f coverage.txt ]]; then TOTAL_LINE=$(grep '^total:' coverage.txt | tail -1) COVERAGE=$(echo "$TOTAL_LINE" | grep -Eo '[0-9]+\.[0-9]+%') COVERAGE_VALUE="${COVERAGE:-Not available}" echo "coverage=${COVERAGE_VALUE}" >> $GITHUB_OUTPUT echo "COVERAGE=${COVERAGE_VALUE}" >> $GITHUB_ENV echo "Test Coverage: ${COVERAGE_VALUE}" else echo "coverage=Not available" >> $GITHUB_OUTPUT echo "COVERAGE=Not available" >> $GITHUB_ENV echo "⚠️ Coverage file not found" fi - name: "Post Coverage Report to PR" if: github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' uses: mshick/add-pr-comment@b8f338c590a895d50bcbfa6c5859251edc8952fc # v2.8.2 with: message: | ## 🧪 Test Coverage Report **Coverage:** `${{ steps.coverage.outputs.coverage }}` e2e-tests: name: "E2E Tests - ${{ matrix.config.name }}" runs-on: ${{ matrix.config.verification_type == 0 && 'relay-16' || 'ubuntu-24.04' }} timeout-minutes: 30 needs: [unit-tests] strategy: matrix: config: - name: "Simple Setup" operators: 4 commiters: 1 aggregators: 1 verification_type: 1 - name: "Multi Committer and Aggregator" operators: 10 commiters: 2 aggregators: 3 verification_type: 1 - name: "ZK Aggregator Test" operators: 10 commiters: 3 aggregators: 3 verification_type: 0 epoch_time: 120 env: # E2E Test Configuration OPERATORS: ${{ matrix.config.operators }} COMMITERS: ${{ matrix.config.commiters }} AGGREGATORS: ${{ matrix.config.aggregators }} VERIFICATION_TYPE: ${{ matrix.config.verification_type }} EPOCH_TIME: ${{ matrix.config.epoch_time || 60 }} BLOCK_TIME: 1 FINALITY_BLOCKS: 2 GENERATE_SIDECARS: false steps: - name: "Checkout Repository" uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 with: fetch-depth: 0 - name: "Configure Private Repository Access" run: | git config --global url.https://x-oauth-basic:${{ secrets.GITHUB_TOKEN }}@github.com/.insteadOf https://github.com/ echo "GOPRIVATE=github.com/symbioticfi/relay" >> $GITHUB_ENV - name: "Setup Go Environment" uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 with: go-version: ${{ env.GO_VERSION }} cache: true cache-dependency-path: "go.sum" - name: "Setup Node.js Environment" uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: ${{ env.NODE_VERSION }} - name: "Setup Foundry Toolchain" uses: foundry-rs/foundry-toolchain@82dee4ba654bd2146511f85f0d013af94670c4de # v1.4.0 with: version: ${{ env.FOUNDRY_VERSION }} - name: "Setup Docker Buildx" uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1 - name: "Install Go Dependencies" run: go mod download - name: "Initialize E2E Test Environment" run: | echo "Configuring E2E test environment..." echo " - Operators: ${{ env.OPERATORS }}" echo " - Commiters: ${{ env.COMMITERS }}" echo " - Aggregators: ${{ env.AGGREGATORS }}" echo " - Verification Type: ${{ env.VERIFICATION_TYPE }}" echo " - Epoch Time: ${{ env.EPOCH_TIME }}s" echo " - Block Time: ${{ env.BLOCK_TIME }}s" echo " - Finality Blocks: ${{ env.FINALITY_BLOCKS }}" cd e2e chmod +x setup.sh ./setup.sh cd ../ chmod -R 777 e2e/ - name: "Start Test Network" run: | cd e2e/temp-network echo "Starting Docker Compose network..." docker compose up -d echo "Waiting for services to initialize..." sleep 30 echo "✅ Network startup completed" - name: "Execute E2E Tests" run: | echo "Running End-to-End tests..." make e2e-test - name: "Collect Diagnostic Information" if: failure() run: | cd e2e echo "❌ Test failure detected - collecting diagnostic information..." # Create organized logs directory structure mkdir -p logs/{containers,system,summary} echo "Gathering container information..." # Get active containers (excluding anvil containers which are noisy) CONTAINER_IDS=$(docker ps -a --format "table {{.ID}}\t{{.Names}}" | grep -v -E "(anvil|buildx_buildkit|CONTAINER)" | awk '{print $1}' | tr '\n' ' ') if [ -n "$CONTAINER_IDS" ]; then echo "Found active containers: $(echo $CONTAINER_IDS | wc -w)" # Container status overview { echo "=== Container Status Overview ===" echo "Generated at: $(date -u '+%Y-%m-%d %H:%M:%S UTC')" echo "Workflow: ${{ github.workflow }}" echo "Run ID: ${{ github.run_id }}" echo "" docker ps -a --format "table {{.ID}}\t{{.Names}}\t{{.Status}}\t{{.Ports}}" | grep -v -E "(anvil|buildx_buildkit)" } > logs/containers/status-overview.log # Individual container logs for container_id in $CONTAINER_IDS; do if [ -n "$container_id" ]; then CONTAINER_NAME=$(docker inspect --format='{{.Name}}' $container_id 2>/dev/null | sed 's/^\/*//' || echo "container-$container_id") echo "Collecting logs for: $CONTAINER_NAME" { echo "=== Container: $CONTAINER_NAME ($container_id) ===" echo "Generated at: $(date -u '+%Y-%m-%d %H:%M:%S UTC')" echo "Last 500 lines of logs:" echo "" docker logs --tail=500 $container_id 2>&1 } > logs/containers/$CONTAINER_NAME.log fi done else echo "⚠️ No active containers found (excluding anvil)" > logs/containers/status-overview.log fi echo "Gathering system information..." { echo "=== System Diagnostics ===" echo "Generated at: $(date -u '+%Y-%m-%d %H:%M:%S UTC')" echo "" echo "=== Disk Usage ===" df -h echo "" echo "=== Memory Usage ===" free -h echo "" echo "=== All Docker Containers ===" docker ps -a --format "table {{.Names}}\t{{.Image}}\t{{.Status}}\t{{.Ports}}" echo "" echo "=== Docker Images ===" docker images --format "table {{.Repository}}\t{{.Tag}}\t{{.Size}}\t{{.CreatedAt}}" } > logs/system/diagnostics.log echo "Creating test summary..." { echo "=== E2E Test Failure Summary ===" echo "Timestamp: $(date -u '+%Y-%m-%d %H:%M:%S UTC')" echo "Workflow: ${{ github.workflow }}" echo "Run ID: ${{ github.run_id }}" echo "Run Number: ${{ github.run_number }}" echo "Repository: ${{ github.repository }}" echo "Branch: ${{ github.ref_name }}" echo "" echo "=== Test Configuration ===" echo " - Operators: ${{ env.OPERATORS }}" echo " - Commiters: ${{ env.COMMITERS }}" echo " - Aggregators: ${{ env.AGGREGATORS }}" echo " - Verification Type: ${{ env.VERIFICATION_TYPE }}" echo " - Epoch Time: ${{ env.EPOCH_TIME }}s" echo " - Block Time: ${{ env.BLOCK_TIME }}s" echo " - Finality Blocks: ${{ env.FINALITY_BLOCKS }}" echo "" echo "=== Available Log Files ===" echo "containers/status-overview.log - Container status summary" echo "containers/[name].log - Individual container logs (last 500 lines)" echo "system/diagnostics.log - System resource usage and Docker info" echo "summary/failure-report.log - This summary file" echo "" echo "=== Next Steps ===" echo "1. Review container logs for error messages" echo "2. Check system diagnostics for resource constraints" echo "3. Verify test configuration parameters" echo "4. Consider adjusting timeout values if needed" } > logs/summary/failure-report.log echo "✅ Diagnostic collection completed" echo "Log file summary:" find logs -type f -name "*.log" -exec echo " - {}" \; | sort - name: "Upload Diagnostic Artifacts" if: failure() uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: "e2e-diagnostics-${{ matrix.config.name }}-${{ github.run_number }}-${{ github.run_attempt }}" path: e2e/logs/ retention-days: 7 if-no-files-found: warn ```` ## File: .github/dependabot.yml ````yaml version: 2 updates: # Enable version updates for docker - package-ecosystem: "docker" directory: "/" schedule: interval: "weekly" open-pull-requests-limit: 10 target-branch: "dev" # Enable version updates for go - package-ecosystem: "gomod" directory: "/" schedule: interval: "weekly" open-pull-requests-limit: 10 target-branch: "dev" # Enable version updates for github-actions - package-ecosystem: "github-actions" directory: "/" schedule: interval: "weekly" open-pull-requests-limit: 5 target-branch: "dev" ```` ## File: api/client/examples/main.go ````go // Basic usage example for the Symbiotic Relay Go client. // // This example demonstrates how to: // 1. Connect to a Symbiotic Relay server // 2. Get the current epoch // 3. Sign a message // 4. Retrieve aggregation proofs // 5. Get validator set information // 6. Get individual signatures // 7. Get signature request IDs by epoch // 8. Get signature requests by epoch // 9. Get a signature request by request ID // 10. Stream signatures in real-time // 11. Stream aggregation proofs in real-time // 12. Stream validator set changes in real-time ⋮---- package main ⋮---- import ( "context" "fmt" "log" "os" "time" "github.com/go-errors/errors" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" client "github.com/symbioticfi/relay/api/client/v1" ) ⋮---- "context" "fmt" "log" "os" "time" ⋮---- "github.com/go-errors/errors" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" ⋮---- client "github.com/symbioticfi/relay/api/client/v1" ⋮---- // RelayClient wraps the Symbiotic client with helpful methods type RelayClient struct { client *client.SymbioticClient conn *grpc.ClientConn } ⋮---- // NewRelayClient creates a new client connected to the specified server URL func NewRelayClient(serverURL string) (*RelayClient, error) ⋮---- // Create gRPC connection ⋮---- // Create the symbiotic client ⋮---- // Close closes the gRPC connection func (rc *RelayClient) Close() error ⋮---- // GetCurrentEpoch gets the current epoch information func (rc *RelayClient) GetCurrentEpoch(ctx context.Context) (*client.GetCurrentEpochResponse, error) ⋮---- // GetLastAllCommitted gets the last all committed epochs for all chains func (rc *RelayClient) GetLastAllCommitted(ctx context.Context) (*client.GetLastAllCommittedResponse, error) ⋮---- // SignMessage signs a message using the specified key tag func (rc *RelayClient) SignMessage(ctx context.Context, keyTag uint32, message []byte, requiredEpoch *uint64) (*client.SignMessageResponse, error) ⋮---- // GetAggregationProof gets aggregation proof for a specific request func (rc *RelayClient) GetAggregationProof(ctx context.Context, requestID string) (*client.GetAggregationProofResponse, error) ⋮---- // GetSignatures gets individual signatures for a request func (rc *RelayClient) GetSignatures(ctx context.Context, requestID string) (*client.GetSignaturesResponse, error) ⋮---- // GetSignatureRequestIDsByEpoch gets all signature request IDs for a given epoch func (rc *RelayClient) GetSignatureRequestIDsByEpoch(ctx context.Context, epoch uint64) (*client.GetSignatureRequestIDsByEpochResponse, error) ⋮---- // GetSignatureRequestsByEpoch gets all signature requests for a given epoch func (rc *RelayClient) GetSignatureRequestsByEpoch(ctx context.Context, epoch uint64) (*client.GetSignatureRequestsByEpochResponse, error) ⋮---- // GetSignatureRequest gets a signature request by its request ID func (rc *RelayClient) GetSignatureRequest(ctx context.Context, requestID string) (*client.GetSignatureRequestResponse, error) ⋮---- // GetValidatorSet gets validator set information func (rc *RelayClient) GetValidatorSet(ctx context.Context, epoch *uint64) (*client.GetValidatorSetResponse, error) ⋮---- // ListenSignatures streams signatures in real-time func (rc *RelayClient) ListenSignatures(ctx context.Context, startEpoch *uint64) (grpc.ServerStreamingClient[client.ListenSignaturesResponse], error) ⋮---- // ListenProofs streams aggregation proofs in real-time func (rc *RelayClient) ListenProofs(ctx context.Context, startEpoch *uint64) (grpc.ServerStreamingClient[client.ListenProofsResponse], error) ⋮---- // ListenValidatorSet streams validator set changes in real-time func (rc *RelayClient) ListenValidatorSet(ctx context.Context, startEpoch *uint64) (grpc.ServerStreamingClient[client.ListenValidatorSetResponse], error) ⋮---- func main() ⋮---- // Initialize client ⋮---- // Create context with timeout ⋮---- // Example 1: Get current epoch ⋮---- // Example 2: Get suggested epoch ⋮---- // Example 3: Get validator set ⋮---- // Display some validator details ⋮---- // Example 4: Sign a message ⋮---- // Example 5: Get aggregation proof (this might fail if signing is not complete) ⋮---- // Example 6: Get individual signatures ⋮---- // Example 7: Get signature request IDs by epoch ⋮---- // Display first few request IDs ⋮---- // Example 8: Get signature requests by epoch ⋮---- // Display first few signature requests ⋮---- // Example 9: Get a signature request by request ID ⋮---- // Example 10: Listen to signatures stream ⋮---- // Create a new context with a shorter timeout for streaming example ⋮---- // Start listening from a specific epoch (optional) var startEpoch *uint64 ⋮---- epoch := epochResponse.GetEpoch() - 1 // Start from previous epoch to get some historical data ⋮---- // Example 11: Listen to aggregation proofs stream ⋮---- // Example 12: Listen to validator set changes stream ```` ## File: api/client/examples/README.md ````markdown # Symbiotic Relay Client Examples This directory contains example code demonstrating how to use the [Symbiotic Relay Go client library](../v1/) to interact with a Symbiotic Relay server. ## Basic Usage Example The example shows how to: 1. Connect to a Symbiotic Relay server 2. Get current epoch information 3. Sign messages 4. Retrieve aggregation proofs and signatures 5. Get validator set information 6. Use streaming responses for real-time updates ## Prerequisites Before running the examples, ensure you have: - **[Go 1.25 or later](https://golang.org/doc/install)** installed - **Access to a running Symbiotic Relay Network** - **Network connectivity** to the relay server - **Valid key configurations** on the relay server (for signing operations) ## Running the Example ```bash cd api/client/examples go run main.go ``` By default, the example will try to connect to `localhost:8080`. You can specify a different server URL by setting the `RELAY_SERVER_URL` environment variable: ```bash RELAY_SERVER_URL=my-relay-server:8081 go run main.go ``` NOTE: for the signature/proof generation to work you need to run the script for all active relay servers to get the majority consensus to generate proof. ## Integration with Your Application To integrate this client into your own application: 1. **Import the client package**: ```go import client "github.com/symbioticfi/relay/api/client/v1" ``` 2. **Create a connection**: ```go conn, err := grpc.Dial(serverURL, grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { return err } client := client.NewSymbioticClient(conn) ``` 3. **Use the client methods** as demonstrated in the [example](main.go) 4. **Handle errors appropriately** for your use case 5. **Ensure proper connection cleanup** with `defer conn.Close()` ## More Examples For a more comprehensive example of using the client library in a real-world application, see: - **[Symbiotic Super Sum Example](https://github.com/symbioticfi/symbiotic-super-sum/tree/main/off-chain)** ## API Reference For complete API documentation, refer to: - **API Documentation**: [`docs/api/v1/doc.md`](../../../docs/api/v1/doc.md) - **Protocol Buffer definitions**: [`api/proto/v1/api.proto`](../../proto/v1/api.proto) - **Generated Go types**: [`api/client/v1/types.go`](../v1/types.go) - **Client interface**: [`api/client/v1/client.go`](../v1/client.go) ## License This client library and example code are licensed under the MIT License. See the [LICENSE](../LICENSE) file for details. ```` ## File: api/client/v1/client.go ````go package v1 ⋮---- import ( apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" "google.golang.org/grpc" ) ⋮---- apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" "google.golang.org/grpc" ⋮---- // SymbioticClient wraps the generated gRPC client type SymbioticClient struct { apiv1.SymbioticAPIServiceClient } ⋮---- // NewSymbioticClient creates a new client instance for symbiotic relay func NewSymbioticClient(conn grpc.ClientConnInterface) *SymbioticClient ```` ## File: api/client/v1/types.go ````go // Code generated by generate-client-types. DO NOT EDIT. package v1 ⋮---- import ( apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" ) ⋮---- apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" ⋮---- // Exported types for client usage ⋮---- // Enums ⋮---- // Enum constants const ( // ErrorCode values ErrorCode_ERROR_CODE_UNSPECIFIED = apiv1.ErrorCode_ERROR_CODE_UNSPECIFIED ErrorCode_ERROR_CODE_NO_DATA = apiv1.ErrorCode_ERROR_CODE_NO_DATA ErrorCode_ERROR_CODE_INTERNAL = apiv1.ErrorCode_ERROR_CODE_INTERNAL ErrorCode_ERROR_CODE_NOT_AGGREGATOR = apiv1.ErrorCode_ERROR_CODE_NOT_AGGREGATOR // SigningStatus values SigningStatus_SIGNING_STATUS_UNSPECIFIED = apiv1.SigningStatus_SIGNING_STATUS_UNSPECIFIED SigningStatus_SIGNING_STATUS_PENDING = apiv1.SigningStatus_SIGNING_STATUS_PENDING SigningStatus_SIGNING_STATUS_COMPLETED = apiv1.SigningStatus_SIGNING_STATUS_COMPLETED SigningStatus_SIGNING_STATUS_FAILED = apiv1.SigningStatus_SIGNING_STATUS_FAILED SigningStatus_SIGNING_STATUS_TIMEOUT = apiv1.SigningStatus_SIGNING_STATUS_TIMEOUT // ValidatorSetStatus values ValidatorSetStatus_VALIDATOR_SET_STATUS_UNSPECIFIED = apiv1.ValidatorSetStatus_VALIDATOR_SET_STATUS_UNSPECIFIED ValidatorSetStatus_VALIDATOR_SET_STATUS_DERIVED = apiv1.ValidatorSetStatus_VALIDATOR_SET_STATUS_DERIVED ValidatorSetStatus_VALIDATOR_SET_STATUS_AGGREGATED = apiv1.ValidatorSetStatus_VALIDATOR_SET_STATUS_AGGREGATED ValidatorSetStatus_VALIDATOR_SET_STATUS_COMMITTED = apiv1.ValidatorSetStatus_VALIDATOR_SET_STATUS_COMMITTED ValidatorSetStatus_VALIDATOR_SET_STATUS_MISSED = apiv1.ValidatorSetStatus_VALIDATOR_SET_STATUS_MISSED ) ⋮---- // ErrorCode values ⋮---- // SigningStatus values ⋮---- // ValidatorSetStatus values ⋮---- // Request types ⋮---- // Response types ⋮---- // Data types ```` ## File: api/client/LICENSE ```` MIT License Copyright (c) 2025 Symbiotic Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ```` ## File: api/proto/v1/api.proto ````protobuf syntax = "proto3"; package api.proto.v1; import "google/protobuf/timestamp.proto"; import "google/api/annotations.proto"; option go_package = "github.com/symbioticfi/relay/api/proto/v1"; // SymbioticAPI provides access to the Symbiotic relay functions service SymbioticAPIService { // Sign a message rpc SignMessage(SignMessageRequest) returns (SignMessageResponse) { option (google.api.http) = { post: "/v1/sign" body: "*" }; } // Get aggregation proof rpc GetAggregationProof(GetAggregationProofRequest) returns (GetAggregationProofResponse) { option (google.api.http) = { get: "/v1/aggregation/proof/{request_id}" }; } // Get aggregation proofs by epoch rpc GetAggregationProofsByEpoch(GetAggregationProofsByEpochRequest) returns (GetAggregationProofsByEpochResponse) { option (google.api.http) = { get: "/v1/aggregation/proofs/epoch/{epoch}" }; } // Get current epoch rpc GetCurrentEpoch(GetCurrentEpochRequest) returns (GetCurrentEpochResponse) { option (google.api.http) = { get: "/v1/epoch/current" }; } // Get signature by request id rpc GetSignatures(GetSignaturesRequest) returns (GetSignaturesResponse) { option (google.api.http) = { get: "/v1/signatures/{request_id}" }; } // Get signature by epoch rpc GetSignaturesByEpoch(GetSignaturesByEpochRequest) returns (GetSignaturesByEpochResponse) { option (google.api.http) = { get: "/v1/signatures/epoch/{epoch}" }; } // Get all signature request IDs by epoch rpc GetSignatureRequestIDsByEpoch(GetSignatureRequestIDsByEpochRequest) returns (GetSignatureRequestIDsByEpochResponse) { option (google.api.http) = { get: "/v1/signature-request-ids/epoch/{epoch}" }; } // Get all signature requests by epoch rpc GetSignatureRequestsByEpoch(GetSignatureRequestsByEpochRequest) returns (GetSignatureRequestsByEpochResponse) { option (google.api.http) = { get: "/v1/signature-requests/epoch/{epoch}" }; } // Get signature request by request id rpc GetSignatureRequest(GetSignatureRequestRequest) returns (GetSignatureRequestResponse) { option (google.api.http) = { get: "/v1/signature-request/{request_id}" }; } // Get aggregation status, can be sent only to aggregator nodes rpc GetAggregationStatus(GetAggregationStatusRequest) returns (GetAggregationStatusResponse) { option (google.api.http) = { get: "/v1/aggregation/status/{request_id}" }; } // Get current validator set rpc GetValidatorSet(GetValidatorSetRequest) returns (GetValidatorSetResponse) { option (google.api.http) = { get: "/v1/validator-set" }; } // Get validator by address rpc GetValidatorByAddress(GetValidatorByAddressRequest) returns (GetValidatorByAddressResponse) { option (google.api.http) = { get: "/v1/validator/address/{address}" }; } // Get validator by key rpc GetValidatorByKey(GetValidatorByKeyRequest) returns (GetValidatorByKeyResponse) { option (google.api.http) = { get: "/v1/validator/key/{key_tag}/{on_chain_key}" }; } // Get local validator rpc GetLocalValidator(GetLocalValidatorRequest) returns (GetLocalValidatorResponse) { option (google.api.http) = { get: "/v1/validator/local" }; } // Get validator set header rpc GetValidatorSetHeader(GetValidatorSetHeaderRequest) returns (GetValidatorSetHeaderResponse) { option (google.api.http) = { get: "/v1/validator-set/header" }; } // Get last committed epoch for a specific settlement chain rpc GetLastCommitted(GetLastCommittedRequest) returns (GetLastCommittedResponse) { option (google.api.http) = { get: "/v1/committed/chain/{settlement_chain_id}" }; } // Get last committed epochs for all settlement chains rpc GetLastAllCommitted(GetLastAllCommittedRequest) returns (GetLastAllCommittedResponse) { option (google.api.http) = { get: "/v1/committed/all" }; } // Get validator set metadata like extra data and request id to fetch aggregation and signature requests rpc GetValidatorSetMetadata(GetValidatorSetMetadataRequest) returns (GetValidatorSetMetadataResponse) { option (google.api.http) = { get: "/v1/validator-set/metadata" }; } // Stream signatures in real-time. If start_epoch is provided, sends historical data first rpc ListenSignatures(ListenSignaturesRequest) returns (stream ListenSignaturesResponse) { option (google.api.http) = { get: "/v1/stream/signatures" }; } // Stream aggregation proofs in real-time. If start_epoch is provided, sends historical data first rpc ListenProofs(ListenProofsRequest) returns (stream ListenProofsResponse) { option (google.api.http) = { get: "/v1/stream/proofs" }; } // Stream validator set changes in real-time. If start_epoch is provided, sends historical data first rpc ListenValidatorSet(ListenValidatorSetRequest) returns (stream ListenValidatorSetResponse) { option (google.api.http) = { get: "/v1/stream/validator-set" }; } } // Request message for signing a message message SignMessageRequest { // Key tag identifier (0-127) uint32 key_tag = 1; // Message to be signed bytes message = 2; // Required epoch (optional, if not provided latest committed epoch will be used) optional uint64 required_epoch = 3; } // Response message for sign message request message SignMessageResponse { // Hash of the signature request string request_id = 1; // Epoch number uint64 epoch = 2; } // Request message for listening to signatures stream message ListenSignaturesRequest { // Optional: start epoch. If provided, stream will first send all historical signatures starting from this epoch, then continue with real-time updates // If not provided, only signatures generated after stream creation will be sent optional uint64 start_epoch = 1; } // Response message for signatures stream message ListenSignaturesResponse { // Id of the signature request string request_id = 1; // Epoch number uint64 epoch = 2; // Signature data Signature signature = 3; } // Request message for listening to aggregation proofs stream message ListenProofsRequest { // Optional: start epoch. If provided, stream will first send all historical proofs starting from this epoch, then continue with real-time updates // If not provided, only proofs generated after stream creation will be sent optional uint64 start_epoch = 1; } // Response message for aggregation proofs stream message ListenProofsResponse { // Id of the request string request_id = 1; // Epoch number uint64 epoch = 2; // Final aggregation proof AggregationProof aggregation_proof = 3; } // Request message for listening to validator set changes stream message ListenValidatorSetRequest { // Optional: start epoch. If provided, stream will first send all historical validator sets starting from this epoch, then continue with real-time updates // If not provided, only validator sets generated after stream creation will be sent optional uint64 start_epoch = 1; } // Response message for validator set changes stream message ListenValidatorSetResponse { // The validator set ValidatorSet validator_set = 1; } // Request message for getting aggregation proof message GetAggregationProofRequest { string request_id = 1; } // Request message for getting aggregation proof message GetAggregationProofsByEpochRequest { // Epoch number uint64 epoch = 1; } // Request message for getting current epoch message GetCurrentEpochRequest {} // Request message for getting signatures message GetSignaturesRequest { string request_id = 1; } // Request message for getting signatures by epoch message GetSignaturesByEpochRequest { // Epoch number uint64 epoch = 1; } // Response message for getting signatures message GetSignaturesResponse { // List of signatures repeated Signature signatures = 1; } // Response message for getting signatures by epoch message GetSignaturesByEpochResponse { // List of signatures repeated Signature signatures = 1; } // Request message for getting all signature request IDs by epoch message GetSignatureRequestIDsByEpochRequest { // Epoch number uint64 epoch = 1; } // Response message for getting all signature request IDs by epoch message GetSignatureRequestIDsByEpochResponse { // List of all signature request IDs for the epoch repeated string request_ids = 1; } // Request message for getting all signature requests by epoch message GetSignatureRequestsByEpochRequest { // Epoch number uint64 epoch = 1; } // Response message for getting all signature requests by epoch message GetSignatureRequestsByEpochResponse { // List of all signature requests for the epoch repeated SignatureRequest signature_requests = 1; } // Request message for getting signature request message GetSignatureRequestRequest { string request_id = 1; } // Request message for getting aggregation status message GetAggregationStatusRequest { string request_id = 1; } // Request message for getting validator set message GetValidatorSetRequest { // Epoch number (optional, if not provided current epoch will be used) optional uint64 epoch = 1; } // Request message for getting validator by address message GetValidatorByAddressRequest { // Epoch number (optional, if not provided current epoch will be used) optional uint64 epoch = 1; // Validator address (required) string address = 2; } // Request message for getting validator by key message GetValidatorByKeyRequest { // Epoch number (optional, if not provided current epoch will be used) optional uint64 epoch = 1; // Validator key tag (required) uint32 key_tag = 2; // Validator on chain (public) key (required) bytes on_chain_key = 3; } // Request message for getting local validator message GetLocalValidatorRequest { // Epoch number (optional, if not provided current epoch will be used) optional uint64 epoch = 1; } // Request message for getting validator set header message GetValidatorSetHeaderRequest { // Epoch number (optional, if not provided current epoch will be used) optional uint64 epoch = 1; } // Request message for getting validator set metadata message GetValidatorSetMetadataRequest { // Epoch number (optional, if not provided current epoch will be used) optional uint64 epoch = 1; } // Response message for getting current epoch message GetCurrentEpochResponse { // Epoch number uint64 epoch = 1; // Epoch start time google.protobuf.Timestamp start_time = 2; } // SignatureRequest represents a signature request message SignatureRequest { // Request ID string request_id = 1; // Key tag identifier (0-127) uint32 key_tag = 2; // Message to be signed bytes message = 3; // Required epoch uint64 required_epoch = 4; } // Response message for getting signature request message GetSignatureRequestResponse { SignatureRequest signature_request = 1; } // Response message for getting aggregation proof message GetAggregationProofResponse { AggregationProof aggregation_proof = 1; } // Response message for getting aggregation proof message GetAggregationProofsByEpochResponse { repeated AggregationProof aggregation_proofs = 1; } // Response message for getting aggregation proof message AggregationProof { // Message hash bytes message_hash = 2; // Proof data bytes proof = 3; // Request ID string request_id = 4; } // Response message for getting aggregation status message GetAggregationStatusResponse { // Current voting power of the aggregator (big integer as string) string current_voting_power = 1; // List of operator addresses that signed the request repeated string signer_operators = 2; } // Digital signature message Signature { // Signature data bytes signature = 1; // Message hash bytes message_hash = 2; // Public key bytes public_key = 3; // Request ID string request_id = 4; } // Response message for getting validator set message GetValidatorSetResponse { // The validator set ValidatorSet validator_set = 1; } // Response message for getting validator by address message GetValidatorByAddressResponse { // The validator Validator validator = 1; } // Response message for getting validator by key message GetValidatorByKeyResponse { // The validator Validator validator = 1; } // Response message for getting local validator message GetLocalValidatorResponse { // The validator Validator validator = 1; } message ExtraData { bytes key = 1; bytes value = 2; } // Response message for getting validator set header message GetValidatorSetMetadataResponse { repeated ExtraData extra_data = 1; bytes commitment_data = 2; string request_id = 3; } // Response message for getting validator set header message GetValidatorSetHeaderResponse { // Version of the validator set uint32 version = 1; // Key tag required to commit next validator set uint32 required_key_tag = 2; // Validator set epoch uint64 epoch = 3; // Epoch capture timestamp google.protobuf.Timestamp capture_timestamp = 4; // Quorum threshold (big integer as string) string quorum_threshold = 5; // Total voting power (big integer as string) string total_voting_power = 6; // Validators SSZ Merkle root (hex string) string validators_ssz_mroot = 7; } // Validator set status enumeration enum ValidatorSetStatus { // Default/unknown status VALIDATOR_SET_STATUS_UNSPECIFIED = 0; // Derived status VALIDATOR_SET_STATUS_DERIVED = 1; // Aggregated status VALIDATOR_SET_STATUS_AGGREGATED = 2; // Committed status VALIDATOR_SET_STATUS_COMMITTED = 3; // Missed status VALIDATOR_SET_STATUS_MISSED = 4; } // Validator information message Validator { // Operator address (hex string) string operator = 1; // Voting power of the validator (big integer as string) string voting_power = 2; // Indicates if the validator is active bool is_active = 3; // List of cryptographic keys repeated Key keys = 4; // List of validator vaults repeated ValidatorVault vaults = 5; } // Cryptographic key message Key { // Key tag identifier (0-127) uint32 tag = 1; // Key payload bytes payload = 2; } // Validator vault information message ValidatorVault { // Chain identifier uint64 chain_id = 1; // Vault address string vault = 2; // Voting power for this vault (big integer as string) string voting_power = 3; } // Signing process status enumeration enum SigningStatus { // Default/unknown status SIGNING_STATUS_UNSPECIFIED = 0; // Request has been created and is waiting for signatures SIGNING_STATUS_PENDING = 1; // Signing process completed successfully with proof SIGNING_STATUS_COMPLETED = 2; // Signing process failed SIGNING_STATUS_FAILED = 3; // Signing request timed out SIGNING_STATUS_TIMEOUT = 4; } // Error code enumeration enum ErrorCode { // Default/unknown error ERROR_CODE_UNSPECIFIED = 0; // No data found ERROR_CODE_NO_DATA = 1; // Internal server error ERROR_CODE_INTERNAL = 2; // Not an aggregator node ERROR_CODE_NOT_AGGREGATOR = 3; } // Request message for getting last committed epoch for a specific settlement chain message GetLastCommittedRequest { // Settlement chain ID uint64 settlement_chain_id = 1; } // Response message for getting last committed epoch message GetLastCommittedResponse { // Settlement chain ID uint64 settlement_chain_id = 1; ChainEpochInfo epoch_info = 2; } // Request message for getting last committed epochs for all chains message GetLastAllCommittedRequest { // No parameters needed } // Response message for getting all last committed epochs message GetLastAllCommittedResponse { // List of settlement chains with their last committed epochs map epoch_infos = 1; // Suggested epoch info for signatures, it is the minimum commited epoch among all chains ChainEpochInfo suggested_epoch_info = 2; } // Settlement chain with its last committed epoch message ChainEpochInfo { // Last committed epoch for this chain uint64 last_committed_epoch = 1; // Epoch start time google.protobuf.Timestamp start_time = 2; } message ValidatorSet { // Version of the validator set uint32 version = 1; // Key tag required to commit next validator set uint32 required_key_tag = 2; // Validator set epoch uint64 epoch = 3; // Epoch capture timestamp google.protobuf.Timestamp capture_timestamp = 4; // Quorum threshold (big integer as string) string quorum_threshold = 5; // Status of validator set header ValidatorSetStatus status = 6; // List of validators repeated Validator validators = 7; } ```` ## File: cmd/relay/root/app.go ````go package root ⋮---- import ( "context" "log/slog" "net/http" "time" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/go-errors/errors" "github.com/libp2p/go-libp2p" "github.com/libp2p/go-libp2p/core/crypto" "github.com/libp2p/go-libp2p/p2p/security/noise" "github.com/libp2p/go-libp2p/p2p/transport/tcp" "golang.org/x/sync/errgroup" "github.com/symbioticfi/relay/internal/client/p2p" "github.com/symbioticfi/relay/internal/client/repository/badger" "github.com/symbioticfi/relay/internal/entity" aggregationPolicy "github.com/symbioticfi/relay/internal/usecase/aggregation-policy" aggregatorApp "github.com/symbioticfi/relay/internal/usecase/aggregator-app" api_server "github.com/symbioticfi/relay/internal/usecase/api-server" entity_processor "github.com/symbioticfi/relay/internal/usecase/entity-processor" keyprovider "github.com/symbioticfi/relay/internal/usecase/key-provider" "github.com/symbioticfi/relay/internal/usecase/metrics" signatureListener "github.com/symbioticfi/relay/internal/usecase/signature-listener" signerApp "github.com/symbioticfi/relay/internal/usecase/signer-app" sync_provider "github.com/symbioticfi/relay/internal/usecase/sync-provider" sync_runner "github.com/symbioticfi/relay/internal/usecase/sync-runner" valsetListener "github.com/symbioticfi/relay/internal/usecase/valset-listener" valsetStatusTracker "github.com/symbioticfi/relay/internal/usecase/valset-status-tracker" "github.com/symbioticfi/relay/pkg/log" "github.com/symbioticfi/relay/pkg/proof" "github.com/symbioticfi/relay/pkg/signals" "github.com/symbioticfi/relay/symbiotic/client/evm" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/aggregator" symbioticCrypto "github.com/symbioticfi/relay/symbiotic/usecase/crypto" valsetDeriver "github.com/symbioticfi/relay/symbiotic/usecase/valset-deriver" ) ⋮---- "context" "log/slog" "net/http" "time" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/go-errors/errors" "github.com/libp2p/go-libp2p" "github.com/libp2p/go-libp2p/core/crypto" "github.com/libp2p/go-libp2p/p2p/security/noise" "github.com/libp2p/go-libp2p/p2p/transport/tcp" "golang.org/x/sync/errgroup" ⋮---- "github.com/symbioticfi/relay/internal/client/p2p" "github.com/symbioticfi/relay/internal/client/repository/badger" "github.com/symbioticfi/relay/internal/entity" aggregationPolicy "github.com/symbioticfi/relay/internal/usecase/aggregation-policy" aggregatorApp "github.com/symbioticfi/relay/internal/usecase/aggregator-app" api_server "github.com/symbioticfi/relay/internal/usecase/api-server" entity_processor "github.com/symbioticfi/relay/internal/usecase/entity-processor" keyprovider "github.com/symbioticfi/relay/internal/usecase/key-provider" "github.com/symbioticfi/relay/internal/usecase/metrics" signatureListener "github.com/symbioticfi/relay/internal/usecase/signature-listener" signerApp "github.com/symbioticfi/relay/internal/usecase/signer-app" sync_provider "github.com/symbioticfi/relay/internal/usecase/sync-provider" sync_runner "github.com/symbioticfi/relay/internal/usecase/sync-runner" valsetListener "github.com/symbioticfi/relay/internal/usecase/valset-listener" valsetStatusTracker "github.com/symbioticfi/relay/internal/usecase/valset-status-tracker" "github.com/symbioticfi/relay/pkg/log" "github.com/symbioticfi/relay/pkg/proof" "github.com/symbioticfi/relay/pkg/signals" "github.com/symbioticfi/relay/symbiotic/client/evm" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/aggregator" symbioticCrypto "github.com/symbioticfi/relay/symbiotic/usecase/crypto" valsetDeriver "github.com/symbioticfi/relay/symbiotic/usecase/valset-deriver" ⋮---- func runApp(ctx context.Context) error ⋮---- var keyProvider *keyprovider.CacheKeyProvider ⋮---- var err error ⋮---- var prover *proof.ZkProver ⋮---- // Load all missing epochs before starting services ⋮---- // also start monitoring for new epochs immediately so that we don't miss any epochs while starting other services ⋮---- var aggApp *aggregatorApp.AggregatorApp ⋮---- func initP2PService(ctx context.Context, cfg config, keyProvider keyprovider.KeyProvider, provider *sync_provider.Syncer, mtr *metrics.Metrics) (*p2p.Service, *p2p.DiscoveryService, error) ⋮---- // pad to make 20 byte to 32 bytes ⋮---- // TODO: include p2p key in valset ⋮---- libp2p.PrivateNetwork(swarmPSK), // Use a private network with the provided swarm key libp2p.Identity(p2pIdentityPK), // Use the provided identity private key to sign messages that will be sent over the P2P gossip sub ```` ## File: cmd/relay/root/config.go ````go package root ⋮---- import ( "context" "fmt" "io/fs" "reflect" "strconv" "strings" "time" "github.com/spf13/pflag" "github.com/symbioticfi/relay/pkg/signals" "github.com/go-errors/errors" "github.com/go-playground/validator/v10" "github.com/samber/lo" "github.com/spf13/cobra" "github.com/spf13/viper" ) ⋮---- "context" "fmt" "io/fs" "reflect" "strconv" "strings" "time" ⋮---- "github.com/spf13/pflag" ⋮---- "github.com/symbioticfi/relay/pkg/signals" ⋮---- "github.com/go-errors/errors" "github.com/go-playground/validator/v10" "github.com/samber/lo" "github.com/spf13/cobra" "github.com/spf13/viper" ⋮---- // The config can be populated from command-line flags, environment variables, and a config.yaml file. // Priority order (highest to lowest): // 1. Command-line flags // 2. Environment variables (prefixed with SYMB_ and dashes replaced by underscores) // 3. config.yaml file (specified by --config or default "config.yaml") type config struct { StorageDir string `mapstructure:"storage-dir"` CircuitsDir string `mapstructure:"circuits-dir"` MaxUnsigners uint64 `mapstructure:"aggregation-policy-max-unsigners"` Log LogConfig `mapstructure:"log" validate:"required"` API APIConfig `mapstructure:"api" validate:"required"` Metrics MetricsConfig `mapstructure:"metrics"` Driver CMDCrossChainAddress `mapstructure:"driver" validate:"required"` SecretKeys CMDSecretKeySlice `mapstructure:"secret-keys"` KeyStore KeyStore `mapstructure:"keystore"` SignalCfg signals.Config `mapstructure:"signal"` Cache CacheConfig `mapstructure:"cache"` Sync SyncConfig `mapstructure:"sync"` KeyCache KeyCache `mapstructure:"key-cache"` P2P P2PConfig `mapstructure:"p2p" validate:"required"` Evm EvmConfig `mapstructure:"evm" validate:"required"` ForceRole ForceRole `mapstructure:"force-role"` Retention RetentionConfig `mapstructure:"retention"` } ⋮---- type LogConfig struct { Level string `mapstructure:"level" validate:"oneof=debug info warn error"` Mode string `mapstructure:"mode" validate:"oneof=json text pretty"` } ⋮---- type APIConfig struct { ListenAddress string `mapstructure:"listen" validate:"required"` MaxAllowedStreams uint64 `mapstructure:"max-allowed-streams" validate:"required"` VerboseLogging bool `mapstructure:"verbose-logging"` HTTPGateway bool `mapstructure:"http-gateway"` } ⋮---- type MetricsConfig struct { ListenAddress string `mapstructure:"listen"` PprofEnabled bool `mapstructure:"pprof"` } ⋮---- type CMDCrossChainAddress struct { ChainID uint64 `mapstructure:"chain-id" validate:"required"` Address string `mapstructure:"address" validate:"required"` } ⋮---- type CMDSecretKeySlice []CMDSecretKey ⋮---- func (s *CMDSecretKeySlice) String() string ⋮---- func (s *CMDSecretKeySlice) Set(str string) error ⋮---- func (s *CMDSecretKeySlice) Type() string ⋮---- type CMDSecretKey struct { Namespace string `validate:"required"` KeyType uint8 `validate:"required"` KeyId int `validate:"required"` Secret string `validate:"required"` } ⋮---- func (c *CMDSecretKey) FromStr(str string) (*CMDSecretKey, error) ⋮---- type KeyStore struct { Path string `json:"path"` Password string `json:"password"` } type CacheConfig struct { NetworkConfigCacheSize int `mapstructure:"network-config-size"` ValidatorSetCacheSize int `mapstructure:"validator-set-size"` } ⋮---- type SyncConfig struct { Enabled bool `mapstructure:"enabled"` Period time.Duration `mapstructure:"period"` Timeout time.Duration `mapstructure:"timeout"` EpochsToSync uint64 `mapstructure:"epochs"` } ⋮---- type KeyCache struct { // max size of the cache Size int `mapstructure:"size"` Enabled bool `mapstructure:"enabled"` } ⋮---- // max size of the cache ⋮---- type P2PConfig struct { ListenAddress string `mapstructure:"listen" validate:"required"` Bootnodes []string `mapstructure:"bootnodes"` DHTMode string `mapstructure:"dht-mode" validate:"oneof=auto server client disabled"` MDnsEnabled bool `mapstructure:"mdns"` } ⋮---- type EvmConfig struct { Chains []string `mapstructure:"chains" validate:"required"` MaxCalls int `mapstructure:"max-calls"` } ⋮---- type ForceRole struct { Aggregator bool `mapstructure:"aggregator"` Committer bool `mapstructure:"committer"` } ⋮---- type RetentionConfig struct { ValSetEpochs uint64 `mapstructure:"valset-epochs"` } ⋮---- func (c config) Validate() error ⋮---- // Validate that sync.epochs doesn't exceed retention.valset-epochs ⋮---- var ( configFile string ) ⋮---- func addRootFlags(cmd *cobra.Command) ⋮---- func DecodeFlagToStruct(fromType reflect.Type, toType reflect.Type, from interface ⋮---- // if not string return as is ⋮---- // Handle time.Duration specifically ⋮---- // if fromType implements pflag.Value then we can parse it from string ⋮---- func initConfig(cmd *cobra.Command, _ []string) error ⋮---- var cfg config ⋮---- // pflags allows to implement custom types by implementing pflag.Value (we can define how to parse struct from string) // but[1] viper converts back struct defined flags to string automatically using String() method :( // but[2] fortunately viper allows to pass decoder that we can use to convert string back to struct :D ⋮---- type contextKeyStruct struct{} ⋮---- func ctxWithCfg(ctx context.Context, cfg config) context.Context func cfgFromCtx(ctx context.Context) config ```` ## File: cmd/relay/root/root.go ````go package root ⋮---- import ( "context" "log/slog" "os" "os/signal" "syscall" "github.com/spf13/cobra" ) ⋮---- "context" "log/slog" "os" "os/signal" "syscall" ⋮---- "github.com/spf13/cobra" ⋮---- var Version = "local" var BuildTime = "unknown" ⋮---- func NewRootCommand() *cobra.Command ⋮---- // rootCmd represents the base command when called without any subcommands var rootCmd = &cobra.Command{ Use: "relay_sidecar", Short: "Relay sidecar for signature aggregation", Long: "A P2P service for collecting and aggregating signatures for Ethereum contracts.", SilenceUsage: true, SilenceErrors: true, PersistentPreRunE: initConfig, RunE: func(cmd *cobra.Command, args []string) error { return runApp(signalContext(cmd.Context())) }, } ⋮---- // signalContext returns a context that is canceled if either SIGTERM or SIGINT signal is received. func signalContext(ctx context.Context) context.Context ```` ## File: cmd/relay/main.go ````go package main ⋮---- import ( "context" "log/slog" "os" "github.com/go-errors/errors" "github.com/symbioticfi/relay/cmd/relay/root" ) ⋮---- "context" "log/slog" "os" ⋮---- "github.com/go-errors/errors" "github.com/symbioticfi/relay/cmd/relay/root" ⋮---- func main() ```` ## File: cmd/utils/cmd-helpers/helpers.go ````go package cmdhelpers ⋮---- import ( "fmt" "math/big" "sort" "strconv" "strings" "syscall" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/go-errors/errors" "github.com/pterm/pterm" "golang.org/x/term" ) ⋮---- "fmt" "math/big" "sort" "strconv" "strings" "syscall" ⋮---- symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- "github.com/go-errors/errors" "github.com/pterm/pterm" "golang.org/x/term" ⋮---- type SecretKeyMapFlag struct { Secrets map[uint64]string } ⋮---- func (s *SecretKeyMapFlag) String() string ⋮---- sort.Strings(parts) // Optional: consistent output order ⋮---- func (s *SecretKeyMapFlag) Set(val string) error ⋮---- func (s *SecretKeyMapFlag) Type() string ⋮---- func GetPassword() (string, error) ⋮---- func PrintTreeValidator(leveledList pterm.LeveledList, validator symbiotic.Validator, totalVotingPower *big.Int) pterm.LeveledList ⋮---- func GetPct(value *big.Int, total *big.Int) float64 ```` ## File: cmd/utils/keys/add.go ````go package keys ⋮---- import ( cmdhelpers "github.com/symbioticfi/relay/cmd/utils/cmd-helpers" keyprovider "github.com/symbioticfi/relay/internal/usecase/key-provider" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/spf13/cobra" ) ⋮---- cmdhelpers "github.com/symbioticfi/relay/cmd/utils/cmd-helpers" keyprovider "github.com/symbioticfi/relay/internal/usecase/key-provider" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/spf13/cobra" ⋮---- var addKeyCmd = &cobra.Command{ Use: "add", Short: "Add key", RunE: func(cmd *cobra.Command, args []string) error { if addFlags.PrivateKey == "" && !addFlags.Generate { return errors.New("add --generate if private key omitted") } if addFlags.EvmNs { if addFlags.ChainID < 0 { return errors.New("chain ID is required for evm namespace, use --chain-id=0 for default key for all chains") } return addKeyWithNamespace(keyprovider.EVM_KEY_NAMESPACE, symbiotic.KeyTypeEcdsaSecp256k1, int(addFlags.ChainID), addFlags.Generate, addFlags.Force, addFlags.PrivateKey) } else if addFlags.RelayNs { if addFlags.KeyTag == uint8(symbiotic.KeyTypeInvalid) { return errors.New("key tag is required for relay namespace") } kt := symbiotic.KeyTag(addFlags.KeyTag) if kt.Type() == symbiotic.KeyTypeInvalid { return errors.New("invalid key tag, type not supported") } keyId := kt & 0x0F return addKeyWithNamespace(keyprovider.SYMBIOTIC_KEY_NAMESPACE, kt.Type(), int(keyId), addFlags.Generate, addFlags.Force, addFlags.PrivateKey) } else if addFlags.P2PNs { return addKeyWithNamespace(keyprovider.P2P_KEY_NAMESPACE, symbiotic.KeyTypeEcdsaSecp256k1, keyprovider.P2P_HOST_IDENTITY_KEY_ID, addFlags.Generate, addFlags.Force, addFlags.PrivateKey) } return errors.New("either --evm or --relay or --p2p must be specified") }, } ⋮---- func addKeyWithNamespace(ns string, keyType symbiotic.KeyType, id int, generate bool, force bool, privateKey string) error ⋮---- var err error ```` ## File: cmd/utils/keys/cmd.go ````go package keys ⋮---- import ( symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/spf13/cobra" ) ⋮---- symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- "github.com/spf13/cobra" ⋮---- func NewKeysCmd() *cobra.Command ⋮---- var keysCmd = &cobra.Command{ Use: "keys", Short: "Keys tool", } ⋮---- type GlobalFlags struct { Path string Password string } ⋮---- type AddFlags struct { EvmNs bool RelayNs bool P2PNs bool KeyTag uint8 ChainID int16 PrivateKey string Generate bool Force bool } ⋮---- type RemoveFlags struct { EvmNs bool RelayNs bool P2PNs bool KeyTag uint8 ChainID int16 } ⋮---- type UpdateFlags struct { EvmNs bool RelayNs bool P2PNs bool KeyTag uint8 ChainID int16 PrivateKey string Force bool } ⋮---- var globalFlags GlobalFlags var addFlags AddFlags ⋮---- var removeFlags RemoveFlags var updateFlags UpdateFlags ⋮---- func initFlags() ```` ## File: cmd/utils/keys/print.go ````go package keys ⋮---- import ( "strconv" "github.com/pterm/pterm" cmdhelpers "github.com/symbioticfi/relay/cmd/utils/cmd-helpers" keyprovider "github.com/symbioticfi/relay/internal/usecase/key-provider" "github.com/symbioticfi/relay/symbiotic/entity" "github.com/spf13/cobra" ) ⋮---- "strconv" ⋮---- "github.com/pterm/pterm" ⋮---- cmdhelpers "github.com/symbioticfi/relay/cmd/utils/cmd-helpers" keyprovider "github.com/symbioticfi/relay/internal/usecase/key-provider" "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- "github.com/spf13/cobra" ⋮---- var printKeysCmd = &cobra.Command{ Use: "list", Short: "Print all keys", RunE: func(cmd *cobra.Command, args []string) error { var err error if globalFlags.Password == "" { globalFlags.Password, err = cmdhelpers.GetPassword() if err != nil { return err } } keyStore, err := keyprovider.NewKeystoreProvider(globalFlags.Path, globalFlags.Password) if err != nil { return err } aliases := keyStore.GetAliases() tableData := pterm.TableData{{"#", "Alias", "Key Tag (Symb Keys)", "Public Key"}} for i, alias := range aliases { ns, kType, id, err := keyprovider.AliasToKeyTypeId(alias) if err != nil { return err } pk, err := keyStore.GetPrivateKeyByNamespaceTypeId(ns, kType, id) if err != nil { return err } prettyPk, err := pk.PublicKey().OnChain().MarshalText() if err != nil { return err } tag := "-" // for other namespace no guarantees can be made about the key id size if ns == keyprovider.SYMBIOTIC_KEY_NAMESPACE { kTag, err := entity.KeyTagFromTypeAndId(kType, uint8(id)) if err != nil { return err } tag = kTag.String() } tableData = append(tableData, []string{ strconv.Itoa(i + 1), alias, tag, string(prettyPk), }) } return pterm.DefaultTable.WithHasHeader().WithData(tableData).Render() }, } ⋮---- var err error ⋮---- // for other namespace no guarantees can be made about the key id size ```` ## File: cmd/utils/keys/remove.go ````go package keys ⋮---- import ( cmdhelpers "github.com/symbioticfi/relay/cmd/utils/cmd-helpers" keyprovider "github.com/symbioticfi/relay/internal/usecase/key-provider" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/go-errors/errors" "github.com/spf13/cobra" ) ⋮---- cmdhelpers "github.com/symbioticfi/relay/cmd/utils/cmd-helpers" keyprovider "github.com/symbioticfi/relay/internal/usecase/key-provider" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- "github.com/go-errors/errors" "github.com/spf13/cobra" ⋮---- var removeKeyCmd = &cobra.Command{ Use: "remove", Short: "Remove key", RunE: func(cmd *cobra.Command, args []string) error { var err error if globalFlags.Password == "" { globalFlags.Password, err = cmdhelpers.GetPassword() if err != nil { return err } } keyStore, err := keyprovider.NewKeystoreProvider(globalFlags.Path, globalFlags.Password) if err != nil { return err } if removeFlags.EvmNs { if removeFlags.ChainID < 0 { return errors.New("chain ID is required for evm namespace, use --chain-id=0 for default key for all chains") } return keyStore.DeleteKeyByNamespaceTypeId(keyprovider.EVM_KEY_NAMESPACE, symbiotic.KeyTypeEcdsaSecp256k1, int(removeFlags.ChainID), globalFlags.Password) } else if removeFlags.RelayNs { if removeFlags.KeyTag == uint8(symbiotic.KeyTypeInvalid) { return errors.New("key tag is required for relay namespace") } kt := symbiotic.KeyTag(removeFlags.KeyTag) if kt.Type() == symbiotic.KeyTypeInvalid { return errors.New("invalid key tag, type not supported") } keyId := kt & 0x0F return keyStore.DeleteKeyByNamespaceTypeId(keyprovider.SYMBIOTIC_KEY_NAMESPACE, kt.Type(), int(keyId), globalFlags.Password) } else if removeFlags.P2PNs { return keyStore.DeleteKeyByNamespaceTypeId(keyprovider.P2P_KEY_NAMESPACE, symbiotic.KeyTypeEcdsaSecp256k1, keyprovider.P2P_HOST_IDENTITY_KEY_ID, globalFlags.Password) } return errors.New("either --evm or --relay or --p2p must be specified") }, } ⋮---- var err error ```` ## File: cmd/utils/keys/update.go ````go package keys ⋮---- import ( "github.com/ethereum/go-ethereum/common" cmdhelpers "github.com/symbioticfi/relay/cmd/utils/cmd-helpers" keyprovider "github.com/symbioticfi/relay/internal/usecase/key-provider" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" "github.com/go-errors/errors" "github.com/spf13/cobra" ) ⋮---- "github.com/ethereum/go-ethereum/common" cmdhelpers "github.com/symbioticfi/relay/cmd/utils/cmd-helpers" keyprovider "github.com/symbioticfi/relay/internal/usecase/key-provider" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" ⋮---- "github.com/go-errors/errors" "github.com/spf13/cobra" ⋮---- var updateKeyCmd = &cobra.Command{ Use: "update", Short: "Update key", RunE: func(cmd *cobra.Command, args []string) error { var err error if globalFlags.Password == "" { globalFlags.Password, err = cmdhelpers.GetPassword() if err != nil { return err } } keyStore, err := keyprovider.NewKeystoreProvider(globalFlags.Path, globalFlags.Password) if err != nil { return err } if updateFlags.PrivateKey == "" { return errors.New("private key is required for update") } privKeyBytes := common.FromHex(updateFlags.PrivateKey) if updateFlags.EvmNs { if updateFlags.ChainID < 0 { return errors.New("chain ID is required for evm namespace, use --chain-id=0 for default key for all chains") } exists, err := keyStore.HasKeyByNamespaceTypeId(keyprovider.EVM_KEY_NAMESPACE, symbiotic.KeyTypeEcdsaSecp256k1, int(updateFlags.ChainID)) if err != nil { return err } if !exists { return errors.New("key doesn't exist") } key, err := crypto.NewPrivateKey(symbiotic.KeyTypeEcdsaSecp256k1, privKeyBytes) if err != nil { return err } return keyStore.AddKeyByNamespaceTypeId(keyprovider.EVM_KEY_NAMESPACE, symbiotic.KeyTypeEcdsaSecp256k1, int(updateFlags.ChainID), key, globalFlags.Password, true) } else if updateFlags.RelayNs { if updateFlags.KeyTag == uint8(symbiotic.KeyTypeInvalid) { return errors.New("key tag is required for relay namespace") } kt := symbiotic.KeyTag(updateFlags.KeyTag) if kt.Type() == symbiotic.KeyTypeInvalid { return errors.New("invalid key tag, type not supported") } keyId := kt & 0x0F exists, err := keyStore.HasKeyByNamespaceTypeId(keyprovider.SYMBIOTIC_KEY_NAMESPACE, kt.Type(), int(keyId)) if err != nil { return err } if !exists { return errors.New("key doesn't exist") } key, err := crypto.NewPrivateKey(kt.Type(), privKeyBytes) if err != nil { return err } return keyStore.AddKeyByNamespaceTypeId(keyprovider.SYMBIOTIC_KEY_NAMESPACE, kt.Type(), int(keyId), key, globalFlags.Password, true) } else if updateFlags.P2PNs { exists, err := keyStore.HasKeyByNamespaceTypeId(keyprovider.P2P_KEY_NAMESPACE, symbiotic.KeyTypeEcdsaSecp256k1, keyprovider.P2P_HOST_IDENTITY_KEY_ID) if err != nil { return err } if !exists { return errors.New("key doesn't exist") } key, err := crypto.NewPrivateKey(symbiotic.KeyTypeEcdsaSecp256k1, privKeyBytes) if err != nil { return err } return keyStore.AddKeyByNamespaceTypeId(keyprovider.P2P_KEY_NAMESPACE, symbiotic.KeyTypeEcdsaSecp256k1, keyprovider.P2P_HOST_IDENTITY_KEY_ID, key, globalFlags.Password, true) } return errors.New("either --evm or --relay or --p2p must be specified") }, } ⋮---- var err error ```` ## File: cmd/utils/network/cmd.go ````go package network ⋮---- import ( "context" "os" "os/signal" "syscall" cmdhelpers "github.com/symbioticfi/relay/cmd/utils/cmd-helpers" "github.com/pterm/pterm" "github.com/spf13/cobra" ) ⋮---- "context" "os" "os/signal" "syscall" ⋮---- cmdhelpers "github.com/symbioticfi/relay/cmd/utils/cmd-helpers" ⋮---- "github.com/pterm/pterm" "github.com/spf13/cobra" ⋮---- func NewNetworkCmd() *cobra.Command ⋮---- var networkCmd = &cobra.Command{ Use: "network", Short: "Network tool", } ⋮---- type GlobalFlags struct { Chains []string DriverAddress string DriverChainId uint64 Epoch uint64 } ⋮---- type InfoFlags struct { Validators bool ValidatorsFull bool Addresses bool Settlement bool } ⋮---- type GenesisFlags struct { Json bool Commit bool Epoch int64 Output string Secrets cmdhelpers.SecretKeyMapFlag } ⋮---- var globalFlags GlobalFlags var infoFlags InfoFlags var genesisFlags GenesisFlags ⋮---- func initFlags() ⋮---- // signalContext returns a context that is canceled if either SIGTERM or SIGINT signal is received. func signalContext(ctx context.Context) context.Context ```` ## File: cmd/utils/network/genesis.go ````go package network ⋮---- import ( "os" "strconv" "time" keyprovider "github.com/symbioticfi/relay/internal/usecase/key-provider" "github.com/symbioticfi/relay/symbiotic/client/evm" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/aggregator" symbioticCrypto "github.com/symbioticfi/relay/symbiotic/usecase/crypto" valsetDeriver "github.com/symbioticfi/relay/symbiotic/usecase/valset-deriver" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/pterm/pterm" "github.com/spf13/cobra" ) ⋮---- "os" "strconv" "time" ⋮---- keyprovider "github.com/symbioticfi/relay/internal/usecase/key-provider" "github.com/symbioticfi/relay/symbiotic/client/evm" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/aggregator" symbioticCrypto "github.com/symbioticfi/relay/symbiotic/usecase/crypto" valsetDeriver "github.com/symbioticfi/relay/symbiotic/usecase/valset-deriver" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/pterm/pterm" "github.com/spf13/cobra" ⋮---- var genesisCmd = &cobra.Command{ Use: "generate-genesis", Short: "Generate genesis validator set header", RunE: func(cmd *cobra.Command, args []string) error { ctx := signalContext(cmd.Context()) kp, err := keyprovider.NewSimpleKeystoreProvider() if err != nil { return err } evmClient, err := evm.NewEvmClient(ctx, evm.Config{ ChainURLs: globalFlags.Chains, DriverAddress: symbiotic.CrossChainAddress{ ChainId: globalFlags.DriverChainId, Address: common.HexToAddress(globalFlags.DriverAddress), }, RequestTimeout: 5 * time.Second, KeyProvider: kp, }) if err != nil { return err } if genesisFlags.Commit { privateKeyInput := pterm.DefaultInteractiveTextInput.WithMask("*") for _, chainId := range evmClient.GetChains() { secret, ok := genesisFlags.Secrets.Secrets[chainId] if !ok { secret, _ = privateKeyInput.Show("Enter private key for chain with ID: " + strconv.Itoa(int(chainId))) } pk, err := symbioticCrypto.NewPrivateKey(symbiotic.KeyTypeEcdsaSecp256k1, common.FromHex(secret)) if err != nil { return err } err = kp.AddKeyByNamespaceTypeId( keyprovider.EVM_KEY_NAMESPACE, symbiotic.KeyTypeEcdsaSecp256k1, int(chainId), pk, ) if err != nil { return err } } } spinner := getSpinner("Fetching on-chain network config...") deriver, err := valsetDeriver.NewDeriver(evmClient) if err != nil { return errors.Errorf("failed to create deriver: %v", err) } currentOnchainEpoch := symbiotic.Epoch(0) if genesisFlags.Epoch >= 0 { currentOnchainEpoch = symbiotic.Epoch(genesisFlags.Epoch) } else { currentOnchainEpoch, err = evmClient.GetCurrentEpoch(ctx) if err != nil { return errors.Errorf("failed to get current epoch: %w", err) } } captureTimestamp, err := evmClient.GetEpochStart(ctx, currentOnchainEpoch) if err != nil { return errors.Errorf("failed to get capture timestamp: %w", err) } networkConfig, err := evmClient.GetConfig(ctx, captureTimestamp, currentOnchainEpoch) if err != nil { return errors.Errorf("failed to get config: %w", err) } spinner.Success() spinner = getSpinner("Fetching on-chain validators data...") newValset, err := deriver.GetValidatorSet(ctx, currentOnchainEpoch, networkConfig) if err != nil { return errors.Errorf("failed to get validator set extra for epoch %d: %w", currentOnchainEpoch, err) } spinner.Success() spinner = getSpinner("Building header and extra data...") // header generation is clear now header, err := newValset.GetHeader() if err != nil { return errors.Errorf("failed to generate validator set header: %w", err) } aggregator, err := aggregator.NewAggregator(networkConfig.VerificationType, nil) if err != nil { return errors.Errorf("failed to create aggregator: %w", err) } // extra data generation is also clear but still in deriver extraData, err := aggregator.GenerateExtraData(newValset, networkConfig.RequiredKeyTags) if err != nil { return errors.Errorf("failed to generate extra data: %w", err) } spinner.Success() jsonData := printHeaderWithExtraDataToJSON(header, extraData) if !genesisFlags.Json { panels := pterm.Panels{ { {Data: pterm.DefaultBox.WithTitle("Validator Set Header").Sprint( printHeaderTable(header), )}, }, { {Data: pterm.DefaultBox.WithTitle("Extra Data").Sprint( printExtraDataTable(extraData), )}, }, } pterm.DefaultPanel.WithPanels(panels).Render() } else { pterm.Println(jsonData) } if genesisFlags.Output != "" { err = os.WriteFile(genesisFlags.Output, []byte(jsonData), 0600) if err != nil { return errors.Errorf("failed to write output file: %w", err) } pterm.Success.Println("Genesis data written to " + genesisFlags.Output) } if genesisFlags.Commit { for _, settlement := range networkConfig.Settlements { spinner = getSpinner("Setting genesis on " + settlement.Address.String()) txResult, err := evmClient.SetGenesis( ctx, settlement, header, extraData) if err != nil { spinner.Fail("Transaction failed: ", err) return errors.Errorf("failed to set genesis for network %d: %w", settlement.ChainId, err) } spinner.Success("Transaction hash: ", txResult.TxHash.String()) } } return nil }, } ⋮---- // header generation is clear now ⋮---- // extra data generation is also clear but still in deriver ⋮---- func getSpinner(text string) *pterm.SpinnerPrinter ```` ## File: cmd/utils/network/info.go ````go package network ⋮---- import ( "time" keyprovider "github.com/symbioticfi/relay/internal/usecase/key-provider" "github.com/symbioticfi/relay/internal/usecase/metrics" "github.com/symbioticfi/relay/symbiotic/client/evm" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" valsetDeriver "github.com/symbioticfi/relay/symbiotic/usecase/valset-deriver" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/pterm/pterm" "github.com/samber/lo" "github.com/spf13/cobra" "golang.org/x/sync/errgroup" ) ⋮---- "time" ⋮---- keyprovider "github.com/symbioticfi/relay/internal/usecase/key-provider" "github.com/symbioticfi/relay/internal/usecase/metrics" "github.com/symbioticfi/relay/symbiotic/client/evm" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" valsetDeriver "github.com/symbioticfi/relay/symbiotic/usecase/valset-deriver" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/pterm/pterm" "github.com/samber/lo" "github.com/spf13/cobra" "golang.org/x/sync/errgroup" ⋮---- var infoCmd = &cobra.Command{ Use: "info", Short: "Print network information", RunE: func(cmd *cobra.Command, args []string) error { var err error ctx := signalContext(cmd.Context()) kp, err := keyprovider.NewSimpleKeystoreProvider() if err != nil { return err } evmClient, err := evm.NewEvmClient(ctx, evm.Config{ ChainURLs: globalFlags.Chains, DriverAddress: symbiotic.CrossChainAddress{ ChainId: globalFlags.DriverChainId, Address: common.HexToAddress(globalFlags.DriverAddress), }, RequestTimeout: 5 * time.Second, KeyProvider: kp, Metrics: metrics.New(metrics.Config{}), }) if err != nil { return err } if err != nil { return errors.Errorf("Failed to get evm client: %v", err) } deriver, err := valsetDeriver.NewDeriver(evmClient) if err != nil { return errors.Errorf("Failed to create deriver: %v", err) } epoch := symbiotic.Epoch(globalFlags.Epoch) if globalFlags.Epoch == 0 { epoch, err = evmClient.GetCurrentEpoch(ctx) if err != nil { return errors.Errorf("Failed to get current epoch: %w", err) } } captureTimestamp, err := evmClient.GetEpochStart(ctx, epoch) if err != nil { return errors.Errorf("Failed to get capture timestamp: %w", err) } networkConfig, err := evmClient.GetConfig(ctx, captureTimestamp, epoch) if err != nil { return errors.Errorf("Failed to get config: %w", err) } epochDuration, err := evmClient.GetEpochDuration(ctx, epoch) if err != nil { return errors.Errorf("Failed to get epoch duration: %w", err) } valset, err := deriver.GetValidatorSet(ctx, epoch, networkConfig) if err != nil { return errors.Errorf("Failed to get validator set: %w", err) } // row with info and config panels := pterm.Panels{ { {Data: pterm.DefaultBox.WithTitle("Network info").Sprint( printNetworkInfo(epoch, captureTimestamp, &networkConfig, &valset), )}, {Data: pterm.DefaultBox.WithTitle("Network config").Sprint( printNetworkConfig(epochDuration, &networkConfig), )}, }, } // row with addresses [optional] if infoFlags.Addresses { panels = append(panels, []pterm.Panel{ {Data: pterm.DefaultBox.WithTitle("Addresses").Sprint( printAddresses(symbiotic.CrossChainAddress{ ChainId: globalFlags.DriverChainId, Address: common.HexToAddress(globalFlags.DriverAddress), }, &networkConfig), )}, }) } // row with settlements info if infoFlags.Settlement { settlementData := make([]settlementReplicaData, len(networkConfig.Settlements)) eg, egCtx := errgroup.WithContext(ctx) eg.SetLimit(5) for i, settlement := range networkConfig.Settlements { eg.Go(func() error { isCommitted, err := evmClient.IsValsetHeaderCommittedAt(egCtx, settlement, epoch) if err != nil { return errors.Errorf("Failed to get latest epoch: %w", err) } settlementData[i].IsCommitted = isCommitted if isCommitted { headerHash, err := evmClient.GetHeaderHashAt(egCtx, settlement, epoch) if err != nil { return errors.Errorf("Failed to get header hash: %w", err) } settlementData[i].HeaderHash = headerHash } lastCommittedHeaderEpoch, err := evmClient.GetLastCommittedHeaderEpoch(ctx, settlement) if err != nil { return errors.Errorf("Failed to get last committed header epoch: %w", err) } settlementData[i].LastCommittedHeaderEpoch = uint64(lastCommittedHeaderEpoch) allEpochsFromZero := lo.RepeatBy(int(epoch+1), func(i int) symbiotic.Epoch { return symbiotic.Epoch(i) }) commitmentResults, err := evmClient.IsValsetHeaderCommittedAtEpochs(egCtx, settlement, allEpochsFromZero) if err != nil { return errors.Errorf("Failed to check epoch commitments: %w", err) } settlementData[i].MissedEpochs = uint64(lo.CountBy(commitmentResults, func(committed bool) bool { return !committed })) return nil }) } if err := eg.Wait(); err != nil { return err } header, err := valset.GetHeader() if err != nil { return errors.Errorf("Failed to get header: %w", err) } panels = append(panels, []pterm.Panel{ {Data: pterm.DefaultBox.WithTitle("Settlement").Sprint( printSettlementData(header, networkConfig, settlementData), )}, }) } // row with validators [optional] if infoFlags.ValidatorsFull { panels = append(panels, []pterm.Panel{ {Data: pterm.DefaultBox.WithTitle("Validators").Sprint( printValidatorsTree(&valset), )}, }) } else if infoFlags.Validators { panels = append(panels, []pterm.Panel{ {Data: pterm.DefaultBox.WithTitle("Validators").Sprint( printValidatorsTable(&valset), )}, }) } pterm.DefaultPanel.WithPanels(panels).Render() return nil }, } ⋮---- var err error ⋮---- // row with info and config ⋮---- // row with addresses [optional] ⋮---- // row with settlements info ⋮---- // row with validators [optional] ```` ## File: cmd/utils/network/printers.go ````go package network ⋮---- import ( "encoding/json" "fmt" "math/big" "strconv" "strings" "time" cmdhelpers "github.com/symbioticfi/relay/cmd/utils/cmd-helpers" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/ethereum/go-ethereum/common" "github.com/pterm/pterm" "github.com/pterm/pterm/putils" "github.com/samber/lo" ) ⋮---- "encoding/json" "fmt" "math/big" "strconv" "strings" "time" ⋮---- cmdhelpers "github.com/symbioticfi/relay/cmd/utils/cmd-helpers" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/pterm/pterm" "github.com/pterm/pterm/putils" "github.com/samber/lo" ⋮---- type settlementReplicaData struct { IsCommitted bool HeaderHash common.Hash MissedEpochs uint64 LastCommittedHeaderEpoch uint64 } ⋮---- func printAddresses(driver symbiotic.CrossChainAddress, networkConfig *symbiotic.NetworkConfig) string ⋮---- func printNetworkConfig(epochDuration uint64, networkConfig *symbiotic.NetworkConfig) string ⋮---- func printNetworkInfo(epoch symbiotic.Epoch, epochStart symbiotic.Timestamp, networkConfig *symbiotic.NetworkConfig, valset *symbiotic.ValidatorSet) string ⋮---- func printValidatorsTree(valset *symbiotic.ValidatorSet) string ⋮---- // Render the tree structure using the default tree printer. ⋮---- func printValidatorsTable(valset *symbiotic.ValidatorSet) string ⋮---- func printHeaderTable(header symbiotic.ValidatorSetHeader) string ⋮---- func printExtraDataTable(extraData symbiotic.ExtraDataList) string ⋮---- func printHeaderWithExtraDataToJSON(validatorSetHeader symbiotic.ValidatorSetHeader, extraDataList symbiotic.ExtraDataList) string ⋮---- type jsonHeader struct { Version uint8 `json:"version"` ValidatorsSszMRoot string `json:"validatorsSszMRoot"` // hex string Epoch uint64 `json:"epoch"` RequiredKeyTag uint8 `json:"requiredKeyTag"` CaptureTimestamp uint64 `json:"captureTimestamp"` QuorumThreshold *big.Int `json:"quorumThreshold"` TotalVotingPower *big.Int `json:"totalVotingPower"` } ⋮---- ValidatorsSszMRoot string `json:"validatorsSszMRoot"` // hex string ⋮---- type jsonExtraData struct { Key string `json:"key"` // hex string Value string `json:"value"` // hex string } ⋮---- Key string `json:"key"` // hex string Value string `json:"value"` // hex string ⋮---- type jsonValidatorSetHeaderWithExtraData struct { Header jsonHeader `json:"header"` ExtraDataList []jsonExtraData `json:"extraData"` } ⋮---- func printSettlementData( valsetHeader symbiotic.ValidatorSetHeader, networkConfig symbiotic.NetworkConfig, settlementData []settlementReplicaData, ) string ```` ## File: cmd/utils/operator/cmd.go ````go package operator ⋮---- import ( "context" "os" "os/signal" "syscall" "github.com/go-errors/errors" cmdhelpers "github.com/symbioticfi/relay/cmd/utils/cmd-helpers" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/pterm/pterm" "github.com/spf13/cobra" ) ⋮---- "context" "os" "os/signal" "syscall" ⋮---- "github.com/go-errors/errors" ⋮---- cmdhelpers "github.com/symbioticfi/relay/cmd/utils/cmd-helpers" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- "github.com/pterm/pterm" "github.com/spf13/cobra" ⋮---- func NewOperatorCmd() *cobra.Command ⋮---- var operatorCmd = &cobra.Command{ Use: "operator", Short: "Operator tool", } ⋮---- type GlobalFlags struct { Chains []string DriverAddress string DriverChainId uint64 VotingProviderChainId uint64 } ⋮---- type InfoFlags struct { Epoch uint64 Full bool Path string Password string KeyTag uint8 } ⋮---- type RegisterKeyFlags struct { Secrets cmdhelpers.SecretKeyMapFlag Path string Password string KeyTag uint8 } ⋮---- type InvalidateOldSignaturesFlags struct { Secrets cmdhelpers.SecretKeyMapFlag } ⋮---- type RegisterOperatorWithSignatureFlags struct { Secrets cmdhelpers.SecretKeyMapFlag } ⋮---- type UnregisterOperatorWithSignatureFlags struct { Secrets cmdhelpers.SecretKeyMapFlag } ⋮---- type RegisterOperatorFlags struct { Secrets cmdhelpers.SecretKeyMapFlag } ⋮---- type UnregisterOperatorFlags struct { Secrets cmdhelpers.SecretKeyMapFlag } ⋮---- var globalFlags GlobalFlags var infoFlags InfoFlags var registerKeyFlags RegisterKeyFlags var invalidateOldSignaturesFlags InvalidateOldSignaturesFlags var registerOperatorWithSignatureFlags RegisterOperatorWithSignatureFlags var unregisterOperatorWithSignatureFlags UnregisterOperatorWithSignatureFlags var registerOperatorFlags RegisterOperatorFlags var unregisterOperatorFlags UnregisterOperatorFlags ⋮---- func initFlags() ⋮---- // signalContext returns a context that is canceled if either SIGTERM or SIGINT signal is received. func signalContext(ctx context.Context) context.Context ⋮---- // findVotingPowerProviderByChainId finds a voting power provider by chain id from the list func findVotingPowerProviderByChainId(providers []symbiotic.CrossChainAddress, chainId uint64) (symbiotic.CrossChainAddress, error) ```` ## File: cmd/utils/operator/info.go ````go package operator ⋮---- import ( "time" cmdhelpers "github.com/symbioticfi/relay/cmd/utils/cmd-helpers" keyprovider "github.com/symbioticfi/relay/internal/usecase/key-provider" "github.com/symbioticfi/relay/internal/usecase/metrics" "github.com/symbioticfi/relay/symbiotic/client/evm" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" valsetDeriver "github.com/symbioticfi/relay/symbiotic/usecase/valset-deriver" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/pterm/pterm" "github.com/pterm/pterm/putils" "github.com/spf13/cobra" ) ⋮---- "time" ⋮---- cmdhelpers "github.com/symbioticfi/relay/cmd/utils/cmd-helpers" keyprovider "github.com/symbioticfi/relay/internal/usecase/key-provider" "github.com/symbioticfi/relay/internal/usecase/metrics" "github.com/symbioticfi/relay/symbiotic/client/evm" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" valsetDeriver "github.com/symbioticfi/relay/symbiotic/usecase/valset-deriver" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/pterm/pterm" "github.com/pterm/pterm/putils" "github.com/spf13/cobra" ⋮---- var infoCmd = &cobra.Command{ Use: "info", Short: "Print operator information", RunE: func(cmd *cobra.Command, args []string) error { ctx := signalContext(cmd.Context()) kp, err := keyprovider.NewSimpleKeystoreProvider() if err != nil { return err } evmClient, err := evm.NewEvmClient(ctx, evm.Config{ ChainURLs: globalFlags.Chains, DriverAddress: symbiotic.CrossChainAddress{ ChainId: globalFlags.DriverChainId, Address: common.HexToAddress(globalFlags.DriverAddress), }, RequestTimeout: 5 * time.Second, KeyProvider: kp, Metrics: metrics.New(metrics.Config{}), }) if err != nil { return err } if infoFlags.Password == "" { infoFlags.Password, err = cmdhelpers.GetPassword() if err != nil { return errors.Errorf("failed to get password: %w", err) } } if infoFlags.Epoch == 0 { epoch, err := evmClient.GetCurrentEpoch(ctx) if err != nil { return errors.Errorf("failed to get current epoch: %w", err) } infoFlags.Epoch = uint64(epoch) } captureTimestamp, err := evmClient.GetEpochStart(ctx, symbiotic.Epoch(infoFlags.Epoch)) if err != nil { return errors.Errorf("failed to get capture timestamp: %w", err) } networkConfig, err := evmClient.GetConfig(ctx, captureTimestamp, symbiotic.Epoch(infoFlags.Epoch)) if err != nil { return errors.Errorf("failed to get config: %w", err) } epoch, err := evmClient.GetLastCommittedHeaderEpoch(ctx, networkConfig.Settlements[0]) if err != nil { return errors.Errorf("failed to get valset header: %w", err) } deriver, err := valsetDeriver.NewDeriver(evmClient) if err != nil { return errors.Errorf("failed to create valset deriver: %w", err) } valset, err := deriver.GetValidatorSet(ctx, epoch, networkConfig) if err != nil { return errors.Errorf("failed to get validator set: %w", err) } keyStore, err := keyprovider.NewKeystoreProvider(infoFlags.Path, infoFlags.Password) if err != nil { return err } kt := symbiotic.KeyTag(infoFlags.KeyTag) pk, err := keyStore.GetPrivateKey(kt) if err != nil { return err } validator, found := valset.FindValidatorByKey(kt, pk.PublicKey().OnChain()) if !found { return errors.Errorf("validator not found for key: %d %s", kt, common.Bytes2Hex(pk.PublicKey().Raw())) } leveledList := pterm.LeveledList{} leveledList = cmdhelpers.PrintTreeValidator(leveledList, validator, valset.GetTotalActiveVotingPower().Int) text, _ := pterm.DefaultTree.WithRoot(putils.TreeFromLeveledList(leveledList)).Srender() panels := pterm.Panels{{{Data: pterm.DefaultBox.WithTitle("Operator info").Sprint(text)}}} pterm.DefaultPanel.WithPanels(panels).Render() return nil }, } ```` ## File: cmd/utils/operator/invalidate_old_signatures.go ````go package operator ⋮---- import ( "strconv" "time" keyprovider "github.com/symbioticfi/relay/internal/usecase/key-provider" "github.com/symbioticfi/relay/internal/usecase/metrics" "github.com/symbioticfi/relay/symbiotic/client/evm" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" symbioticCrypto "github.com/symbioticfi/relay/symbiotic/usecase/crypto" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/pterm/pterm" "github.com/spf13/cobra" ) ⋮---- "strconv" "time" ⋮---- keyprovider "github.com/symbioticfi/relay/internal/usecase/key-provider" "github.com/symbioticfi/relay/internal/usecase/metrics" "github.com/symbioticfi/relay/symbiotic/client/evm" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" symbioticCrypto "github.com/symbioticfi/relay/symbiotic/usecase/crypto" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/pterm/pterm" "github.com/spf13/cobra" ⋮---- var invalidateOldSignaturesCmd = &cobra.Command{ Use: "invalidate-old-signatures", Short: "Invalidate old signatures for operator", RunE: func(cmd *cobra.Command, args []string) error { ctx := signalContext(cmd.Context()) kp, err := keyprovider.NewSimpleKeystoreProvider() if err != nil { return err } evmClient, err := evm.NewEvmClient(ctx, evm.Config{ ChainURLs: globalFlags.Chains, DriverAddress: symbiotic.CrossChainAddress{ ChainId: globalFlags.DriverChainId, Address: common.HexToAddress(globalFlags.DriverAddress), }, RequestTimeout: 5 * time.Second, KeyProvider: kp, Metrics: metrics.New(metrics.Config{}), }) if err != nil { return err } currentOnChainEpoch, err := evmClient.GetCurrentEpoch(ctx) if err != nil { return errors.Errorf("failed to get current epoch: %w", err) } captureTimestamp, err := evmClient.GetEpochStart(ctx, currentOnChainEpoch) if err != nil { return errors.Errorf("failed to get capture timestamp: %w", err) } networkConfig, err := evmClient.GetConfig(ctx, captureTimestamp, currentOnChainEpoch) if err != nil { return errors.Errorf("failed to get config: %w", err) } if len(networkConfig.VotingPowerProviders) == 0 { return errors.New("no voting power providers found in network config") } votingPowerProvider, err := findVotingPowerProviderByChainId(networkConfig.VotingPowerProviders, globalFlags.VotingProviderChainId) if err != nil { return err } // Load the operator key for the voting power provider's chain privateKeyInput := pterm.DefaultInteractiveTextInput.WithMask("*") secret, ok := invalidateOldSignaturesFlags.Secrets.Secrets[votingPowerProvider.ChainId] if !ok { secret, _ = privateKeyInput.Show("Enter operator private key for chain with ID: " + strconv.Itoa(int(votingPowerProvider.ChainId))) } pk, err := symbioticCrypto.NewPrivateKey(symbiotic.KeyTypeEcdsaSecp256k1, common.FromHex(secret)) if err != nil { return err } err = kp.AddKeyByNamespaceTypeId( keyprovider.EVM_KEY_NAMESPACE, symbiotic.KeyTypeEcdsaSecp256k1, int(votingPowerProvider.ChainId), pk, ) if err != nil { return err } txResult, err := evmClient.InvalidateOldSignatures(ctx, votingPowerProvider) if err != nil { return errors.Errorf("failed to invalidate old signatures: %w", err) } pterm.Success.Println("Old signatures invalidated! TxHash:", txResult.TxHash.String()) return nil }, } ⋮---- // Load the operator key for the voting power provider's chain ```` ## File: cmd/utils/operator/register_key.go ````go package operator ⋮---- import ( "log/slog" "strconv" "time" "github.com/ethereum/go-ethereum/common/math" cmdhelpers "github.com/symbioticfi/relay/cmd/utils/cmd-helpers" keyprovider "github.com/symbioticfi/relay/internal/usecase/key-provider" "github.com/symbioticfi/relay/internal/usecase/metrics" "github.com/symbioticfi/relay/symbiotic/client/evm" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" symbioticCrypto "github.com/symbioticfi/relay/symbiotic/usecase/crypto" "github.com/symbioticfi/relay/symbiotic/usecase/crypto/bls12381Bn254" "github.com/symbioticfi/relay/symbiotic/usecase/crypto/blsBn254" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/signer/core/apitypes" "github.com/go-errors/errors" "github.com/pterm/pterm" "github.com/spf13/cobra" ) ⋮---- "log/slog" "strconv" "time" ⋮---- "github.com/ethereum/go-ethereum/common/math" ⋮---- cmdhelpers "github.com/symbioticfi/relay/cmd/utils/cmd-helpers" keyprovider "github.com/symbioticfi/relay/internal/usecase/key-provider" "github.com/symbioticfi/relay/internal/usecase/metrics" "github.com/symbioticfi/relay/symbiotic/client/evm" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" symbioticCrypto "github.com/symbioticfi/relay/symbiotic/usecase/crypto" "github.com/symbioticfi/relay/symbiotic/usecase/crypto/bls12381Bn254" "github.com/symbioticfi/relay/symbiotic/usecase/crypto/blsBn254" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/signer/core/apitypes" "github.com/go-errors/errors" "github.com/pterm/pterm" "github.com/spf13/cobra" ⋮---- var registerKeyCmd = &cobra.Command{ Use: "register-key", Short: "Register operator key in key registry", RunE: func(cmd *cobra.Command, args []string) error { var err error ctx := signalContext(cmd.Context()) kp, err := keyprovider.NewSimpleKeystoreProvider() if err != nil { return err } evmClient, err := evm.NewEvmClient(ctx, evm.Config{ ChainURLs: globalFlags.Chains, DriverAddress: symbiotic.CrossChainAddress{ ChainId: globalFlags.DriverChainId, Address: common.HexToAddress(globalFlags.DriverAddress), }, RequestTimeout: 5 * time.Second, KeyProvider: kp, Metrics: metrics.New(metrics.Config{}), }) if err != nil { return err } // TODO multiple chains key registration support if len(evmClient.GetChains()) != 1 { return errors.New("only single chain is supported") } chainId := evmClient.GetChains()[0] // duplicate from genesis privateKeyInput := pterm.DefaultInteractiveTextInput.WithMask("*") secret, ok := registerKeyFlags.Secrets.Secrets[chainId] if !ok { secret, _ = privateKeyInput.Show("Enter private key for chain with ID: " + strconv.Itoa(int(chainId))) } pk, err := symbioticCrypto.NewPrivateKey(symbiotic.KeyTypeEcdsaSecp256k1, common.FromHex(secret)) if err != nil { return err } err = kp.AddKeyByNamespaceTypeId( keyprovider.EVM_KEY_NAMESPACE, symbiotic.KeyTypeEcdsaSecp256k1, int(chainId), pk, ) if err != nil { return err } if registerKeyFlags.Password == "" { registerKeyFlags.Password, err = cmdhelpers.GetPassword() if err != nil { return err } } keyStore, err := keyprovider.NewKeystoreProvider(registerKeyFlags.Path, registerKeyFlags.Password) if err != nil { return err } kt := symbiotic.KeyTag(registerKeyFlags.KeyTag) pk, err = keyStore.GetPrivateKey(kt) if err != nil { return errors.Errorf("failed to get private key for keyTag %v from keystore: %w", kt, err) } currentOnchainEpoch, err := evmClient.GetCurrentEpoch(ctx) if err != nil { return errors.Errorf("failed to get current epoch: %w", err) } captureTimestamp, err := evmClient.GetEpochStart(ctx, currentOnchainEpoch) if err != nil { return errors.Errorf("failed to get capture timestamp: %w", err) } networkConfig, err := evmClient.GetConfig(ctx, captureTimestamp, currentOnchainEpoch) if err != nil { return errors.Errorf("failed to get config: %w", err) } eip712Domain, err := evmClient.GetEip712Domain(ctx, networkConfig.KeysProvider) if err != nil { return errors.Errorf("failed to get eip712 domain: %w", err) } ecdsaPk, err := crypto.HexToECDSA(secret) if err != nil { return err } operator := crypto.PubkeyToAddress(ecdsaPk.PublicKey) key := pk.PublicKey().OnChain() commitmentData, err := keyCommitmentData(eip712Domain, operator, key) if err != nil { return errors.Errorf("failed to get commitment data: %w", err) } signature, _, err := pk.Sign(commitmentData) if err != nil { return errors.Errorf("failed to sign commitment data: %w", err) } // For ECDSA signatures, we need to adjust the recovery ID // Go's crypto.Sign() returns V as 0 or 1, but Ethereum expects 27 or 28 if kt.Type() == symbiotic.KeyTypeEcdsaSecp256k1 && len(signature) == 65 { // Convert recovery ID from 0/1 to 27/28 for Ethereum signature[64] += 27 } var extraData []byte switch kt.Type() { case symbiotic.KeyTypeBlsBn254: blsKey, err := blsBn254.FromRaw(pk.PublicKey().Raw()) if err != nil { return errors.Errorf("failed to parse BLS public key: %w", err) } rawByte := blsKey.G2().RawBytes() extraData = rawByte[:] case symbiotic.KeyTypeBls12381Bn254: blsKey, err := bls12381Bn254.FromRaw(pk.PublicKey().Raw()) if err != nil { return errors.Errorf("failed to parse BLS public key: %w", err) } rawByte := blsKey.G2().RawBytes() extraData = rawByte[:] case symbiotic.KeyTypeEcdsaSecp256k1: // no extra data needed for ECDSA keys case symbiotic.KeyTypeInvalid: return errors.New("invalid key type") } // Use the adjusted signature for registration txResult, err := evmClient.RegisterKey(ctx, networkConfig.KeysProvider, kt, key, signature, extraData) if err != nil { return errors.Errorf("failed to register operator: %w", err) } slog.InfoContext(ctx, "Operator Key registered!", "txHash", txResult.TxHash.String(), "key-tag", kt) return nil }, } ⋮---- var err error ⋮---- // TODO multiple chains key registration support ⋮---- // duplicate from genesis ⋮---- // For ECDSA signatures, we need to adjust the recovery ID // Go's crypto.Sign() returns V as 0 or 1, but Ethereum expects 27 or 28 ⋮---- // Convert recovery ID from 0/1 to 27/28 for Ethereum ⋮---- var extraData []byte ⋮---- // no extra data needed for ECDSA keys ⋮---- // Use the adjusted signature for registration ⋮---- func keyCommitmentData(eip712Domain symbiotic.Eip712Domain, operator common.Address, keyBytes []byte) ([]byte, error) ```` ## File: cmd/utils/operator/register_operator.go ````go package operator ⋮---- import ( "strconv" "time" keyprovider "github.com/symbioticfi/relay/internal/usecase/key-provider" "github.com/symbioticfi/relay/internal/usecase/metrics" "github.com/symbioticfi/relay/symbiotic/client/evm" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" symbioticCrypto "github.com/symbioticfi/relay/symbiotic/usecase/crypto" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/pterm/pterm" "github.com/spf13/cobra" ) ⋮---- "strconv" "time" ⋮---- keyprovider "github.com/symbioticfi/relay/internal/usecase/key-provider" "github.com/symbioticfi/relay/internal/usecase/metrics" "github.com/symbioticfi/relay/symbiotic/client/evm" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" symbioticCrypto "github.com/symbioticfi/relay/symbiotic/usecase/crypto" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/pterm/pterm" "github.com/spf13/cobra" ⋮---- var registerOperatorCmd = &cobra.Command{ Use: "register-operator", Short: "Register operator on-chain via VotingPowerProvider", RunE: func(cmd *cobra.Command, args []string) error { ctx := signalContext(cmd.Context()) kp, err := keyprovider.NewSimpleKeystoreProvider() if err != nil { return err } evmClient, err := evm.NewEvmClient(ctx, evm.Config{ ChainURLs: globalFlags.Chains, DriverAddress: symbiotic.CrossChainAddress{ ChainId: globalFlags.DriverChainId, Address: common.HexToAddress(globalFlags.DriverAddress), }, RequestTimeout: 5 * time.Second, KeyProvider: kp, Metrics: metrics.New(metrics.Config{}), }) if err != nil { return err } currentOnchainEpoch, err := evmClient.GetCurrentEpoch(ctx) if err != nil { return errors.Errorf("failed to get current epoch: %w", err) } captureTimestamp, err := evmClient.GetEpochStart(ctx, currentOnchainEpoch) if err != nil { return errors.Errorf("failed to get capture timestamp: %w", err) } networkConfig, err := evmClient.GetConfig(ctx, captureTimestamp, currentOnchainEpoch) if err != nil { return errors.Errorf("failed to get config: %w", err) } if len(networkConfig.VotingPowerProviders) == 0 { return errors.New("no voting power providers found in network config") } votingPowerProvider, err := findVotingPowerProviderByChainId(networkConfig.VotingPowerProviders, globalFlags.VotingProviderChainId) if err != nil { return err } // Load the operator key for the voting power provider's chain privateKeyInput := pterm.DefaultInteractiveTextInput.WithMask("*") secret, ok := registerOperatorFlags.Secrets.Secrets[votingPowerProvider.ChainId] if !ok { secret, _ = privateKeyInput.Show("Enter operator private key for chain with ID: " + strconv.Itoa(int(votingPowerProvider.ChainId))) } pk, err := symbioticCrypto.NewPrivateKey(symbiotic.KeyTypeEcdsaSecp256k1, common.FromHex(secret)) if err != nil { return err } err = kp.AddKeyByNamespaceTypeId( keyprovider.EVM_KEY_NAMESPACE, symbiotic.KeyTypeEcdsaSecp256k1, int(votingPowerProvider.ChainId), pk, ) if err != nil { return err } txResult, err := evmClient.RegisterOperatorVotingPowerProvider(ctx, votingPowerProvider) if err != nil { return errors.Errorf("failed to register operator: %w", err) } pterm.Success.Println("Operator registered! TxHash:", txResult.TxHash.String()) return nil }, } ⋮---- // Load the operator key for the voting power provider's chain ```` ## File: cmd/utils/operator/register_with_signature.go ````go package operator ⋮---- import ( "strconv" "time" "github.com/symbioticfi/relay/internal/usecase/metrics" "github.com/symbioticfi/relay/symbiotic/client/evm" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/math" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/signer/core/apitypes" "github.com/go-errors/errors" "github.com/pterm/pterm" "github.com/spf13/cobra" ) ⋮---- "strconv" "time" ⋮---- "github.com/symbioticfi/relay/internal/usecase/metrics" "github.com/symbioticfi/relay/symbiotic/client/evm" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/math" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/signer/core/apitypes" "github.com/go-errors/errors" "github.com/pterm/pterm" "github.com/spf13/cobra" ⋮---- var registerOperatorWithSignatureCmd = &cobra.Command{ Use: "register-operator-with-signature", Short: "Generate EIP-712 signature for operator registration", RunE: func(cmd *cobra.Command, args []string) error { ctx := signalContext(cmd.Context()) evmClient, err := evm.NewEvmClient(ctx, evm.Config{ ChainURLs: globalFlags.Chains, DriverAddress: symbiotic.CrossChainAddress{ ChainId: globalFlags.DriverChainId, Address: common.HexToAddress(globalFlags.DriverAddress), }, RequestTimeout: 5 * time.Second, Metrics: metrics.New(metrics.Config{}), }) if err != nil { return err } privateKeyInput := pterm.DefaultInteractiveTextInput.WithMask("*") secret, ok := registerOperatorWithSignatureFlags.Secrets.Secrets[globalFlags.DriverChainId] if !ok { secret, _ = privateKeyInput.Show("Enter operator private key for chain with ID: " + strconv.Itoa(int(globalFlags.DriverChainId))) } ecdsaPk, err := crypto.HexToECDSA(secret) if err != nil { return errors.Errorf("failed to parse private key: %w", err) } operator := crypto.PubkeyToAddress(ecdsaPk.PublicKey) currentOnchainEpoch, err := evmClient.GetCurrentEpoch(ctx) if err != nil { return errors.Errorf("failed to get current epoch: %w", err) } captureTimestamp, err := evmClient.GetEpochStart(ctx, currentOnchainEpoch) if err != nil { return errors.Errorf("failed to get capture timestamp: %w", err) } networkConfig, err := evmClient.GetConfig(ctx, captureTimestamp, currentOnchainEpoch) if err != nil { return errors.Errorf("failed to get config: %w", err) } // Find VotingPowerProvider by chain ID if len(networkConfig.VotingPowerProviders) == 0 { return errors.New("no voting power providers found in network config") } votingPowerProvider, err := findVotingPowerProviderByChainId(networkConfig.VotingPowerProviders, globalFlags.VotingProviderChainId) if err != nil { return err } eip712Domain, err := evmClient.GetVotingPowerProviderEip712Domain(ctx, votingPowerProvider) if err != nil { return errors.Errorf("failed to get eip712 domain: %w", err) } nonce, err := evmClient.GetOperatorNonce(ctx, votingPowerProvider, operator) if err != nil { return errors.Errorf("failed to get operator nonce: %w", err) } // Build EIP-712 typed data for RegisterOperator typedData := apitypes.TypedData{ Types: apitypes.Types{ "EIP712Domain": []apitypes.Type{ {Name: "name", Type: "string"}, {Name: "version", Type: "string"}, {Name: "chainId", Type: "uint256"}, {Name: "verifyingContract", Type: "address"}, }, "RegisterOperator": []apitypes.Type{ {Name: "operator", Type: "address"}, {Name: "nonce", Type: "uint256"}, }, }, PrimaryType: "RegisterOperator", Domain: apitypes.TypedDataDomain{ Name: eip712Domain.Name, Version: eip712Domain.Version, ChainId: (*math.HexOrDecimal256)(eip712Domain.ChainId), VerifyingContract: eip712Domain.VerifyingContract.Hex(), }, Message: apitypes.TypedDataMessage{ "operator": operator.Hex(), "nonce": (*math.HexOrDecimal256)(nonce), }, } typedDataHash, _, err := apitypes.TypedDataAndHash(typedData) if err != nil { return errors.Errorf("failed to hash typed data: %w", err) } signature, err := crypto.Sign(typedDataHash, ecdsaPk) if err != nil { return errors.Errorf("failed to sign: %w", err) } // Ethereum expects recovery ID to be 27 or 28, not 0 or 1 if len(signature) == 65 { signature[64] += 27 } pterm.Success.Printf("0x%x\n", signature) return nil }, } ⋮---- // Find VotingPowerProvider by chain ID ⋮---- // Build EIP-712 typed data for RegisterOperator ⋮---- // Ethereum expects recovery ID to be 27 or 28, not 0 or 1 ```` ## File: cmd/utils/operator/unregister_operator.go ````go package operator ⋮---- import ( "strconv" "time" keyprovider "github.com/symbioticfi/relay/internal/usecase/key-provider" "github.com/symbioticfi/relay/internal/usecase/metrics" "github.com/symbioticfi/relay/symbiotic/client/evm" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" symbioticCrypto "github.com/symbioticfi/relay/symbiotic/usecase/crypto" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/pterm/pterm" "github.com/spf13/cobra" ) ⋮---- "strconv" "time" ⋮---- keyprovider "github.com/symbioticfi/relay/internal/usecase/key-provider" "github.com/symbioticfi/relay/internal/usecase/metrics" "github.com/symbioticfi/relay/symbiotic/client/evm" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" symbioticCrypto "github.com/symbioticfi/relay/symbiotic/usecase/crypto" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/pterm/pterm" "github.com/spf13/cobra" ⋮---- var unregisterOperatorCmd = &cobra.Command{ Use: "unregister-operator", Short: "Unregister operator on-chain via VotingPowerProvider", RunE: func(cmd *cobra.Command, args []string) error { ctx := signalContext(cmd.Context()) kp, err := keyprovider.NewSimpleKeystoreProvider() if err != nil { return err } evmClient, err := evm.NewEvmClient(ctx, evm.Config{ ChainURLs: globalFlags.Chains, DriverAddress: symbiotic.CrossChainAddress{ ChainId: globalFlags.DriverChainId, Address: common.HexToAddress(globalFlags.DriverAddress), }, RequestTimeout: 5 * time.Second, KeyProvider: kp, Metrics: metrics.New(metrics.Config{}), }) if err != nil { return err } currentOnchainEpoch, err := evmClient.GetCurrentEpoch(ctx) if err != nil { return errors.Errorf("failed to get current epoch: %w", err) } captureTimestamp, err := evmClient.GetEpochStart(ctx, currentOnchainEpoch) if err != nil { return errors.Errorf("failed to get capture timestamp: %w", err) } networkConfig, err := evmClient.GetConfig(ctx, captureTimestamp, currentOnchainEpoch) if err != nil { return errors.Errorf("failed to get config: %w", err) } if len(networkConfig.VotingPowerProviders) == 0 { return errors.New("no voting power providers found in network config") } votingPowerProvider, err := findVotingPowerProviderByChainId(networkConfig.VotingPowerProviders, globalFlags.VotingProviderChainId) if err != nil { return err } // Load the operator key for the voting power provider's chain privateKeyInput := pterm.DefaultInteractiveTextInput.WithMask("*") secret, ok := unregisterOperatorFlags.Secrets.Secrets[votingPowerProvider.ChainId] if !ok { secret, _ = privateKeyInput.Show("Enter operator private key for chain with ID: " + strconv.Itoa(int(votingPowerProvider.ChainId))) } pk, err := symbioticCrypto.NewPrivateKey(symbiotic.KeyTypeEcdsaSecp256k1, common.FromHex(secret)) if err != nil { return err } err = kp.AddKeyByNamespaceTypeId( keyprovider.EVM_KEY_NAMESPACE, symbiotic.KeyTypeEcdsaSecp256k1, int(votingPowerProvider.ChainId), pk, ) if err != nil { return err } txResult, err := evmClient.UnregisterOperatorVotingPowerProvider(ctx, votingPowerProvider) if err != nil { return errors.Errorf("failed to unregister operator: %w", err) } pterm.Success.Println("Operator unregistered! TxHash:", txResult.TxHash.String()) return nil }, } ⋮---- // Load the operator key for the voting power provider's chain ```` ## File: cmd/utils/operator/unregister_with_signature.go ````go package operator ⋮---- import ( "strconv" "time" "github.com/symbioticfi/relay/internal/usecase/metrics" "github.com/symbioticfi/relay/symbiotic/client/evm" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/math" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/signer/core/apitypes" "github.com/go-errors/errors" "github.com/pterm/pterm" "github.com/spf13/cobra" ) ⋮---- "strconv" "time" ⋮---- "github.com/symbioticfi/relay/internal/usecase/metrics" "github.com/symbioticfi/relay/symbiotic/client/evm" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/math" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/signer/core/apitypes" "github.com/go-errors/errors" "github.com/pterm/pterm" "github.com/spf13/cobra" ⋮---- var unregisterOperatorWithSignatureCmd = &cobra.Command{ Use: "unregister-operator-with-signature", Short: "Generate EIP-712 signature for operator unregistration", RunE: func(cmd *cobra.Command, args []string) error { ctx := signalContext(cmd.Context()) evmClient, err := evm.NewEvmClient(ctx, evm.Config{ ChainURLs: globalFlags.Chains, DriverAddress: symbiotic.CrossChainAddress{ ChainId: globalFlags.DriverChainId, Address: common.HexToAddress(globalFlags.DriverAddress), }, RequestTimeout: 5 * time.Second, Metrics: metrics.New(metrics.Config{}), }) if err != nil { return err } privateKeyInput := pterm.DefaultInteractiveTextInput.WithMask("*") secret, ok := unregisterOperatorWithSignatureFlags.Secrets.Secrets[globalFlags.DriverChainId] if !ok { secret, _ = privateKeyInput.Show("Enter operator private key for chain with ID: " + strconv.Itoa(int(globalFlags.DriverChainId))) } ecdsaPk, err := crypto.HexToECDSA(secret) if err != nil { return errors.Errorf("failed to parse private key: %w", err) } operator := crypto.PubkeyToAddress(ecdsaPk.PublicKey) currentOnchainEpoch, err := evmClient.GetCurrentEpoch(ctx) if err != nil { return errors.Errorf("failed to get current epoch: %w", err) } captureTimestamp, err := evmClient.GetEpochStart(ctx, currentOnchainEpoch) if err != nil { return errors.Errorf("failed to get capture timestamp: %w", err) } networkConfig, err := evmClient.GetConfig(ctx, captureTimestamp, currentOnchainEpoch) if err != nil { return errors.Errorf("failed to get config: %w", err) } // Find VotingPowerProvider by chain ID if len(networkConfig.VotingPowerProviders) == 0 { return errors.New("no voting power providers found in network config") } votingPowerProvider, err := findVotingPowerProviderByChainId(networkConfig.VotingPowerProviders, globalFlags.VotingProviderChainId) if err != nil { return err } eip712Domain, err := evmClient.GetVotingPowerProviderEip712Domain(ctx, votingPowerProvider) if err != nil { return errors.Errorf("failed to get eip712 domain: %w", err) } nonce, err := evmClient.GetOperatorNonce(ctx, votingPowerProvider, operator) if err != nil { return errors.Errorf("failed to get operator nonce: %w", err) } // Build EIP-712 typed data for UnregisterOperator typedData := apitypes.TypedData{ Types: apitypes.Types{ "EIP712Domain": []apitypes.Type{ {Name: "name", Type: "string"}, {Name: "version", Type: "string"}, {Name: "chainId", Type: "uint256"}, {Name: "verifyingContract", Type: "address"}, }, "UnregisterOperator": []apitypes.Type{ {Name: "operator", Type: "address"}, {Name: "nonce", Type: "uint256"}, }, }, PrimaryType: "UnregisterOperator", Domain: apitypes.TypedDataDomain{ Name: eip712Domain.Name, Version: eip712Domain.Version, ChainId: (*math.HexOrDecimal256)(eip712Domain.ChainId), VerifyingContract: eip712Domain.VerifyingContract.Hex(), }, Message: apitypes.TypedDataMessage{ "operator": operator.Hex(), "nonce": (*math.HexOrDecimal256)(nonce), }, } typedDataHash, _, err := apitypes.TypedDataAndHash(typedData) if err != nil { return errors.Errorf("failed to hash typed data: %w", err) } signature, err := crypto.Sign(typedDataHash, ecdsaPk) if err != nil { return errors.Errorf("failed to sign: %w", err) } // Ethereum expects recovery ID to be 27 or 28, not 0 or 1 if len(signature) == 65 { signature[64] += 27 } pterm.Success.Printf("0x%x\n", signature) return nil }, } ⋮---- // Find VotingPowerProvider by chain ID ⋮---- // Build EIP-712 typed data for UnregisterOperator ⋮---- // Ethereum expects recovery ID to be 27 or 28, not 0 or 1 ```` ## File: cmd/utils/root/root.go ````go package root ⋮---- import ( "runtime" "github.com/symbioticfi/relay/cmd/utils/keys" "github.com/symbioticfi/relay/cmd/utils/network" "github.com/symbioticfi/relay/cmd/utils/operator" "github.com/symbioticfi/relay/pkg/log" "github.com/pterm/pterm" "github.com/spf13/cobra" ) ⋮---- "runtime" ⋮---- "github.com/symbioticfi/relay/cmd/utils/keys" "github.com/symbioticfi/relay/cmd/utils/network" "github.com/symbioticfi/relay/cmd/utils/operator" "github.com/symbioticfi/relay/pkg/log" ⋮---- "github.com/pterm/pterm" "github.com/spf13/cobra" ⋮---- type config struct { logLevel string logMode string } ⋮---- var Version = "local" var BuildTime = "unknown" ⋮---- var cfg config ⋮---- func NewRootCommand() *cobra.Command ⋮---- var rootCmd = &cobra.Command{ Use: "utils", Short: "Utils tool", PreRun: func(cmd *cobra.Command, args []string) { log.Init(cfg.logLevel, cfg.logMode) }, } ⋮---- var versionCommand = &cobra.Command{ Use: "version", Short: "Print the version of the utils tool", Run: func(cmd *cobra.Command, args []string) { pterm.Info.Println("Utils tool version:", Version) pterm.Info.Println("Go version:", runtime.Version()) pterm.Info.Println("OS/Arch:", runtime.GOOS+"/"+runtime.GOARCH) pterm.Info.Println("Build time:", BuildTime) }, } ```` ## File: cmd/utils/main.go ````go package main ⋮---- import ( "os" "github.com/pterm/pterm" "github.com/symbioticfi/relay/cmd/utils/root" ) ⋮---- "os" ⋮---- "github.com/pterm/pterm" "github.com/symbioticfi/relay/cmd/utils/root" ⋮---- func main() ```` ## File: docs/api/v1/api.swagger.json ````json { "swagger": "2.0", "info": { "title": "v1/api.proto", "version": "version not set" }, "tags": [ { "name": "SymbioticAPIService" } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "paths": { "/v1/aggregation/proof/{requestId}": { "get": { "summary": "Get aggregation proof", "operationId": "SymbioticAPIService_GetAggregationProof", "responses": { "200": { "description": "A successful response.", "schema": { "$ref": "#/definitions/GetAggregationProofResponse" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Status" } } }, "parameters": [ { "name": "requestId", "in": "path", "required": true, "type": "string" } ], "tags": [ "SymbioticAPIService" ] } }, "/v1/aggregation/proofs/epoch/{epoch}": { "get": { "summary": "Get aggregation proofs by epoch", "operationId": "SymbioticAPIService_GetAggregationProofsByEpoch", "responses": { "200": { "description": "A successful response.", "schema": { "$ref": "#/definitions/GetAggregationProofsByEpochResponse" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Status" } } }, "parameters": [ { "name": "epoch", "description": "Epoch number", "in": "path", "required": true, "type": "string", "format": "uint64" } ], "tags": [ "SymbioticAPIService" ] } }, "/v1/aggregation/status/{requestId}": { "get": { "summary": "Get aggregation status, can be sent only to aggregator nodes", "operationId": "SymbioticAPIService_GetAggregationStatus", "responses": { "200": { "description": "A successful response.", "schema": { "$ref": "#/definitions/GetAggregationStatusResponse" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Status" } } }, "parameters": [ { "name": "requestId", "in": "path", "required": true, "type": "string" } ], "tags": [ "SymbioticAPIService" ] } }, "/v1/committed/all": { "get": { "summary": "Get last committed epochs for all settlement chains", "operationId": "SymbioticAPIService_GetLastAllCommitted", "responses": { "200": { "description": "A successful response.", "schema": { "$ref": "#/definitions/GetLastAllCommittedResponse" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Status" } } }, "tags": [ "SymbioticAPIService" ] } }, "/v1/committed/chain/{settlementChainId}": { "get": { "summary": "Get last committed epoch for a specific settlement chain", "operationId": "SymbioticAPIService_GetLastCommitted", "responses": { "200": { "description": "A successful response.", "schema": { "$ref": "#/definitions/GetLastCommittedResponse" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Status" } } }, "parameters": [ { "name": "settlementChainId", "description": "Settlement chain ID", "in": "path", "required": true, "type": "string", "format": "uint64" } ], "tags": [ "SymbioticAPIService" ] } }, "/v1/epoch/current": { "get": { "summary": "Get current epoch", "operationId": "SymbioticAPIService_GetCurrentEpoch", "responses": { "200": { "description": "A successful response.", "schema": { "$ref": "#/definitions/GetCurrentEpochResponse" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Status" } } }, "tags": [ "SymbioticAPIService" ] } }, "/v1/sign": { "post": { "summary": "Sign a message", "operationId": "SymbioticAPIService_SignMessage", "responses": { "200": { "description": "A successful response.", "schema": { "$ref": "#/definitions/SignMessageResponse" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Status" } } }, "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/SignMessageRequest" } } ], "tags": [ "SymbioticAPIService" ] } }, "/v1/signature-request-ids/epoch/{epoch}": { "get": { "summary": "Get all signature request IDs by epoch", "operationId": "SymbioticAPIService_GetSignatureRequestIDsByEpoch", "responses": { "200": { "description": "A successful response.", "schema": { "$ref": "#/definitions/GetSignatureRequestIDsByEpochResponse" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Status" } } }, "parameters": [ { "name": "epoch", "description": "Epoch number", "in": "path", "required": true, "type": "string", "format": "uint64" } ], "tags": [ "SymbioticAPIService" ] } }, "/v1/signature-request/{requestId}": { "get": { "summary": "Get signature request by request id", "operationId": "SymbioticAPIService_GetSignatureRequest", "responses": { "200": { "description": "A successful response.", "schema": { "$ref": "#/definitions/GetSignatureRequestResponse" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Status" } } }, "parameters": [ { "name": "requestId", "in": "path", "required": true, "type": "string" } ], "tags": [ "SymbioticAPIService" ] } }, "/v1/signature-requests/epoch/{epoch}": { "get": { "summary": "Get all signature requests by epoch", "operationId": "SymbioticAPIService_GetSignatureRequestsByEpoch", "responses": { "200": { "description": "A successful response.", "schema": { "$ref": "#/definitions/GetSignatureRequestsByEpochResponse" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Status" } } }, "parameters": [ { "name": "epoch", "description": "Epoch number", "in": "path", "required": true, "type": "string", "format": "uint64" } ], "tags": [ "SymbioticAPIService" ] } }, "/v1/signatures/epoch/{epoch}": { "get": { "summary": "Get signature by epoch", "operationId": "SymbioticAPIService_GetSignaturesByEpoch", "responses": { "200": { "description": "A successful response.", "schema": { "$ref": "#/definitions/GetSignaturesByEpochResponse" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Status" } } }, "parameters": [ { "name": "epoch", "description": "Epoch number", "in": "path", "required": true, "type": "string", "format": "uint64" } ], "tags": [ "SymbioticAPIService" ] } }, "/v1/signatures/{requestId}": { "get": { "summary": "Get signature by request id", "operationId": "SymbioticAPIService_GetSignatures", "responses": { "200": { "description": "A successful response.", "schema": { "$ref": "#/definitions/GetSignaturesResponse" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Status" } } }, "parameters": [ { "name": "requestId", "in": "path", "required": true, "type": "string" } ], "tags": [ "SymbioticAPIService" ] } }, "/v1/stream/proofs": { "get": { "summary": "Stream aggregation proofs in real-time. If start_epoch is provided, sends historical data first", "operationId": "SymbioticAPIService_ListenProofs", "responses": { "200": { "description": "A successful response.(streaming responses)", "schema": { "type": "object", "properties": { "result": { "$ref": "#/definitions/ListenProofsResponse" }, "error": { "$ref": "#/definitions/Status" } }, "title": "Stream result of ListenProofsResponse" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Status" } } }, "parameters": [ { "name": "startEpoch", "description": "Optional: start epoch. If provided, stream will first send all historical proofs starting from this epoch, then continue with real-time updates\nIf not provided, only proofs generated after stream creation will be sent", "in": "query", "required": false, "type": "string", "format": "uint64" } ], "tags": [ "SymbioticAPIService" ] } }, "/v1/stream/signatures": { "get": { "summary": "Stream signatures in real-time. If start_epoch is provided, sends historical data first", "operationId": "SymbioticAPIService_ListenSignatures", "responses": { "200": { "description": "A successful response.(streaming responses)", "schema": { "type": "object", "properties": { "result": { "$ref": "#/definitions/ListenSignaturesResponse" }, "error": { "$ref": "#/definitions/Status" } }, "title": "Stream result of ListenSignaturesResponse" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Status" } } }, "parameters": [ { "name": "startEpoch", "description": "Optional: start epoch. If provided, stream will first send all historical signatures starting from this epoch, then continue with real-time updates\nIf not provided, only signatures generated after stream creation will be sent", "in": "query", "required": false, "type": "string", "format": "uint64" } ], "tags": [ "SymbioticAPIService" ] } }, "/v1/stream/validator-set": { "get": { "summary": "Stream validator set changes in real-time. If start_epoch is provided, sends historical data first", "operationId": "SymbioticAPIService_ListenValidatorSet", "responses": { "200": { "description": "A successful response.(streaming responses)", "schema": { "type": "object", "properties": { "result": { "$ref": "#/definitions/ListenValidatorSetResponse" }, "error": { "$ref": "#/definitions/Status" } }, "title": "Stream result of ListenValidatorSetResponse" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Status" } } }, "parameters": [ { "name": "startEpoch", "description": "Optional: start epoch. If provided, stream will first send all historical validator sets starting from this epoch, then continue with real-time updates\nIf not provided, only validator sets generated after stream creation will be sent", "in": "query", "required": false, "type": "string", "format": "uint64" } ], "tags": [ "SymbioticAPIService" ] } }, "/v1/validator-set": { "get": { "summary": "Get current validator set", "operationId": "SymbioticAPIService_GetValidatorSet", "responses": { "200": { "description": "A successful response.", "schema": { "$ref": "#/definitions/GetValidatorSetResponse" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Status" } } }, "parameters": [ { "name": "epoch", "description": "Epoch number (optional, if not provided current epoch will be used)", "in": "query", "required": false, "type": "string", "format": "uint64" } ], "tags": [ "SymbioticAPIService" ] } }, "/v1/validator-set/header": { "get": { "summary": "Get validator set header", "operationId": "SymbioticAPIService_GetValidatorSetHeader", "responses": { "200": { "description": "A successful response.", "schema": { "$ref": "#/definitions/GetValidatorSetHeaderResponse" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Status" } } }, "parameters": [ { "name": "epoch", "description": "Epoch number (optional, if not provided current epoch will be used)", "in": "query", "required": false, "type": "string", "format": "uint64" } ], "tags": [ "SymbioticAPIService" ] } }, "/v1/validator-set/metadata": { "get": { "summary": "Get validator set metadata like extra data and request id to fetch aggregation and signature requests", "operationId": "SymbioticAPIService_GetValidatorSetMetadata", "responses": { "200": { "description": "A successful response.", "schema": { "$ref": "#/definitions/GetValidatorSetMetadataResponse" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Status" } } }, "parameters": [ { "name": "epoch", "description": "Epoch number (optional, if not provided current epoch will be used)", "in": "query", "required": false, "type": "string", "format": "uint64" } ], "tags": [ "SymbioticAPIService" ] } }, "/v1/validator/address/{address}": { "get": { "summary": "Get validator by address", "operationId": "SymbioticAPIService_GetValidatorByAddress", "responses": { "200": { "description": "A successful response.", "schema": { "$ref": "#/definitions/GetValidatorByAddressResponse" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Status" } } }, "parameters": [ { "name": "address", "description": "Validator address (required)", "in": "path", "required": true, "type": "string" }, { "name": "epoch", "description": "Epoch number (optional, if not provided current epoch will be used)", "in": "query", "required": false, "type": "string", "format": "uint64" } ], "tags": [ "SymbioticAPIService" ] } }, "/v1/validator/key/{keyTag}/{onChainKey}": { "get": { "summary": "Get validator by key", "operationId": "SymbioticAPIService_GetValidatorByKey", "responses": { "200": { "description": "A successful response.", "schema": { "$ref": "#/definitions/GetValidatorByKeyResponse" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Status" } } }, "parameters": [ { "name": "keyTag", "description": "Validator key tag (required)", "in": "path", "required": true, "type": "integer", "format": "int64" }, { "name": "onChainKey", "description": "Validator on chain (public) key (required)", "in": "path", "required": true, "type": "string", "format": "byte" }, { "name": "epoch", "description": "Epoch number (optional, if not provided current epoch will be used)", "in": "query", "required": false, "type": "string", "format": "uint64" } ], "tags": [ "SymbioticAPIService" ] } }, "/v1/validator/local": { "get": { "summary": "Get local validator", "operationId": "SymbioticAPIService_GetLocalValidator", "responses": { "200": { "description": "A successful response.", "schema": { "$ref": "#/definitions/GetLocalValidatorResponse" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Status" } } }, "parameters": [ { "name": "epoch", "description": "Epoch number (optional, if not provided current epoch will be used)", "in": "query", "required": false, "type": "string", "format": "uint64" } ], "tags": [ "SymbioticAPIService" ] } } }, "definitions": { "AggregationProof": { "type": "object", "properties": { "messageHash": { "type": "string", "format": "byte", "title": "Message hash" }, "proof": { "type": "string", "format": "byte", "title": "Proof data" }, "requestId": { "type": "string", "title": "Request ID" } }, "title": "Response message for getting aggregation proof" }, "Any": { "type": "object", "properties": { "@type": { "type": "string" } }, "additionalProperties": {} }, "ChainEpochInfo": { "type": "object", "properties": { "lastCommittedEpoch": { "type": "string", "format": "uint64", "title": "Last committed epoch for this chain" }, "startTime": { "type": "string", "format": "date-time", "title": "Epoch start time" } }, "title": "Settlement chain with its last committed epoch" }, "ExtraData": { "type": "object", "properties": { "key": { "type": "string", "format": "byte" }, "value": { "type": "string", "format": "byte" } } }, "GetAggregationProofResponse": { "type": "object", "properties": { "aggregationProof": { "$ref": "#/definitions/AggregationProof" } }, "title": "Response message for getting aggregation proof" }, "GetAggregationProofsByEpochResponse": { "type": "object", "properties": { "aggregationProofs": { "type": "array", "items": { "type": "object", "$ref": "#/definitions/AggregationProof" } } }, "title": "Response message for getting aggregation proof" }, "GetAggregationStatusResponse": { "type": "object", "properties": { "currentVotingPower": { "type": "string", "title": "Current voting power of the aggregator (big integer as string)" }, "signerOperators": { "type": "array", "items": { "type": "string" }, "title": "List of operator addresses that signed the request" } }, "title": "Response message for getting aggregation status" }, "GetCurrentEpochResponse": { "type": "object", "properties": { "epoch": { "type": "string", "format": "uint64", "title": "Epoch number" }, "startTime": { "type": "string", "format": "date-time", "title": "Epoch start time" } }, "title": "Response message for getting current epoch" }, "GetLastAllCommittedResponse": { "type": "object", "properties": { "epochInfos": { "type": "object", "additionalProperties": { "$ref": "#/definitions/ChainEpochInfo" }, "title": "List of settlement chains with their last committed epochs" }, "suggestedEpochInfo": { "$ref": "#/definitions/ChainEpochInfo", "title": "Suggested epoch info for signatures, it is the minimum commited epoch among all chains" } }, "title": "Response message for getting all last committed epochs" }, "GetLastCommittedResponse": { "type": "object", "properties": { "settlementChainId": { "type": "string", "format": "uint64", "title": "Settlement chain ID" }, "epochInfo": { "$ref": "#/definitions/ChainEpochInfo" } }, "title": "Response message for getting last committed epoch" }, "GetLocalValidatorResponse": { "type": "object", "properties": { "validator": { "$ref": "#/definitions/Validator", "title": "The validator" } }, "title": "Response message for getting local validator" }, "GetSignatureRequestIDsByEpochResponse": { "type": "object", "properties": { "requestIds": { "type": "array", "items": { "type": "string" }, "title": "List of all signature request IDs for the epoch" } }, "title": "Response message for getting all signature request IDs by epoch" }, "GetSignatureRequestResponse": { "type": "object", "properties": { "signatureRequest": { "$ref": "#/definitions/SignatureRequest" } }, "title": "Response message for getting signature request" }, "GetSignatureRequestsByEpochResponse": { "type": "object", "properties": { "signatureRequests": { "type": "array", "items": { "type": "object", "$ref": "#/definitions/SignatureRequest" }, "title": "List of all signature requests for the epoch" } }, "title": "Response message for getting all signature requests by epoch" }, "GetSignaturesByEpochResponse": { "type": "object", "properties": { "signatures": { "type": "array", "items": { "type": "object", "$ref": "#/definitions/Signature" }, "title": "List of signatures" } }, "title": "Response message for getting signatures by epoch" }, "GetSignaturesResponse": { "type": "object", "properties": { "signatures": { "type": "array", "items": { "type": "object", "$ref": "#/definitions/Signature" }, "title": "List of signatures" } }, "title": "Response message for getting signatures" }, "GetValidatorByAddressResponse": { "type": "object", "properties": { "validator": { "$ref": "#/definitions/Validator", "title": "The validator" } }, "title": "Response message for getting validator by address" }, "GetValidatorByKeyResponse": { "type": "object", "properties": { "validator": { "$ref": "#/definitions/Validator", "title": "The validator" } }, "title": "Response message for getting validator by key" }, "GetValidatorSetHeaderResponse": { "type": "object", "properties": { "version": { "type": "integer", "format": "int64", "title": "Version of the validator set" }, "requiredKeyTag": { "type": "integer", "format": "int64", "title": "Key tag required to commit next validator set" }, "epoch": { "type": "string", "format": "uint64", "title": "Validator set epoch" }, "captureTimestamp": { "type": "string", "format": "date-time", "title": "Epoch capture timestamp" }, "quorumThreshold": { "type": "string", "title": "Quorum threshold (big integer as string)" }, "totalVotingPower": { "type": "string", "title": "Total voting power (big integer as string)" }, "validatorsSszMroot": { "type": "string", "title": "Validators SSZ Merkle root (hex string)" } }, "title": "Response message for getting validator set header" }, "GetValidatorSetMetadataResponse": { "type": "object", "properties": { "extraData": { "type": "array", "items": { "type": "object", "$ref": "#/definitions/ExtraData" } }, "commitmentData": { "type": "string", "format": "byte" }, "requestId": { "type": "string" } }, "title": "Response message for getting validator set header" }, "GetValidatorSetResponse": { "type": "object", "properties": { "validatorSet": { "$ref": "#/definitions/ValidatorSet", "title": "The validator set" } }, "title": "Response message for getting validator set" }, "Key": { "type": "object", "properties": { "tag": { "type": "integer", "format": "int64", "title": "Key tag identifier (0-127)" }, "payload": { "type": "string", "format": "byte", "title": "Key payload" } }, "title": "Cryptographic key" }, "ListenProofsResponse": { "type": "object", "properties": { "requestId": { "type": "string", "title": "Id of the request" }, "epoch": { "type": "string", "format": "uint64", "title": "Epoch number" }, "aggregationProof": { "$ref": "#/definitions/AggregationProof", "title": "Final aggregation proof" } }, "title": "Response message for aggregation proofs stream" }, "ListenSignaturesResponse": { "type": "object", "properties": { "requestId": { "type": "string", "title": "Id of the signature request" }, "epoch": { "type": "string", "format": "uint64", "title": "Epoch number" }, "signature": { "$ref": "#/definitions/Signature", "title": "Signature data" } }, "title": "Response message for signatures stream" }, "ListenValidatorSetResponse": { "type": "object", "properties": { "validatorSet": { "$ref": "#/definitions/ValidatorSet", "title": "The validator set" } }, "title": "Response message for validator set changes stream" }, "SignMessageRequest": { "type": "object", "properties": { "keyTag": { "type": "integer", "format": "int64", "title": "Key tag identifier (0-127)" }, "message": { "type": "string", "format": "byte", "title": "Message to be signed" }, "requiredEpoch": { "type": "string", "format": "uint64", "title": "Required epoch (optional, if not provided latest committed epoch will be used)" } }, "title": "Request message for signing a message" }, "SignMessageResponse": { "type": "object", "properties": { "requestId": { "type": "string", "title": "Hash of the signature request" }, "epoch": { "type": "string", "format": "uint64", "title": "Epoch number" } }, "title": "Response message for sign message request" }, "Signature": { "type": "object", "properties": { "signature": { "type": "string", "format": "byte", "title": "Signature data" }, "messageHash": { "type": "string", "format": "byte", "title": "Message hash" }, "publicKey": { "type": "string", "format": "byte", "title": "Public key" }, "requestId": { "type": "string", "title": "Request ID" } }, "title": "Digital signature" }, "SignatureRequest": { "type": "object", "properties": { "requestId": { "type": "string", "title": "Request ID" }, "keyTag": { "type": "integer", "format": "int64", "title": "Key tag identifier (0-127)" }, "message": { "type": "string", "format": "byte", "title": "Message to be signed" }, "requiredEpoch": { "type": "string", "format": "uint64", "title": "Required epoch" } }, "title": "SignatureRequest represents a signature request" }, "Status": { "type": "object", "properties": { "code": { "type": "integer", "format": "int32" }, "message": { "type": "string" }, "details": { "type": "array", "items": { "type": "object", "$ref": "#/definitions/Any" } } } }, "Validator": { "type": "object", "properties": { "operator": { "type": "string", "title": "Operator address (hex string)" }, "votingPower": { "type": "string", "title": "Voting power of the validator (big integer as string)" }, "isActive": { "type": "boolean", "title": "Indicates if the validator is active" }, "keys": { "type": "array", "items": { "type": "object", "$ref": "#/definitions/Key" }, "title": "List of cryptographic keys" }, "vaults": { "type": "array", "items": { "type": "object", "$ref": "#/definitions/ValidatorVault" }, "title": "List of validator vaults" } }, "title": "Validator information" }, "ValidatorSet": { "type": "object", "properties": { "version": { "type": "integer", "format": "int64", "title": "Version of the validator set" }, "requiredKeyTag": { "type": "integer", "format": "int64", "title": "Key tag required to commit next validator set" }, "epoch": { "type": "string", "format": "uint64", "title": "Validator set epoch" }, "captureTimestamp": { "type": "string", "format": "date-time", "title": "Epoch capture timestamp" }, "quorumThreshold": { "type": "string", "title": "Quorum threshold (big integer as string)" }, "status": { "$ref": "#/definitions/ValidatorSetStatus", "title": "Status of validator set header" }, "validators": { "type": "array", "items": { "type": "object", "$ref": "#/definitions/Validator" }, "title": "List of validators" } } }, "ValidatorSetStatus": { "type": "string", "enum": [ "VALIDATOR_SET_STATUS_UNSPECIFIED", "VALIDATOR_SET_STATUS_DERIVED", "VALIDATOR_SET_STATUS_AGGREGATED", "VALIDATOR_SET_STATUS_COMMITTED", "VALIDATOR_SET_STATUS_MISSED" ], "default": "VALIDATOR_SET_STATUS_UNSPECIFIED", "description": "- VALIDATOR_SET_STATUS_UNSPECIFIED: Default/unknown status\n - VALIDATOR_SET_STATUS_DERIVED: Derived status\n - VALIDATOR_SET_STATUS_AGGREGATED: Aggregated status\n - VALIDATOR_SET_STATUS_COMMITTED: Committed status\n - VALIDATOR_SET_STATUS_MISSED: Missed status", "title": "Validator set status enumeration" }, "ValidatorVault": { "type": "object", "properties": { "chainId": { "type": "string", "format": "uint64", "title": "Chain identifier" }, "vault": { "type": "string", "title": "Vault address" }, "votingPower": { "type": "string", "title": "Voting power for this vault (big integer as string)" } }, "title": "Validator vault information" } } } ```` ## File: docs/api/v1/doc.md ````markdown # Protocol Documentation ## Table of Contents - [v1/api.proto](#v1_api-proto) - [AggregationProof](#api-proto-v1-AggregationProof) - [ChainEpochInfo](#api-proto-v1-ChainEpochInfo) - [ExtraData](#api-proto-v1-ExtraData) - [GetAggregationProofRequest](#api-proto-v1-GetAggregationProofRequest) - [GetAggregationProofResponse](#api-proto-v1-GetAggregationProofResponse) - [GetAggregationProofsByEpochRequest](#api-proto-v1-GetAggregationProofsByEpochRequest) - [GetAggregationProofsByEpochResponse](#api-proto-v1-GetAggregationProofsByEpochResponse) - [GetAggregationStatusRequest](#api-proto-v1-GetAggregationStatusRequest) - [GetAggregationStatusResponse](#api-proto-v1-GetAggregationStatusResponse) - [GetCurrentEpochRequest](#api-proto-v1-GetCurrentEpochRequest) - [GetCurrentEpochResponse](#api-proto-v1-GetCurrentEpochResponse) - [GetLastAllCommittedRequest](#api-proto-v1-GetLastAllCommittedRequest) - [GetLastAllCommittedResponse](#api-proto-v1-GetLastAllCommittedResponse) - [GetLastAllCommittedResponse.EpochInfosEntry](#api-proto-v1-GetLastAllCommittedResponse-EpochInfosEntry) - [GetLastCommittedRequest](#api-proto-v1-GetLastCommittedRequest) - [GetLastCommittedResponse](#api-proto-v1-GetLastCommittedResponse) - [GetLocalValidatorRequest](#api-proto-v1-GetLocalValidatorRequest) - [GetLocalValidatorResponse](#api-proto-v1-GetLocalValidatorResponse) - [GetSignatureRequestIDsByEpochRequest](#api-proto-v1-GetSignatureRequestIDsByEpochRequest) - [GetSignatureRequestIDsByEpochResponse](#api-proto-v1-GetSignatureRequestIDsByEpochResponse) - [GetSignatureRequestRequest](#api-proto-v1-GetSignatureRequestRequest) - [GetSignatureRequestResponse](#api-proto-v1-GetSignatureRequestResponse) - [GetSignatureRequestsByEpochRequest](#api-proto-v1-GetSignatureRequestsByEpochRequest) - [GetSignatureRequestsByEpochResponse](#api-proto-v1-GetSignatureRequestsByEpochResponse) - [GetSignaturesByEpochRequest](#api-proto-v1-GetSignaturesByEpochRequest) - [GetSignaturesByEpochResponse](#api-proto-v1-GetSignaturesByEpochResponse) - [GetSignaturesRequest](#api-proto-v1-GetSignaturesRequest) - [GetSignaturesResponse](#api-proto-v1-GetSignaturesResponse) - [GetValidatorByAddressRequest](#api-proto-v1-GetValidatorByAddressRequest) - [GetValidatorByAddressResponse](#api-proto-v1-GetValidatorByAddressResponse) - [GetValidatorByKeyRequest](#api-proto-v1-GetValidatorByKeyRequest) - [GetValidatorByKeyResponse](#api-proto-v1-GetValidatorByKeyResponse) - [GetValidatorSetHeaderRequest](#api-proto-v1-GetValidatorSetHeaderRequest) - [GetValidatorSetHeaderResponse](#api-proto-v1-GetValidatorSetHeaderResponse) - [GetValidatorSetMetadataRequest](#api-proto-v1-GetValidatorSetMetadataRequest) - [GetValidatorSetMetadataResponse](#api-proto-v1-GetValidatorSetMetadataResponse) - [GetValidatorSetRequest](#api-proto-v1-GetValidatorSetRequest) - [GetValidatorSetResponse](#api-proto-v1-GetValidatorSetResponse) - [Key](#api-proto-v1-Key) - [ListenProofsRequest](#api-proto-v1-ListenProofsRequest) - [ListenProofsResponse](#api-proto-v1-ListenProofsResponse) - [ListenSignaturesRequest](#api-proto-v1-ListenSignaturesRequest) - [ListenSignaturesResponse](#api-proto-v1-ListenSignaturesResponse) - [ListenValidatorSetRequest](#api-proto-v1-ListenValidatorSetRequest) - [ListenValidatorSetResponse](#api-proto-v1-ListenValidatorSetResponse) - [SignMessageRequest](#api-proto-v1-SignMessageRequest) - [SignMessageResponse](#api-proto-v1-SignMessageResponse) - [Signature](#api-proto-v1-Signature) - [SignatureRequest](#api-proto-v1-SignatureRequest) - [Validator](#api-proto-v1-Validator) - [ValidatorSet](#api-proto-v1-ValidatorSet) - [ValidatorVault](#api-proto-v1-ValidatorVault) - [ErrorCode](#api-proto-v1-ErrorCode) - [SigningStatus](#api-proto-v1-SigningStatus) - [ValidatorSetStatus](#api-proto-v1-ValidatorSetStatus) - [SymbioticAPIService](#api-proto-v1-SymbioticAPIService) - [Scalar Value Types](#scalar-value-types)

Top

## v1/api.proto ### AggregationProof Response message for getting aggregation proof | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | message_hash | [bytes](#bytes) | | Message hash | | proof | [bytes](#bytes) | | Proof data | | request_id | [string](#string) | | Request ID | ### ChainEpochInfo Settlement chain with its last committed epoch | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | last_committed_epoch | [uint64](#uint64) | | Last committed epoch for this chain | | start_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | Epoch start time | ### ExtraData | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | key | [bytes](#bytes) | | | | value | [bytes](#bytes) | | | ### GetAggregationProofRequest Request message for getting aggregation proof | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | request_id | [string](#string) | | | ### GetAggregationProofResponse Response message for getting aggregation proof | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | aggregation_proof | [AggregationProof](#api-proto-v1-AggregationProof) | | | ### GetAggregationProofsByEpochRequest Request message for getting aggregation proof | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | epoch | [uint64](#uint64) | | Epoch number | ### GetAggregationProofsByEpochResponse Response message for getting aggregation proof | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | aggregation_proofs | [AggregationProof](#api-proto-v1-AggregationProof) | repeated | | ### GetAggregationStatusRequest Request message for getting aggregation status | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | request_id | [string](#string) | | | ### GetAggregationStatusResponse Response message for getting aggregation status | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | current_voting_power | [string](#string) | | Current voting power of the aggregator (big integer as string) | | signer_operators | [string](#string) | repeated | List of operator addresses that signed the request | ### GetCurrentEpochRequest Request message for getting current epoch ### GetCurrentEpochResponse Response message for getting current epoch | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | epoch | [uint64](#uint64) | | Epoch number | | start_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | Epoch start time | ### GetLastAllCommittedRequest Request message for getting last committed epochs for all chains No parameters needed ### GetLastAllCommittedResponse Response message for getting all last committed epochs | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | epoch_infos | [GetLastAllCommittedResponse.EpochInfosEntry](#api-proto-v1-GetLastAllCommittedResponse-EpochInfosEntry) | repeated | List of settlement chains with their last committed epochs | | suggested_epoch_info | [ChainEpochInfo](#api-proto-v1-ChainEpochInfo) | | Suggested epoch info for signatures, it is the minimum commited epoch among all chains | ### GetLastAllCommittedResponse.EpochInfosEntry | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | key | [uint64](#uint64) | | | | value | [ChainEpochInfo](#api-proto-v1-ChainEpochInfo) | | | ### GetLastCommittedRequest Request message for getting last committed epoch for a specific settlement chain | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | settlement_chain_id | [uint64](#uint64) | | Settlement chain ID | ### GetLastCommittedResponse Response message for getting last committed epoch | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | settlement_chain_id | [uint64](#uint64) | | Settlement chain ID | | epoch_info | [ChainEpochInfo](#api-proto-v1-ChainEpochInfo) | | | ### GetLocalValidatorRequest Request message for getting local validator | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | epoch | [uint64](#uint64) | optional | Epoch number (optional, if not provided current epoch will be used) | ### GetLocalValidatorResponse Response message for getting local validator | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | validator | [Validator](#api-proto-v1-Validator) | | The validator | ### GetSignatureRequestIDsByEpochRequest Request message for getting all signature request IDs by epoch | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | epoch | [uint64](#uint64) | | Epoch number | ### GetSignatureRequestIDsByEpochResponse Response message for getting all signature request IDs by epoch | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | request_ids | [string](#string) | repeated | List of all signature request IDs for the epoch | ### GetSignatureRequestRequest Request message for getting signature request | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | request_id | [string](#string) | | | ### GetSignatureRequestResponse Response message for getting signature request | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | signature_request | [SignatureRequest](#api-proto-v1-SignatureRequest) | | | ### GetSignatureRequestsByEpochRequest Request message for getting all signature requests by epoch | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | epoch | [uint64](#uint64) | | Epoch number | ### GetSignatureRequestsByEpochResponse Response message for getting all signature requests by epoch | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | signature_requests | [SignatureRequest](#api-proto-v1-SignatureRequest) | repeated | List of all signature requests for the epoch | ### GetSignaturesByEpochRequest Request message for getting signatures by epoch | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | epoch | [uint64](#uint64) | | Epoch number | ### GetSignaturesByEpochResponse Response message for getting signatures by epoch | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | signatures | [Signature](#api-proto-v1-Signature) | repeated | List of signatures | ### GetSignaturesRequest Request message for getting signatures | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | request_id | [string](#string) | | | ### GetSignaturesResponse Response message for getting signatures | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | signatures | [Signature](#api-proto-v1-Signature) | repeated | List of signatures | ### GetValidatorByAddressRequest Request message for getting validator by address | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | epoch | [uint64](#uint64) | optional | Epoch number (optional, if not provided current epoch will be used) | | address | [string](#string) | | Validator address (required) | ### GetValidatorByAddressResponse Response message for getting validator by address | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | validator | [Validator](#api-proto-v1-Validator) | | The validator | ### GetValidatorByKeyRequest Request message for getting validator by key | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | epoch | [uint64](#uint64) | optional | Epoch number (optional, if not provided current epoch will be used) | | key_tag | [uint32](#uint32) | | Validator key tag (required) | | on_chain_key | [bytes](#bytes) | | Validator on chain (public) key (required) | ### GetValidatorByKeyResponse Response message for getting validator by key | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | validator | [Validator](#api-proto-v1-Validator) | | The validator | ### GetValidatorSetHeaderRequest Request message for getting validator set header | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | epoch | [uint64](#uint64) | optional | Epoch number (optional, if not provided current epoch will be used) | ### GetValidatorSetHeaderResponse Response message for getting validator set header | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | version | [uint32](#uint32) | | Version of the validator set | | required_key_tag | [uint32](#uint32) | | Key tag required to commit next validator set | | epoch | [uint64](#uint64) | | Validator set epoch | | capture_timestamp | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | Epoch capture timestamp | | quorum_threshold | [string](#string) | | Quorum threshold (big integer as string) | | total_voting_power | [string](#string) | | Total voting power (big integer as string) | | validators_ssz_mroot | [string](#string) | | Validators SSZ Merkle root (hex string) | ### GetValidatorSetMetadataRequest Request message for getting validator set metadata | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | epoch | [uint64](#uint64) | optional | Epoch number (optional, if not provided current epoch will be used) | ### GetValidatorSetMetadataResponse Response message for getting validator set header | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | extra_data | [ExtraData](#api-proto-v1-ExtraData) | repeated | | | commitment_data | [bytes](#bytes) | | | | request_id | [string](#string) | | | ### GetValidatorSetRequest Request message for getting validator set | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | epoch | [uint64](#uint64) | optional | Epoch number (optional, if not provided current epoch will be used) | ### GetValidatorSetResponse Response message for getting validator set | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | validator_set | [ValidatorSet](#api-proto-v1-ValidatorSet) | | The validator set | ### Key Cryptographic key | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | tag | [uint32](#uint32) | | Key tag identifier (0-127) | | payload | [bytes](#bytes) | | Key payload | ### ListenProofsRequest Request message for listening to aggregation proofs stream | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | start_epoch | [uint64](#uint64) | optional | Optional: start epoch. If provided, stream will first send all historical proofs starting from this epoch, then continue with real-time updates If not provided, only proofs generated after stream creation will be sent | ### ListenProofsResponse Response message for aggregation proofs stream | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | request_id | [string](#string) | | Id of the request | | epoch | [uint64](#uint64) | | Epoch number | | aggregation_proof | [AggregationProof](#api-proto-v1-AggregationProof) | | Final aggregation proof | ### ListenSignaturesRequest Request message for listening to signatures stream | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | start_epoch | [uint64](#uint64) | optional | Optional: start epoch. If provided, stream will first send all historical signatures starting from this epoch, then continue with real-time updates If not provided, only signatures generated after stream creation will be sent | ### ListenSignaturesResponse Response message for signatures stream | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | request_id | [string](#string) | | Id of the signature request | | epoch | [uint64](#uint64) | | Epoch number | | signature | [Signature](#api-proto-v1-Signature) | | Signature data | ### ListenValidatorSetRequest Request message for listening to validator set changes stream | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | start_epoch | [uint64](#uint64) | optional | Optional: start epoch. If provided, stream will first send all historical validator sets starting from this epoch, then continue with real-time updates If not provided, only validator sets generated after stream creation will be sent | ### ListenValidatorSetResponse Response message for validator set changes stream | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | validator_set | [ValidatorSet](#api-proto-v1-ValidatorSet) | | The validator set | ### SignMessageRequest Request message for signing a message | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | key_tag | [uint32](#uint32) | | Key tag identifier (0-127) | | message | [bytes](#bytes) | | Message to be signed | | required_epoch | [uint64](#uint64) | optional | Required epoch (optional, if not provided latest committed epoch will be used) | ### SignMessageResponse Response message for sign message request | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | request_id | [string](#string) | | Hash of the signature request | | epoch | [uint64](#uint64) | | Epoch number | ### Signature Digital signature | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | signature | [bytes](#bytes) | | Signature data | | message_hash | [bytes](#bytes) | | Message hash | | public_key | [bytes](#bytes) | | Public key | | request_id | [string](#string) | | Request ID | ### SignatureRequest SignatureRequest represents a signature request | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | request_id | [string](#string) | | Request ID | | key_tag | [uint32](#uint32) | | Key tag identifier (0-127) | | message | [bytes](#bytes) | | Message to be signed | | required_epoch | [uint64](#uint64) | | Required epoch | ### Validator Validator information | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | operator | [string](#string) | | Operator address (hex string) | | voting_power | [string](#string) | | Voting power of the validator (big integer as string) | | is_active | [bool](#bool) | | Indicates if the validator is active | | keys | [Key](#api-proto-v1-Key) | repeated | List of cryptographic keys | | vaults | [ValidatorVault](#api-proto-v1-ValidatorVault) | repeated | List of validator vaults | ### ValidatorSet | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | version | [uint32](#uint32) | | Version of the validator set | | required_key_tag | [uint32](#uint32) | | Key tag required to commit next validator set | | epoch | [uint64](#uint64) | | Validator set epoch | | capture_timestamp | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | Epoch capture timestamp | | quorum_threshold | [string](#string) | | Quorum threshold (big integer as string) | | status | [ValidatorSetStatus](#api-proto-v1-ValidatorSetStatus) | | Status of validator set header | | validators | [Validator](#api-proto-v1-Validator) | repeated | List of validators | ### ValidatorVault Validator vault information | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | chain_id | [uint64](#uint64) | | Chain identifier | | vault | [string](#string) | | Vault address | | voting_power | [string](#string) | | Voting power for this vault (big integer as string) | ### ErrorCode Error code enumeration | Name | Number | Description | | ---- | ------ | ----------- | | ERROR_CODE_UNSPECIFIED | 0 | Default/unknown error | | ERROR_CODE_NO_DATA | 1 | No data found | | ERROR_CODE_INTERNAL | 2 | Internal server error | | ERROR_CODE_NOT_AGGREGATOR | 3 | Not an aggregator node | ### SigningStatus Signing process status enumeration | Name | Number | Description | | ---- | ------ | ----------- | | SIGNING_STATUS_UNSPECIFIED | 0 | Default/unknown status | | SIGNING_STATUS_PENDING | 1 | Request has been created and is waiting for signatures | | SIGNING_STATUS_COMPLETED | 2 | Signing process completed successfully with proof | | SIGNING_STATUS_FAILED | 3 | Signing process failed | | SIGNING_STATUS_TIMEOUT | 4 | Signing request timed out | ### ValidatorSetStatus Validator set status enumeration | Name | Number | Description | | ---- | ------ | ----------- | | VALIDATOR_SET_STATUS_UNSPECIFIED | 0 | Default/unknown status | | VALIDATOR_SET_STATUS_DERIVED | 1 | Derived status | | VALIDATOR_SET_STATUS_AGGREGATED | 2 | Aggregated status | | VALIDATOR_SET_STATUS_COMMITTED | 3 | Committed status | | VALIDATOR_SET_STATUS_MISSED | 4 | Missed status | ### SymbioticAPIService SymbioticAPI provides access to the Symbiotic relay functions | Method Name | Request Type | Response Type | Description | | ----------- | ------------ | ------------- | ------------| | SignMessage | [SignMessageRequest](#api-proto-v1-SignMessageRequest) | [SignMessageResponse](#api-proto-v1-SignMessageResponse) | Sign a message | | GetAggregationProof | [GetAggregationProofRequest](#api-proto-v1-GetAggregationProofRequest) | [GetAggregationProofResponse](#api-proto-v1-GetAggregationProofResponse) | Get aggregation proof | | GetAggregationProofsByEpoch | [GetAggregationProofsByEpochRequest](#api-proto-v1-GetAggregationProofsByEpochRequest) | [GetAggregationProofsByEpochResponse](#api-proto-v1-GetAggregationProofsByEpochResponse) | Get aggregation proofs by epoch | | GetCurrentEpoch | [GetCurrentEpochRequest](#api-proto-v1-GetCurrentEpochRequest) | [GetCurrentEpochResponse](#api-proto-v1-GetCurrentEpochResponse) | Get current epoch | | GetSignatures | [GetSignaturesRequest](#api-proto-v1-GetSignaturesRequest) | [GetSignaturesResponse](#api-proto-v1-GetSignaturesResponse) | Get signature by request id | | GetSignaturesByEpoch | [GetSignaturesByEpochRequest](#api-proto-v1-GetSignaturesByEpochRequest) | [GetSignaturesByEpochResponse](#api-proto-v1-GetSignaturesByEpochResponse) | Get signature by epoch | | GetSignatureRequestIDsByEpoch | [GetSignatureRequestIDsByEpochRequest](#api-proto-v1-GetSignatureRequestIDsByEpochRequest) | [GetSignatureRequestIDsByEpochResponse](#api-proto-v1-GetSignatureRequestIDsByEpochResponse) | Get all signature request IDs by epoch | | GetSignatureRequestsByEpoch | [GetSignatureRequestsByEpochRequest](#api-proto-v1-GetSignatureRequestsByEpochRequest) | [GetSignatureRequestsByEpochResponse](#api-proto-v1-GetSignatureRequestsByEpochResponse) | Get all signature requests by epoch | | GetSignatureRequest | [GetSignatureRequestRequest](#api-proto-v1-GetSignatureRequestRequest) | [GetSignatureRequestResponse](#api-proto-v1-GetSignatureRequestResponse) | Get signature request by request id | | GetAggregationStatus | [GetAggregationStatusRequest](#api-proto-v1-GetAggregationStatusRequest) | [GetAggregationStatusResponse](#api-proto-v1-GetAggregationStatusResponse) | Get aggregation status, can be sent only to aggregator nodes | | GetValidatorSet | [GetValidatorSetRequest](#api-proto-v1-GetValidatorSetRequest) | [GetValidatorSetResponse](#api-proto-v1-GetValidatorSetResponse) | Get current validator set | | GetValidatorByAddress | [GetValidatorByAddressRequest](#api-proto-v1-GetValidatorByAddressRequest) | [GetValidatorByAddressResponse](#api-proto-v1-GetValidatorByAddressResponse) | Get validator by address | | GetValidatorByKey | [GetValidatorByKeyRequest](#api-proto-v1-GetValidatorByKeyRequest) | [GetValidatorByKeyResponse](#api-proto-v1-GetValidatorByKeyResponse) | Get validator by key | | GetLocalValidator | [GetLocalValidatorRequest](#api-proto-v1-GetLocalValidatorRequest) | [GetLocalValidatorResponse](#api-proto-v1-GetLocalValidatorResponse) | Get local validator | | GetValidatorSetHeader | [GetValidatorSetHeaderRequest](#api-proto-v1-GetValidatorSetHeaderRequest) | [GetValidatorSetHeaderResponse](#api-proto-v1-GetValidatorSetHeaderResponse) | Get validator set header | | GetLastCommitted | [GetLastCommittedRequest](#api-proto-v1-GetLastCommittedRequest) | [GetLastCommittedResponse](#api-proto-v1-GetLastCommittedResponse) | Get last committed epoch for a specific settlement chain | | GetLastAllCommitted | [GetLastAllCommittedRequest](#api-proto-v1-GetLastAllCommittedRequest) | [GetLastAllCommittedResponse](#api-proto-v1-GetLastAllCommittedResponse) | Get last committed epochs for all settlement chains | | GetValidatorSetMetadata | [GetValidatorSetMetadataRequest](#api-proto-v1-GetValidatorSetMetadataRequest) | [GetValidatorSetMetadataResponse](#api-proto-v1-GetValidatorSetMetadataResponse) | Get validator set metadata like extra data and request id to fetch aggregation and signature requests | | ListenSignatures | [ListenSignaturesRequest](#api-proto-v1-ListenSignaturesRequest) | [ListenSignaturesResponse](#api-proto-v1-ListenSignaturesResponse) stream | Stream signatures in real-time. If start_epoch is provided, sends historical data first | | ListenProofs | [ListenProofsRequest](#api-proto-v1-ListenProofsRequest) | [ListenProofsResponse](#api-proto-v1-ListenProofsResponse) stream | Stream aggregation proofs in real-time. If start_epoch is provided, sends historical data first | | ListenValidatorSet | [ListenValidatorSetRequest](#api-proto-v1-ListenValidatorSetRequest) | [ListenValidatorSetResponse](#api-proto-v1-ListenValidatorSetResponse) stream | Stream validator set changes in real-time. If start_epoch is provided, sends historical data first | ## Scalar Value Types | .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby | | ----------- | ----- | --- | ---- | ------ | -- | -- | --- | ---- | | double | | double | double | float | float64 | double | float | Float | | float | | float | float | float | float32 | float | float | Float | | int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | | int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | int64 | long | integer/string | Bignum | | uint32 | Uses variable-length encoding. | uint32 | int | int/long | uint32 | uint | integer | Bignum or Fixnum (as required) | | uint64 | Uses variable-length encoding. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum or Fixnum (as required) | | sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | | sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | int64 | long | integer/string | Bignum | | fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | uint32 | uint | integer | Bignum or Fixnum (as required) | | fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum | | sfixed32 | Always four bytes. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | | sfixed64 | Always eight bytes. | int64 | long | int/long | int64 | long | integer/string | Bignum | | bool | | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass | | string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) | | bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) | ```` ## File: docs/api/v1/index.html ````html Protocol Documentation

Protocol Documentation

Table of Contents

v1/api.proto

Top

AggregationProof

Response message for getting aggregation proof

FieldTypeLabelDescription
message_hash bytes

Message hash

proof bytes

Proof data

request_id string

Request ID

ChainEpochInfo

Settlement chain with its last committed epoch

FieldTypeLabelDescription
last_committed_epoch uint64

Last committed epoch for this chain

start_time google.protobuf.Timestamp

Epoch start time

ExtraData

FieldTypeLabelDescription
key bytes

value bytes

GetAggregationProofRequest

Request message for getting aggregation proof

FieldTypeLabelDescription
request_id string

GetAggregationProofResponse

Response message for getting aggregation proof

FieldTypeLabelDescription
aggregation_proof AggregationProof

GetAggregationProofsByEpochRequest

Request message for getting aggregation proof

FieldTypeLabelDescription
epoch uint64

Epoch number

GetAggregationProofsByEpochResponse

Response message for getting aggregation proof

FieldTypeLabelDescription
aggregation_proofs AggregationProof repeated

GetAggregationStatusRequest

Request message for getting aggregation status

FieldTypeLabelDescription
request_id string

GetAggregationStatusResponse

Response message for getting aggregation status

FieldTypeLabelDescription
current_voting_power string

Current voting power of the aggregator (big integer as string)

signer_operators string repeated

List of operator addresses that signed the request

GetCurrentEpochRequest

Request message for getting current epoch

GetCurrentEpochResponse

Response message for getting current epoch

FieldTypeLabelDescription
epoch uint64

Epoch number

start_time google.protobuf.Timestamp

Epoch start time

GetLastAllCommittedRequest

Request message for getting last committed epochs for all chains

No parameters needed

GetLastAllCommittedResponse

Response message for getting all last committed epochs

FieldTypeLabelDescription
epoch_infos GetLastAllCommittedResponse.EpochInfosEntry repeated

List of settlement chains with their last committed epochs

suggested_epoch_info ChainEpochInfo

Suggested epoch info for signatures, it is the minimum commited epoch among all chains

GetLastAllCommittedResponse.EpochInfosEntry

FieldTypeLabelDescription
key uint64

value ChainEpochInfo

GetLastCommittedRequest

Request message for getting last committed epoch for a specific settlement chain

FieldTypeLabelDescription
settlement_chain_id uint64

Settlement chain ID

GetLastCommittedResponse

Response message for getting last committed epoch

FieldTypeLabelDescription
settlement_chain_id uint64

Settlement chain ID

epoch_info ChainEpochInfo

GetLocalValidatorRequest

Request message for getting local validator

FieldTypeLabelDescription
epoch uint64 optional

Epoch number (optional, if not provided current epoch will be used)

GetLocalValidatorResponse

Response message for getting local validator

FieldTypeLabelDescription
validator Validator

The validator

GetSignatureRequestIDsByEpochRequest

Request message for getting all signature request IDs by epoch

FieldTypeLabelDescription
epoch uint64

Epoch number

GetSignatureRequestIDsByEpochResponse

Response message for getting all signature request IDs by epoch

FieldTypeLabelDescription
request_ids string repeated

List of all signature request IDs for the epoch

GetSignatureRequestRequest

Request message for getting signature request

FieldTypeLabelDescription
request_id string

GetSignatureRequestResponse

Response message for getting signature request

FieldTypeLabelDescription
signature_request SignatureRequest

GetSignatureRequestsByEpochRequest

Request message for getting all signature requests by epoch

FieldTypeLabelDescription
epoch uint64

Epoch number

GetSignatureRequestsByEpochResponse

Response message for getting all signature requests by epoch

FieldTypeLabelDescription
signature_requests SignatureRequest repeated

List of all signature requests for the epoch

GetSignaturesByEpochRequest

Request message for getting signatures by epoch

FieldTypeLabelDescription
epoch uint64

Epoch number

GetSignaturesByEpochResponse

Response message for getting signatures by epoch

FieldTypeLabelDescription
signatures Signature repeated

List of signatures

GetSignaturesRequest

Request message for getting signatures

FieldTypeLabelDescription
request_id string

GetSignaturesResponse

Response message for getting signatures

FieldTypeLabelDescription
signatures Signature repeated

List of signatures

GetValidatorByAddressRequest

Request message for getting validator by address

FieldTypeLabelDescription
epoch uint64 optional

Epoch number (optional, if not provided current epoch will be used)

address string

Validator address (required)

GetValidatorByAddressResponse

Response message for getting validator by address

FieldTypeLabelDescription
validator Validator

The validator

GetValidatorByKeyRequest

Request message for getting validator by key

FieldTypeLabelDescription
epoch uint64 optional

Epoch number (optional, if not provided current epoch will be used)

key_tag uint32

Validator key tag (required)

on_chain_key bytes

Validator on chain (public) key (required)

GetValidatorByKeyResponse

Response message for getting validator by key

FieldTypeLabelDescription
validator Validator

The validator

GetValidatorSetHeaderRequest

Request message for getting validator set header

FieldTypeLabelDescription
epoch uint64 optional

Epoch number (optional, if not provided current epoch will be used)

GetValidatorSetHeaderResponse

Response message for getting validator set header

FieldTypeLabelDescription
version uint32

Version of the validator set

required_key_tag uint32

Key tag required to commit next validator set

epoch uint64

Validator set epoch

capture_timestamp google.protobuf.Timestamp

Epoch capture timestamp

quorum_threshold string

Quorum threshold (big integer as string)

total_voting_power string

Total voting power (big integer as string)

validators_ssz_mroot string

Validators SSZ Merkle root (hex string)

GetValidatorSetMetadataRequest

Request message for getting validator set metadata

FieldTypeLabelDescription
epoch uint64 optional

Epoch number (optional, if not provided current epoch will be used)

GetValidatorSetMetadataResponse

Response message for getting validator set header

FieldTypeLabelDescription
extra_data ExtraData repeated

commitment_data bytes

request_id string

GetValidatorSetRequest

Request message for getting validator set

FieldTypeLabelDescription
epoch uint64 optional

Epoch number (optional, if not provided current epoch will be used)

GetValidatorSetResponse

Response message for getting validator set

FieldTypeLabelDescription
validator_set ValidatorSet

The validator set

Key

Cryptographic key

FieldTypeLabelDescription
tag uint32

Key tag identifier (0-127)

payload bytes

Key payload

ListenProofsRequest

Request message for listening to aggregation proofs stream

FieldTypeLabelDescription
start_epoch uint64 optional

Optional: start epoch. If provided, stream will first send all historical proofs starting from this epoch, then continue with real-time updates If not provided, only proofs generated after stream creation will be sent

ListenProofsResponse

Response message for aggregation proofs stream

FieldTypeLabelDescription
request_id string

Id of the request

epoch uint64

Epoch number

aggregation_proof AggregationProof

Final aggregation proof

ListenSignaturesRequest

Request message for listening to signatures stream

FieldTypeLabelDescription
start_epoch uint64 optional

Optional: start epoch. If provided, stream will first send all historical signatures starting from this epoch, then continue with real-time updates If not provided, only signatures generated after stream creation will be sent

ListenSignaturesResponse

Response message for signatures stream

FieldTypeLabelDescription
request_id string

Id of the signature request

epoch uint64

Epoch number

signature Signature

Signature data

ListenValidatorSetRequest

Request message for listening to validator set changes stream

FieldTypeLabelDescription
start_epoch uint64 optional

Optional: start epoch. If provided, stream will first send all historical validator sets starting from this epoch, then continue with real-time updates If not provided, only validator sets generated after stream creation will be sent

ListenValidatorSetResponse

Response message for validator set changes stream

FieldTypeLabelDescription
validator_set ValidatorSet

The validator set

SignMessageRequest

Request message for signing a message

FieldTypeLabelDescription
key_tag uint32

Key tag identifier (0-127)

message bytes

Message to be signed

required_epoch uint64 optional

Required epoch (optional, if not provided latest committed epoch will be used)

SignMessageResponse

Response message for sign message request

FieldTypeLabelDescription
request_id string

Hash of the signature request

epoch uint64

Epoch number

Signature

Digital signature

FieldTypeLabelDescription
signature bytes

Signature data

message_hash bytes

Message hash

public_key bytes

Public key

request_id string

Request ID

SignatureRequest

SignatureRequest represents a signature request

FieldTypeLabelDescription
request_id string

Request ID

key_tag uint32

Key tag identifier (0-127)

message bytes

Message to be signed

required_epoch uint64

Required epoch

Validator

Validator information

FieldTypeLabelDescription
operator string

Operator address (hex string)

voting_power string

Voting power of the validator (big integer as string)

is_active bool

Indicates if the validator is active

keys Key repeated

List of cryptographic keys

vaults ValidatorVault repeated

List of validator vaults

ValidatorSet

FieldTypeLabelDescription
version uint32

Version of the validator set

required_key_tag uint32

Key tag required to commit next validator set

epoch uint64

Validator set epoch

capture_timestamp google.protobuf.Timestamp

Epoch capture timestamp

quorum_threshold string

Quorum threshold (big integer as string)

status ValidatorSetStatus

Status of validator set header

validators Validator repeated

List of validators

ValidatorVault

Validator vault information

FieldTypeLabelDescription
chain_id uint64

Chain identifier

vault string

Vault address

voting_power string

Voting power for this vault (big integer as string)

ErrorCode

Error code enumeration

NameNumberDescription
ERROR_CODE_UNSPECIFIED 0

Default/unknown error

ERROR_CODE_NO_DATA 1

No data found

ERROR_CODE_INTERNAL 2

Internal server error

ERROR_CODE_NOT_AGGREGATOR 3

Not an aggregator node

SigningStatus

Signing process status enumeration

NameNumberDescription
SIGNING_STATUS_UNSPECIFIED 0

Default/unknown status

SIGNING_STATUS_PENDING 1

Request has been created and is waiting for signatures

SIGNING_STATUS_COMPLETED 2

Signing process completed successfully with proof

SIGNING_STATUS_FAILED 3

Signing process failed

SIGNING_STATUS_TIMEOUT 4

Signing request timed out

ValidatorSetStatus

Validator set status enumeration

NameNumberDescription
VALIDATOR_SET_STATUS_UNSPECIFIED 0

Default/unknown status

VALIDATOR_SET_STATUS_DERIVED 1

Derived status

VALIDATOR_SET_STATUS_AGGREGATED 2

Aggregated status

VALIDATOR_SET_STATUS_COMMITTED 3

Committed status

VALIDATOR_SET_STATUS_MISSED 4

Missed status

SymbioticAPIService

SymbioticAPI provides access to the Symbiotic relay functions

Method NameRequest TypeResponse TypeDescription
SignMessage SignMessageRequest SignMessageResponse

Sign a message

GetAggregationProof GetAggregationProofRequest GetAggregationProofResponse

Get aggregation proof

GetAggregationProofsByEpoch GetAggregationProofsByEpochRequest GetAggregationProofsByEpochResponse

Get aggregation proofs by epoch

GetCurrentEpoch GetCurrentEpochRequest GetCurrentEpochResponse

Get current epoch

GetSignatures GetSignaturesRequest GetSignaturesResponse

Get signature by request id

GetSignaturesByEpoch GetSignaturesByEpochRequest GetSignaturesByEpochResponse

Get signature by epoch

GetSignatureRequestIDsByEpoch GetSignatureRequestIDsByEpochRequest GetSignatureRequestIDsByEpochResponse

Get all signature request IDs by epoch

GetSignatureRequestsByEpoch GetSignatureRequestsByEpochRequest GetSignatureRequestsByEpochResponse

Get all signature requests by epoch

GetSignatureRequest GetSignatureRequestRequest GetSignatureRequestResponse

Get signature request by request id

GetAggregationStatus GetAggregationStatusRequest GetAggregationStatusResponse

Get aggregation status, can be sent only to aggregator nodes

GetValidatorSet GetValidatorSetRequest GetValidatorSetResponse

Get current validator set

GetValidatorByAddress GetValidatorByAddressRequest GetValidatorByAddressResponse

Get validator by address

GetValidatorByKey GetValidatorByKeyRequest GetValidatorByKeyResponse

Get validator by key

GetLocalValidator GetLocalValidatorRequest GetLocalValidatorResponse

Get local validator

GetValidatorSetHeader GetValidatorSetHeaderRequest GetValidatorSetHeaderResponse

Get validator set header

GetLastCommitted GetLastCommittedRequest GetLastCommittedResponse

Get last committed epoch for a specific settlement chain

GetLastAllCommitted GetLastAllCommittedRequest GetLastAllCommittedResponse

Get last committed epochs for all settlement chains

GetValidatorSetMetadata GetValidatorSetMetadataRequest GetValidatorSetMetadataResponse

Get validator set metadata like extra data and request id to fetch aggregation and signature requests

ListenSignatures ListenSignaturesRequest ListenSignaturesResponse stream

Stream signatures in real-time. If start_epoch is provided, sends historical data first

ListenProofs ListenProofsRequest ListenProofsResponse stream

Stream aggregation proofs in real-time. If start_epoch is provided, sends historical data first

ListenValidatorSet ListenValidatorSetRequest ListenValidatorSetResponse stream

Stream validator set changes in real-time. If start_epoch is provided, sends historical data first

Methods with HTTP bindings

Method Name Method Pattern Body
SignMessage POST /v1/sign *
GetAggregationProof GET /v1/aggregation/proof/{request_id}
GetAggregationProofsByEpoch GET /v1/aggregation/proofs/epoch/{epoch}
GetCurrentEpoch GET /v1/epoch/current
GetSignatures GET /v1/signatures/{request_id}
GetSignaturesByEpoch GET /v1/signatures/epoch/{epoch}
GetSignatureRequestIDsByEpoch GET /v1/signature-request-ids/epoch/{epoch}
GetSignatureRequestsByEpoch GET /v1/signature-requests/epoch/{epoch}
GetSignatureRequest GET /v1/signature-request/{request_id}
GetAggregationStatus GET /v1/aggregation/status/{request_id}
GetValidatorSet GET /v1/validator-set
GetValidatorByAddress GET /v1/validator/address/{address}
GetValidatorByKey GET /v1/validator/key/{key_tag}/{on_chain_key}
GetLocalValidator GET /v1/validator/local
GetValidatorSetHeader GET /v1/validator-set/header
GetLastCommitted GET /v1/committed/chain/{settlement_chain_id}
GetLastAllCommitted GET /v1/committed/all
GetValidatorSetMetadata GET /v1/validator-set/metadata
ListenSignatures GET /v1/stream/signatures
ListenProofs GET /v1/stream/proofs
ListenValidatorSet GET /v1/stream/validator-set

Scalar Value Types

.proto TypeNotesC++JavaPythonGoC#PHPRuby
double double double float float64 double float Float
float float float float float32 float float Float
int32 Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. int32 int int int32 int integer Bignum or Fixnum (as required)
int64 Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. int64 long int/long int64 long integer/string Bignum
uint32 Uses variable-length encoding. uint32 int int/long uint32 uint integer Bignum or Fixnum (as required)
uint64 Uses variable-length encoding. uint64 long int/long uint64 ulong integer/string Bignum or Fixnum (as required)
sint32 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. int32 int int int32 int integer Bignum or Fixnum (as required)
sint64 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. int64 long int/long int64 long integer/string Bignum
fixed32 Always four bytes. More efficient than uint32 if values are often greater than 2^28. uint32 int int uint32 uint integer Bignum or Fixnum (as required)
fixed64 Always eight bytes. More efficient than uint64 if values are often greater than 2^56. uint64 long int/long uint64 ulong integer/string Bignum
sfixed32 Always four bytes. int32 int int int32 int integer Bignum or Fixnum (as required)
sfixed64 Always eight bytes. int64 long int/long int64 long integer/string Bignum
bool bool boolean boolean bool bool boolean TrueClass/FalseClass
string A string must always contain UTF-8 encoded or 7-bit ASCII text. string String str/unicode string string string String (UTF-8)
bytes May contain any arbitrary sequence of bytes. string ByteString str []byte ByteString string String (ASCII-8BIT)
```` ## File: docs/cli/relay/relay_sidecar.md ````markdown # `relay sidecar` Command Reference ## relay_sidecar Relay sidecar for signature aggregation ### Synopsis A P2P service for collecting and aggregating signatures for Ethereum contracts. ``` relay_sidecar [flags] ``` ### Options ``` --aggregation-policy-max-unsigners uint Max unsigners for low cost agg policy (default 50) --api.http-gateway Enable HTTP/JSON REST API gateway on /api/v1/* path --api.listen string API Server listener address --api.max-allowed-streams uint Max allowed streams count API Server (default 100) --api.verbose-logging Enable verbose logging for the API Server --cache.network-config-size int Network config cache size (default 10) --cache.validator-set-size int Validator set cache size (default 10) --circuits-dir string Directory path to load zk circuits from, if empty then zp prover is disabled --config string Path to config file (default "config.yaml") --driver.address string Driver contract address --driver.chain-id uint Driver contract chain id --evm.chains strings Chains, comma separated rpc-url,.. --evm.max-calls int Max calls in multicall --force-role.aggregator Force node to act as aggregator regardless of deterministic scheduling --force-role.committer Force node to act as committer regardless of deterministic scheduling -h, --help help for relay_sidecar --key-cache.enabled Enable key cache (default true) --key-cache.size int Key cache size (default 100) --keystore.password string Password for the keystore file, if provided will be used to decrypt the keystore file --keystore.path string Path to optional keystore file, if provided will be used instead of secret-keys flag --log.level string Log level (debug, info, warn, error) (default "info") --log.mode string Log mode (text, pretty, json) (default "json") --metrics.listen string Http listener address for metrics endpoint --metrics.pprof Enable pprof debug endpoints --p2p.bootnodes strings List of bootnodes in multiaddr format --p2p.dht-mode string DHT mode: auto, server, client, disabled (default "server") --p2p.listen string P2P listen address --p2p.mdns Enable mDNS discovery for P2P --retention.valset-epochs uint Number of historical validator set epochs to retain on fresh node startup (0 = unlimited) --secret-keys secret-key-slice Secret keys, comma separated {namespace}/{type}/{id}/{key},.. --signal.buffer-size int Signal buffer size (default 20) --signal.worker-count int Signal worker count (default 10) --storage-dir string Dir to store data (default ".data") --sync.enabled Enable signature syncer (default true) --sync.epochs uint Epochs to sync (default 5) --sync.period duration Signature sync period (default 5s) --sync.timeout duration Signature sync timeout (default 1m0s) ``` ```` ## File: docs/cli/utils/utils_keys_add.md ````markdown # `utils keys add` Command Reference ## utils keys add Add key ``` utils keys add [flags] ``` ### Options ``` --chain-id int16 chain id for evm keys, use 0 for default key for all chains (default -1) --evm use evm namespace keys --force force overwrite key --generate generate key -h, --help help for add --key-tag uint8 key tag for relay keys (default 255) --p2p use p2p key --private-key string private key to add in hex --relay use relay namespace keys ``` ### Options inherited from parent commands ``` --log.level string log level(info, debug, warn, error) (default "info") --log.mode string log mode(pretty, text, json) (default "text") --password string Keystore password -p, --path string Path to keystore (default "./keystore.jks") ``` ### SEE ALSO * [utils keys](utils_keys.md) - Keys tool ```` ## File: docs/cli/utils/utils_keys_list.md ````markdown # `utils keys list` Command Reference ## utils keys list Print all keys ``` utils keys list [flags] ``` ### Options ``` -h, --help help for list ``` ### Options inherited from parent commands ``` --log.level string log level(info, debug, warn, error) (default "info") --log.mode string log mode(pretty, text, json) (default "text") --password string Keystore password -p, --path string Path to keystore (default "./keystore.jks") ``` ### SEE ALSO * [utils keys](utils_keys.md) - Keys tool ```` ## File: docs/cli/utils/utils_keys_remove.md ````markdown # `utils keys remove` Command Reference ## utils keys remove Remove key ``` utils keys remove [flags] ``` ### Options ``` --chain-id int16 chain id for evm keys, use 0 for default key for all chains (default -1) --evm use evm namespace keys -h, --help help for remove --key-tag uint8 key tag for relay keys (default 255) --p2p use p2p key --relay use relay namespace keys ``` ### Options inherited from parent commands ``` --log.level string log level(info, debug, warn, error) (default "info") --log.mode string log mode(pretty, text, json) (default "text") --password string Keystore password -p, --path string Path to keystore (default "./keystore.jks") ``` ### SEE ALSO * [utils keys](utils_keys.md) - Keys tool ```` ## File: docs/cli/utils/utils_keys_update.md ````markdown # `utils keys update` Command Reference ## utils keys update Update key ``` utils keys update [flags] ``` ### Options ``` --chain-id int16 chain id for evm keys, use 0 for default key for all chains (default -1) --evm use evm namespace keys --force force overwrite key -h, --help help for update --key-tag uint8 key tag for relay keys (default 255) --p2p use p2p key --private-key string private key to add in hex --relay use relay namespace keys ``` ### Options inherited from parent commands ``` --log.level string log level(info, debug, warn, error) (default "info") --log.mode string log mode(pretty, text, json) (default "text") --password string Keystore password -p, --path string Path to keystore (default "./keystore.jks") ``` ### SEE ALSO * [utils keys](utils_keys.md) - Keys tool ```` ## File: docs/cli/utils/utils_keys.md ````markdown # `utils keys` Command Reference ## utils keys Keys tool ### Options ``` -h, --help help for keys --password string Keystore password -p, --path string Path to keystore (default "./keystore.jks") ``` ### Options inherited from parent commands ``` --log.level string log level(info, debug, warn, error) (default "info") --log.mode string log mode(pretty, text, json) (default "text") ``` ### SEE ALSO * [utils](utils.md) - Utils tool * [utils keys add](utils_keys_add.md) - Add key * [utils keys list](utils_keys_list.md) - Print all keys * [utils keys remove](utils_keys_remove.md) - Remove key * [utils keys update](utils_keys_update.md) - Update key ```` ## File: docs/cli/utils/utils_network_generate-genesis.md ````markdown # `utils network generate-genesis` Command Reference ## utils network generate-genesis Generate genesis validator set header ``` utils network generate-genesis [flags] ``` ### Options ``` --commit Commit genesis flag -e, --epoch int Epoch to generate genesis for (default: current epoch - 1) (default -1) -h, --help help for generate-genesis -j, --json Print as json -o, --output string Output file path --secret-keys secretKeyMap Secret key for genesis commit in format 'chainId:key,chainId:key' (e.g. '1:0xabc,137:0xdef') ``` ### Options inherited from parent commands ``` -c, --chains strings Chains rpc url, comma separated --driver.address string Driver contract address --driver.chainid uint Driver contract chain id --log.level string log level(info, debug, warn, error) (default "info") --log.mode string log mode(pretty, text, json) (default "text") ``` ### SEE ALSO * [utils network](utils_network.md) - Network tool ```` ## File: docs/cli/utils/utils_network_info.md ````markdown # `utils network info` Command Reference ## utils network info Print network information ``` utils network info [flags] ``` ### Options ``` -a, --addresses Print addresses -h, --help help for info -s, --settlement Print settlement info -v, --validators Print compact validators info -V, --validators-full Print full validators info ``` ### Options inherited from parent commands ``` -c, --chains strings Chains rpc url, comma separated --driver.address string Driver contract address --driver.chainid uint Driver contract chain id -e, --epoch uint Network epoch to fetch info --log.level string log level(info, debug, warn, error) (default "info") --log.mode string log mode(pretty, text, json) (default "text") ``` ### SEE ALSO * [utils network](utils_network.md) - Network tool ```` ## File: docs/cli/utils/utils_network.md ````markdown # `utils network` Command Reference ## utils network Network tool ### Options ``` -c, --chains strings Chains rpc url, comma separated --driver.address string Driver contract address --driver.chainid uint Driver contract chain id -e, --epoch uint Network epoch to fetch info -h, --help help for network ``` ### Options inherited from parent commands ``` --log.level string log level(info, debug, warn, error) (default "info") --log.mode string log mode(pretty, text, json) (default "text") ``` ### SEE ALSO * [utils](utils.md) - Utils tool * [utils network generate-genesis](utils_network_generate-genesis.md) - Generate genesis validator set header * [utils network info](utils_network_info.md) - Print network information ```` ## File: docs/cli/utils/utils_operator_info.md ````markdown # `utils operator info` Command Reference ## utils operator info Print operator information ``` utils operator info [flags] ``` ### Options ``` -e, --epoch uint Network epoch to fetch info -h, --help help for info --key-tag uint8 key tag (default 255) --password string Keystore password -p, --path string Path to keystore (default "./keystore.jks") ``` ### Options inherited from parent commands ``` -c, --chains strings Chains rpc url, comma separated --driver.address string Driver contract address --driver.chainid uint Driver contract chain id --log.level string log level(info, debug, warn, error) (default "info") --log.mode string log mode(pretty, text, json) (default "text") --voting-provider-chain-id uint Voting power provider chain id ``` ### SEE ALSO * [utils operator](utils_operator.md) - Operator tool ```` ## File: docs/cli/utils/utils_operator_invalidate-old-signatures.md ````markdown # `utils operator invalidate-old-signatures` Command Reference ## utils operator invalidate-old-signatures Invalidate old signatures for operator ``` utils operator invalidate-old-signatures [flags] ``` ### Options ``` -h, --help help for invalidate-old-signatures --secret-keys secretKeyMap Secret key for signing in format 'chainId:key' (e.g. '1:0xabc') ``` ### Options inherited from parent commands ``` -c, --chains strings Chains rpc url, comma separated --driver.address string Driver contract address --driver.chainid uint Driver contract chain id --log.level string log level(info, debug, warn, error) (default "info") --log.mode string log mode(pretty, text, json) (default "text") --voting-provider-chain-id uint Voting power provider chain id ``` ### SEE ALSO * [utils operator](utils_operator.md) - Operator tool ```` ## File: docs/cli/utils/utils_operator_register-key.md ````markdown # `utils operator register-key` Command Reference ## utils operator register-key Register operator key in key registry ``` utils operator register-key [flags] ``` ### Options ``` -h, --help help for register-key --key-tag uint8 key tag (default 255) --password string Keystore password -p, --path string Path to keystore (default "./keystore.jks") --secret-keys secretKeyMap Secret key for key register in format 'chainId:key' (e.g. '1:0xabc') ``` ### Options inherited from parent commands ``` -c, --chains strings Chains rpc url, comma separated --driver.address string Driver contract address --driver.chainid uint Driver contract chain id --log.level string log level(info, debug, warn, error) (default "info") --log.mode string log mode(pretty, text, json) (default "text") --voting-provider-chain-id uint Voting power provider chain id ``` ### SEE ALSO * [utils operator](utils_operator.md) - Operator tool ```` ## File: docs/cli/utils/utils_operator_register-operator-with-signature.md ````markdown # `utils operator register-operator-with-signature` Command Reference ## utils operator register-operator-with-signature Generate EIP-712 signature for operator registration ``` utils operator register-operator-with-signature [flags] ``` ### Options ``` -h, --help help for register-operator-with-signature --secret-keys secretKeyMap Secret key for signing in format 'chainId:key' (e.g. '1:0xabc') ``` ### Options inherited from parent commands ``` -c, --chains strings Chains rpc url, comma separated --driver.address string Driver contract address --driver.chainid uint Driver contract chain id --log.level string log level(info, debug, warn, error) (default "info") --log.mode string log mode(pretty, text, json) (default "text") --voting-provider-chain-id uint Voting power provider chain id ``` ### SEE ALSO * [utils operator](utils_operator.md) - Operator tool ```` ## File: docs/cli/utils/utils_operator_register-operator.md ````markdown # `utils operator register-operator` Command Reference ## utils operator register-operator Register operator on-chain via VotingPowerProvider ``` utils operator register-operator [flags] ``` ### Options ``` -h, --help help for register-operator --secret-keys secretKeyMap Secret key for operator in format 'chainId:key' (e.g. '1:0xabc') ``` ### Options inherited from parent commands ``` -c, --chains strings Chains rpc url, comma separated --driver.address string Driver contract address --driver.chainid uint Driver contract chain id --log.level string log level(info, debug, warn, error) (default "info") --log.mode string log mode(pretty, text, json) (default "text") --voting-provider-chain-id uint Voting power provider chain id ``` ### SEE ALSO * [utils operator](utils_operator.md) - Operator tool ```` ## File: docs/cli/utils/utils_operator_register-signature.md ````markdown # `utils operator register-signature` Command Reference ## utils operator register-signature Generate EIP-712 signature for operator registration ``` utils operator register-signature [flags] ``` ### Options ``` -h, --help help for register-signature --secret-keys secretKeyMap Secret key for signing in format 'chainId:key' (e.g. '1:0xabc') ``` ### Options inherited from parent commands ``` -c, --chains strings Chains rpc url, comma separated --driver.address string Driver contract address --driver.chainid uint Driver contract chain id --log.level string log level(info, debug, warn, error) (default "info") --log.mode string log mode(pretty, text, json) (default "text") ``` ### SEE ALSO * [utils operator](utils_operator.md) - Operator tool ```` ## File: docs/cli/utils/utils_operator_unregister-operator-with-signature.md ````markdown # `utils operator unregister-operator-with-signature` Command Reference ## utils operator unregister-operator-with-signature Generate EIP-712 signature for operator unregistration ``` utils operator unregister-operator-with-signature [flags] ``` ### Options ``` -h, --help help for unregister-operator-with-signature --secret-keys secretKeyMap Secret key for signing in format 'chainId:key' (e.g. '1:0xabc') ``` ### Options inherited from parent commands ``` -c, --chains strings Chains rpc url, comma separated --driver.address string Driver contract address --driver.chainid uint Driver contract chain id --log.level string log level(info, debug, warn, error) (default "info") --log.mode string log mode(pretty, text, json) (default "text") --voting-provider-chain-id uint Voting power provider chain id ``` ### SEE ALSO * [utils operator](utils_operator.md) - Operator tool ```` ## File: docs/cli/utils/utils_operator_unregister-operator.md ````markdown # `utils operator unregister-operator` Command Reference ## utils operator unregister-operator Unregister operator on-chain via VotingPowerProvider ``` utils operator unregister-operator [flags] ``` ### Options ``` -h, --help help for unregister-operator --secret-keys secretKeyMap Secret key for operator in format 'chainId:key' (e.g. '1:0xabc') ``` ### Options inherited from parent commands ``` -c, --chains strings Chains rpc url, comma separated --driver.address string Driver contract address --driver.chainid uint Driver contract chain id --log.level string log level(info, debug, warn, error) (default "info") --log.mode string log mode(pretty, text, json) (default "text") --voting-provider-chain-id uint Voting power provider chain id ``` ### SEE ALSO * [utils operator](utils_operator.md) - Operator tool ```` ## File: docs/cli/utils/utils_operator_unregister-signature.md ````markdown # `utils operator unregister-signature` Command Reference ## utils operator unregister-signature Generate EIP-712 signature for operator unregistration ``` utils operator unregister-signature [flags] ``` ### Options ``` -h, --help help for unregister-signature --secret-keys secretKeyMap Secret key for signing in format 'chainId:key' (e.g. '1:0xabc') ``` ### Options inherited from parent commands ``` -c, --chains strings Chains rpc url, comma separated --driver.address string Driver contract address --driver.chainid uint Driver contract chain id --log.level string log level(info, debug, warn, error) (default "info") --log.mode string log mode(pretty, text, json) (default "text") ``` ### SEE ALSO * [utils operator](utils_operator.md) - Operator tool ```` ## File: docs/cli/utils/utils_operator.md ````markdown # `utils operator` Command Reference ## utils operator Operator tool ### Options ``` -c, --chains strings Chains rpc url, comma separated --driver.address string Driver contract address --driver.chainid uint Driver contract chain id -h, --help help for operator --voting-provider-chain-id uint Voting power provider chain id ``` ### Options inherited from parent commands ``` --log.level string log level(info, debug, warn, error) (default "info") --log.mode string log mode(pretty, text, json) (default "text") ``` ### SEE ALSO * [utils](utils.md) - Utils tool * [utils operator info](utils_operator_info.md) - Print operator information * [utils operator invalidate-old-signatures](utils_operator_invalidate-old-signatures.md) - Invalidate old signatures for operator * [utils operator register-key](utils_operator_register-key.md) - Register operator key in key registry * [utils operator register-operator](utils_operator_register-operator.md) - Register operator on-chain via VotingPowerProvider * [utils operator register-operator-with-signature](utils_operator_register-operator-with-signature.md) - Generate EIP-712 signature for operator registration * [utils operator unregister-operator](utils_operator_unregister-operator.md) - Unregister operator on-chain via VotingPowerProvider * [utils operator unregister-operator-with-signature](utils_operator_unregister-operator-with-signature.md) - Generate EIP-712 signature for operator unregistration ```` ## File: docs/cli/utils/utils_version.md ````markdown # `utils version` Command Reference ## utils version Print the version of the utils tool ``` utils version [flags] ``` ### Options ``` -h, --help help for version ``` ### Options inherited from parent commands ``` --log.level string log level(info, debug, warn, error) (default "info") --log.mode string log mode(pretty, text, json) (default "text") ``` ### SEE ALSO * [utils](utils.md) - Utils tool ```` ## File: docs/cli/utils/utils.md ````markdown # `utils` Command Reference ## utils Utils tool ### Options ``` -h, --help help for utils --log.level string log level(info, debug, warn, error) (default "info") --log.mode string log mode(pretty, text, json) (default "text") ``` ### SEE ALSO * [utils keys](utils_keys.md) - Keys tool * [utils network](utils_network.md) - Network tool * [utils operator](utils_operator.md) - Operator tool * [utils version](utils_version.md) - Print the version of the utils tool ```` ## File: e2e/scripts/deploy.sh ````bash #!/bin/sh set -e echo "Waiting for anvil to be ready..." until cast client --rpc-url http://anvil:8545 > /dev/null 2>&1; do sleep 1; done until cast client --rpc-url http://anvil-settlement:8546 > /dev/null 2>&1; do sleep 1; done echo "Deploying contracts..." forge script script/LocalDeploy.s.sol:LocalDeploy --rpc-url http://anvil:8545 -vv --broadcast --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 | tee /deploy-data/deployment.log forge script script/SettlementChainDeploy.s.sol:SettlementChainDeploy --rpc-url http://anvil-settlement:8546 -vv --broadcast --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 | tee /deploy-data/settlement-deployment.log forge script script/ValSetDriverDeploy.s.sol:ValSetDriverDeploy --rpc-url http://anvil:8545 -vv --broadcast --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 | tee /deploy-data/valsetdriver-deployment.log echo "Deploying multicall3 contracts..." cast send --rpc-url http://anvil:8545 0x05f32b3cc3888453ff71b01135b34ff8e41263f2 --value 100000000000000000 --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 cast publish --rpc-url http://anvil:8545 0xf90f538085174876e800830f42408080b90f00608060405234801561001057600080fd5b50610ee0806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e1461025a578063bce38bd714610275578063c3077fa914610288578063ee82ac5e1461029b57600080fd5b80634d2301cc146101ec57806372425d9d1461022157806382ad56cb1461023457806386d516e81461024757600080fd5b80633408e470116100c65780633408e47014610191578063399542e9146101a45780633e64a696146101c657806342cbb15c146101d957600080fd5b80630f28c97d146100f8578063174dea711461011a578063252dba421461013a57806327e86d6e1461015b575b600080fd5b34801561010457600080fd5b50425b6040519081526020015b60405180910390f35b61012d610128366004610a85565b6102ba565b6040516101119190610bbe565b61014d610148366004610a85565b6104ef565b604051610111929190610bd8565b34801561016757600080fd5b50437fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0140610107565b34801561019d57600080fd5b5046610107565b6101b76101b2366004610c60565b610690565b60405161011193929190610cba565b3480156101d257600080fd5b5048610107565b3480156101e557600080fd5b5043610107565b3480156101f857600080fd5b50610107610207366004610ce2565b73ffffffffffffffffffffffffffffffffffffffff163190565b34801561022d57600080fd5b5044610107565b61012d610242366004610a85565b6106ab565b34801561025357600080fd5b5045610107565b34801561026657600080fd5b50604051418152602001610111565b61012d610283366004610c60565b61085a565b6101b7610296366004610a85565b610a1a565b3480156102a757600080fd5b506101076102b6366004610d18565b4090565b60606000828067ffffffffffffffff8111156102d8576102d8610d31565b60405190808252806020026020018201604052801561031e57816020015b6040805180820190915260008152606060208201528152602001906001900390816102f65790505b5092503660005b8281101561047757600085828151811061034157610341610d60565b6020026020010151905087878381811061035d5761035d610d60565b905060200281019061036f9190610d8f565b6040810135958601959093506103886020850185610ce2565b73ffffffffffffffffffffffffffffffffffffffff16816103ac6060870187610dcd565b6040516103ba929190610e32565b60006040518083038185875af1925050503d80600081146103f7576040519150601f19603f3d011682016040523d82523d6000602084013e6103fc565b606091505b50602080850191909152901515808452908501351761046d577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b5050600101610325565b508234146104e6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f4d756c746963616c6c333a2076616c7565206d69736d6174636800000000000060448201526064015b60405180910390fd5b50505092915050565b436060828067ffffffffffffffff81111561050c5761050c610d31565b60405190808252806020026020018201604052801561053f57816020015b606081526020019060019003908161052a5790505b5091503660005b8281101561068657600087878381811061056257610562610d60565b90506020028101906105749190610e42565b92506105836020840184610ce2565b73ffffffffffffffffffffffffffffffffffffffff166105a66020850185610dcd565b6040516105b4929190610e32565b6000604051808303816000865af19150503d80600081146105f1576040519150601f19603f3d011682016040523d82523d6000602084013e6105f6565b606091505b5086848151811061060957610609610d60565b602090810291909101015290508061067d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060448201526064016104dd565b50600101610546565b5050509250929050565b43804060606106a086868661085a565b905093509350939050565b6060818067ffffffffffffffff8111156106c7576106c7610d31565b60405190808252806020026020018201604052801561070d57816020015b6040805180820190915260008152606060208201528152602001906001900390816106e55790505b5091503660005b828110156104e657600084828151811061073057610730610d60565b6020026020010151905086868381811061074c5761074c610d60565b905060200281019061075e9190610e76565b925061076d6020840184610ce2565b73ffffffffffffffffffffffffffffffffffffffff166107906040850185610dcd565b60405161079e929190610e32565b6000604051808303816000865af19150503d80600081146107db576040519150601f19603f3d011682016040523d82523d6000602084013e6107e0565b606091505b506020808401919091529015158083529084013517610851577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b50600101610714565b6060818067ffffffffffffffff81111561087657610876610d31565b6040519080825280602002602001820160405280156108bc57816020015b6040805180820190915260008152606060208201528152602001906001900390816108945790505b5091503660005b82811015610a105760008482815181106108df576108df610d60565b602002602001015190508686838181106108fb576108fb610d60565b905060200281019061090d9190610e42565b925061091c6020840184610ce2565b73ffffffffffffffffffffffffffffffffffffffff1661093f6020850185610dcd565b60405161094d929190610e32565b6000604051808303816000865af19150503d806000811461098a576040519150601f19603f3d011682016040523d82523d6000602084013e61098f565b606091505b506020830152151581528715610a07578051610a07576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060448201526064016104dd565b506001016108c3565b5050509392505050565b6000806060610a2b60018686610690565b919790965090945092505050565b60008083601f840112610a4b57600080fd5b50813567ffffffffffffffff811115610a6357600080fd5b6020830191508360208260051b8501011115610a7e57600080fd5b9250929050565b60008060208385031215610a9857600080fd5b823567ffffffffffffffff811115610aaf57600080fd5b610abb85828601610a39565b90969095509350505050565b6000815180845260005b81811015610aed57602081850181015186830182015201610ad1565b81811115610aff576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015610bb1578583037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001895281518051151584528401516040858501819052610b9d81860183610ac7565b9a86019a9450505090830190600101610b4f565b5090979650505050505050565b602081526000610bd16020830184610b32565b9392505050565b600060408201848352602060408185015281855180845260608601915060608160051b870101935082870160005b82811015610c52577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa0888703018452610c40868351610ac7565b95509284019290840190600101610c06565b509398975050505050505050565b600080600060408486031215610c7557600080fd5b83358015158114610c8557600080fd5b9250602084013567ffffffffffffffff811115610ca157600080fd5b610cad86828701610a39565b9497909650939450505050565b838152826020820152606060408201526000610cd96060830184610b32565b95945050505050565b600060208284031215610cf457600080fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114610bd157600080fd5b600060208284031215610d2a57600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81833603018112610dc357600080fd5b9190910192915050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112610e0257600080fd5b83018035915067ffffffffffffffff821115610e1d57600080fd5b602001915036819003821315610a7e57600080fd5b8183823760009101908152919050565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc1833603018112610dc357600080fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa1833603018112610dc357600080fdfea2646970667358221220bb2b5c71a328032f97c676ae39a1ec2148d3e5d6f73d95e9b17910152d61f16264736f6c634300080c00331ca0edce47092c0f398cebf3ffc267f05c8e7076e3b89445e0fe50f6332273d4569ba01b0b9d000e19b24c5869b0fc3b22b0d6fa47cd63316875cbbd577d76e6fde086 cast send --rpc-url http://anvil-settlement:8546 0x05f32b3cc3888453ff71b01135b34ff8e41263f2 --value 100000000000000000 --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 cast publish --rpc-url http://anvil-settlement:8546 0xf90f538085174876e800830f42408080b90f00608060405234801561001057600080fd5b50610ee0806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e1461025a578063bce38bd714610275578063c3077fa914610288578063ee82ac5e1461029b57600080fd5b80634d2301cc146101ec57806372425d9d1461022157806382ad56cb1461023457806386d516e81461024757600080fd5b80633408e470116100c65780633408e47014610191578063399542e9146101a45780633e64a696146101c657806342cbb15c146101d957600080fd5b80630f28c97d146100f8578063174dea711461011a578063252dba421461013a57806327e86d6e1461015b575b600080fd5b34801561010457600080fd5b50425b6040519081526020015b60405180910390f35b61012d610128366004610a85565b6102ba565b6040516101119190610bbe565b61014d610148366004610a85565b6104ef565b604051610111929190610bd8565b34801561016757600080fd5b50437fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0140610107565b34801561019d57600080fd5b5046610107565b6101b76101b2366004610c60565b610690565b60405161011193929190610cba565b3480156101d257600080fd5b5048610107565b3480156101e557600080fd5b5043610107565b3480156101f857600080fd5b50610107610207366004610ce2565b73ffffffffffffffffffffffffffffffffffffffff163190565b34801561022d57600080fd5b5044610107565b61012d610242366004610a85565b6106ab565b34801561025357600080fd5b5045610107565b34801561026657600080fd5b50604051418152602001610111565b61012d610283366004610c60565b61085a565b6101b7610296366004610a85565b610a1a565b3480156102a757600080fd5b506101076102b6366004610d18565b4090565b60606000828067ffffffffffffffff8111156102d8576102d8610d31565b60405190808252806020026020018201604052801561031e57816020015b6040805180820190915260008152606060208201528152602001906001900390816102f65790505b5092503660005b8281101561047757600085828151811061034157610341610d60565b6020026020010151905087878381811061035d5761035d610d60565b905060200281019061036f9190610d8f565b6040810135958601959093506103886020850185610ce2565b73ffffffffffffffffffffffffffffffffffffffff16816103ac6060870187610dcd565b6040516103ba929190610e32565b60006040518083038185875af1925050503d80600081146103f7576040519150601f19603f3d011682016040523d82523d6000602084013e6103fc565b606091505b50602080850191909152901515808452908501351761046d577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b5050600101610325565b508234146104e6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f4d756c746963616c6c333a2076616c7565206d69736d6174636800000000000060448201526064015b60405180910390fd5b50505092915050565b436060828067ffffffffffffffff81111561050c5761050c610d31565b60405190808252806020026020018201604052801561053f57816020015b606081526020019060019003908161052a5790505b5091503660005b8281101561068657600087878381811061056257610562610d60565b90506020028101906105749190610e42565b92506105836020840184610ce2565b73ffffffffffffffffffffffffffffffffffffffff166105a66020850185610dcd565b6040516105b4929190610e32565b6000604051808303816000865af19150503d80600081146105f1576040519150601f19603f3d011682016040523d82523d6000602084013e6105f6565b606091505b5086848151811061060957610609610d60565b602090810291909101015290508061067d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060448201526064016104dd565b50600101610546565b5050509250929050565b43804060606106a086868661085a565b905093509350939050565b6060818067ffffffffffffffff8111156106c7576106c7610d31565b60405190808252806020026020018201604052801561070d57816020015b6040805180820190915260008152606060208201528152602001906001900390816106e55790505b5091503660005b828110156104e657600084828151811061073057610730610d60565b6020026020010151905086868381811061074c5761074c610d60565b905060200281019061075e9190610e76565b925061076d6020840184610ce2565b73ffffffffffffffffffffffffffffffffffffffff166107906040850185610dcd565b60405161079e929190610e32565b6000604051808303816000865af19150503d80600081146107db576040519150601f19603f3d011682016040523d82523d6000602084013e6107e0565b606091505b506020808401919091529015158083529084013517610851577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b50600101610714565b6060818067ffffffffffffffff81111561087657610876610d31565b6040519080825280602002602001820160405280156108bc57816020015b6040805180820190915260008152606060208201528152602001906001900390816108945790505b5091503660005b82811015610a105760008482815181106108df576108df610d60565b602002602001015190508686838181106108fb576108fb610d60565b905060200281019061090d9190610e42565b925061091c6020840184610ce2565b73ffffffffffffffffffffffffffffffffffffffff1661093f6020850185610dcd565b60405161094d929190610e32565b6000604051808303816000865af19150503d806000811461098a576040519150601f19603f3d011682016040523d82523d6000602084013e61098f565b606091505b506020830152151581528715610a07578051610a07576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060448201526064016104dd565b506001016108c3565b5050509392505050565b6000806060610a2b60018686610690565b919790965090945092505050565b60008083601f840112610a4b57600080fd5b50813567ffffffffffffffff811115610a6357600080fd5b6020830191508360208260051b8501011115610a7e57600080fd5b9250929050565b60008060208385031215610a9857600080fd5b823567ffffffffffffffff811115610aaf57600080fd5b610abb85828601610a39565b90969095509350505050565b6000815180845260005b81811015610aed57602081850181015186830182015201610ad1565b81811115610aff576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015610bb1578583037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001895281518051151584528401516040858501819052610b9d81860183610ac7565b9a86019a9450505090830190600101610b4f565b5090979650505050505050565b602081526000610bd16020830184610b32565b9392505050565b600060408201848352602060408185015281855180845260608601915060608160051b870101935082870160005b82811015610c52577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa0888703018452610c40868351610ac7565b95509284019290840190600101610c06565b509398975050505050505050565b600080600060408486031215610c7557600080fd5b83358015158114610c8557600080fd5b9250602084013567ffffffffffffffff811115610ca157600080fd5b610cad86828701610a39565b9497909650939450505050565b838152826020820152606060408201526000610cd96060830184610b32565b95945050505050565b600060208284031215610cf457600080fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114610bd157600080fd5b600060208284031215610d2a57600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81833603018112610dc357600080fd5b9190910192915050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112610e0257600080fd5b83018035915067ffffffffffffffff821115610e1d57600080fd5b602001915036819003821315610a7e57600080fd5b8183823760009101908152919050565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc1833603018112610dc357600080fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa1833603018112610dc357600080fdfea2646970667358221220bb2b5c71a328032f97c676ae39a1ec2148d3e5d6f73d95e9b17910152d61f16264736f6c634300080c00331ca0edce47092c0f398cebf3ffc267f05c8e7076e3b89445e0fe50f6332273d4569ba01b0b9d000e19b24c5869b0fc3b22b0d6fa47cd63316875cbbd577d76e6fde086 echo 'Waiting for relay contracts file...' until [ -f /deploy-data/relay_contracts.json ]; do sleep 2; done echo "Setting interval mining..." BLOCK_TIME=${BLOCK_TIME:-1} cast rpc --rpc-url http://anvil:8545 evm_setIntervalMining $BLOCK_TIME cast rpc --rpc-url http://anvil-settlement:8546 evm_setIntervalMining $BLOCK_TIME echo "Mine a single block to finalize the deployment..." cast rpc --rpc-url http://anvil:8545 evm_mine cast rpc --rpc-url http://anvil-settlement:8546 evm_mine echo "Deployment completed successfully!" # Create deployment completion marker echo "$(date): Deployment completed successfully" > /deploy-data/deployment-complete.marker echo "Deployment completion marker created" ```` ## File: e2e/scripts/generate_network.sh ````bash #!/bin/bash # Symbiotic Network Infrastructure Generator # This script generates a Docker Compose setup for blockchain infrastructure # (anvil chains, deployer, genesis-generator) with configurable parameters # # Environment Variables: # OPERATORS - Number of operators (default: 4, max: 999) # COMMITERS - Number of commiters (default: 1) # AGGREGATORS - Number of aggregators (default: 1) # VERIFICATION_TYPE - Verification type: 0=BLS-BN254-ZK, 1=BLS-BN254-SIMPLE (default: 1) # EPOCH_TIME - Time for new epochs in relay network (default: 30) # BLOCK_TIME - Block time in seconds for anvil interval mining (default: 1) # FINALITY_BLOCKS - Number of blocks for finality (default: 1) # GENERATE_SIDECARS - Generate relay sidecar services (default: true) # # Example usage: # OPERATORS=6 COMMITERS=2 AGGREGATORS=1 VERIFICATION_TYPE=0 EPOCH_TIME=32 BLOCK_TIME=2 ./generate_network.sh # GENERATE_SIDECARS=false ./generate_network.sh # Skip generating relay sidecars set -e RED='\033[0;31m' GREEN='\033[0;32m' YELLOW='\033[1;33m' BLUE='\033[0;34m' NC='\033[0m' # Default values DEFAULT_OPERATORS=4 DEFAULT_COMMITERS=1 DEFAULT_AGGREGATORS=1 DEFAULT_VERIFICATION_TYPE=1 # BLS-BN254-SIMPLE DEFAULT_EPOCH_TIME=30 DEFAULT_BLOCK_TIME=1 DEFAULT_FINALITY_BLOCKS=2 DEFAULT_GENERATE_SIDECARS=false MAX_OPERATORS=999 print_status() { echo -e "${GREEN}[INFO]${NC} $1" } print_warning() { echo -e "${YELLOW}[WARNING]${NC} $1" } print_error() { echo -e "${RED}[ERROR]${NC} $1" } print_header() { echo -e "${BLUE}================================${NC}" echo -e "${BLUE}$1${NC}" echo -e "${BLUE}================================${NC}" } validate_number() { local num=$1 local name=$2 if ! [[ "$num" =~ ^[0-9]+$ ]] || [ "$num" -lt 1 ]; then print_error "$name must be a positive integer" exit 1 fi } validate_verification_type() { local type=$1 local name=$2 if ! [[ "$type" =~ ^[0-1]$ ]]; then print_error "$name must be 0 (BLS-BN254-ZK) or 1 (BLS-BN254-SIMPLE)" exit 1 fi } get_config_from_env() { echo print_header "Symbiotic Network Configuration" echo # Read from environment variables with defaults operators=${OPERATORS:-$DEFAULT_OPERATORS} commiters=${COMMITERS:-$DEFAULT_COMMITERS} aggregators=${AGGREGATORS:-$DEFAULT_AGGREGATORS} verification_type=${VERIFICATION_TYPE:-$DEFAULT_VERIFICATION_TYPE} epoch_size=${EPOCH_TIME:-$DEFAULT_EPOCH_TIME} block_time=${BLOCK_TIME:-$DEFAULT_BLOCK_TIME} finality_blocks=${FINALITY_BLOCKS:-$DEFAULT_FINALITY_BLOCKS} generate_sidecars=${GENERATE_SIDECARS:-$DEFAULT_GENERATE_SIDECARS} # Validate inputs validate_number "$operators" "Number of operators (OPERATORS env var)" validate_number "$commiters" "Number of commiters (COMMITERS env var)" validate_number "$aggregators" "Number of aggregators (AGGREGATORS env var)" validate_verification_type "$verification_type" "Verification type (VERIFICATION_TYPE env var)" validate_number "$epoch_size" "Epoch size (EPOCH_TIME env var)" validate_number "$block_time" "Block time (BLOCK_TIME env var)" validate_number "$finality_blocks" "Finality blocks (FINALITY_BLOCKS env var)" # Validate generate_sidecars is true or false if [[ "$generate_sidecars" != "true" && "$generate_sidecars" != "false" ]]; then print_error "GENERATE_SIDECARS must be 'true' or 'false', got: $generate_sidecars" exit 1 fi # Validate that commiters + aggregators <= operators total_special_roles=$((commiters + aggregators)) if [ "$total_special_roles" -gt "$operators" ]; then print_error "Total commiters ($commiters) + aggregators ($aggregators) cannot exceed total operators ($operators)" exit 1 fi if [ "$operators" -gt $MAX_OPERATORS ]; then print_error "Maximum $MAX_OPERATORS operators supported. Requested: $operators" exit 1 fi # Convert verification type to description local verification_desc case $verification_type in 0) verification_desc="BLS-BN254-ZK" ;; 1) verification_desc="BLS-BN254-SIMPLE" ;; esac print_status "Configuration (from environment variables):" print_status " Operators: $operators (OPERATORS=${OPERATORS:-default})" print_status " Committers: $commiters (COMMITERS=${COMMITERS:-default})" print_status " Aggregators: $aggregators (AGGREGATORS=${AGGREGATORS:-default})" print_status " Regular signers: $((operators - total_special_roles))" print_status " Verification type: $verification_type ($verification_desc) (VERIFICATION_TYPE=${VERIFICATION_TYPE:-default})" print_status " Epoch size: $epoch_size slots (EPOCH_TIME=${EPOCH_TIME:-default})" print_status " Block time: $block_time seconds (BLOCK_TIME=${BLOCK_TIME:-default})" print_status " Finality blocks: $finality_blocks (FINALITY_BLOCKS=${FINALITY_BLOCKS:-default})" print_status " Generate sidecars: $generate_sidecars (GENERATE_SIDECARS=${GENERATE_SIDECARS:-default})" } # Function to generate Docker Compose file generate_docker_compose() { local operators=$1 local commiters=$2 local aggregators=$3 local verification_type=$4 local epoch_size=$5 local block_time=$6 local finality_blocks=$7 local generate_sidecars=$8 local network_dir="temp-network" if [ -d "$network_dir" ]; then print_status "Cleaning up existing $network_dir directory..." rm -rf "$network_dir" fi mkdir -p "$network_dir/deploy-data" # Ensure deploy-data directory is writable for Docker containers chmod 777 "$network_dir/deploy-data" for i in $(seq 1 $operators); do local storage_dir="$network_dir/data-$(printf "%02d" $i)" mkdir -p "$storage_dir" # Make sure the directory is writable chmod 777 "$storage_dir" done local anvil_port=8545 local anvil_settlement_port=8546 local relay_start_port=8081 local sum_start_port=9091 # Calculate timestamp as current unix timestamp + 5 seconds local timestamp=$(($(date +%s) + 5)) cat > "$network_dir/docker-compose.yml" << EOF services: # Main Anvil local Ethereum network (Chain ID: 31337) anvil: image: ghcr.io/foundry-rs/foundry:v1.2.3 container_name: symbiotic-anvil entrypoint: ["anvil"] command: "--port 8545 --chain-id 31337 --timestamp $timestamp --auto-impersonate --slots-in-an-epoch $finality_blocks --accounts 10 --balance 10000 --gas-limit 30000000" environment: - ANVIL_IP_ADDR=0.0.0.0 ports: - "8545:8545" networks: - symbiotic-network healthcheck: test: ["CMD", "cast", "client", "--rpc-url", "http://localhost:8545"] interval: 2s timeout: 1s retries: 10 # Settlement Anvil local Ethereum network (Chain ID: 31338) anvil-settlement: image: ghcr.io/foundry-rs/foundry:v1.2.3 container_name: symbiotic-anvil-settlement entrypoint: ["anvil"] command: "--port 8546 --chain-id 31338 --timestamp $timestamp --auto-impersonate --slots-in-an-epoch $finality_blocks --accounts 10 --balance 10000 --gas-limit 30000000" environment: - ANVIL_IP_ADDR=0.0.0.0 ports: - "8546:8546" networks: - symbiotic-network healthcheck: test: ["CMD", "cast", "client", "--rpc-url", "http://localhost:8546"] interval: 2s timeout: 1s retries: 10 # Contract deployment service for main chain deployer: image: ghcr.io/foundry-rs/foundry:v1.3.0 container_name: symbiotic-deployer volumes: - ../contracts/:/app - ../scripts:/app/deploy-scripts - ../temp-network:/app/temp-network - ./deploy-data:/deploy-data working_dir: /app command: ./deploy-scripts/deploy.sh depends_on: anvil: condition: service_healthy anvil-settlement: condition: service_healthy networks: - symbiotic-network environment: - OPERATOR_COUNT=$operators - VERIFICATION_TYPE=$verification_type - BLOCK_TIME=$block_time - EPOCH_TIME=$epoch_size - FOUNDRY_CACHE_PATH=/tmp/.foundry-cache - NUM_AGGREGATORS=$aggregators - NUM_COMMITTERS=$commiters # Genesis generation service genesis-generator: image: relay_sidecar:dev container_name: symbiotic-genesis-generator volumes: - ../:/workspace - ./deploy-data:/deploy-data working_dir: /workspace command: ./scripts/genesis-generator.sh depends_on: deployer: condition: service_completed_successfully networks: - symbiotic-network EOF # Skip generating relay sidecars if disabled if [ "$generate_sidecars" = "false" ]; then print_status "Skipping relay sidecar generation (GENERATE_SIDECARS=false)" cat >> "$network_dir/docker-compose.yml" << EOF networks: symbiotic-network: driver: bridge EOF return fi local committer_count=0 local aggregator_count=0 local signer_count=0 # Calculate symb private key properly # ECDSA secp256k1 private keys must be 32 bytes (64 hex chars) and within range [1, n-1] # where n = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 BASE_PRIVATE_KEY=1000000000000000000 for i in $(seq 1 $operators); do local port=$((relay_start_port + i - 1)) local storage_dir="data-$(printf "%02d" $i)" local key_index=$((i - 1)) SYMB_PRIVATE_KEY_DECIMAL=$(($BASE_PRIVATE_KEY + $key_index)) SYMB_SECONDARY_PRIVATE_KEY_DECIMAL=$(($BASE_PRIVATE_KEY + $key_index + 10000)) SYMB_PRIVATE_KEY_HEX=$(printf "%064x" $SYMB_PRIVATE_KEY_DECIMAL) SYMB_SECONDARY_PRIVATE_KEY_HEX=$(printf "%064x" $SYMB_SECONDARY_PRIVATE_KEY_DECIMAL) # Validate ECDSA secp256k1 private key range (must be between 1 and n-1) # Maximum valid key: 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364140 if [ $SYMB_PRIVATE_KEY_DECIMAL -eq 0 ]; then echo "ERROR: Generated private key is zero (invalid for ECDSA)" exit 1 fi # Set circuits directory parameter based on verification type if [ "$verification_type" = "0" ]; then circuits_param="/app/circuits" else circuits_param="" fi cat >> "$network_dir/docker-compose.yml" << EOF # Relay sidecar $i relay-sidecar-$i: image: relay_sidecar:dev container_name: symbiotic-relay-$i command: - sh - -c - "chmod 777 /app/$storage_dir /deploy-data 2>/dev/null || true && /workspace/scripts/sidecar-start.sh symb/0/15/0x$SYMB_PRIVATE_KEY_HEX,symb/0/11/0x$SYMB_SECONDARY_PRIVATE_KEY_HEX,symb/1/0/0x$SYMB_PRIVATE_KEY_HEX,evm/1/31337/0x$SYMB_PRIVATE_KEY_HEX,evm/1/31338/0x$SYMB_PRIVATE_KEY_HEX,p2p/1/1/$SYMB_PRIVATE_KEY_HEX /app/$storage_dir $circuits_param" ports: - "$port:8080" volumes: - ../:/workspace - ./$storage_dir:/app/$storage_dir - ./deploy-data:/deploy-data EOF # Add circuits volume only if verification type is 0 if [ "$verification_type" = "0" ]; then cat >> "$network_dir/docker-compose.yml" << EOF - ./circuits:/app/circuits EOF fi cat >> "$network_dir/docker-compose.yml" << EOF depends_on: genesis-generator: condition: service_completed_successfully networks: - symbiotic-network restart: unless-stopped environment: - MAX_VALIDATORS=10,100 healthcheck: test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:8080/healthz"] interval: 30s timeout: 10s retries: 3 start_period: 40s EOF done cat >> "$network_dir/docker-compose.yml" << EOF networks: symbiotic-network: driver: bridge EOF } # Main execution main() { print_header "Symbiotic Network Generator" # Check if required tools are available if ! command -v docker &> /dev/null; then print_error "Docker is not installed or not in PATH" exit 1 fi if ! command -v docker-compose &> /dev/null && ! docker compose version &> /dev/null; then print_error "Docker Compose is not installed or not in PATH" exit 1 fi get_config_from_env print_status "Generating Docker Compose configuration..." print_status "Creating $operators new operator accounts..." generate_docker_compose "$operators" "$commiters" "$aggregators" "$verification_type" "$epoch_size" "$block_time" "$finality_blocks" "$generate_sidecars" } main "$@" ```` ## File: e2e/scripts/genesis-generator.sh ````bash #!/bin/sh apk add --no-cache jq echo 'Waiting for deployment completion...' until [ -f /deploy-data/deployment-complete.marker ]; do sleep 2; done echo 'Waiting for relay contracts file...' until [ -f /deploy-data/relay_contracts.json ]; do sleep 2; done DRIVER_ADDRESS=$(jq -r '.driver.addr' /deploy-data/relay_contracts.json) echo "Driver address from relay_contracts.json: $DRIVER_ADDRESS" MAX_RETRIES=50 RETRY_DELAY=2 attempt=1 while [ $attempt -le $MAX_RETRIES ]; do echo "Attempt $attempt of $MAX_RETRIES: Generating network genesis..." if /app/relay_utils network \ --chains http://anvil:8545,http://anvil-settlement:8546 \ --driver.address "$DRIVER_ADDRESS" \ --driver.chainid 31337 \ generate-genesis \ --commit \ --secret-keys 31337:0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80,31338:0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80; then echo 'Genesis generation completed successfully!' # Create genesis completion marker echo "$(date): Genesis generation completed successfully" > /deploy-data/genesis-complete.marker echo "Genesis completion marker created" echo "Waiting few seconds before exiting..." sleep 5 exit 0 else echo "Genesis generation failed on attempt $attempt" if [ $attempt -lt $MAX_RETRIES ]; then echo "Waiting $RETRY_DELAY seconds before retry..." sleep $RETRY_DELAY else echo "All $MAX_RETRIES attempts failed. Exiting with error." exit 1 fi attempt=$((attempt + 1)) fi done ```` ## File: e2e/scripts/sidecar-start.sh ````bash #!/bin/sh apk add --no-cache jq echo "Waiting for relay_contracts.json file..." until [ -f /deploy-data/relay_contracts.json ]; do sleep 2; done DRIVER_ADDRESS=$(jq -r '.driver.addr' /deploy-data/relay_contracts.json) echo "Driver address from relay_contracts.json: $DRIVER_ADDRESS" cat > /tmp/sidecar.yaml << EOFCONFIG # Logging log: level: "debug" mode: "pretty" # API Server Configuration api: listen: ":8080" http-gateway: true # Metrics Configuration metrics: pprof: true # Driver Contract driver: chain-id: 31337 address: "$DRIVER_ADDRESS" # P2P Configuration p2p: listen: "/ip4/0.0.0.0/tcp/8880" bootnodes: - /dns4/relay-sidecar-1/tcp/8880/p2p/16Uiu2HAmFUiPYAJ7bE88Q8d7Kznrw5ifrje2e5QFyt7uFPk2G3iR dht-mode: "server" mdns: true # EVM Configuration evm: chains: - "http://anvil:8545" - "http://anvil-settlement:8546" max-calls: 30 # Retention config retention: valset-epochs: 5 EOFCONFIG # Ensure environment variables are explicitly preserved export MAX_VALIDATORS="${MAX_VALIDATORS:-}" # Handle optional circuits directory parameter if [ -n "$3" ] && [ -d "$3" ]; then echo "Using circuits directory: $3" echo "Starting relay_sidecar with MAX_VALIDATORS=$MAX_VALIDATORS" exec /app/relay_sidecar --config /tmp/sidecar.yaml --secret-keys "$1" --storage-dir "$2" --circuits-dir "$3" else echo "No circuits directory provided or directory doesn't exist, running without circuits" echo "Starting relay_sidecar with MAX_VALIDATORS=$MAX_VALIDATORS" exec /app/relay_sidecar --config /tmp/sidecar.yaml --secret-keys "$1" --storage-dir "$2" fi ```` ## File: e2e/tests/api_test.go ````go package tests ⋮---- import ( "context" "fmt" "math/big" "testing" "time" "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/require" apiv1 "github.com/symbioticfi/relay/api/client/v1" "github.com/symbioticfi/relay/symbiotic/client/evm" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" valsetDeriver "github.com/symbioticfi/relay/symbiotic/usecase/valset-deriver" ) ⋮---- "context" "fmt" "math/big" "testing" "time" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/require" ⋮---- apiv1 "github.com/symbioticfi/relay/api/client/v1" "github.com/symbioticfi/relay/symbiotic/client/evm" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" valsetDeriver "github.com/symbioticfi/relay/symbiotic/usecase/valset-deriver" ⋮---- // ContractExpectedData holds expected values derived from smart contracts type ContractExpectedData struct { CurrentEpoch symbiotic.Epoch EpochStartTime symbiotic.Timestamp CurrentEpochDuration uint64 ValidatorSet symbiotic.ValidatorSet NetworkConfig symbiotic.NetworkConfig IsEpochCommitted bool } ⋮---- // getExpectedDataFromContracts retrieves expected values directly from smart contracts func getExpectedDataFromContracts(t *testing.T, relayContracts RelayContractsData) *ContractExpectedData ⋮---- // Check if current epoch is committed ⋮---- // validateValidatorSetAgainstExpected compares API response with expected contract data func validateValidatorSetAgainstExpected(t *testing.T, apiResponse *apiv1.GetValidatorSetResponse, expected *ContractExpectedData) ⋮---- // TestRelayAPIConnectivity tests that all relay servers are accessible via gRPC func TestRelayAPIConnectivity(t *testing.T) ⋮---- // TestValidatorSetAPI tests the GetValidatorSet API endpoint func TestValidatorSetAPI(t *testing.T) ⋮---- const retryAttempts = 4 ⋮---- func TestAPIsSequence(t *testing.T) ⋮---- func testListenSignaturesAPI(t *testing.T) ⋮---- func testListenProofsAPI(t *testing.T) ⋮---- func testListenValidatorSetAPI(t *testing.T) ⋮---- func testGetSignaturesByEpochAPI(t *testing.T) ⋮---- // Verify request_id field is present in each signature ⋮---- func testGetAggregationProofsByEpochAPI(t *testing.T) ⋮---- // Verify request_id field is present in each proof ⋮---- func testGetValidatorByKeyAPI(t *testing.T) ⋮---- func testGetSignatureRequestIDsByEpochAPI(t *testing.T) ⋮---- // Verify each request ID is a valid hex hash ⋮---- func testGetSignatureRequestsByEpochAPI(t *testing.T) ⋮---- // Verify each signature request has valid fields ⋮---- // Verify request ID ⋮---- // Verify key tag ⋮---- // Verify message ⋮---- // Verify required epoch matches the requested epoch ⋮---- func testGetSignatureRequestAPI(t *testing.T) ⋮---- // First, get current epoch ⋮---- // Get signature request IDs for current epoch ⋮---- // Get the first signature request by ID ⋮---- // Verify request ID is included and matches ⋮---- // Verify other fields are populated ⋮---- func testGetLocalValidatorAPI(t *testing.T) ```` ## File: e2e/tests/epoch_test.go ````go package tests ⋮---- import ( "context" "testing" "time" "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/require" "github.com/symbioticfi/relay/symbiotic/client/evm" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" "testing" "time" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/require" ⋮---- "github.com/symbioticfi/relay/symbiotic/client/evm" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- // TestEpochProgression tests that epochs progress correctly over time func TestEpochProgression(t *testing.T) ⋮---- // ensure the current epoch gets committed, timeout after 2x epoch time and error if still not committed ⋮---- // Check if the epoch has been committed ⋮---- // start watching for any new epochs being committed, will keep timeout to 5x the epoch duration ```` ## File: e2e/tests/genesis_test.go ````go package tests ⋮---- import ( "context" "testing" "time" "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/require" "github.com/symbioticfi/relay/symbiotic/client/evm" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" "testing" "time" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/require" ⋮---- "github.com/symbioticfi/relay/symbiotic/client/evm" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- // TestGenesisDone tests that the genesis validator set header has been committed func TestGenesisDone(t *testing.T) ⋮---- // TestContractData tests that the data in the contract matches expected values func TestContractData(t *testing.T) ```` ## File: e2e/tests/http_gateway_test.go ````go package tests ⋮---- import ( "bufio" "context" "encoding/json" "errors" "fmt" "io" "net/http" "strings" "testing" "time" "github.com/stretchr/testify/require" "google.golang.org/protobuf/encoding/protojson" apiv1 "github.com/symbioticfi/relay/api/client/v1" ) ⋮---- "bufio" "context" "encoding/json" "errors" "fmt" "io" "net/http" "strings" "testing" "time" ⋮---- "github.com/stretchr/testify/require" "google.golang.org/protobuf/encoding/protojson" ⋮---- apiv1 "github.com/symbioticfi/relay/api/client/v1" ⋮---- // httpGatewayBaseURL constructs the base URL for HTTP gateway requests func httpGatewayBaseURL(t *testing.T) string ⋮---- // TestHTTPGateway_GetCurrentEpoch tests the HTTP gateway GET endpoint for current epoch func TestHTTPGateway_GetCurrentEpoch(t *testing.T) ⋮---- // Get expected data from gRPC API ⋮---- // Make HTTP request ⋮---- // Verify HTTP status ⋮---- // Verify Content-Type ⋮---- // Parse response using protobuf JSON unmarshaler ⋮---- var httpResult apiv1.GetCurrentEpochResponse ⋮---- // Verify response matches gRPC data ⋮---- // TestHTTPGateway_GetValidatorSet tests the HTTP gateway GET endpoint for validator set func TestHTTPGateway_GetValidatorSet(t *testing.T) ⋮---- var httpResult apiv1.GetValidatorSetResponse ⋮---- // TestHTTPGateway_StreamProofs tests the HTTP gateway streaming endpoint for proofs func TestHTTPGateway_StreamProofs(t *testing.T) ⋮---- // Make HTTP streaming request ⋮---- // Verify SSE Content-Type ⋮---- // Verify SSE headers ⋮---- // Read streaming responses with timeout ⋮---- // Channel to signal when we've read enough messages ⋮---- // Skip empty lines ⋮---- // Parse SSE format: "data: {...}" ⋮---- // Parse the wrapper to extract the result field var wrapper struct { Result json.RawMessage `json:"result"` } ⋮---- // Use protojson to unmarshal the result field var sseMessage apiv1.ListenProofsResponse ⋮---- // Verify message structure (log warnings instead of failing in goroutine) ⋮---- // Wait for messages or timeout ⋮---- // Successfully received messages ⋮---- // Timeout - this is OK if no proofs were generated during test ⋮---- // Check for scanner errors ⋮---- // Only fail if we didn't receive any messages ⋮---- // TestHTTPGateway_StreamSignatures tests the HTTP gateway streaming endpoint for signatures func TestHTTPGateway_StreamSignatures(t *testing.T) ⋮---- // Verify HTTP status and headers ⋮---- // Read a few messages to verify streaming ⋮---- var sseMessage apiv1.ListenSignaturesResponse ```` ## File: e2e/tests/metadata_test.go ````go package tests ⋮---- import ( "context" "fmt" "testing" "time" "github.com/stretchr/testify/require" apiv1 "github.com/symbioticfi/relay/api/client/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" "fmt" "testing" "time" ⋮---- "github.com/stretchr/testify/require" ⋮---- apiv1 "github.com/symbioticfi/relay/api/client/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- // TestGetValidatorSetMetadata tests the GetValidatorSetMetadata API endpoint // and verifies that the request id can be used to retrieve the proof of a committed valset func TestGetValidatorSetMetadata(t *testing.T) ⋮---- // Get last committed epochs to find a committed epoch ≥1 for testing // We need committed epochs because that's when proofs and signatures are available var committedEpoch uint64 const maxRetries = 10 const retryDelay = 10 * time.Second ⋮---- // Find the minimum committed epoch across all chains that is ≥1 ⋮---- // Test 1: Get metadata for committed epoch (should work and have proofs/signatures) ⋮---- // Validate response structure ⋮---- // ExtraData can be empty, so we don't require it to be non-empty ⋮---- // Test 2: Use the request id to get signature request ⋮---- // Validate the signature request ⋮---- // Test 3: Get aggregation proof (should exist for committed epochs) ⋮---- // For committed epochs, aggregation proof should be available ⋮---- // Test 4: Get signatures for the request id (should exist for committed epochs) ⋮---- // For committed epochs, signatures should be available ⋮---- // Validate signatures structure ⋮---- // Test 5: Get metadata without specifying epoch (should use current epoch) ⋮---- // Test 6: Try to get metadata for a future epoch (should fail) ⋮---- // Get current epoch to determine what would be a future epoch ⋮---- // TestGetLastAllCommitted tests the GetLastAllCommitted API endpoint // and validates whether it returns proper epoch info for the contracts func TestGetLastAllCommitted(t *testing.T) ⋮---- // Get expected data from contracts to validate against ⋮---- // Test the GetLastAllCommitted API ⋮---- // Get current epoch for validation ⋮---- // Validate that we have epoch info for all settlement chains in the network config ⋮---- // Validate that the epoch is reasonable (not 0 and not way in the future) ⋮---- // Validate start time is reasonable (not zero and not in the future) ⋮---- // Test individual GetLastCommitted for each chain to ensure consistency ⋮---- // Compare with the result from GetLastAllCommitted ⋮---- // Test edge case: query for non-existent chain ```` ## File: e2e/tests/setup_test.go ````go package tests ⋮---- import ( "context" "encoding/hex" "fmt" "os" "path/filepath" "strings" "sync" "testing" "time" "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/mount" "github.com/go-errors/errors" "github.com/stretchr/testify/require" "github.com/testcontainers/testcontainers-go" "github.com/testcontainers/testcontainers-go/wait" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" apiv1 "github.com/symbioticfi/relay/api/client/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" ) ⋮---- "context" "encoding/hex" "fmt" "os" "path/filepath" "strings" "sync" "testing" "time" ⋮---- "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/mount" "github.com/go-errors/errors" "github.com/stretchr/testify/require" "github.com/testcontainers/testcontainers-go" "github.com/testcontainers/testcontainers-go/wait" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" ⋮---- apiv1 "github.com/symbioticfi/relay/api/client/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" ⋮---- var globalTestEnv *TestEnvironment ⋮---- func TestMain(m *testing.M) ⋮---- // Setup test environment before all tests var err error ⋮---- // Run all tests ⋮---- // Cleanup after all tests ⋮---- type RelaySidecarConfig struct { Keys string DataDir string ContainerName string RequiredSymKey crypto.PrivateKey } ⋮---- type TestEnvironment struct { Containers map[int]testcontainers.Container ContainerPorts map[int]string SidecarConfigs []RelaySidecarConfig } ⋮---- func generateSidecarConfigs(env EnvInfo) []RelaySidecarConfig ⋮---- const ( basePrivateKey = 1000000000000000000 ) ⋮---- // Generate key string in the same format as generate_network.sh ⋮---- func setupGlobalTestEnvironment() (*TestEnvironment, error) ⋮---- // Use the existing docker-compose network ⋮---- // Generate sidecar configurations based on environment variables ⋮---- // Get project root directory (assuming we're in e2e/tests/) ⋮---- // Start each relay sidecar container concurrently type containerResult struct { index int container testcontainers.Container port string } ⋮---- var wg sync.WaitGroup ⋮---- // Create data directory path ⋮---- var env map[string]string ⋮---- // Build the command to start the sidecar ⋮---- // Get the mapped port ⋮---- // Wait for all goroutines to complete ⋮---- // Check for errors ⋮---- // Collect results ⋮---- func cleanupGlobalTestEnvironment(env *TestEnvironment) ⋮---- // Stop and remove containers ⋮---- // Note: We don't remove the network since it might be used by docker-compose // The network will be cleaned up when docker-compose is stopped ⋮---- func (env *TestEnvironment) GetContainerPort(i int) string ⋮---- // Helper function to get container port func (env *TestEnvironment) GetHealthEndpoint(i int) string ⋮---- func (env *TestEnvironment) GetGRPCAddress(index int) string ⋮---- func (env *TestEnvironment) GetGRPCClient(t *testing.T, index int) *apiv1.SymbioticClient ```` ## File: e2e/tests/sidecar.yaml ````yaml # E2E Test Sidecar Configuration # Logging log: level: "debug" mode: "json" # API Server Configuration api: listen: ":8080" verbose-logging: false http-gateway: true # Metrics Configuration metrics: pprof: false # Driver Contract (address is set via command-line flag in tests) driver: chain-id: 31337 # P2P Configuration p2p: listen: "/ip4/0.0.0.0/tcp/8880" bootnodes: - /dns4/relay-sidecar-1/tcp/8880/p2p/16Uiu2HAmFUiPYAJ7bE88Q8d7Kznrw5ifrje2e5QFyt7uFPk2G3iR dht-mode: "server" mdns: true # EVM Configuration evm: chains: - "http://anvil:8545" - "http://anvil-settlement:8546" max-calls: 30 ```` ## File: e2e/tests/sign_test.go ````go package tests ⋮---- import ( "bytes" "context" "crypto/rand" "testing" "time" "github.com/ethereum/go-ethereum/crypto" "github.com/samber/lo" "github.com/stretchr/testify/require" apiv1 "github.com/symbioticfi/relay/api/client/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" cryptoModule "github.com/symbioticfi/relay/symbiotic/usecase/crypto" ) ⋮---- "bytes" "context" "crypto/rand" "testing" "time" ⋮---- "github.com/ethereum/go-ethereum/crypto" "github.com/samber/lo" "github.com/stretchr/testify/require" ⋮---- apiv1 "github.com/symbioticfi/relay/api/client/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" cryptoModule "github.com/symbioticfi/relay/symbiotic/usecase/crypto" ⋮---- const ( defaultECDSAKeyTag = 16 secondaryBLSKeyTag = 11 ) ⋮---- // TestNonHeaderKeySignature tests signing with different non-header key types func TestNonHeaderKeySignature(t *testing.T) ⋮---- var resp *apiv1.SignMessageResponse // retry sign call 3 times as it can get transaction conflict ⋮---- // wait for signatures ⋮---- // expect all n signatures for ECDSA ⋮---- // need at least 2/3 signatures for BLS, signers skip signing is proof is already generated so we may not get all n sigs ⋮---- // verify signatures based on key type ⋮---- // ECDSA signature verification using ethereum crypto ⋮---- // the contract stores 32 bytes padded address for ecdsa addrs, // so stripping first 12 bytes to get to the address ⋮---- // Create public key from stored payload ⋮---- // Verify signature using BLS verification ⋮---- // check for proof var proof *apiv1.GetAggregationProofResponse ⋮---- // if it's ZK proof, poll for the proof to be generated for the epoch duration ```` ## File: e2e/tests/sync_test.go ````go package tests ⋮---- import ( "context" "net/http" "testing" "time" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/stretchr/testify/require" apiv1 "github.com/symbioticfi/relay/api/client/v1" "github.com/symbioticfi/relay/symbiotic/client/evm" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" valsetDeriver "github.com/symbioticfi/relay/symbiotic/usecase/valset-deriver" ) ⋮---- "context" "net/http" "testing" "time" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/stretchr/testify/require" ⋮---- apiv1 "github.com/symbioticfi/relay/api/client/v1" "github.com/symbioticfi/relay/symbiotic/client/evm" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" valsetDeriver "github.com/symbioticfi/relay/symbiotic/usecase/valset-deriver" ⋮---- // TestAggregatorSignatureSync tests that aggregators can sync missed signatures // and generate proofs even when they were offline during signature collection. // // Test scenario: // 1. Get current epoch from EVM client // 2. Stop all aggregators before signatures are generated // 3. Wait for next epoch to trigger signature generation by signers // 4. Verify signers have generated signatures // 5. Start aggregators back up // 6. Verify aggregators sync missed signatures and generate proofs func TestAggregatorSignatureSync(t *testing.T) ⋮---- // Load deployment data to get contract addresses and environment info ⋮---- // Identify aggregators ⋮---- var aggregatorIndexes []int ⋮---- // Step 1: Get current epoch from EVM client ⋮---- // Step 2: Stop all aggregator containers ⋮---- // Step 3: Wait for next epoch to trigger signature generation // During this time, signers will generate signatures but aggregators are offline ⋮---- // Step 4: Verify signers have generated signatures ⋮---- // Step 5: Start aggregators back up ⋮---- // Step 6: Verify aggregators have synced and generated proofs ⋮---- // Wait for aggregator to be healthy ⋮---- func waitForErrorIsNil(ctx context.Context, timeout time.Duration, f func() error) error ⋮---- // waitForHealthy polls a health endpoint until it returns 200 or timeout occurs func waitForHealthy(ctx context.Context, healthURL string, timeout time.Duration) error ⋮---- // createEVMClient creates an EVM client for interacting with the blockchain func createEVMClient(t *testing.T, deploymentData RelayContractsData) *evm.Client ⋮---- // waitForEpoch waits until the specified epoch is reached func waitForEpoch(ctx context.Context, client evm.IEvmClient, targetEpoch symbiotic.Epoch, timeout time.Duration) error ⋮---- // Continue trying on error, but log it ```` ## File: e2e/tests/types_test.go ````go package tests ⋮---- import ( "context" "encoding/json" "os" "time" "github.com/go-errors/errors" "github.com/kelseyhightower/envconfig" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" symbioticCrypto "github.com/symbioticfi/relay/symbiotic/usecase/crypto" ) ⋮---- "context" "encoding/json" "os" "time" ⋮---- "github.com/go-errors/errors" "github.com/kelseyhightower/envconfig" ⋮---- symbiotic "github.com/symbioticfi/relay/symbiotic/entity" symbioticCrypto "github.com/symbioticfi/relay/symbiotic/usecase/crypto" ⋮---- var ( settlementChains = []string{ "http://localhost:8545", // Main anvil chain "http://localhost:8546", // Settlement anvil chain } ) ⋮---- "http://localhost:8545", // Main anvil chain "http://localhost:8546", // Settlement anvil chain ⋮---- // RelayServerEndpoint represents a relay server endpoint for testing type RelayServerEndpoint struct { Address string Port string Role string // "committer", "aggregator", "signer" } ⋮---- Role string // "committer", "aggregator", "signer" ⋮---- // ContractAddress represents a contract address with chain ID type ContractAddress struct { Addr string `json:"addr"` ChainId uint64 `json:"chainId"` } ⋮---- // RelayContractsData represents the structure from relay_contracts.json type RelayContractsData struct { Driver ContractAddress `json:"driver"` KeyRegistry ContractAddress `json:"keyRegistry"` Network string `json:"network"` Settlements []ContractAddress `json:"settlements"` StakingTokens []ContractAddress `json:"stakingTokens"` VotingPowerProviders []ContractAddress `json:"votingPowerProviders"` Env EnvInfo `json:"-"` } ⋮---- type EnvInfo struct { Operators int64 `default:"4" split_words:"true"` Commiters int64 `default:"1" split_words:"true"` Aggregators int64 `default:"1" split_words:"true"` EpochTime uint64 `default:"30" split_words:"true"` VerificationType uint32 `default:"1" split_words:"true"` } ⋮---- // GetDriverAddress returns the driver address as a string for backward compatibility func (d RelayContractsData) GetDriverAddress() string ⋮---- // GetKeyRegistryAddress returns the key registry address as a string func (d RelayContractsData) GetKeyRegistryAddress() string ⋮---- // GetVotingPowerProviderAddress returns the first voting power provider address func (d RelayContractsData) GetVotingPowerProviderAddress() string ⋮---- // GetSettlementAddresses returns all settlement addresses func (d RelayContractsData) GetSettlementAddresses() []ContractAddress ⋮---- func loadDeploymentData(ctx context.Context) (RelayContractsData, error) ⋮---- // Wait for relay_contracts.json to be created by shell script const maxWaitTime = 60 * time.Second const checkInterval = 500 * time.Millisecond ⋮---- break // File exists, break the loop ⋮---- var relayContracts RelayContractsData ⋮---- // testMockKeyProvider is a mock key provider for testing type testMockKeyProvider struct{} ⋮---- func (m *testMockKeyProvider) GetPrivateKey(_ symbiotic.KeyTag) (symbioticCrypto.PrivateKey, error) ⋮---- func (m *testMockKeyProvider) GetPrivateKeyByAlias(_ string) (symbioticCrypto.PrivateKey, error) ⋮---- func (m *testMockKeyProvider) GetPrivateKeyByNamespaceTypeId(_ string, _ symbiotic.KeyType, _ int) (symbioticCrypto.PrivateKey, error) ⋮---- func (m *testMockKeyProvider) HasKey(_ symbiotic.KeyTag) (bool, error) ⋮---- func (m *testMockKeyProvider) HasKeyByAlias(_ string) (bool, error) ⋮---- func (m *testMockKeyProvider) HasKeyByNamespaceTypeId(_ string, _ symbiotic.KeyType, _ int) (bool, error) ```` ## File: e2e/README.md ````markdown # E2E Testing Guide This directory contains end-to-end tests for the Symbiotic Relay project. The tests run against a local blockchain network with configurable relay operators, commiters, and aggregators. ## Prerequisites - Docker and Docker Compose - Go 1.25+ - Node.js and npm (for smart contract compilation) - Foundry (forge) for contract building ## Quick Start 1. **Setup the test environment:** ```bash ./setup.sh ``` 2. **Start the network:** ```bash cd temp-network docker compose up -d cd .. ``` 3. **Run the tests:** ```bash cd tests go test -v ``` ## Configuration You can customize the test environment by setting environment variables before running `setup.sh`. All variables have sensible defaults. ### Environment Variables | Variable | Default | Description | |----------|---------|-------------| | `OPERATORS` | `4` | Number of relay operators (max: 999) | | `COMMITERS` | `1` | Number of commiter nodes | | `AGGREGATORS` | `1` | Number of aggregator nodes | | `VERIFICATION_TYPE` | `1` | Verification type: `0`=BLS-BN254-ZK, `1`=BLS-BN254-SIMPLE | | `EPOCH_TIME` | `30` | Time for new epochs in relay network (seconds) | | `BLOCK_TIME` | `1` | Block time in seconds for anvil interval mining | | `FINALITY_BLOCKS` | `2` | Number of blocks for finality | ### Example with Custom Configuration ```bash # Set custom configuration export OPERATORS=6 export COMMITERS=2 export AGGREGATORS=1 export VERIFICATION_TYPE=0 export EPOCH_TIME=32 export BLOCK_TIME=2 # Run setup ./setup.sh # Start network cd temp-network docker compose up -d cd .. # Run tests cd tests go test -v ``` ## Contract Information The tests use smart contracts from the Symbiotic protocol: - **Repository**: https://github.com/symbioticfi/symbiotic-super-sum The commit hash can be updated in `setup.sh` if needed for testing against different contract versions. ```` ## File: e2e/setup.sh ````bash #!/bin/bash set -eo pipefail # Configuration # Contracts commit hash to use CONTRACTS_COMMIT="24bcb351c8b6125b0412d5bf7916da405c548000" # Circuits commit CIRCUITS_COMMIT="e2e-branch" # ----------------------------------------- echo "Building Relay Docker image for e2e tests..." # go to root of repo cd .. make image TAG=dev # get back into e2e cd e2e # Check if temp-network directory exists and clean up any running containers if [ -d "temp-network" ]; then echo "Found existing temp-network directory. Attempting to clean up running containers..." cd temp-network if ! docker compose down; then echo "WARNING: Failed to run 'docker compose down' in temp-network directory." echo "Please manually clean up the temp-network directory and any running containers before proceeding." echo "You can try: cd temp-network && docker compose down --remove-orphans && cd .. && rm -rf temp-network" exit 1 fi cd .. echo "Successfully cleaned up existing containers." fi echo "Setting up Symbiotic contracts..." if [ ! -d "contracts" ]; then echo "Cloning Symbiotic contracts repository..." git clone https://github.com/symbioticfi/symbiotic-super-sum contracts else echo "Contracts directory already exists, skipping clone..." fi cd contracts git fetch origin git checkout $CONTRACTS_COMMIT echo "Installing dependencies..." npm install echo "Building contracts..." forge build cd .. # Pass through all environment variables to generate_network.sh with defaults export OPERATORS=${OPERATORS} export COMMITERS=${COMMITERS} export AGGREGATORS=${AGGREGATORS} export VERIFICATION_TYPE=${VERIFICATION_TYPE} export EPOCH_TIME=${EPOCH_TIME} export BLOCK_TIME=${BLOCK_TIME} export FINALITY_BLOCKS=${FINALITY_BLOCKS} export GENERATE_SIDECARS=${GENERATE_SIDECARS} # Call the generate network script ./scripts/generate_network.sh # If verification type is 0, clone the circuit keys repository if [ "${VERIFICATION_TYPE}" = "0" ]; then echo "Verification type is 0, cloning circuit keys repository..." if [ ! -d "temp-network/circuits" ]; then echo "Cloning circuit keys repository (shallow clone of specific commit)..." # Create circuits directory in temp-network mkdir -p temp-network/circuits cd temp-network/circuits # Initialize empty git repo and add remote git init git remote add origin https://github.com/symbioticfi/relay-bn254-example-circuit-keys # Fetch only the specific commit (shallow) with parallel jobs for speed git fetch --depth 1 --jobs=4 origin $CIRCUITS_COMMIT git checkout FETCH_HEAD # Remove git metadata to keep only the files rm -rf .git cd ../.. echo "Circuit keys cloned successfully to temp-network/circuits/" else echo "Circuits directory already exists in temp-network, skipping clone..." fi echo "Copying circuits to contracts directory and building..." cp -r temp-network/circuits contracts/circuits cd contracts echo "Building circuits with Forge..." forge build circuits/ else echo "Verification type is not 0, skipping circuit keys clone..." fi echo "Setup complete! Network configuration generated in temp-network/ directory." ```` ## File: hack/codegen/generate-client-types.go ````go package main ⋮---- // generate-client-types is a tool to parse the generated protobuf file and create a client types file // that exports types for client usage, including enums, requests, responses, and data types. ⋮---- import ( "fmt" "go/ast" "go/parser" "go/token" "os" "regexp" "sort" "strings" ) ⋮---- "fmt" "go/ast" "go/parser" "go/token" "os" "regexp" "sort" "strings" ⋮---- const clientTemplate = `// Code generated by generate-client-types. DO NOT EDIT. package v1 import ( apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" ) // Exported types for client usage %s ` ⋮---- type TypeInfo struct { Name string Category string IsEnum bool Constants []string } ⋮---- func main() ⋮---- // Parse the generated protobuf file ⋮---- // Generate the client file content ⋮---- // Write to client file ⋮---- func parseGeneratedFile(filename string) ([]TypeInfo, error) ⋮---- // Read the file content ⋮---- // Parse using AST ⋮---- var types []TypeInfo ⋮---- // Walk the AST to find type declarations ⋮---- // Skip internal/private types ⋮---- // Determine type category and if it's an enum ⋮---- // Check if it's an enum (int32 type) ⋮---- func isExportedType(typeName string) bool ⋮---- // Skip internal protobuf types and unexported types ⋮---- func categorizeStruct(typeName string) string ⋮---- return "response" // ErrorResponse goes with responses ⋮---- func findEnumConstants(content, enumName string) []string ⋮---- var constants []string ⋮---- // Use regex to find enum constants ⋮---- func generateClientContent(types []TypeInfo) string ⋮---- var sections []string ⋮---- // Group types by category ⋮---- // Sort each category ⋮---- // Generate enums section ⋮---- // Generate enum constants ⋮---- // Generate request types section ⋮---- // Generate response types section ⋮---- // Generate data types section ⋮---- func hasEnumConstants(enums []TypeInfo) bool ```` ## File: hack/docgen/generate-cli-docs.go ````go package main ⋮---- import ( "fmt" "log" "os" "path/filepath" "strings" "github.com/spf13/cobra/doc" relay "github.com/symbioticfi/relay/cmd/relay/root" utils "github.com/symbioticfi/relay/cmd/utils/root" ) ⋮---- "fmt" "log" "os" "path/filepath" "strings" ⋮---- "github.com/spf13/cobra/doc" relay "github.com/symbioticfi/relay/cmd/relay/root" utils "github.com/symbioticfi/relay/cmd/utils/root" ⋮---- func main() ⋮---- // The default header looks like `Argocd app get`. The leading capital letter is off-putting. // This header overrides the default. It's better visually and for search results. ⋮---- filename = filename[:len(filename)-3] // Drop the '.md' ⋮---- // Create docs/cli directory ⋮---- // Disable auto-generated timestamp line ```` ## File: internal/client/p2p/proto/v1/message_grpc.pb.go ````go // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: v1/message.proto ⋮---- package v1 ⋮---- import ( context "context" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" ) ⋮---- context "context" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" ⋮---- // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. // Requires gRPC-Go v1.64.0 or later. const _ = grpc.SupportPackageIsVersion9 ⋮---- const ( SymbioticP2PService_WantSignatures_FullMethodName = "/internal.client.p2p.proto.v1.SymbioticP2PService/WantSignatures" SymbioticP2PService_WantAggregationProofs_FullMethodName = "/internal.client.p2p.proto.v1.SymbioticP2PService/WantAggregationProofs" ) ⋮---- // SymbioticP2PServiceClient is the client API for SymbioticP2PService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type SymbioticP2PServiceClient interface { WantSignatures(ctx context.Context, in *WantSignaturesRequest, opts ...grpc.CallOption) (*WantSignaturesResponse, error) WantAggregationProofs(ctx context.Context, in *WantAggregationProofsRequest, opts ...grpc.CallOption) (*WantAggregationProofsResponse, error) } ⋮---- type symbioticP2PServiceClient struct { cc grpc.ClientConnInterface } ⋮---- func NewSymbioticP2PServiceClient(cc grpc.ClientConnInterface) SymbioticP2PServiceClient ⋮---- func (c *symbioticP2PServiceClient) WantSignatures(ctx context.Context, in *WantSignaturesRequest, opts ...grpc.CallOption) (*WantSignaturesResponse, error) ⋮---- func (c *symbioticP2PServiceClient) WantAggregationProofs(ctx context.Context, in *WantAggregationProofsRequest, opts ...grpc.CallOption) (*WantAggregationProofsResponse, error) ⋮---- // SymbioticP2PServiceServer is the server API for SymbioticP2PService service. // All implementations must embed UnimplementedSymbioticP2PServiceServer // for forward compatibility. type SymbioticP2PServiceServer interface { WantSignatures(context.Context, *WantSignaturesRequest) (*WantSignaturesResponse, error) WantAggregationProofs(context.Context, *WantAggregationProofsRequest) (*WantAggregationProofsResponse, error) mustEmbedUnimplementedSymbioticP2PServiceServer() } ⋮---- // UnimplementedSymbioticP2PServiceServer must be embedded to have // forward compatible implementations. ⋮---- // NOTE: this should be embedded by value instead of pointer to avoid a nil // pointer dereference when methods are called. type UnimplementedSymbioticP2PServiceServer struct{} ⋮---- func (UnimplementedSymbioticP2PServiceServer) mustEmbedUnimplementedSymbioticP2PServiceServer() func (UnimplementedSymbioticP2PServiceServer) testEmbeddedByValue() ⋮---- // UnsafeSymbioticP2PServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to SymbioticP2PServiceServer will // result in compilation errors. type UnsafeSymbioticP2PServiceServer interface { mustEmbedUnimplementedSymbioticP2PServiceServer() } ⋮---- func RegisterSymbioticP2PServiceServer(s grpc.ServiceRegistrar, srv SymbioticP2PServiceServer) ⋮---- // If the following call pancis, it indicates UnimplementedSymbioticP2PServiceServer was // embedded by pointer and is nil. This will cause panics if an // unimplemented method is ever invoked, so we test this at initialization // time to prevent it from happening at runtime later due to I/O. ⋮---- func _SymbioticP2PService_WantSignatures_Handler(srv interface ⋮---- func _SymbioticP2PService_WantAggregationProofs_Handler(srv interface ⋮---- // SymbioticP2PService_ServiceDesc is the grpc.ServiceDesc for SymbioticP2PService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var SymbioticP2PService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "internal.client.p2p.proto.v1.SymbioticP2PService", HandlerType: (*SymbioticP2PServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "WantSignatures", Handler: _SymbioticP2PService_WantSignatures_Handler, }, { MethodName: "WantAggregationProofs", Handler: _SymbioticP2PService_WantAggregationProofs_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "v1/message.proto", } ```` ## File: internal/client/p2p/proto/v1/message.pb.go ````go // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.6 // protoc (unknown) // source: v1/message.proto ⋮---- package v1 ⋮---- import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" unsafe "unsafe" ) ⋮---- protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" unsafe "unsafe" ⋮---- const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) ⋮---- // Verify that this generated code is sufficiently up-to-date. ⋮---- // Verify that runtime/protoimpl is sufficiently up-to-date. ⋮---- // AggregationProof represents the aggregated signatures message type AggregationProof struct { state protoimpl.MessageState `protogen:"open.v1"` KeyTag uint32 `protobuf:"varint,2,opt,name=key_tag,json=keyTag,proto3" json:"key_tag,omitempty"` Epoch uint64 `protobuf:"varint,3,opt,name=epoch,proto3" json:"epoch,omitempty"` MessageHash []byte `protobuf:"bytes,4,opt,name=message_hash,json=messageHash,proto3" json:"message_hash,omitempty"` Proof []byte `protobuf:"bytes,5,opt,name=proof,proto3" json:"proof,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- func (x *AggregationProof) Reset() ⋮---- func (x *AggregationProof) String() string ⋮---- func (*AggregationProof) ProtoMessage() ⋮---- func (x *AggregationProof) ProtoReflect() protoreflect.Message ⋮---- // Deprecated: Use AggregationProof.ProtoReflect.Descriptor instead. func (*AggregationProof) Descriptor() ([]byte, []int) ⋮---- func (x *AggregationProof) GetKeyTag() uint32 ⋮---- func (x *AggregationProof) GetEpoch() uint64 ⋮---- func (x *AggregationProof) GetMessageHash() []byte ⋮---- func (x *AggregationProof) GetProof() []byte ⋮---- // P2PMessage represents a peer-to-peer message wrapper type P2PMessage struct { state protoimpl.MessageState `protogen:"open.v1"` Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` Timestamp int64 `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Deprecated: Use P2PMessage.ProtoReflect.Descriptor instead. ⋮---- func (x *P2PMessage) GetSender() string ⋮---- func (x *P2PMessage) GetTimestamp() int64 ⋮---- func (x *P2PMessage) GetData() []byte ⋮---- type WantSignaturesRequest struct { state protoimpl.MessageState `protogen:"open.v1"` // Map of request id to bitmap of wanted validator indices WantSignatures map[string][]byte `protobuf:"bytes,1,rep,name=want_signatures,json=wantSignatures,proto3" json:"want_signatures,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` // key: hex string of common.Hash, value: roaring bitmap bytes unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Map of request id to bitmap of wanted validator indices WantSignatures map[string][]byte `protobuf:"bytes,1,rep,name=want_signatures,json=wantSignatures,proto3" json:"want_signatures,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` // key: hex string of common.Hash, value: roaring bitmap bytes ⋮---- // Deprecated: Use WantSignaturesRequest.ProtoReflect.Descriptor instead. ⋮---- func (x *WantSignaturesRequest) GetWantSignatures() map[string][]byte ⋮---- type WantSignaturesResponse struct { state protoimpl.MessageState `protogen:"open.v1"` // Map of request id to list of validator signatures Signatures map[string]*ValidatorSignatureList `protobuf:"bytes,2,rep,name=signatures,proto3" json:"signatures,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` // key: hex string of common.Hash unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Map of request id to list of validator signatures Signatures map[string]*ValidatorSignatureList `protobuf:"bytes,2,rep,name=signatures,proto3" json:"signatures,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` // key: hex string of common.Hash ⋮---- // Deprecated: Use WantSignaturesResponse.ProtoReflect.Descriptor instead. ⋮---- func (x *WantSignaturesResponse) GetSignatures() map[string]*ValidatorSignatureList ⋮---- // ValidatorSignatureList contains a list of validator signatures for a specific request type ValidatorSignatureList struct { state protoimpl.MessageState `protogen:"open.v1"` Signatures []*ValidatorSignature `protobuf:"bytes,1,rep,name=signatures,proto3" json:"signatures,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Deprecated: Use ValidatorSignatureList.ProtoReflect.Descriptor instead. ⋮---- // ValidatorSignature pairs a signature with its validator index type ValidatorSignature struct { state protoimpl.MessageState `protogen:"open.v1"` ValidatorIndex uint32 `protobuf:"varint,1,opt,name=validator_index,json=validatorIndex,proto3" json:"validator_index,omitempty"` Signature *Signature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Deprecated: Use ValidatorSignature.ProtoReflect.Descriptor instead. ⋮---- func (x *ValidatorSignature) GetValidatorIndex() uint32 ⋮---- func (x *ValidatorSignature) GetSignature() *Signature ⋮---- // Signature represents extended signature data type Signature struct { state protoimpl.MessageState `protogen:"open.v1"` MessageHash []byte `protobuf:"bytes,1,opt,name=message_hash,json=messageHash,proto3" json:"message_hash,omitempty"` KeyTag uint32 `protobuf:"varint,2,opt,name=key_tag,json=keyTag,proto3" json:"key_tag,omitempty"` Epoch uint64 `protobuf:"varint,3,opt,name=epoch,proto3" json:"epoch,omitempty"` Signature []byte `protobuf:"bytes,4,opt,name=signature,proto3" json:"signature,omitempty"` PublicKey []byte `protobuf:"bytes,5,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Deprecated: Use Signature.ProtoReflect.Descriptor instead. ⋮---- func (x *Signature) GetPublicKey() []byte ⋮---- type WantAggregationProofsRequest struct { state protoimpl.MessageState `protogen:"open.v1"` // List of request ids for which aggregation proofs are needed RequestIds []string `protobuf:"bytes,1,rep,name=request_ids,json=requestIds,proto3" json:"request_ids,omitempty"` // hex strings of common.Hash unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // List of request ids for which aggregation proofs are needed RequestIds []string `protobuf:"bytes,1,rep,name=request_ids,json=requestIds,proto3" json:"request_ids,omitempty"` // hex strings of common.Hash ⋮---- // Deprecated: Use WantAggregationProofsRequest.ProtoReflect.Descriptor instead. ⋮---- func (x *WantAggregationProofsRequest) GetRequestIds() []string ⋮---- type WantAggregationProofsResponse struct { state protoimpl.MessageState `protogen:"open.v1"` // Map of request ids to aggregation proof Proofs map[string]*AggregationProof `protobuf:"bytes,1,rep,name=proofs,proto3" json:"proofs,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` // key: hex string of common.Hash unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Map of request ids to aggregation proof Proofs map[string]*AggregationProof `protobuf:"bytes,1,rep,name=proofs,proto3" json:"proofs,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` // key: hex string of common.Hash ⋮---- // Deprecated: Use WantAggregationProofsResponse.ProtoReflect.Descriptor instead. ⋮---- func (x *WantAggregationProofsResponse) GetProofs() map[string]*AggregationProof ⋮---- var File_v1_message_proto protoreflect.FileDescriptor ⋮---- const file_v1_message_proto_rawDesc = "" + "\n" + "\x10v1/message.proto\x12\x1cinternal.client.p2p.proto.v1\"z\n" + "\x10AggregationProof\x12\x17\n" + "\akey_tag\x18\x02 \x01(\rR\x06keyTag\x12\x14\n" + "\x05epoch\x18\x03 \x01(\x04R\x05epoch\x12!\n" + "\fmessage_hash\x18\x04 \x01(\fR\vmessageHash\x12\x14\n" + "\x05proof\x18\x05 \x01(\fR\x05proof\"V\n" + "\n" + "P2PMessage\x12\x16\n" + "\x06sender\x18\x01 \x01(\tR\x06sender\x12\x1c\n" + "\ttimestamp\x18\x02 \x01(\x03R\ttimestamp\x12\x12\n" + "\x04data\x18\x03 \x01(\fR\x04data\"\xcc\x01\n" + "\x15WantSignaturesRequest\x12p\n" + "\x0fwant_signatures\x18\x01 \x03(\v2G.internal.client.p2p.proto.v1.WantSignaturesRequest.WantSignaturesEntryR\x0ewantSignatures\x1aA\n" + "\x13WantSignaturesEntry\x12\x10\n" + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + "\x05value\x18\x02 \x01(\fR\x05value:\x028\x01\"\xf3\x01\n" + "\x16WantSignaturesResponse\x12d\n" + "\n" + "signatures\x18\x02 \x03(\v2D.internal.client.p2p.proto.v1.WantSignaturesResponse.SignaturesEntryR\n" + "signatures\x1as\n" + "\x0fSignaturesEntry\x12\x10\n" + "\x03key\x18\x01 \x01(\tR\x03key\x12J\n" + "\x05value\x18\x02 \x01(\v24.internal.client.p2p.proto.v1.ValidatorSignatureListR\x05value:\x028\x01\"j\n" + "\x16ValidatorSignatureList\x12P\n" + "\n" + "signatures\x18\x01 \x03(\v20.internal.client.p2p.proto.v1.ValidatorSignatureR\n" + "signatures\"\x84\x01\n" + "\x12ValidatorSignature\x12'\n" + "\x0fvalidator_index\x18\x01 \x01(\rR\x0evalidatorIndex\x12E\n" + "\tsignature\x18\x02 \x01(\v2'.internal.client.p2p.proto.v1.SignatureR\tsignature\"\x9a\x01\n" + "\tSignature\x12!\n" + "\fmessage_hash\x18\x01 \x01(\fR\vmessageHash\x12\x17\n" + "\akey_tag\x18\x02 \x01(\rR\x06keyTag\x12\x14\n" + "\x05epoch\x18\x03 \x01(\x04R\x05epoch\x12\x1c\n" + "\tsignature\x18\x04 \x01(\fR\tsignature\x12\x1d\n" + "\n" + "public_key\x18\x05 \x01(\fR\tpublicKey\"?\n" + "\x1cWantAggregationProofsRequest\x12\x1f\n" + "\vrequest_ids\x18\x01 \x03(\tR\n" + "requestIds\"\xeb\x01\n" + "\x1dWantAggregationProofsResponse\x12_\n" + "\x06proofs\x18\x01 \x03(\v2G.internal.client.p2p.proto.v1.WantAggregationProofsResponse.ProofsEntryR\x06proofs\x1ai\n" + "\vProofsEntry\x12\x10\n" + "\x03key\x18\x01 \x01(\tR\x03key\x12D\n" + "\x05value\x18\x02 \x01(\v2..internal.client.p2p.proto.v1.AggregationProofR\x05value:\x028\x012\xa5\x02\n" + "\x13SymbioticP2PService\x12{\n" + "\x0eWantSignatures\x123.internal.client.p2p.proto.v1.WantSignaturesRequest\x1a4.internal.client.p2p.proto.v1.WantSignaturesResponse\x12\x90\x01\n" + "\x15WantAggregationProofs\x12:.internal.client.p2p.proto.v1.WantAggregationProofsRequest\x1a;.internal.client.p2p.proto.v1.WantAggregationProofsResponseB\x80\x02\n" + " com.internal.client.p2p.proto.v1B\fMessageProtoP\x01Z9github.com/symbioticfi/relay/internal/client/p2p/proto/v1\xa2\x02\x04ICPP\xaa\x02\x1cInternal.Client.P2p.Proto.V1\xca\x02\x1cInternal\\Client\\P2p\\Proto\\V1\xe2\x02(Internal\\Client\\P2p\\Proto\\V1\\GPBMetadata\xea\x02 Internal::Client::P2p::Proto::V1b\x06proto3" ⋮---- var ( file_v1_message_proto_rawDescOnce sync.Once file_v1_message_proto_rawDescData []byte ) ⋮---- func file_v1_message_proto_rawDescGZIP() []byte ⋮---- var file_v1_message_proto_msgTypes = make([]protoimpl.MessageInfo, 12) var file_v1_message_proto_goTypes = []any{ (*AggregationProof)(nil), // 0: internal.client.p2p.proto.v1.AggregationProof (*P2PMessage)(nil), // 1: internal.client.p2p.proto.v1.P2PMessage (*WantSignaturesRequest)(nil), // 2: internal.client.p2p.proto.v1.WantSignaturesRequest (*WantSignaturesResponse)(nil), // 3: internal.client.p2p.proto.v1.WantSignaturesResponse (*ValidatorSignatureList)(nil), // 4: internal.client.p2p.proto.v1.ValidatorSignatureList (*ValidatorSignature)(nil), // 5: internal.client.p2p.proto.v1.ValidatorSignature (*Signature)(nil), // 6: internal.client.p2p.proto.v1.Signature (*WantAggregationProofsRequest)(nil), // 7: internal.client.p2p.proto.v1.WantAggregationProofsRequest (*WantAggregationProofsResponse)(nil), // 8: internal.client.p2p.proto.v1.WantAggregationProofsResponse nil, // 9: internal.client.p2p.proto.v1.WantSignaturesRequest.WantSignaturesEntry nil, // 10: internal.client.p2p.proto.v1.WantSignaturesResponse.SignaturesEntry nil, // 11: internal.client.p2p.proto.v1.WantAggregationProofsResponse.ProofsEntry } ⋮---- (*AggregationProof)(nil), // 0: internal.client.p2p.proto.v1.AggregationProof (*P2PMessage)(nil), // 1: internal.client.p2p.proto.v1.P2PMessage (*WantSignaturesRequest)(nil), // 2: internal.client.p2p.proto.v1.WantSignaturesRequest (*WantSignaturesResponse)(nil), // 3: internal.client.p2p.proto.v1.WantSignaturesResponse (*ValidatorSignatureList)(nil), // 4: internal.client.p2p.proto.v1.ValidatorSignatureList (*ValidatorSignature)(nil), // 5: internal.client.p2p.proto.v1.ValidatorSignature (*Signature)(nil), // 6: internal.client.p2p.proto.v1.Signature (*WantAggregationProofsRequest)(nil), // 7: internal.client.p2p.proto.v1.WantAggregationProofsRequest (*WantAggregationProofsResponse)(nil), // 8: internal.client.p2p.proto.v1.WantAggregationProofsResponse nil, // 9: internal.client.p2p.proto.v1.WantSignaturesRequest.WantSignaturesEntry nil, // 10: internal.client.p2p.proto.v1.WantSignaturesResponse.SignaturesEntry nil, // 11: internal.client.p2p.proto.v1.WantAggregationProofsResponse.ProofsEntry ⋮---- var file_v1_message_proto_depIdxs = []int32{ 9, // 0: internal.client.p2p.proto.v1.WantSignaturesRequest.want_signatures:type_name -> internal.client.p2p.proto.v1.WantSignaturesRequest.WantSignaturesEntry 10, // 1: internal.client.p2p.proto.v1.WantSignaturesResponse.signatures:type_name -> internal.client.p2p.proto.v1.WantSignaturesResponse.SignaturesEntry 5, // 2: internal.client.p2p.proto.v1.ValidatorSignatureList.signatures:type_name -> internal.client.p2p.proto.v1.ValidatorSignature 6, // 3: internal.client.p2p.proto.v1.ValidatorSignature.signature:type_name -> internal.client.p2p.proto.v1.Signature 11, // 4: internal.client.p2p.proto.v1.WantAggregationProofsResponse.proofs:type_name -> internal.client.p2p.proto.v1.WantAggregationProofsResponse.ProofsEntry 4, // 5: internal.client.p2p.proto.v1.WantSignaturesResponse.SignaturesEntry.value:type_name -> internal.client.p2p.proto.v1.ValidatorSignatureList 0, // 6: internal.client.p2p.proto.v1.WantAggregationProofsResponse.ProofsEntry.value:type_name -> internal.client.p2p.proto.v1.AggregationProof 2, // 7: internal.client.p2p.proto.v1.SymbioticP2PService.WantSignatures:input_type -> internal.client.p2p.proto.v1.WantSignaturesRequest 7, // 8: internal.client.p2p.proto.v1.SymbioticP2PService.WantAggregationProofs:input_type -> internal.client.p2p.proto.v1.WantAggregationProofsRequest 3, // 9: internal.client.p2p.proto.v1.SymbioticP2PService.WantSignatures:output_type -> internal.client.p2p.proto.v1.WantSignaturesResponse 8, // 10: internal.client.p2p.proto.v1.SymbioticP2PService.WantAggregationProofs:output_type -> internal.client.p2p.proto.v1.WantAggregationProofsResponse 9, // [9:11] is the sub-list for method output_type 7, // [7:9] is the sub-list for method input_type 7, // [7:7] is the sub-list for extension type_name 7, // [7:7] is the sub-list for extension extendee 0, // [0:7] is the sub-list for field type_name } ⋮---- 9, // 0: internal.client.p2p.proto.v1.WantSignaturesRequest.want_signatures:type_name -> internal.client.p2p.proto.v1.WantSignaturesRequest.WantSignaturesEntry 10, // 1: internal.client.p2p.proto.v1.WantSignaturesResponse.signatures:type_name -> internal.client.p2p.proto.v1.WantSignaturesResponse.SignaturesEntry 5, // 2: internal.client.p2p.proto.v1.ValidatorSignatureList.signatures:type_name -> internal.client.p2p.proto.v1.ValidatorSignature 6, // 3: internal.client.p2p.proto.v1.ValidatorSignature.signature:type_name -> internal.client.p2p.proto.v1.Signature 11, // 4: internal.client.p2p.proto.v1.WantAggregationProofsResponse.proofs:type_name -> internal.client.p2p.proto.v1.WantAggregationProofsResponse.ProofsEntry 4, // 5: internal.client.p2p.proto.v1.WantSignaturesResponse.SignaturesEntry.value:type_name -> internal.client.p2p.proto.v1.ValidatorSignatureList 0, // 6: internal.client.p2p.proto.v1.WantAggregationProofsResponse.ProofsEntry.value:type_name -> internal.client.p2p.proto.v1.AggregationProof 2, // 7: internal.client.p2p.proto.v1.SymbioticP2PService.WantSignatures:input_type -> internal.client.p2p.proto.v1.WantSignaturesRequest 7, // 8: internal.client.p2p.proto.v1.SymbioticP2PService.WantAggregationProofs:input_type -> internal.client.p2p.proto.v1.WantAggregationProofsRequest 3, // 9: internal.client.p2p.proto.v1.SymbioticP2PService.WantSignatures:output_type -> internal.client.p2p.proto.v1.WantSignaturesResponse 8, // 10: internal.client.p2p.proto.v1.SymbioticP2PService.WantAggregationProofs:output_type -> internal.client.p2p.proto.v1.WantAggregationProofsResponse 9, // [9:11] is the sub-list for method output_type 7, // [7:9] is the sub-list for method input_type 7, // [7:7] is the sub-list for extension type_name 7, // [7:7] is the sub-list for extension extendee 0, // [0:7] is the sub-list for field type_name ⋮---- func init() func file_v1_message_proto_init() ⋮---- type x struct{} ```` ## File: internal/client/p2p/proto/v1/message.proto ````protobuf syntax = "proto3"; package internal.client.p2p.proto.v1; option go_package = "github.com/symbioticfi/relay/internal/client/p2p/proto/v1"; // AggregationProof represents the aggregated signatures message message AggregationProof { uint32 key_tag = 2; uint64 epoch = 3; bytes message_hash = 4; bytes proof = 5; } // P2PMessage represents a peer-to-peer message wrapper message P2PMessage { string sender = 1; int64 timestamp = 2; bytes data = 3; } service SymbioticP2PService { rpc WantSignatures(WantSignaturesRequest) returns (WantSignaturesResponse); rpc WantAggregationProofs(WantAggregationProofsRequest) returns (WantAggregationProofsResponse); } message WantSignaturesRequest { // Map of request id to bitmap of wanted validator indices map want_signatures = 1; // key: hex string of common.Hash, value: roaring bitmap bytes } message WantSignaturesResponse { // Map of request id to list of validator signatures map signatures = 2; // key: hex string of common.Hash } // ValidatorSignatureList contains a list of validator signatures for a specific request message ValidatorSignatureList { repeated ValidatorSignature signatures = 1; } // ValidatorSignature pairs a signature with its validator index message ValidatorSignature { uint32 validator_index = 1; Signature signature = 2; } // Signature represents extended signature data message Signature { bytes message_hash = 1; uint32 key_tag = 2; uint64 epoch = 3; bytes signature = 4; bytes public_key = 5; } message WantAggregationProofsRequest { // List of request ids for which aggregation proofs are needed repeated string request_ids = 1; // hex strings of common.Hash } message WantAggregationProofsResponse { // Map of request ids to aggregation proof map proofs = 1; // key: hex string of common.Hash } ```` ## File: internal/client/p2p/broadcast_signature_aggregated_message.go ````go package p2p ⋮---- import ( "context" "github.com/go-errors/errors" "google.golang.org/protobuf/proto" prototypes "github.com/symbioticfi/relay/internal/client/p2p/proto/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" ⋮---- "github.com/go-errors/errors" "google.golang.org/protobuf/proto" ⋮---- prototypes "github.com/symbioticfi/relay/internal/client/p2p/proto/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- func (s *Service) BroadcastSignatureAggregatedMessage(ctx context.Context, msg symbiotic.AggregationProof) error ```` ## File: internal/client/p2p/broadcast_signature_generated_message.go ````go package p2p ⋮---- import ( "context" "github.com/go-errors/errors" "google.golang.org/protobuf/proto" prototypes "github.com/symbioticfi/relay/internal/client/p2p/proto/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" ⋮---- "github.com/go-errors/errors" "google.golang.org/protobuf/proto" ⋮---- prototypes "github.com/symbioticfi/relay/internal/client/p2p/proto/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- func (s *Service) BroadcastSignatureGeneratedMessage(ctx context.Context, msg symbiotic.Signature) error ```` ## File: internal/client/p2p/discovery_integration_test.go ````go package p2p ⋮---- import ( "context" "testing" "time" "github.com/libp2p/go-libp2p" "github.com/libp2p/go-libp2p/core/host" "github.com/libp2p/go-libp2p/core/network" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) ⋮---- "context" "testing" "time" ⋮---- "github.com/libp2p/go-libp2p" "github.com/libp2p/go-libp2p/core/host" "github.com/libp2p/go-libp2p/core/network" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ⋮---- func TestDiscoveryService_Start_WithDHTEnabled_InitializesDHT(t *testing.T) ⋮---- func TestDiscoveryService_Start_WithDHTDisabled_SkipsDHT(t *testing.T) ⋮---- func TestDiscoveryService_Start_WhenAlreadyStarted_ReturnsError(t *testing.T) ⋮---- func TestDiscoveryService_initDHT_WithClientMode_Success(t *testing.T) ⋮---- func TestDiscoveryService_initDHT_WithBootstrapPeers_ParsesPeers(t *testing.T) ⋮---- func TestDiscoveryService_initMDNS_WhenDisabled_ReturnsNil(t *testing.T) ⋮---- func TestDiscoveryService_initMDNS_WhenEnabled_InitializesMDNS(t *testing.T) ⋮---- func TestDiscoveryService_Close_WithDHTAndMDNS_ClosesAll(t *testing.T) ⋮---- func TestDiscoveryService_HandlePeerFound_ConnectsToPeer(t *testing.T) ⋮---- func TestDiscoveryService_Advertise_WithValidRdiscov_SuccessOrExpectedError(t *testing.T) ⋮---- func TestDiscoveryService_Advertise_WithZeroTTL_CallsAdvertise(t *testing.T) ⋮---- func TestDiscoveryService_GetDiscoveryClient_WhenInitialized_ReturnsClient(t *testing.T) ```` ## File: internal/client/p2p/discovery_test.go ````go package p2p ⋮---- import ( "context" "testing" "time" "github.com/libp2p/go-libp2p" dht "github.com/libp2p/go-libp2p-kad-dht" "github.com/libp2p/go-libp2p/core/host" "github.com/libp2p/go-libp2p/core/network" "github.com/libp2p/go-libp2p/core/peer" "github.com/multiformats/go-multiaddr" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) ⋮---- "context" "testing" "time" ⋮---- "github.com/libp2p/go-libp2p" dht "github.com/libp2p/go-libp2p-kad-dht" "github.com/libp2p/go-libp2p/core/host" "github.com/libp2p/go-libp2p/core/network" "github.com/libp2p/go-libp2p/core/peer" "github.com/multiformats/go-multiaddr" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ⋮---- func createMockHost(t *testing.T) host.Host ⋮---- func TestDiscoveryService_determineDHTMode_Client(t *testing.T) ⋮---- func TestDiscoveryService_determineDHTMode_Server(t *testing.T) ⋮---- func TestDiscoveryService_determineDHTMode_Auto(t *testing.T) ⋮---- func TestDiscoveryService_determineDHTMode_Empty(t *testing.T) ⋮---- func TestDiscoveryService_determineDHTMode_Invalid(t *testing.T) ⋮---- func TestDiscoveryService_parseBootstrapPeers_EmptyList(t *testing.T) ⋮---- func TestDiscoveryService_parseBootstrapPeers_ValidPeer(t *testing.T) ⋮---- func TestDiscoveryService_parseBootstrapPeers_InvalidPeer(t *testing.T) ⋮---- func TestDiscoveryService_parseBootstrapPeers_SkipsSelfPeer(t *testing.T) ⋮---- func TestDiscoveryService_parseBootstrapPeers_MultiplePeers(t *testing.T) ⋮---- func TestDiscoveryService_GetDiscoveryClient_WhenNotInitialized_ReturnsNil(t *testing.T) ⋮---- func TestNewDiscoveryService_WithValidHost_Success(t *testing.T) ⋮---- func TestNewDiscoveryService_WithNilHost_ReturnsError(t *testing.T) ⋮---- func TestDiscoveryService_Advertise_WhenRdiscovIsNil_ReturnsError(t *testing.T) ⋮---- func TestDiscoveryService_connectToPeer_AlreadyConnected_ReturnsNil(t *testing.T) ⋮---- func TestDiscoveryService_connectToPeer_NotConnected_ConnectsToPeer(t *testing.T) ⋮---- func TestDiscoveryService_connectToPeer_WithTimeout_ReturnsError(t *testing.T) ⋮---- func TestDiscoveryService_Close_WhenNotStarted_ReturnsNil(t *testing.T) ```` ## File: internal/client/p2p/discovery.go ````go package p2p ⋮---- import ( "context" "log/slog" "sync" "time" "github.com/go-errors/errors" dht "github.com/libp2p/go-libp2p-kad-dht" "github.com/libp2p/go-libp2p/core/discovery" "github.com/libp2p/go-libp2p/core/host" "github.com/libp2p/go-libp2p/core/network" "github.com/libp2p/go-libp2p/core/peer" "github.com/libp2p/go-libp2p/p2p/discovery/mdns" drouting "github.com/libp2p/go-libp2p/p2p/discovery/routing" ) ⋮---- "context" "log/slog" "sync" "time" ⋮---- "github.com/go-errors/errors" dht "github.com/libp2p/go-libp2p-kad-dht" "github.com/libp2p/go-libp2p/core/discovery" "github.com/libp2p/go-libp2p/core/host" "github.com/libp2p/go-libp2p/core/network" "github.com/libp2p/go-libp2p/core/peer" "github.com/libp2p/go-libp2p/p2p/discovery/mdns" drouting "github.com/libp2p/go-libp2p/p2p/discovery/routing" ⋮---- // DiscoveryService implements peer discovery functionality allowing both DHT and mDNS. type DiscoveryService struct { cfg Config host host.Host dht *dht.IpfsDHT mdns mdns.Service rdiscov *drouting.RoutingDiscovery mu sync.RWMutex started bool ctx context.Context cancel context.CancelFunc lastAdvertisement time.Time bootstrapPeers []peer.AddrInfo } ⋮---- // DiscoverySvc represents the peer discovery service interface. type DiscoverySvc interface { Start(ctx context.Context) error Close(ctx context.Context) error GetDiscoveryClient(ctx context.Context) *drouting.RoutingDiscovery } ⋮---- const ProtocolPrefix = "/symbiotic" ⋮---- // NewDiscoveryService creates a new discovery service. func NewDiscoveryService(cfg Config) (*DiscoveryService, error) ⋮---- func (s *DiscoveryService) initDHT(ctx context.Context) error ⋮---- func (s *DiscoveryService) determineDHTMode(ctx context.Context) dht.ModeOpt ⋮---- func (s *DiscoveryService) parseBootstrapPeers(ctx context.Context) ([]peer.AddrInfo, error) ⋮---- func (s *DiscoveryService) initMDNS(ctx context.Context) error ⋮---- func (s *DiscoveryService) Start(ctx context.Context) error ⋮---- func (s *DiscoveryService) maintainConnections(ctx context.Context) ⋮---- func (s *DiscoveryService) Close(ctx context.Context) error ⋮---- func (s *DiscoveryService) GetDiscoveryClient(ctx context.Context) *drouting.RoutingDiscovery ⋮---- func (s *DiscoveryService) Advertise(ctx context.Context, topic string) error ⋮---- // HandlePeerFound processes a newly discovered mDNS peer and attempts to connect. func (s *DiscoveryService) HandlePeerFound(peerInfo peer.AddrInfo) ⋮---- // linter suggests to use separate context ⋮---- // Attempt to connect to the discovered peer ⋮---- func (s *DiscoveryService) connectToPeer(ctx context.Context, peerInfo peer.AddrInfo) error ```` ## File: internal/client/p2p/p2p_broadcast_test.go ````go package p2p ⋮---- import ( "context" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) ⋮---- "context" "testing" ⋮---- "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ⋮---- func TestService_ID_ReturnsHostID(t *testing.T) ⋮---- func TestService_Broadcast_TopicNotFound_ReturnsError(t *testing.T) ⋮---- func TestService_AddPeer_SkipsSelfConnection(t *testing.T) ⋮---- func TestService_AddPeer_ConnectsToValidPeer(t *testing.T) ```` ## File: internal/client/p2p/p2p_grpc_handler.go ````go package p2p ⋮---- import ( "context" "github.com/go-errors/errors" p2pv1 "github.com/symbioticfi/relay/internal/client/p2p/proto/v1" "github.com/symbioticfi/relay/internal/entity" "github.com/symbioticfi/relay/pkg/log" ) ⋮---- "context" ⋮---- "github.com/go-errors/errors" ⋮---- p2pv1 "github.com/symbioticfi/relay/internal/client/p2p/proto/v1" "github.com/symbioticfi/relay/internal/entity" "github.com/symbioticfi/relay/pkg/log" ⋮---- // syncRequestHandler defines the interface for handling both signature and aggregation proof requests type syncRequestHandler interface { HandleWantSignaturesRequest(ctx context.Context, request entity.WantSignaturesRequest) (entity.WantSignaturesResponse, error) HandleWantAggregationProofsRequest(ctx context.Context, request entity.WantAggregationProofsRequest) (entity.WantAggregationProofsResponse, error) } ⋮---- type GRPCHandler struct { p2pv1.UnimplementedSymbioticP2PServiceServer syncHandler syncRequestHandler } ⋮---- func NewP2PHandler(syncHandler syncRequestHandler) *GRPCHandler ⋮---- // WantSignatures handles incoming signature requests from peers func (h *GRPCHandler) WantSignatures(ctx context.Context, req *p2pv1.WantSignaturesRequest) (*p2pv1.WantSignaturesResponse, error) ⋮---- // WantAggregationProofs handles incoming aggregation proof requests from peers func (h *GRPCHandler) WantAggregationProofs(ctx context.Context, req *p2pv1.WantAggregationProofsRequest) (*p2pv1.WantAggregationProofsResponse, error) ```` ## File: internal/client/p2p/p2p_grpc_send_want_aggregation_proofs_request_test.go ````go package p2p ⋮---- import ( "context" "testing" "time" "github.com/ethereum/go-ethereum/common" "github.com/libp2p/go-libp2p" "github.com/libp2p/go-libp2p/core/peer" "github.com/libp2p/go-libp2p/core/peerstore" "github.com/stretchr/testify/require" "github.com/symbioticfi/relay/internal/entity" "github.com/symbioticfi/relay/pkg/signals" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" "testing" "time" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/libp2p/go-libp2p" "github.com/libp2p/go-libp2p/core/peer" "github.com/libp2p/go-libp2p/core/peerstore" "github.com/stretchr/testify/require" ⋮---- "github.com/symbioticfi/relay/internal/entity" "github.com/symbioticfi/relay/pkg/signals" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- func TestSendWantAggregationProofsRequest_HappyPath(t *testing.T) ⋮---- type mockAggregationProofHandler struct { expectedRequest entity.WantAggregationProofsRequest responseToReturn entity.WantAggregationProofsResponse wasCalled bool receivedRequest entity.WantAggregationProofsRequest } ⋮---- func (m *mockAggregationProofHandler) HandleWantSignaturesRequest(_ context.Context, request entity.WantSignaturesRequest) (entity.WantSignaturesResponse, error) ⋮---- func (m *mockAggregationProofHandler) HandleWantAggregationProofsRequest(_ context.Context, request entity.WantAggregationProofsRequest) (entity.WantAggregationProofsResponse, error) ```` ## File: internal/client/p2p/p2p_grpc_send_want_aggregation_proofs_request.go ````go package p2p ⋮---- import ( "context" "time" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/libp2p/go-libp2p/core/peer" "github.com/samber/lo" prototypes "github.com/symbioticfi/relay/internal/client/p2p/proto/v1" "github.com/symbioticfi/relay/internal/entity" "github.com/symbioticfi/relay/pkg/log" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" "time" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/libp2p/go-libp2p/core/peer" "github.com/samber/lo" ⋮---- prototypes "github.com/symbioticfi/relay/internal/client/p2p/proto/v1" "github.com/symbioticfi/relay/internal/entity" "github.com/symbioticfi/relay/pkg/log" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- // SendWantAggregationProofsRequest sends a synchronous aggregation proof request to a peer func (s *Service) SendWantAggregationProofsRequest(ctx context.Context, request entity.WantAggregationProofsRequest) (entity.WantAggregationProofsResponse, error) ⋮---- // Convert entity request to protobuf ⋮---- // Select a peer for the request ⋮---- // Send request to the selected peer ⋮---- // sendAggregationProofRequestToPeer sends a gRPC aggregation proof request to a specific peer func (s *Service) sendAggregationProofRequestToPeer(ctx context.Context, peerID peer.ID, req *prototypes.WantAggregationProofsRequest) (*prototypes.WantAggregationProofsResponse, error) ⋮---- // Create gRPC connection over libp2p stream ⋮---- // Create gRPC client and send request ⋮---- // entityToProtoAggregationProofRequest converts entity.WantAggregationProofsRequest to protobuf func entityToProtoAggregationProofRequest(req entity.WantAggregationProofsRequest) *prototypes.WantAggregationProofsRequest ⋮---- // protoToEntityAggregationProofResponse converts protobuf WantAggregationProofsResponse to entity func protoToEntityAggregationProofResponse(resp *prototypes.WantAggregationProofsResponse) entity.WantAggregationProofsResponse ⋮---- // Convert aggregation proof ⋮---- // protoToEntityAggregationProofRequest converts protobuf WantAggregationProofsRequest to entity func protoToEntityAggregationProofRequest(req *prototypes.WantAggregationProofsRequest) entity.WantAggregationProofsRequest ⋮---- // entityToProtoAggregationProofResponse converts entity WantAggregationProofsResponse to protobuf func entityToProtoAggregationProofResponse(resp entity.WantAggregationProofsResponse) *prototypes.WantAggregationProofsResponse ```` ## File: internal/client/p2p/p2p_grpc_send_want_signatures_request_test.go ````go package p2p ⋮---- import ( "context" "testing" "time" "github.com/ethereum/go-ethereum/common" "github.com/libp2p/go-libp2p" "github.com/libp2p/go-libp2p/core/peer" "github.com/libp2p/go-libp2p/core/peerstore" "github.com/stretchr/testify/require" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" "github.com/symbioticfi/relay/internal/entity" "github.com/symbioticfi/relay/pkg/signals" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" "testing" "time" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/libp2p/go-libp2p" "github.com/libp2p/go-libp2p/core/peer" "github.com/libp2p/go-libp2p/core/peerstore" "github.com/stretchr/testify/require" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" ⋮---- "github.com/symbioticfi/relay/internal/entity" "github.com/symbioticfi/relay/pkg/signals" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- func TestSendWantSignaturesRequest_HappyPath(t *testing.T) ⋮---- // Setup two libp2p hosts (peer1 as client, peer2 as server) ⋮---- // Manually connect the peers by adding addresses to peerstore ⋮---- // Actually connect the peers ⋮---- // Create test data for the request ⋮---- // Create signature bitmaps (requesting signatures from validators 0, 2, 5) ⋮---- // Create expected response data ⋮---- // Setup mock sync request handler for the server ⋮---- // Create server P2P service using NewService constructor ⋮---- SkipMessageSign: true, // Skip message signing for tests ⋮---- // Start the gRPC server ⋮---- // Stop server ⋮---- // Create client P2P service using NewService constructor ⋮---- Handler: NewP2PHandler(mockHandler), // Not used for client but required ⋮---- // Execute the test: send want signatures request ⋮---- // Verify the response ⋮---- // Verify signatures for testHash1 ⋮---- // Find and verify first signature var foundSig1, foundSig2 *entity.ValidatorSignature ⋮---- // Verify signatures for testHash2 ⋮---- // Verify that the mock handler was called with the correct request ⋮---- // mockSyncRequestHandler implements syncRequestHandler for testing type mockSyncRequestHandler struct { expectedRequest entity.WantSignaturesRequest responseToReturn entity.WantSignaturesResponse wasCalled bool receivedRequest entity.WantSignaturesRequest } ⋮---- func (m *mockSyncRequestHandler) HandleWantSignaturesRequest(_ context.Context, request entity.WantSignaturesRequest) (entity.WantSignaturesResponse, error) ⋮---- func (m *mockSyncRequestHandler) HandleWantAggregationProofsRequest(_ context.Context, request entity.WantAggregationProofsRequest) (entity.WantAggregationProofsResponse, error) ⋮---- // Return empty response for tests that don't need aggregation proof functionality ```` ## File: internal/client/p2p/p2p_grpc_send_want_signatures_request.go ````go package p2p ⋮---- import ( "context" "log/slog" "math/rand/v2" "net" "time" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" gostream "github.com/libp2p/go-libp2p-gostream" "github.com/libp2p/go-libp2p/core/peer" "github.com/libp2p/go-libp2p/core/protocol" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" prototypes "github.com/symbioticfi/relay/internal/client/p2p/proto/v1" "github.com/symbioticfi/relay/internal/entity" "github.com/symbioticfi/relay/pkg/log" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" "log/slog" "math/rand/v2" "net" "time" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" gostream "github.com/libp2p/go-libp2p-gostream" "github.com/libp2p/go-libp2p/core/peer" "github.com/libp2p/go-libp2p/core/protocol" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" ⋮---- prototypes "github.com/symbioticfi/relay/internal/client/p2p/proto/v1" "github.com/symbioticfi/relay/internal/entity" "github.com/symbioticfi/relay/pkg/log" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- const grpcProtocolTag protocol.ID = "/relay/v1/grpc" ⋮---- // SendWantSignaturesRequest sends a synchronous signature request to a peer func (s *Service) SendWantSignaturesRequest(ctx context.Context, request entity.WantSignaturesRequest) (entity.WantSignaturesResponse, error) ⋮---- // Convert entity request to protobuf ⋮---- // Select a peer for the request ⋮---- // Send request to the selected peer ⋮---- // Convert protobuf response to entity ⋮---- // sendRequestToPeer sends a gRPC request to a specific peer func (s *Service) sendRequestToPeer(ctx context.Context, peerID peer.ID, req *prototypes.WantSignaturesRequest) (*prototypes.WantSignaturesResponse, error) ⋮---- // Create gRPC connection over libp2p stream ⋮---- // Create gRPC client and send request ⋮---- // createGRPCConnection creates a gRPC connection to a peer over libp2p func (s *Service) createGRPCConnection(_ context.Context, peerID peer.ID) (*grpc.ClientConn, error) ⋮---- // entityToProtoRequest converts entity.WantSignaturesRequest to protobuf func entityToProtoRequest(req entity.WantSignaturesRequest) (*prototypes.WantSignaturesRequest, error) ⋮---- // Serialize roaring bitmap to bytes ⋮---- // protoToEntityResponse converts protobuf WantSignaturesResponse to entity func protoToEntityResponse(ctx context.Context, resp *prototypes.WantSignaturesResponse) entity.WantSignaturesResponse ⋮---- // Convert validator signatures var validatorSigs []entity.ValidatorSignature ⋮---- // selectPeerForSync selects a single peer for synchronous signature requests func (s *Service) selectPeerForSync() (peer.ID, error) ⋮---- //nolint:gosec // G404: non-cryptographic random selection ⋮---- // protoToEntityRequest converts protobuf WantSignaturesRequest to entity func protoToEntityRequest(req *prototypes.WantSignaturesRequest) (entity.WantSignaturesRequest, error) ⋮---- // Deserialize roaring bitmap from bytes ⋮---- // entityToProtoResponse converts entity WantSignaturesResponse to protobuf func entityToProtoResponse(resp entity.WantSignaturesResponse) *prototypes.WantSignaturesResponse ⋮---- var protoSigs []*prototypes.ValidatorSignature ```` ## File: internal/client/p2p/p2p_grpc_test.go ````go package p2p ⋮---- import ( "context" "net" "testing" "time" "github.com/ethereum/go-ethereum/common" grpcmiddleware "github.com/grpc-ecosystem/go-grpc-middleware" grpc_retry "github.com/grpc-ecosystem/go-grpc-middleware/retry" "github.com/libp2p/go-libp2p" gostream "github.com/libp2p/go-libp2p-gostream" "github.com/libp2p/go-libp2p/core/peer" "github.com/libp2p/go-libp2p/core/peerstore" "github.com/libp2p/go-libp2p/core/protocol" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" v2 "github.com/symbioticfi/relay/internal/client/p2p/proto/v1" "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" "net" "testing" "time" ⋮---- "github.com/ethereum/go-ethereum/common" grpcmiddleware "github.com/grpc-ecosystem/go-grpc-middleware" grpc_retry "github.com/grpc-ecosystem/go-grpc-middleware/retry" "github.com/libp2p/go-libp2p" gostream "github.com/libp2p/go-libp2p-gostream" "github.com/libp2p/go-libp2p/core/peer" "github.com/libp2p/go-libp2p/core/peerstore" "github.com/libp2p/go-libp2p/core/protocol" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" ⋮---- v2 "github.com/symbioticfi/relay/internal/client/p2p/proto/v1" "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- func TestP2P_GRPC(t *testing.T) ⋮---- var tag protocol.ID = "/testp2pgrpc" ⋮---- type myHandler struct { v2.UnimplementedSymbioticP2PServiceServer } ⋮---- func (m myHandler) WantSignatures(ctx context.Context, request *v2.WantSignaturesRequest) (*v2.WantSignaturesResponse, error) ⋮---- func (m myHandler) HandleWantSignaturesRequest(ctx context.Context, request entity.WantSignaturesRequest) (entity.WantSignaturesResponse, error) ⋮---- func (m myHandler) HandleWantAggregationProofsRequest(ctx context.Context, request entity.WantAggregationProofsRequest) (entity.WantAggregationProofsResponse, error) ```` ## File: internal/client/p2p/p2p_handle_message_test.go ````go package p2p ⋮---- import ( "context" "testing" "time" "github.com/libp2p/go-libp2p" pubsub "github.com/libp2p/go-libp2p-pubsub" pubsub_pb "github.com/libp2p/go-libp2p-pubsub/pb" "github.com/libp2p/go-libp2p/core/crypto" "github.com/libp2p/go-libp2p/core/host" "github.com/libp2p/go-libp2p/p2p/security/noise" "github.com/libp2p/go-libp2p/p2p/transport/tcp" "github.com/samber/lo" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "google.golang.org/grpc" p2pEntity "github.com/symbioticfi/relay/internal/entity" "github.com/symbioticfi/relay/pkg/signals" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" symbioticCrypto "github.com/symbioticfi/relay/symbiotic/usecase/crypto" ) ⋮---- "context" "testing" "time" ⋮---- "github.com/libp2p/go-libp2p" pubsub "github.com/libp2p/go-libp2p-pubsub" pubsub_pb "github.com/libp2p/go-libp2p-pubsub/pb" "github.com/libp2p/go-libp2p/core/crypto" "github.com/libp2p/go-libp2p/core/host" "github.com/libp2p/go-libp2p/p2p/security/noise" "github.com/libp2p/go-libp2p/p2p/transport/tcp" "github.com/samber/lo" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ⋮---- "google.golang.org/grpc" ⋮---- p2pEntity "github.com/symbioticfi/relay/internal/entity" "github.com/symbioticfi/relay/pkg/signals" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" symbioticCrypto "github.com/symbioticfi/relay/symbiotic/usecase/crypto" ⋮---- // TestService_IntegrationSuccessful tests full P2P communication between two services func TestService_IntegrationSuccessful(t *testing.T) ⋮---- // Create two libp2p hosts ⋮---- // Connect the peers ⋮---- time.Sleep(100 * time.Millisecond) // Small delay to ensure the gossip protocol is set up ⋮---- // Wait for connection to establish ⋮---- // Set up message listener on service2 var receivedMsg p2pEntity.P2PMessage[symbiotic.Signature] ⋮---- // Prepare test message ⋮---- // Send the message from service1 ⋮---- // Verify the received message ⋮---- // TestService_IntegrationFailedSignature tests P2P communication with a message that fails signature verification func TestService_IntegrationFailedSignature(t *testing.T) ⋮---- func createTestService(t *testing.T, skipMessageSigning bool, tracer pubsub.EventTracer) *Service ⋮---- type rejectTracer struct { rejectCh chan *pubsub_pb.TraceEvent } ⋮---- func (rt *rejectTracer) Trace(evt *pubsub_pb.TraceEvent) ⋮---- // mockMetrics implements the metrics interface for testing type mockMetrics struct{} ⋮---- func (m *mockMetrics) UnaryServerInterceptor() grpc.UnaryServerInterceptor ⋮---- func (m *mockMetrics) StreamServerInterceptor() grpc.StreamServerInterceptor ⋮---- func (m *mockMetrics) ObserveP2PPeerMessageSent(messageType, status string) ⋮---- func TestService_AggregatedProofIntegrationSuccessful(t *testing.T) ⋮---- var receivedMsg p2pEntity.P2PMessage[symbiotic.AggregationProof] ```` ## File: internal/client/p2p/p2p_handle_message_unit_test.go ````go package p2p ⋮---- import ( "testing" pubsub "github.com/libp2p/go-libp2p-pubsub" pubsub_pb "github.com/libp2p/go-libp2p-pubsub/pb" "github.com/libp2p/go-libp2p/core/peer" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "google.golang.org/protobuf/proto" prototypes "github.com/symbioticfi/relay/internal/client/p2p/proto/v1" ) ⋮---- "testing" ⋮---- pubsub "github.com/libp2p/go-libp2p-pubsub" pubsub_pb "github.com/libp2p/go-libp2p-pubsub/pb" "github.com/libp2p/go-libp2p/core/peer" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "google.golang.org/protobuf/proto" ⋮---- prototypes "github.com/symbioticfi/relay/internal/client/p2p/proto/v1" ⋮---- func TestHandleSignatureReadyMessage_WithOversizedPublicKey_ReturnsError(t *testing.T) ⋮---- func TestHandleSignatureReadyMessage_WithOversizedSignature_ReturnsError(t *testing.T) ⋮---- func TestHandleSignatureReadyMessage_WithOversizedMessageHash_ReturnsError(t *testing.T) ⋮---- func TestHandleSignatureReadyMessage_WithInvalidPublicKey_ReturnsError(t *testing.T) ⋮---- func TestHandleAggregatedProofReadyMessage_WithOversizedMessageHash_ReturnsError(t *testing.T) ⋮---- func TestHandleAggregatedProofReadyMessage_WithOversizedProof_ReturnsError(t *testing.T) ⋮---- func TestUnmarshalMessage_WithInvalidP2PMessage_ReturnsError(t *testing.T) ⋮---- var signature prototypes.Signature ⋮---- func TestUnmarshalMessage_WithInvalidInnerMessage_ReturnsError(t *testing.T) ⋮---- func TestExtractSenderInfo_WithInvalidPeerID_ReturnsError(t *testing.T) ```` ## File: internal/client/p2p/p2p_handle_message.go ````go package p2p ⋮---- import ( "github.com/go-errors/errors" pubsub "github.com/libp2p/go-libp2p-pubsub" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" "google.golang.org/protobuf/proto" prototypes "github.com/symbioticfi/relay/internal/client/p2p/proto/v1" p2pEntity "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "github.com/go-errors/errors" pubsub "github.com/libp2p/go-libp2p-pubsub" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" "google.golang.org/protobuf/proto" ⋮---- prototypes "github.com/symbioticfi/relay/internal/client/p2p/proto/v1" p2pEntity "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- func (s *Service) handleSignatureReadyMessage(pubSubMsg *pubsub.Message) error ⋮---- var signature prototypes.Signature ⋮---- // Validate the signature message ⋮---- func (s *Service) handleAggregatedProofReadyMessage(pubSubMsg *pubsub.Message) error ⋮---- var signaturesAggregated prototypes.AggregationProof ⋮---- // Validate the signaturesAggregated message ⋮---- func extractSenderInfo(pubSubMsg *pubsub.Message) (p2pEntity.SenderInfo, error) ⋮---- // try to extract public key from sender peer.ID ⋮---- func unmarshalMessage(msg *pubsub.Message, v proto.Message) error ⋮---- var message prototypes.P2PMessage ```` ## File: internal/client/p2p/p2p_test.go ````go package p2p ⋮---- import ( "testing" "github.com/libp2p/go-libp2p" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) ⋮---- "testing" ⋮---- "github.com/libp2p/go-libp2p" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ⋮---- func TestConfig_Validate_Success(t *testing.T) ⋮---- func TestConfig_Validate_MissingHost(t *testing.T) ⋮---- func TestConfig_Validate_MissingMetrics(t *testing.T) ⋮---- func TestConfig_Validate_MissingHandler(t *testing.T) ⋮---- func TestDefaultDiscoveryConfig_ReturnsValidConfig(t *testing.T) ```` ## File: internal/client/p2p/p2p.go ````go package p2p ⋮---- import ( "context" "log/slog" "time" "github.com/go-errors/errors" "github.com/go-playground/validator/v10" gostream "github.com/libp2p/go-libp2p-gostream" pubsub "github.com/libp2p/go-libp2p-pubsub" "github.com/libp2p/go-libp2p/core/host" "github.com/libp2p/go-libp2p/core/network" "github.com/libp2p/go-libp2p/core/peer" "github.com/multiformats/go-multiaddr" "google.golang.org/grpc" "google.golang.org/protobuf/proto" prototypes "github.com/symbioticfi/relay/internal/client/p2p/proto/v1" p2pEntity "github.com/symbioticfi/relay/internal/entity" "github.com/symbioticfi/relay/pkg/log" "github.com/symbioticfi/relay/pkg/server" "github.com/symbioticfi/relay/pkg/signals" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" "log/slog" "time" ⋮---- "github.com/go-errors/errors" "github.com/go-playground/validator/v10" gostream "github.com/libp2p/go-libp2p-gostream" pubsub "github.com/libp2p/go-libp2p-pubsub" "github.com/libp2p/go-libp2p/core/host" "github.com/libp2p/go-libp2p/core/network" "github.com/libp2p/go-libp2p/core/peer" "github.com/multiformats/go-multiaddr" "google.golang.org/grpc" "google.golang.org/protobuf/proto" ⋮---- prototypes "github.com/symbioticfi/relay/internal/client/p2p/proto/v1" p2pEntity "github.com/symbioticfi/relay/internal/entity" "github.com/symbioticfi/relay/pkg/log" "github.com/symbioticfi/relay/pkg/server" "github.com/symbioticfi/relay/pkg/signals" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- const ( topicPrefix = "/relay/v1" topicSignatureReady = topicPrefix + "/signature/ready" topicAggProofReady = topicPrefix + "/proof/ready" maxP2PMessageSize = 1<<20 + 1024 // 1 MiB + 1 KiB for overhead maxRequestIDSize = 32 maxPubKeySize = 96 maxSignatureSize = 96 maxMsgHashSize = 64 maxProofSize = 1 << 20 ) ⋮---- maxP2PMessageSize = 1<<20 + 1024 // 1 MiB + 1 KiB for overhead ⋮---- type metrics interface { ObserveP2PPeerMessageSent(messageType, status string) UnaryServerInterceptor() grpc.UnaryServerInterceptor StreamServerInterceptor() grpc.StreamServerInterceptor } ⋮---- // DiscoveryConfig contains discovery protocol configuration type DiscoveryConfig struct { // EnableMDNS specifies whether mDNS discovery is enabled. EnableMDNS bool // MDNSServiceName is the mDNS service name. MDNSServiceName string // DHTMode specifies the DHT mode. DHTMode string // BootstrapPeers is the list of bootstrap peers in multiaddr format. BootstrapPeers []string // AdvertiseTTL is the advertise time-to-live duration. AdvertiseTTL time.Duration // AdvertiseServiceName is the advertise service name. AdvertiseServiceName string // AdvertiseInterval is the interval between advertisements. AdvertiseInterval time.Duration // ConnectionTimeout is the timeout for peer connections. ConnectionTimeout time.Duration // MaxDHTReconnectPeerCount is the maximum number of DHT reconnect peers. MaxDHTReconnectPeerCount int // DHTPeerDiscoveryInterval is the interval for DHT peer discovery. Should be smaller than AdvertiseInterval. DHTPeerDiscoveryInterval time.Duration // DHTRoutingTableRefreshInterval is the interval for DHT routing table refresh. Should be greater than DHTPeerDiscoveryInterval. DHTRoutingTableRefreshInterval time.Duration } ⋮---- // EnableMDNS specifies whether mDNS discovery is enabled. ⋮---- // MDNSServiceName is the mDNS service name. ⋮---- // DHTMode specifies the DHT mode. ⋮---- // BootstrapPeers is the list of bootstrap peers in multiaddr format. ⋮---- // AdvertiseTTL is the advertise time-to-live duration. ⋮---- // AdvertiseServiceName is the advertise service name. ⋮---- // AdvertiseInterval is the interval between advertisements. ⋮---- // ConnectionTimeout is the timeout for peer connections. ⋮---- // MaxDHTReconnectPeerCount is the maximum number of DHT reconnect peers. ⋮---- // DHTPeerDiscoveryInterval is the interval for DHT peer discovery. Should be smaller than AdvertiseInterval. ⋮---- // DHTRoutingTableRefreshInterval is the interval for DHT routing table refresh. Should be greater than DHTPeerDiscoveryInterval. ⋮---- func DefaultDiscoveryConfig() DiscoveryConfig ⋮---- AdvertiseTTL: 3 * time.Hour, // max allowed value in kdht package ⋮---- DHTRoutingTableRefreshInterval: 10 * time.Minute, // same as kdht package default ⋮---- type Config struct { Host host.Host `validate:"required"` SkipMessageSign bool Metrics metrics `validate:"required"` Discovery DiscoveryConfig `validate:"required"` EventTracer pubsub.EventTracer Handler prototypes.SymbioticP2PServiceServer `validate:"required"` } ⋮---- func (c Config) Validate() error ⋮---- // Service handles peer-to-peer communication and signature aggregation type Service struct { ctx context.Context host host.Host signatureReceivedHandler *signals.Signal[p2pEntity.P2PMessage[symbiotic.Signature]] signaturesAggregatedHandler *signals.Signal[p2pEntity.P2PMessage[symbiotic.AggregationProof]] metrics metrics topicsMap map[string]*pubsub.Topic p2pGRPCHandler prototypes.SymbioticP2PServiceServer } ⋮---- // NewService creates a new P2P service with the given configuration func NewService(ctx context.Context, cfg Config, signalCfg signals.Config) (*Service, error) ⋮---- func (s *Service) listenForMessages(ctx context.Context, sub *pubsub.Subscription, topic *pubsub.Topic, handler func(msg *pubsub.Message) error) ⋮---- func (s *Service) StartSignatureMessageListener(mh func(ctx context.Context, msg p2pEntity.P2PMessage[symbiotic.Signature]) error) error ⋮---- func (s *Service) StartSignaturesAggregatedMessageListener(mh func(ctx context.Context, msg p2pEntity.P2PMessage[symbiotic.AggregationProof]) error) error ⋮---- func (s *Service) addPeer(pi peer.AddrInfo) error ⋮---- // broadcast sends a message to all connected peers func (s *Service) broadcast(ctx context.Context, topicName string, data []byte) error ⋮---- // Marshal and send the message ⋮---- // Close gracefully stops the service func (s *Service) Close() error ⋮---- func (s *Service) Listen(n network.Network, multiaddr multiaddr.Multiaddr) ⋮---- func (s *Service) ListenClose(n network.Network, multiaddr multiaddr.Multiaddr) ⋮---- func (s *Service) Connected(n network.Network, conn network.Conn) ⋮---- func (s *Service) Disconnected(n network.Network, conn network.Conn) ⋮---- func (s *Service) ID() string ⋮---- func (s *Service) StartGRPCServer(ctx context.Context) error ⋮---- //nolint:contextcheck // the context comes from th stream ⋮---- // Wait for context cancellation or server error ```` ## File: internal/client/repository/badger/proto/v1/badger.pb.go ````go // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.6 // protoc (unknown) // source: v1/badger.proto ⋮---- package v1 ⋮---- import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" unsafe "unsafe" ) ⋮---- protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" unsafe "unsafe" ⋮---- const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) ⋮---- // Verify that this generated code is sufficiently up-to-date. ⋮---- // Verify that runtime/protoimpl is sufficiently up-to-date. ⋮---- type Validator struct { state protoimpl.MessageState `protogen:"open.v1"` Operator []byte `protobuf:"bytes,1,opt,name=operator,proto3" json:"operator,omitempty"` VotingPower string `protobuf:"bytes,2,opt,name=voting_power,json=votingPower,proto3" json:"voting_power,omitempty"` IsActive bool `protobuf:"varint,3,opt,name=is_active,json=isActive,proto3" json:"is_active,omitempty"` ActiveIndex uint32 `protobuf:"varint,4,opt,name=active_index,json=activeIndex,proto3" json:"active_index,omitempty"` Keys []*ValidatorKey `protobuf:"bytes,5,rep,name=keys,proto3" json:"keys,omitempty"` Vaults []*ValidatorVault `protobuf:"bytes,6,rep,name=vaults,proto3" json:"vaults,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- func (x *Validator) Reset() ⋮---- func (x *Validator) String() string ⋮---- func (*Validator) ProtoMessage() ⋮---- func (x *Validator) ProtoReflect() protoreflect.Message ⋮---- // Deprecated: Use Validator.ProtoReflect.Descriptor instead. func (*Validator) Descriptor() ([]byte, []int) ⋮---- func (x *Validator) GetOperator() []byte ⋮---- func (x *Validator) GetVotingPower() string ⋮---- func (x *Validator) GetIsActive() bool ⋮---- func (x *Validator) GetActiveIndex() uint32 ⋮---- func (x *Validator) GetKeys() []*ValidatorKey ⋮---- func (x *Validator) GetVaults() []*ValidatorVault ⋮---- type ValidatorKey struct { state protoimpl.MessageState `protogen:"open.v1"` Tag uint32 `protobuf:"varint,1,opt,name=tag,proto3" json:"tag,omitempty"` Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Deprecated: Use ValidatorKey.ProtoReflect.Descriptor instead. ⋮---- func (x *ValidatorKey) GetTag() uint32 ⋮---- func (x *ValidatorKey) GetPayload() []byte ⋮---- type ValidatorVault struct { state protoimpl.MessageState `protogen:"open.v1"` ChainId uint64 `protobuf:"varint,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` Vault []byte `protobuf:"bytes,2,opt,name=vault,proto3" json:"vault,omitempty"` VotingPower string `protobuf:"bytes,3,opt,name=voting_power,json=votingPower,proto3" json:"voting_power,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Deprecated: Use ValidatorVault.ProtoReflect.Descriptor instead. ⋮---- func (x *ValidatorVault) GetChainId() uint64 ⋮---- func (x *ValidatorVault) GetVault() []byte ⋮---- type ValidatorSetHeader struct { state protoimpl.MessageState `protogen:"open.v1"` Version uint32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` RequiredKeyTag uint32 `protobuf:"varint,2,opt,name=required_key_tag,json=requiredKeyTag,proto3" json:"required_key_tag,omitempty"` Epoch uint64 `protobuf:"varint,3,opt,name=epoch,proto3" json:"epoch,omitempty"` CaptureTimestamp uint64 `protobuf:"varint,4,opt,name=capture_timestamp,json=captureTimestamp,proto3" json:"capture_timestamp,omitempty"` QuorumThreshold string `protobuf:"bytes,5,opt,name=quorum_threshold,json=quorumThreshold,proto3" json:"quorum_threshold,omitempty"` TotalVotingPower string `protobuf:"bytes,6,opt,name=total_voting_power,json=totalVotingPower,proto3" json:"total_voting_power,omitempty"` ValidatorsSszMroot []byte `protobuf:"bytes,7,opt,name=validators_ssz_mroot,json=validatorsSszMroot,proto3" json:"validators_ssz_mroot,omitempty"` AggregatorIndices []byte `protobuf:"bytes,8,opt,name=aggregator_indices,json=aggregatorIndices,proto3" json:"aggregator_indices,omitempty"` CommitterIndices []byte `protobuf:"bytes,9,opt,name=committer_indices,json=committerIndices,proto3" json:"committer_indices,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Deprecated: Use ValidatorSetHeader.ProtoReflect.Descriptor instead. ⋮---- func (x *ValidatorSetHeader) GetVersion() uint32 ⋮---- func (x *ValidatorSetHeader) GetRequiredKeyTag() uint32 ⋮---- func (x *ValidatorSetHeader) GetEpoch() uint64 ⋮---- func (x *ValidatorSetHeader) GetCaptureTimestamp() uint64 ⋮---- func (x *ValidatorSetHeader) GetQuorumThreshold() string ⋮---- func (x *ValidatorSetHeader) GetTotalVotingPower() string ⋮---- func (x *ValidatorSetHeader) GetValidatorsSszMroot() []byte ⋮---- func (x *ValidatorSetHeader) GetAggregatorIndices() []byte ⋮---- func (x *ValidatorSetHeader) GetCommitterIndices() []byte ⋮---- type ValidatorSetMetadata struct { state protoimpl.MessageState `protogen:"open.v1"` RequestId []byte `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` Epoch uint64 `protobuf:"varint,2,opt,name=epoch,proto3" json:"epoch,omitempty"` ExtraData []*ExtraData `protobuf:"bytes,3,rep,name=extra_data,json=extraData,proto3" json:"extra_data,omitempty"` CommitmentData []byte `protobuf:"bytes,4,opt,name=commitment_data,json=commitmentData,proto3" json:"commitment_data,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Deprecated: Use ValidatorSetMetadata.ProtoReflect.Descriptor instead. ⋮---- func (x *ValidatorSetMetadata) GetRequestId() []byte ⋮---- func (x *ValidatorSetMetadata) GetExtraData() []*ExtraData ⋮---- func (x *ValidatorSetMetadata) GetCommitmentData() []byte ⋮---- type ExtraData struct { state protoimpl.MessageState `protogen:"open.v1"` Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Deprecated: Use ExtraData.ProtoReflect.Descriptor instead. ⋮---- func (x *ExtraData) GetKey() []byte ⋮---- func (x *ExtraData) GetValue() []byte ⋮---- type AggregationProof struct { state protoimpl.MessageState `protogen:"open.v1"` MessageHash []byte `protobuf:"bytes,1,opt,name=message_hash,json=messageHash,proto3" json:"message_hash,omitempty"` KeyTag uint32 `protobuf:"varint,2,opt,name=key_tag,json=keyTag,proto3" json:"key_tag,omitempty"` Epoch uint64 `protobuf:"varint,3,opt,name=epoch,proto3" json:"epoch,omitempty"` Proof []byte `protobuf:"bytes,4,opt,name=proof,proto3" json:"proof,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Deprecated: Use AggregationProof.ProtoReflect.Descriptor instead. ⋮---- func (x *AggregationProof) GetMessageHash() []byte ⋮---- func (x *AggregationProof) GetKeyTag() uint32 ⋮---- func (x *AggregationProof) GetProof() []byte ⋮---- type Signature struct { state protoimpl.MessageState `protogen:"open.v1"` MessageHash []byte `protobuf:"bytes,1,opt,name=message_hash,json=messageHash,proto3" json:"message_hash,omitempty"` KeyTag uint32 `protobuf:"varint,2,opt,name=key_tag,json=keyTag,proto3" json:"key_tag,omitempty"` Epoch uint64 `protobuf:"varint,3,opt,name=epoch,proto3" json:"epoch,omitempty"` Signature []byte `protobuf:"bytes,4,opt,name=signature,proto3" json:"signature,omitempty"` RawPublicKey []byte `protobuf:"bytes,5,opt,name=raw_public_key,json=rawPublicKey,proto3" json:"raw_public_key,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Deprecated: Use Signature.ProtoReflect.Descriptor instead. ⋮---- func (x *Signature) GetSignature() []byte ⋮---- func (x *Signature) GetRawPublicKey() []byte ⋮---- type SignatureRequest struct { state protoimpl.MessageState `protogen:"open.v1"` KeyTag uint32 `protobuf:"varint,1,opt,name=key_tag,json=keyTag,proto3" json:"key_tag,omitempty"` RequiredEpoch uint64 `protobuf:"varint,2,opt,name=required_epoch,json=requiredEpoch,proto3" json:"required_epoch,omitempty"` Message []byte `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Deprecated: Use SignatureRequest.ProtoReflect.Descriptor instead. ⋮---- func (x *SignatureRequest) GetRequiredEpoch() uint64 ⋮---- func (x *SignatureRequest) GetMessage() []byte ⋮---- type SignatureMap struct { state protoimpl.MessageState `protogen:"open.v1"` RequestId []byte `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` Epoch uint64 `protobuf:"varint,2,opt,name=epoch,proto3" json:"epoch,omitempty"` SignedValidatorsBitmap []byte `protobuf:"bytes,3,opt,name=signed_validators_bitmap,json=signedValidatorsBitmap,proto3" json:"signed_validators_bitmap,omitempty"` CurrentVotingPower string `protobuf:"bytes,4,opt,name=current_voting_power,json=currentVotingPower,proto3" json:"current_voting_power,omitempty"` TotalValidators uint32 `protobuf:"varint,5,opt,name=total_validators,json=totalValidators,proto3" json:"total_validators,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Deprecated: Use SignatureMap.ProtoReflect.Descriptor instead. ⋮---- func (x *SignatureMap) GetSignedValidatorsBitmap() []byte ⋮---- func (x *SignatureMap) GetCurrentVotingPower() string ⋮---- func (x *SignatureMap) GetTotalValidators() uint32 ⋮---- type NetworkConfig struct { state protoimpl.MessageState `protogen:"open.v1"` VotingPowerProviders []*CrossChainAddress `protobuf:"bytes,1,rep,name=voting_power_providers,json=votingPowerProviders,proto3" json:"voting_power_providers,omitempty"` KeysProvider *CrossChainAddress `protobuf:"bytes,2,opt,name=keys_provider,json=keysProvider,proto3" json:"keys_provider,omitempty"` Settlements []*CrossChainAddress `protobuf:"bytes,3,rep,name=settlements,proto3" json:"settlements,omitempty"` VerificationType uint32 `protobuf:"varint,4,opt,name=verification_type,json=verificationType,proto3" json:"verification_type,omitempty"` MaxVotingPower string `protobuf:"bytes,5,opt,name=max_voting_power,json=maxVotingPower,proto3" json:"max_voting_power,omitempty"` MinInclusionVotingPower string `protobuf:"bytes,6,opt,name=min_inclusion_voting_power,json=minInclusionVotingPower,proto3" json:"min_inclusion_voting_power,omitempty"` MaxValidatorsCount string `protobuf:"bytes,7,opt,name=max_validators_count,json=maxValidatorsCount,proto3" json:"max_validators_count,omitempty"` RequiredKeyTags []uint32 `protobuf:"varint,8,rep,packed,name=required_key_tags,json=requiredKeyTags,proto3" json:"required_key_tags,omitempty"` RequiredHeaderKeyTag uint32 `protobuf:"varint,9,opt,name=required_header_key_tag,json=requiredHeaderKeyTag,proto3" json:"required_header_key_tag,omitempty"` QuorumThresholds []*QuorumThreshold `protobuf:"bytes,10,rep,name=quorum_thresholds,json=quorumThresholds,proto3" json:"quorum_thresholds,omitempty"` NumCommitters uint64 `protobuf:"varint,11,opt,name=num_committers,json=numCommitters,proto3" json:"num_committers,omitempty"` NumAggregators uint64 `protobuf:"varint,12,opt,name=num_aggregators,json=numAggregators,proto3" json:"num_aggregators,omitempty"` CommitterSlotDuration uint64 `protobuf:"varint,13,opt,name=committer_slot_duration,json=committerSlotDuration,proto3" json:"committer_slot_duration,omitempty"` EpochDuration uint64 `protobuf:"varint,14,opt,name=epoch_duration,json=epochDuration,proto3" json:"epoch_duration,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Deprecated: Use NetworkConfig.ProtoReflect.Descriptor instead. ⋮---- func (x *NetworkConfig) GetVotingPowerProviders() []*CrossChainAddress ⋮---- func (x *NetworkConfig) GetKeysProvider() *CrossChainAddress ⋮---- func (x *NetworkConfig) GetSettlements() []*CrossChainAddress ⋮---- func (x *NetworkConfig) GetVerificationType() uint32 ⋮---- func (x *NetworkConfig) GetMaxVotingPower() string ⋮---- func (x *NetworkConfig) GetMinInclusionVotingPower() string ⋮---- func (x *NetworkConfig) GetMaxValidatorsCount() string ⋮---- func (x *NetworkConfig) GetRequiredKeyTags() []uint32 ⋮---- func (x *NetworkConfig) GetRequiredHeaderKeyTag() uint32 ⋮---- func (x *NetworkConfig) GetQuorumThresholds() []*QuorumThreshold ⋮---- func (x *NetworkConfig) GetNumCommitters() uint64 ⋮---- func (x *NetworkConfig) GetNumAggregators() uint64 ⋮---- func (x *NetworkConfig) GetCommitterSlotDuration() uint64 ⋮---- func (x *NetworkConfig) GetEpochDuration() uint64 ⋮---- type CrossChainAddress struct { state protoimpl.MessageState `protogen:"open.v1"` Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` ChainId uint64 `protobuf:"varint,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Deprecated: Use CrossChainAddress.ProtoReflect.Descriptor instead. ⋮---- func (x *CrossChainAddress) GetAddress() []byte ⋮---- type QuorumThreshold struct { state protoimpl.MessageState `protogen:"open.v1"` KeyTag uint32 `protobuf:"varint,1,opt,name=key_tag,json=keyTag,proto3" json:"key_tag,omitempty"` QuorumThreshold string `protobuf:"bytes,2,opt,name=quorum_threshold,json=quorumThreshold,proto3" json:"quorum_threshold,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Deprecated: Use QuorumThreshold.ProtoReflect.Descriptor instead. ⋮---- var File_v1_badger_proto protoreflect.FileDescriptor ⋮---- const file_v1_badger_proto_rawDesc = "" + "\n" + "\x0fv1/badger.proto\x12*internal.client.repository.badger.proto.v1\"\xac\x02\n" + "\tValidator\x12\x1a\n" + "\boperator\x18\x01 \x01(\fR\boperator\x12!\n" + "\fvoting_power\x18\x02 \x01(\tR\vvotingPower\x12\x1b\n" + "\tis_active\x18\x03 \x01(\bR\bisActive\x12!\n" + "\factive_index\x18\x04 \x01(\rR\vactiveIndex\x12L\n" + "\x04keys\x18\x05 \x03(\v28.internal.client.repository.badger.proto.v1.ValidatorKeyR\x04keys\x12R\n" + "\x06vaults\x18\x06 \x03(\v2:.internal.client.repository.badger.proto.v1.ValidatorVaultR\x06vaults\":\n" + "\fValidatorKey\x12\x10\n" + "\x03tag\x18\x01 \x01(\rR\x03tag\x12\x18\n" + "\apayload\x18\x02 \x01(\fR\apayload\"d\n" + "\x0eValidatorVault\x12\x19\n" + "\bchain_id\x18\x01 \x01(\x04R\achainId\x12\x14\n" + "\x05vault\x18\x02 \x01(\fR\x05vault\x12!\n" + "\fvoting_power\x18\x03 \x01(\tR\vvotingPower\"\x82\x03\n" + "\x12ValidatorSetHeader\x12\x18\n" + "\aversion\x18\x01 \x01(\rR\aversion\x12(\n" + "\x10required_key_tag\x18\x02 \x01(\rR\x0erequiredKeyTag\x12\x14\n" + "\x05epoch\x18\x03 \x01(\x04R\x05epoch\x12+\n" + "\x11capture_timestamp\x18\x04 \x01(\x04R\x10captureTimestamp\x12)\n" + "\x10quorum_threshold\x18\x05 \x01(\tR\x0fquorumThreshold\x12,\n" + "\x12total_voting_power\x18\x06 \x01(\tR\x10totalVotingPower\x120\n" + "\x14validators_ssz_mroot\x18\a \x01(\fR\x12validatorsSszMroot\x12-\n" + "\x12aggregator_indices\x18\b \x01(\fR\x11aggregatorIndices\x12+\n" + "\x11committer_indices\x18\t \x01(\fR\x10committerIndices\"\xca\x01\n" + "\x14ValidatorSetMetadata\x12\x1d\n" + "\n" + "request_id\x18\x01 \x01(\fR\trequestId\x12\x14\n" + "\x05epoch\x18\x02 \x01(\x04R\x05epoch\x12T\n" + "\n" + "extra_data\x18\x03 \x03(\v25.internal.client.repository.badger.proto.v1.ExtraDataR\textraData\x12'\n" + "\x0fcommitment_data\x18\x04 \x01(\fR\x0ecommitmentData\"3\n" + "\tExtraData\x12\x10\n" + "\x03key\x18\x01 \x01(\fR\x03key\x12\x14\n" + "\x05value\x18\x02 \x01(\fR\x05value\"z\n" + "\x10AggregationProof\x12!\n" + "\fmessage_hash\x18\x01 \x01(\fR\vmessageHash\x12\x17\n" + "\akey_tag\x18\x02 \x01(\rR\x06keyTag\x12\x14\n" + "\x05epoch\x18\x03 \x01(\x04R\x05epoch\x12\x14\n" + "\x05proof\x18\x04 \x01(\fR\x05proof\"\xa1\x01\n" + "\tSignature\x12!\n" + "\fmessage_hash\x18\x01 \x01(\fR\vmessageHash\x12\x17\n" + "\akey_tag\x18\x02 \x01(\rR\x06keyTag\x12\x14\n" + "\x05epoch\x18\x03 \x01(\x04R\x05epoch\x12\x1c\n" + "\tsignature\x18\x04 \x01(\fR\tsignature\x12$\n" + "\x0eraw_public_key\x18\x05 \x01(\fR\frawPublicKey\"l\n" + "\x10SignatureRequest\x12\x17\n" + "\akey_tag\x18\x01 \x01(\rR\x06keyTag\x12%\n" + "\x0erequired_epoch\x18\x02 \x01(\x04R\rrequiredEpoch\x12\x18\n" + "\amessage\x18\x03 \x01(\fR\amessage\"\xda\x01\n" + "\fSignatureMap\x12\x1d\n" + "\n" + "request_id\x18\x01 \x01(\fR\trequestId\x12\x14\n" + "\x05epoch\x18\x02 \x01(\x04R\x05epoch\x128\n" + "\x18signed_validators_bitmap\x18\x03 \x01(\fR\x16signedValidatorsBitmap\x120\n" + "\x14current_voting_power\x18\x04 \x01(\tR\x12currentVotingPower\x12)\n" + "\x10total_validators\x18\x05 \x01(\rR\x0ftotalValidators\"\x8b\a\n" + "\rNetworkConfig\x12s\n" + "\x16voting_power_providers\x18\x01 \x03(\v2=.internal.client.repository.badger.proto.v1.CrossChainAddressR\x14votingPowerProviders\x12b\n" + "\rkeys_provider\x18\x02 \x01(\v2=.internal.client.repository.badger.proto.v1.CrossChainAddressR\fkeysProvider\x12_\n" + "\vsettlements\x18\x03 \x03(\v2=.internal.client.repository.badger.proto.v1.CrossChainAddressR\vsettlements\x12+\n" + "\x11verification_type\x18\x04 \x01(\rR\x10verificationType\x12(\n" + "\x10max_voting_power\x18\x05 \x01(\tR\x0emaxVotingPower\x12;\n" + "\x1amin_inclusion_voting_power\x18\x06 \x01(\tR\x17minInclusionVotingPower\x120\n" + "\x14max_validators_count\x18\a \x01(\tR\x12maxValidatorsCount\x12*\n" + "\x11required_key_tags\x18\b \x03(\rR\x0frequiredKeyTags\x125\n" + "\x17required_header_key_tag\x18\t \x01(\rR\x14requiredHeaderKeyTag\x12h\n" + "\x11quorum_thresholds\x18\n" + " \x03(\v2;.internal.client.repository.badger.proto.v1.QuorumThresholdR\x10quorumThresholds\x12%\n" + "\x0enum_committers\x18\v \x01(\x04R\rnumCommitters\x12'\n" + "\x0fnum_aggregators\x18\f \x01(\x04R\x0enumAggregators\x126\n" + "\x17committer_slot_duration\x18\r \x01(\x04R\x15committerSlotDuration\x12%\n" + "\x0eepoch_duration\x18\x0e \x01(\x04R\repochDuration\"H\n" + "\x11CrossChainAddress\x12\x18\n" + "\aaddress\x18\x01 \x01(\fR\aaddress\x12\x19\n" + "\bchain_id\x18\x02 \x01(\x04R\achainId\"U\n" + "\x0fQuorumThreshold\x12\x17\n" + "\akey_tag\x18\x01 \x01(\rR\x06keyTag\x12)\n" + "\x10quorum_threshold\x18\x02 \x01(\tR\x0fquorumThresholdB\xd5\x02\n" + ".com.internal.client.repository.badger.proto.v1B\vBadgerProtoP\x01ZGgithub.com/symbioticfi/relay/internal/client/repository/badger/proto/v1\xa2\x02\x05ICRBP\xaa\x02*Internal.Client.Repository.Badger.Proto.V1\xca\x02*Internal\\Client\\Repository\\Badger\\Proto\\V1\xe2\x026Internal\\Client\\Repository\\Badger\\Proto\\V1\\GPBMetadata\xea\x02/Internal::Client::Repository::Badger::Proto::V1b\x06proto3" ⋮---- var ( file_v1_badger_proto_rawDescOnce sync.Once file_v1_badger_proto_rawDescData []byte ) ⋮---- func file_v1_badger_proto_rawDescGZIP() []byte ⋮---- var file_v1_badger_proto_msgTypes = make([]protoimpl.MessageInfo, 13) var file_v1_badger_proto_goTypes = []any{ (*Validator)(nil), // 0: internal.client.repository.badger.proto.v1.Validator (*ValidatorKey)(nil), // 1: internal.client.repository.badger.proto.v1.ValidatorKey (*ValidatorVault)(nil), // 2: internal.client.repository.badger.proto.v1.ValidatorVault (*ValidatorSetHeader)(nil), // 3: internal.client.repository.badger.proto.v1.ValidatorSetHeader (*ValidatorSetMetadata)(nil), // 4: internal.client.repository.badger.proto.v1.ValidatorSetMetadata (*ExtraData)(nil), // 5: internal.client.repository.badger.proto.v1.ExtraData (*AggregationProof)(nil), // 6: internal.client.repository.badger.proto.v1.AggregationProof (*Signature)(nil), // 7: internal.client.repository.badger.proto.v1.Signature (*SignatureRequest)(nil), // 8: internal.client.repository.badger.proto.v1.SignatureRequest (*SignatureMap)(nil), // 9: internal.client.repository.badger.proto.v1.SignatureMap (*NetworkConfig)(nil), // 10: internal.client.repository.badger.proto.v1.NetworkConfig (*CrossChainAddress)(nil), // 11: internal.client.repository.badger.proto.v1.CrossChainAddress (*QuorumThreshold)(nil), // 12: internal.client.repository.badger.proto.v1.QuorumThreshold } ⋮---- (*Validator)(nil), // 0: internal.client.repository.badger.proto.v1.Validator (*ValidatorKey)(nil), // 1: internal.client.repository.badger.proto.v1.ValidatorKey (*ValidatorVault)(nil), // 2: internal.client.repository.badger.proto.v1.ValidatorVault (*ValidatorSetHeader)(nil), // 3: internal.client.repository.badger.proto.v1.ValidatorSetHeader (*ValidatorSetMetadata)(nil), // 4: internal.client.repository.badger.proto.v1.ValidatorSetMetadata (*ExtraData)(nil), // 5: internal.client.repository.badger.proto.v1.ExtraData (*AggregationProof)(nil), // 6: internal.client.repository.badger.proto.v1.AggregationProof (*Signature)(nil), // 7: internal.client.repository.badger.proto.v1.Signature (*SignatureRequest)(nil), // 8: internal.client.repository.badger.proto.v1.SignatureRequest (*SignatureMap)(nil), // 9: internal.client.repository.badger.proto.v1.SignatureMap (*NetworkConfig)(nil), // 10: internal.client.repository.badger.proto.v1.NetworkConfig (*CrossChainAddress)(nil), // 11: internal.client.repository.badger.proto.v1.CrossChainAddress (*QuorumThreshold)(nil), // 12: internal.client.repository.badger.proto.v1.QuorumThreshold ⋮---- var file_v1_badger_proto_depIdxs = []int32{ 1, // 0: internal.client.repository.badger.proto.v1.Validator.keys:type_name -> internal.client.repository.badger.proto.v1.ValidatorKey 2, // 1: internal.client.repository.badger.proto.v1.Validator.vaults:type_name -> internal.client.repository.badger.proto.v1.ValidatorVault 5, // 2: internal.client.repository.badger.proto.v1.ValidatorSetMetadata.extra_data:type_name -> internal.client.repository.badger.proto.v1.ExtraData 11, // 3: internal.client.repository.badger.proto.v1.NetworkConfig.voting_power_providers:type_name -> internal.client.repository.badger.proto.v1.CrossChainAddress 11, // 4: internal.client.repository.badger.proto.v1.NetworkConfig.keys_provider:type_name -> internal.client.repository.badger.proto.v1.CrossChainAddress 11, // 5: internal.client.repository.badger.proto.v1.NetworkConfig.settlements:type_name -> internal.client.repository.badger.proto.v1.CrossChainAddress 12, // 6: internal.client.repository.badger.proto.v1.NetworkConfig.quorum_thresholds:type_name -> internal.client.repository.badger.proto.v1.QuorumThreshold 7, // [7:7] is the sub-list for method output_type 7, // [7:7] is the sub-list for method input_type 7, // [7:7] is the sub-list for extension type_name 7, // [7:7] is the sub-list for extension extendee 0, // [0:7] is the sub-list for field type_name } ⋮---- 1, // 0: internal.client.repository.badger.proto.v1.Validator.keys:type_name -> internal.client.repository.badger.proto.v1.ValidatorKey 2, // 1: internal.client.repository.badger.proto.v1.Validator.vaults:type_name -> internal.client.repository.badger.proto.v1.ValidatorVault 5, // 2: internal.client.repository.badger.proto.v1.ValidatorSetMetadata.extra_data:type_name -> internal.client.repository.badger.proto.v1.ExtraData 11, // 3: internal.client.repository.badger.proto.v1.NetworkConfig.voting_power_providers:type_name -> internal.client.repository.badger.proto.v1.CrossChainAddress 11, // 4: internal.client.repository.badger.proto.v1.NetworkConfig.keys_provider:type_name -> internal.client.repository.badger.proto.v1.CrossChainAddress 11, // 5: internal.client.repository.badger.proto.v1.NetworkConfig.settlements:type_name -> internal.client.repository.badger.proto.v1.CrossChainAddress 12, // 6: internal.client.repository.badger.proto.v1.NetworkConfig.quorum_thresholds:type_name -> internal.client.repository.badger.proto.v1.QuorumThreshold 7, // [7:7] is the sub-list for method output_type 7, // [7:7] is the sub-list for method input_type 7, // [7:7] is the sub-list for extension type_name 7, // [7:7] is the sub-list for extension extendee 0, // [0:7] is the sub-list for field type_name ⋮---- func init() func file_v1_badger_proto_init() ⋮---- type x struct{} ```` ## File: internal/client/repository/badger/proto/v1/badger.proto ````protobuf syntax = "proto3"; package internal.client.repository.badger.proto.v1; option go_package = "github.com/symbioticfi/relay/internal/client/repository/badger/proto/v1"; message Validator { bytes operator = 1; string voting_power = 2; bool is_active = 3; uint32 active_index = 4; repeated ValidatorKey keys = 5; repeated ValidatorVault vaults = 6; } message ValidatorKey { uint32 tag = 1; bytes payload = 2; } message ValidatorVault { uint64 chain_id = 1; bytes vault = 2; string voting_power = 3; } message ValidatorSetHeader { uint32 version = 1; uint32 required_key_tag = 2; uint64 epoch = 3; uint64 capture_timestamp = 4; string quorum_threshold = 5; string total_voting_power = 6; bytes validators_ssz_mroot = 7; bytes aggregator_indices = 8; bytes committer_indices = 9; } message ValidatorSetMetadata { bytes request_id = 1; uint64 epoch = 2; repeated ExtraData extra_data = 3; bytes commitment_data = 4; } message ExtraData { bytes key = 1; bytes value = 2; } message AggregationProof { bytes message_hash = 1; uint32 key_tag = 2; uint64 epoch = 3; bytes proof = 4; } message Signature { bytes message_hash = 1; uint32 key_tag = 2; uint64 epoch = 3; bytes signature = 4; bytes raw_public_key = 5; } message SignatureRequest { uint32 key_tag = 1; uint64 required_epoch = 2; bytes message = 3; } message SignatureMap { bytes request_id = 1; uint64 epoch = 2; bytes signed_validators_bitmap = 3; string current_voting_power = 4; uint32 total_validators = 5; } message NetworkConfig { repeated CrossChainAddress voting_power_providers = 1; CrossChainAddress keys_provider = 2; repeated CrossChainAddress settlements = 3; uint32 verification_type = 4; string max_voting_power = 5; string min_inclusion_voting_power = 6; string max_validators_count = 7; repeated uint32 required_key_tags = 8; uint32 required_header_key_tag = 9; repeated QuorumThreshold quorum_thresholds = 10; uint64 num_committers = 11; uint64 num_aggregators = 12; uint64 committer_slot_duration = 13; uint64 epoch_duration = 14; } message CrossChainAddress { bytes address = 1; uint64 chain_id = 2; } message QuorumThreshold { uint32 key_tag = 1; string quorum_threshold = 2; } ```` ## File: internal/client/repository/badger/badger_repository_add_proof.go ````go package badger ⋮---- import ( "context" "github.com/dgraph-io/badger/v4" "github.com/go-errors/errors" "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" ⋮---- "github.com/dgraph-io/badger/v4" "github.com/go-errors/errors" "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- func (r *Repository) SaveProof(ctx context.Context, aggregationProof symbiotic.AggregationProof) error ⋮---- // Remove from pending collection ⋮---- // If ErrEntityNotFound or ErrTxConflict, it means it was already processed or is being processed, so we can ignore it ```` ## File: internal/client/repository/badger/badger_repository_add_signature.go ````go package badger ⋮---- import ( "context" "log/slog" "github.com/go-errors/errors" "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" "log/slog" ⋮---- "github.com/go-errors/errors" ⋮---- "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- func (r *Repository) SaveSignature(ctx context.Context, signature symbiotic.Signature, validator symbiotic.Validator, activeIndex uint32) error ⋮---- var ( signatureMap entity.SignatureMap err error ) ⋮---- // Get the total number of active validators for this epoch ⋮---- // outside previous transaction, check if we can remove from pending collection ⋮---- // Blindly save to pending aggregation proof collection // syncer will remove it from collection once proof is found ⋮---- // ignore ErrEntityAlreadyExist and ErrTxConflict - it means it's already there or being processed ⋮---- // for non aggregation keys, we wait for all validators to sign and then remove // the pending aggregation marker to stop syncing signatures for this request ⋮---- // Save to pending aggregation proof collection, to sync for missing signatures // syncer will remove it from collection once all signatures are found ```` ## File: internal/client/repository/badger/badger_repository_aggregation_proof_pending_test.go ````go package badger ⋮---- import ( "testing" "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/require" "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "testing" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/require" ⋮---- "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- func TestBadgerRepository_SaveAggregationProofPending(t *testing.T) ⋮---- func TestBadgerRepository_RemoveAggregationProofPending(t *testing.T) ⋮---- // First save ⋮---- // Then remove ⋮---- // Try to remove again should fail ⋮---- // Save multiple entries ⋮---- // Remove one specific entry ⋮---- // Verify others still exist by trying to save them again (should fail) ⋮---- // But the removed one should be gone - we can save it again ⋮---- func TestBadgerRepository_GetSignatureRequestsWithoutAggregationProof(t *testing.T) ⋮---- // Create multiple signature requests var requests []symbiotic.Signature ⋮---- // Save signature request ⋮---- // Get first page (limit 3) ⋮---- // Get second page using last hash from first page ⋮---- require.Len(t, secondPage, 2) // Remaining 2 requests ⋮---- // Verify no overlap between pages ⋮---- // Verify all original requests are found across both pages ⋮---- // Create one valid signature request ⋮---- // Save signature request ⋮---- // Create a pending aggregation proof marker without corresponding signature request ⋮---- // Should only return the valid request, skipping the orphan ⋮---- // Query epoch1 should only return req1 ⋮---- // Query epoch2 should only return req2 ⋮---- func TestBadgerRepository_AggregationProofPendingIntegration(t *testing.T) ⋮---- // Save signature request ⋮---- // Now it should appear in pending list ⋮---- // Remove from pending ⋮---- // Should no longer appear in pending list ```` ## File: internal/client/repository/badger/badger_repository_aggregation_proof_test.go ````go package badger ⋮---- import ( "testing" "github.com/stretchr/testify/require" "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "testing" ⋮---- "github.com/stretchr/testify/require" ⋮---- "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- func TestBadgerRepository_AggregationProof(t *testing.T) ⋮---- func TestBadgerRepository_GetAggregationProofsStartingFromEpoch(t *testing.T) ⋮---- // Create three aggregation proofs with epochs 1, 2, 3 ⋮---- // Save all three aggregation proofs ⋮---- // Query starting from epoch 2 ⋮---- // Should return exactly 2 proofs (epochs 2 and 3) ⋮---- // Verify epochs are 2 and 3 ⋮---- // Query starting from epoch 1 - should return all 3 ⋮---- // Query starting from epoch 3 - should return only epoch 3 ⋮---- func TestBadgerRepository_GetAggregationProofsByEpoch(t *testing.T) ⋮---- func randomAggregationProof(t *testing.T) symbiotic.AggregationProof ```` ## File: internal/client/repository/badger/badger_repository_aggregation_proof.go ````go package badger ⋮---- import ( "bytes" "context" "fmt" "log/slog" "strings" "github.com/dgraph-io/badger/v4" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" pb "github.com/symbioticfi/relay/internal/client/repository/badger/proto/v1" "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "bytes" "context" "fmt" "log/slog" "strings" ⋮---- "github.com/dgraph-io/badger/v4" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" pb "github.com/symbioticfi/relay/internal/client/repository/badger/proto/v1" "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- func keyAggregationProof(requestID common.Hash) []byte ⋮---- func keyAggregationProofPending(epoch symbiotic.Epoch, requestID common.Hash) []byte ⋮---- func keyAggregationProofPendingEpochPrefix(epoch symbiotic.Epoch) []byte ⋮---- func (r *Repository) saveAggregationProof(ctx context.Context, requestID common.Hash, ap symbiotic.AggregationProof) error ⋮---- func (r *Repository) GetAggregationProof(ctx context.Context, requestID common.Hash) (symbiotic.AggregationProof, error) ⋮---- var ap symbiotic.AggregationProof ⋮---- func (r *Repository) GetAggregationProofsStartingFromEpoch(ctx context.Context, epoch symbiotic.Epoch) ([]symbiotic.AggregationProof, error) ⋮---- var proofs []symbiotic.AggregationProof ⋮---- func (r *Repository) GetAggregationProofsByEpoch(ctx context.Context, epoch symbiotic.Epoch) ([]symbiotic.AggregationProof, error) ⋮---- func getAggregationProofByEpochFromItem(txn *badger.Txn, it *badger.Iterator) (symbiotic.AggregationProof, error) ⋮---- func aggregationProofToBytes(ap symbiotic.AggregationProof) ([]byte, error) ⋮---- func bytesToAggregationProof(value []byte) (symbiotic.AggregationProof, error) ⋮---- func (r *Repository) saveAggregationProofPending(ctx context.Context, requestID common.Hash, epoch symbiotic.Epoch) error ⋮---- // Store just a marker (empty value) - we don't need the full request data here ⋮---- func (r *Repository) RemoveAggregationProofPending(ctx context.Context, epoch symbiotic.Epoch, requestID common.Hash) error ⋮---- // Check if exists before removing ⋮---- func (r *Repository) GetSignatureRequestsWithoutAggregationProof(ctx context.Context, epoch symbiotic.Epoch, limit int, lastHash common.Hash) ([]symbiotic.SignatureRequestWithID, error) ⋮---- var requests []symbiotic.SignatureRequestWithID ⋮---- // Iterate through pending aggregation proof markers ⋮---- opts.PrefetchValues = false // We don't need the values, just the keys ⋮---- // Subsequent pages: seek to the record after lastHash ⋮---- // If we're seeking from a specific hash and positioned exactly on that key, skip it (already returned in previous page) ⋮---- // Stop if we've reached the limit ⋮---- // Extract request id from the pending key: "aggregation_proof_pending:epoch:request_id" ⋮---- // Find the hash part after the second colon ⋮---- // Get the actual signature request ⋮---- // This shouldn't happen - pending marker exists but signature request doesn't // Skip this entry and continue ```` ## File: internal/client/repository/badger/badger_repository_network_config_test.go ````go package badger ⋮---- import ( "math/big" "testing" "github.com/stretchr/testify/require" "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "math/big" "testing" ⋮---- "github.com/stretchr/testify/require" ⋮---- "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- func TestBadgerRepository_NetworkConfig(t *testing.T) ⋮---- func randomNetworkConfig(t *testing.T) symbiotic.NetworkConfig ```` ## File: internal/client/repository/badger/badger_repository_network_config.go ````go package badger ⋮---- import ( "context" "fmt" "math/big" "github.com/dgraph-io/badger/v4" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/samber/lo" pb "github.com/symbioticfi/relay/internal/client/repository/badger/proto/v1" "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" "fmt" "math/big" ⋮---- "github.com/dgraph-io/badger/v4" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/samber/lo" pb "github.com/symbioticfi/relay/internal/client/repository/badger/proto/v1" "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- func keyNetworkConfig(epoch symbiotic.Epoch) []byte ⋮---- func (r *Repository) SaveConfig(ctx context.Context, config symbiotic.NetworkConfig, epoch symbiotic.Epoch) error ⋮---- func (r *Repository) GetConfigByEpoch(ctx context.Context, epoch symbiotic.Epoch) (symbiotic.NetworkConfig, error) ⋮---- var config symbiotic.NetworkConfig ⋮---- func networkConfigToBytes(config symbiotic.NetworkConfig) ([]byte, error) ⋮---- func bytesToNetworkConfig(data []byte) (symbiotic.NetworkConfig, error) ```` ## File: internal/client/repository/badger/badger_repository_proof_commits_test.go ````go package badger ⋮---- import ( "testing" "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/require" "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "testing" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/require" ⋮---- "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- func TestBadgerRepository_SaveProofCommitPending(t *testing.T) ⋮---- func TestBadgerRepository_RemoveProofCommitPending(t *testing.T) ⋮---- // First save ⋮---- // Then remove ⋮---- // Try to remove again should fail ⋮---- // Save multiple entries ⋮---- // Remove one specific entry ⋮---- // Verify others still exist by trying to save them again (should fail) ⋮---- // But the removed one should be gone - we can save it again ⋮---- func TestBadgerRepository_GetPendingProofCommitsSinceEpoch(t *testing.T) ⋮---- // Save commits in different epochs ⋮---- // Get commits since epoch 100 ⋮---- // Should return commits for epochs 100 and 150, not 50 ⋮---- // Create commits with same epoch but different hashes to test hash sorting ⋮---- // Save in reverse order to test sorting ⋮---- // Verify epoch ordering (ascending) ⋮---- // Verify hash ordering within same epoch ⋮---- // Create multiple commits ⋮---- // Test limit = 3 ⋮---- // Test limit = 0 (should return all) ⋮---- // Test limit > available (should return all available) ⋮---- // Query from epoch 701 should return epochs 701 and 702 ⋮---- // This test verifies that the function handles malformed keys in the database // We can't directly insert malformed keys through the public API, but the function // should be robust against them. This test mainly verifies no panic occurs. ```` ## File: internal/client/repository/badger/badger_repository_proof_commits.go ````go package badger ⋮---- import ( "bytes" "context" "math/big" "sort" "github.com/dgraph-io/badger/v4" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "bytes" "context" "math/big" "sort" ⋮---- "github.com/dgraph-io/badger/v4" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" ⋮---- "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- const ( aggregationProofCommitPrefix = "aggregation_proof_commit:" ) ⋮---- func keyAggregationProofCommited(epoch symbiotic.Epoch) []byte ⋮---- func (r *Repository) SaveProofCommitPending(ctx context.Context, epoch symbiotic.Epoch, requestID common.Hash) error ⋮---- func (r *Repository) RemoveProofCommitPending(ctx context.Context, epoch symbiotic.Epoch) error ⋮---- // Check if exists before removing ⋮---- func (r *Repository) GetPendingProofCommitsSinceEpoch(ctx context.Context, epoch symbiotic.Epoch, limit int) ([]symbiotic.ProofCommitKey, error) ⋮---- var requests []symbiotic.ProofCommitKey ⋮---- // Step 1: Collect all keys with their parsed epochs and hashes var keys []symbiotic.ProofCommitKey ⋮---- // Use broader prefix to capture all epochs // Key format: "aggregation_proof_commit:epoch:hash" ⋮---- // Iterate through all aggregation proof commit keys ⋮---- continue // Skip invalid keys ⋮---- // Parse the epoch ⋮---- // Skip if this epoch is less than our target epoch ⋮---- continue // Skip invalid request IDs ⋮---- return nil // No keys found ⋮---- // Step 2: Sort keys by epoch (ascending) and then by hash for deterministic ordering ⋮---- // Step 3: limit response ```` ## File: internal/client/repository/badger/badger_repository_proto_test.go ````go package badger ⋮---- import ( "math/big" "testing" "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" ) ⋮---- "math/big" "testing" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ⋮---- "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" ⋮---- func TestValidatorProtoConversion(t *testing.T) ⋮---- func TestValidatorProtoConversion_EmptyArrays(t *testing.T) ⋮---- func TestNetworkConfigProtoConversion(t *testing.T) ⋮---- func TestValidatorSetHeaderProtoConversion(t *testing.T) ⋮---- func TestValidatorSetMetadataProtoConversion(t *testing.T) ⋮---- func TestSignatureMapProtoConversion(t *testing.T) ⋮---- func TestSignatureProtoConversion(t *testing.T) ⋮---- KeyTag: symbiotic.KeyTag(4), // 4 is BLS (upper nibble = 0) ⋮---- KeyTag: symbiotic.KeyTag(16), // 16 is ECDSA (upper nibble = 1) ⋮---- func TestSignatureRequestProtoConversion(t *testing.T) ⋮---- func TestAggregationProofProtoConversion(t *testing.T) ⋮---- func TestBigIntEdgeCases(t *testing.T) ```` ## File: internal/client/repository/badger/badger_repository_signature_map_test.go ````go package badger ⋮---- import ( "context" "math/big" "testing" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" ) ⋮---- "context" "math/big" "testing" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ⋮---- "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" ⋮---- // randomRequestID generates a valid request id for testing func randomRequestID(t *testing.T) common.Hash ⋮---- // randomSignatureMap creates a SignatureMap with test data func randomSignatureMap(t *testing.T, requestID common.Hash) entity.SignatureMap ⋮---- // assertSignatureMapsEqual performs deep equality check on SignatureMaps func assertSignatureMapsEqual(t *testing.T, expected, actual entity.SignatureMap) ⋮---- func TestBadgerRepository_SignatureMap(t *testing.T) ⋮---- // Verify data was saved correctly ⋮---- // Save initial signature map ⋮---- // Update with modified data ⋮---- // Verify updated data ⋮---- // Save two different signature maps ⋮---- // Retrieve first signature map ⋮---- // Retrieve second signature map ⋮---- // Create multiple signature maps ⋮---- // Verify all can be retrieved correctly ⋮---- func TestSignatureMapSerialization(t *testing.T) ⋮---- // Serialize ⋮---- // Deserialize ⋮---- // Verify round-trip preservation ⋮---- // Create SignatureMap with large big.Int values ⋮---- Epoch: 18446744073709551615, // Max uint64 ⋮---- // Serialize and deserialize ⋮---- // Test roaring bitmap with specific indexes bitmap := entity.NewBitmapOf(0) // Only validator at index 0 is present ⋮---- // Verify bitmap contains expected validator index ⋮---- func TestSignatureMapTransactions(t *testing.T) ⋮---- // Update within transaction ⋮---- // Get within same transaction - should work ⋮---- // Verify data persisted after transaction ⋮---- // Transaction that will rollback due to error ⋮---- // Verify data exists within transaction ⋮---- // Return error to trigger rollback ⋮---- // Verify data was not persisted due to rollback ⋮---- // Setup existing data ⋮---- // Read existing data ⋮---- // Write new data ⋮---- // Read newly written data within same transaction ⋮---- // Verify both datasets exist after transaction ⋮---- func TestSignatureMapKeyGeneration(t *testing.T) ⋮---- func TestSignatureMapEdgeCases(t *testing.T) ⋮---- RequestID: common.Hash{}, // Zero hash ⋮---- // Test single validator scenario ⋮---- SignedValidatorsBitmap: entity.NewBitmapOf(0), // Single validator at index 0 ⋮---- // Create signature map with many validators ⋮---- // Add even indexes (50 validators present out of 100) ```` ## File: internal/client/repository/badger/badger_repository_signature_map.go ````go package badger ⋮---- import ( "context" "math/big" "github.com/dgraph-io/badger/v4" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" pb "github.com/symbioticfi/relay/internal/client/repository/badger/proto/v1" "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" "math/big" ⋮---- "github.com/dgraph-io/badger/v4" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" pb "github.com/symbioticfi/relay/internal/client/repository/badger/proto/v1" "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- func keySignatureMap(requestID common.Hash) []byte ⋮---- func (r *Repository) UpdateSignatureMap(ctx context.Context, vm entity.SignatureMap) error ⋮---- func (r *Repository) GetSignatureMap(ctx context.Context, requestID common.Hash) (entity.SignatureMap, error) ⋮---- var vm entity.SignatureMap ⋮---- // Create a new read-only transaction ⋮---- var err error ⋮---- func (r *Repository) getSignatureMap(ctx context.Context, requestID common.Hash) (entity.SignatureMap, error) ⋮---- func signatureMapToBytes(vm entity.SignatureMap) ([]byte, error) ⋮---- func bytesToSignatureMap(data []byte) (entity.SignatureMap, error) ```` ## File: internal/client/repository/badger/badger_repository_signature_request_test.go ````go package badger ⋮---- import ( "sort" "strconv" "testing" "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/require" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "sort" "strconv" "testing" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/require" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" ⋮---- symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- // signatureRequestID computes the RequestID for a SignatureRequest func signatureRequestID(t *testing.T, req symbiotic.SignatureRequest) common.Hash ⋮---- func TestBadgerRepository_SignatureRequest(t *testing.T) ⋮---- type reqWithTargetID struct { req symbiotic.SignatureRequest hash common.Hash } ⋮---- func TestBadgerRepository_GetSignatureRequestsByEpoch(t *testing.T) ⋮---- // Sort requests by hash (lexicographic order) to match expected retrieval order ⋮---- // Verify they are in correct order ⋮---- // Verify first 3 requests ⋮---- // Get first page (2 items) ⋮---- // Get second page using cursor ⋮---- // Get third page using cursor ⋮---- // Get fourth page (should be empty) ⋮---- // Use a hash that doesn't exist in this epoch ⋮---- // Should return results after the cursor position in lexicographic order ⋮---- // This test validates that when a cursor hash falls between stored keys, // we don't skip the first valid item after the seek (off-by-one bug) // Get the first two requests to determine a cursor that falls between them ⋮---- // Create a cursor hash that falls lexicographically between the first two stored hashes ⋮---- // Create a hash that's lexicographically between first and second var betweenHash common.Hash ⋮---- // Increment the last byte to create a hash between first and second ⋮---- // Verify the hash is actually between the two stored hashes ⋮---- // Query with this between-hash cursor - should start from secondHash (not skip it) ⋮---- // Should return all items starting from the second item (no off-by-one skip) require.Len(t, results, 4) // Should have 4 remaining items (total 5 - first 1) ⋮---- // Verify the sequence is correct ⋮---- expectedIndex := i + 1 // Skip first item, start from second ⋮---- func TestBadgerRepository_GetSignatureRequestsByEpoch_MultipleEpochs(t *testing.T) ⋮---- // Create requests for epoch1 ⋮---- // Create requests for epoch2 ⋮---- // Query epoch1 should return only epoch1 requests ⋮---- // Query epoch2 should return only epoch2 requests ⋮---- func randomSignatureRequest(t *testing.T) symbiotic.SignatureRequest ⋮---- func randomSignatureRequestForEpoch(t *testing.T, epoch symbiotic.Epoch) symbiotic.SignatureRequest ⋮---- func randomSignatureExtendedForEpoch(t *testing.T, epoch symbiotic.Epoch) symbiotic.Signature ⋮---- func TestBadgerRepository_GetSignatureRequestIDsByEpoch(t *testing.T) ⋮---- // Create 5 signature requests for the same epoch ⋮---- // Sort expected IDs by hex string (lexicographic order) ⋮---- // Verify they are in correct lexicographic order ⋮---- // Create requests for epoch2 ⋮---- // Query epoch1 should return only epoch1 IDs ⋮---- // Query epoch2 should return only epoch2 IDs ⋮---- // Verify no overlap between epochs ⋮---- func TestBadgerRepository_GetSignatureRequestsWithIDByEpoch(t *testing.T) ⋮---- // Verify they are in correct order and have correct request IDs ⋮---- // Query epoch1 should return only epoch1 requests ⋮---- // Verify all results are for epoch1 ⋮---- // Query epoch2 should return only epoch2 requests ⋮---- // Verify all results are for epoch2 ⋮---- // Create a single request with known values ⋮---- // Retrieve it ⋮---- // Verify the request ID matches what we saved ```` ## File: internal/client/repository/badger/badger_repository_signature_request.go ````go package badger ⋮---- import ( "bytes" "context" "fmt" "strings" "github.com/dgraph-io/badger/v4" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" pb "github.com/symbioticfi/relay/internal/client/repository/badger/proto/v1" "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "bytes" "context" "fmt" "strings" ⋮---- "github.com/dgraph-io/badger/v4" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" pb "github.com/symbioticfi/relay/internal/client/repository/badger/proto/v1" "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- const ( keySignatureRequestPendingPrefix = "signature_pending:" ) ⋮---- func keySignatureRequest(epoch symbiotic.Epoch, requestID common.Hash) []byte ⋮---- func keySignatureRequestEpochPrefix(epoch symbiotic.Epoch) []byte ⋮---- func keyRequestIDIndex(requestID common.Hash) []byte ⋮---- func keySignatureRequestPending(epoch symbiotic.Epoch, requestID common.Hash) []byte ⋮---- // extractRequestIDFromKey extracts the request ID from a signature request key // Key format: "signature_request:epoch:hash" func extractRequestIDFromKey(key []byte) (common.Hash, error) ⋮---- // saveSignatureRequestToKey saves a signature request to a specific key func (r *Repository) saveSignatureRequestToKey(ctx context.Context, req symbiotic.SignatureRequest, key []byte) error ⋮---- // Store the record ⋮---- func (r *Repository) SaveSignatureRequest(ctx context.Context, requestID common.Hash, req symbiotic.SignatureRequest) error ⋮---- // Save pending signature for all key tags because we should attempt // to sync signatures from all signers even when keytag is non aggregation ⋮---- func (r *Repository) saveSignatureRequest(ctx context.Context, requestID common.Hash, req symbiotic.SignatureRequest) error ⋮---- func (r *Repository) saveSignaturePending(ctx context.Context, requestID common.Hash, req symbiotic.SignatureRequest) error ⋮---- // Store just a marker (empty value) - we don't need the full request data here ⋮---- func (r *Repository) RemoveSignaturePending(ctx context.Context, epoch symbiotic.Epoch, requestID common.Hash) error ⋮---- // Remove from pending collection ⋮---- func signatureRequestToBytes(req symbiotic.SignatureRequest) ([]byte, error) ⋮---- func bytesToSignatureRequest(data []byte) (symbiotic.SignatureRequest, error) ⋮---- func (r *Repository) GetSignatureRequest(ctx context.Context, requestID common.Hash) (symbiotic.SignatureRequest, error) ⋮---- var req symbiotic.SignatureRequest ⋮---- // Get primary key from hash index ⋮---- // Get actual data using primary key ⋮---- // getSignatureRequestsByEpochWithKeys is a generic method for retrieving signature requests by epoch // using provided prefix and key generation function func (r *Repository) getSignatureRequestsByEpochWithKeys( ctx context.Context, epoch symbiotic.Epoch, limit int, lastHash common.Hash, prefix []byte, keyFunc func(symbiotic.Epoch, common.Hash) []byte, ) ([]symbiotic.SignatureRequest, error) ⋮---- var requests []symbiotic.SignatureRequest ⋮---- // Subsequent pages: seek to the record after lastHash ⋮---- // If we're seeking from a specific hash and positioned exactly on that key, skip it (already returned in previous page) ⋮---- // Stop if we've reached the limit ⋮---- // GetSignatureRequestsWithIDByEpoch gets all signature requests with their request IDs for a given epoch func (r *Repository) GetSignatureRequestsWithIDByEpoch(ctx context.Context, epoch symbiotic.Epoch) ([]entity.SignatureRequestWithID, error) ⋮---- var requests []entity.SignatureRequestWithID ⋮---- // Extract request ID from key ⋮---- // GetSignatureRequestsByEpoch gets signature requests for a given epoch with pagination func (r *Repository) GetSignatureRequestsByEpoch(ctx context.Context, epoch symbiotic.Epoch, limit int, lastHash common.Hash) ([]symbiotic.SignatureRequest, error) ⋮---- func (r *Repository) GetSignatureRequestIDsByEpoch(ctx context.Context, epoch symbiotic.Epoch) ([]common.Hash, error) ⋮---- var requestIDs []common.Hash ⋮---- // Iterate through signature request keys without fetching values ⋮---- opts.PrefetchValues = false // Don't fetch values - we only need keys ⋮---- func (r *Repository) GetSignaturePending(ctx context.Context, limit int) ([]common.Hash, error) ⋮---- var requests []common.Hash ⋮---- // Iterate through pending signature markers ⋮---- // Extract request id from the pending key: "signature_pending:epoch:hash" ⋮---- // Find the hash part after the second colon ```` ## File: internal/client/repository/badger/badger_repository_signature_test.go ````go package badger ⋮---- import ( "context" "testing" "github.com/stretchr/testify/require" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" "testing" ⋮---- "github.com/stretchr/testify/require" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" ⋮---- "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- func TestBadgerRepository_Signature(t *testing.T) ⋮---- require.Len(t, signatures, 3) // sig1 from first test + sig1 and sig2 from this test ⋮---- // Verify we can retrieve each signature by index ⋮---- func TestBadgerRepository_SignatureOrdering(t *testing.T) ⋮---- // Test numeric ordering with indices that would be wrong in lexicographic string order ⋮---- expectedOrder := []uint32{2, 9, 11, 100, 1000} // Expected numeric order ⋮---- // Save signatures with test indices ⋮---- sigCopy.PublicKey = priv.PublicKey() // Different public key for each ⋮---- // Retrieve all signatures and verify they are returned in numeric order ⋮---- // Verify each signature can be retrieved by its expected index ⋮---- // Verify this is the signature we expect (by checking the public key byte) ⋮---- // The signature returned by GetAllSignatures should match ⋮---- func TestBadgerRepository_GetSignaturesStartingFromEpoch(t *testing.T) ⋮---- // Create three signatures with epochs 1, 2, 3 ⋮---- // Save all three signatures ⋮---- // Query starting from epoch 2 ⋮---- // Should return exactly 2 signatures (epochs 2 and 3) ⋮---- // Verify epochs are 2 and 3 ⋮---- // Query starting from epoch 1 - should return all 3 ⋮---- // Query starting from epoch 3 - should return only epoch 3 ⋮---- func TestBadgerRepository_GetSignaturesByEpoch(t *testing.T) ```` ## File: internal/client/repository/badger/badger_repository_signature.go ````go package badger ⋮---- import ( "context" "fmt" "log/slog" "github.com/dgraph-io/badger/v4" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" pb "github.com/symbioticfi/relay/internal/client/repository/badger/proto/v1" "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" ) ⋮---- "context" "fmt" "log/slog" ⋮---- "github.com/dgraph-io/badger/v4" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" pb "github.com/symbioticfi/relay/internal/client/repository/badger/proto/v1" "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" ⋮---- func keySignature(requestID common.Hash, validatorIndex uint32) []byte ⋮---- func keySignatureRequestIDPrefix(requestID common.Hash) []byte ⋮---- func (r *Repository) saveSignature( ctx context.Context, validatorIndex uint32, sig symbiotic.Signature, ) error ⋮---- func (r *Repository) GetAllSignatures(ctx context.Context, requestID common.Hash) ([]symbiotic.Signature, error) ⋮---- var signatures []symbiotic.Signature ⋮---- var err error ⋮---- func (r *Repository) GetSignatureByIndex(ctx context.Context, requestID common.Hash, validatorIndex uint32) (symbiotic.Signature, error) ⋮---- var signature symbiotic.Signature ⋮---- func (r *Repository) GetSignaturesStartingFromEpoch(ctx context.Context, epoch symbiotic.Epoch) ([]symbiotic.Signature, error) ⋮---- func (r *Repository) GetSignaturesByEpoch(ctx context.Context, epoch symbiotic.Epoch) ([]symbiotic.Signature, error) ⋮---- func (r *Repository) getSignaturesByEpochFromItem(txn *badger.Txn, it *badger.Iterator) ([]symbiotic.Signature, error) ⋮---- func gatAllSignatures(txn *badger.Txn, requestID common.Hash) ([]symbiotic.Signature, error) ⋮---- func signatureToBytes(sig symbiotic.Signature) ([]byte, error) ⋮---- func bytesToSignature(value []byte) (symbiotic.Signature, error) ```` ## File: internal/client/repository/badger/badger_repository_test.go ````go package badger ⋮---- import ( "crypto/rand" "math/big" "testing" "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/require" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "crypto/rand" "math/big" "testing" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/require" ⋮---- symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- func randomBytes(t *testing.T, n int) []byte ⋮---- func randomAddr(t *testing.T) symbiotic.CrossChainAddress ⋮---- func randomBigInt(t *testing.T) *big.Int ⋮---- func TestKeyRequestIDEpoch(t *testing.T) ⋮---- epoch: ^symbiotic.Epoch(0), // max uint64 ⋮---- func TestExtractRequestIDFromEpochKey_InvalidKeys(t *testing.T) ⋮---- func TestKeyRequestIDEpochPrefix(t *testing.T) ⋮---- func TestKeyRequestIDEpochAll(t *testing.T) ```` ## File: internal/client/repository/badger/badger_repository_transaction_test.go ````go package badger ⋮---- import ( "context" "testing" "github.com/dgraph-io/badger/v4" "github.com/go-errors/errors" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) ⋮---- "context" "testing" ⋮---- "github.com/dgraph-io/badger/v4" "github.com/go-errors/errors" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ⋮---- func TestRepository_DoUpdateInTx(t *testing.T) ⋮---- var executedInTx bool ⋮---- // Verify we have a transaction in the context ⋮---- // Perform a simple write operation ⋮---- // Verify the data was actually committed ⋮---- // Write some data ⋮---- // Return an error to trigger rollback ⋮---- // Verify the data was not committed due to rollback ⋮---- var outerTxn, innerTxn *badger.Txn ⋮---- // Nested transaction should reuse the same transaction ⋮---- // Should be the same transaction object ⋮---- // Write data using the nested context ⋮---- // Verify the nested write was committed ⋮---- // Write multiple keys in the same transaction ⋮---- // Verify all data was committed atomically ⋮---- // Attempt to perform write operation in view transaction // This should fail because view transactions are read-only ⋮---- // BadgerDB returns ErrReadOnlyTxn when trying to write in a read-only transaction ⋮---- // First create a key to attempt to delete ⋮---- // Now try to delete it in a view transaction ⋮---- // Attempt to delete in view transaction ⋮---- // Verify the key still exists (delete didn't work) ```` ## File: internal/client/repository/badger/badger_repository_transaction.go ````go package badger ⋮---- import ( "context" "sync" "sync/atomic" "time" "github.com/dgraph-io/badger/v4" "github.com/go-errors/errors" "github.com/samber/lo" "github.com/symbioticfi/relay/internal/entity" ) ⋮---- "context" "sync" "sync/atomic" "time" ⋮---- "github.com/dgraph-io/badger/v4" "github.com/go-errors/errors" "github.com/samber/lo" ⋮---- "github.com/symbioticfi/relay/internal/entity" ⋮---- type ctxTxnKey struct{} ⋮---- var badgerTxnKey ctxTxnKey ⋮---- type ctxQueryNameKey struct{} ⋮---- var ctxQueryName ctxQueryNameKey ⋮---- // mutexWithUseTime wraps a mutex with a timestamp of last access type mutexWithUseTime struct { mutex sync.Mutex lastAccessNs atomic.Int64 // Unix nanoseconds } ⋮---- lastAccessNs atomic.Int64 // Unix nanoseconds ⋮---- func (m *mutexWithUseTime) lock() ⋮---- func (m *mutexWithUseTime) unlock() ⋮---- func (m *mutexWithUseTime) lastAccess() time.Time ⋮---- func (m *mutexWithUseTime) tryLock() bool ⋮---- func (r *Repository) doUpdateInTxWithLock(ctx context.Context, name string, f func(ctx context.Context) error, lockMap *sync.Map, key any) error ⋮---- func (r *Repository) doUpdateInTx(ctx context.Context, name string, f func(ctx context.Context) error) error ⋮---- func (r *Repository) doViewInTx(ctx context.Context, name string, f func(ctx context.Context) error) error ⋮---- func getTxn(ctx context.Context) *badger.Txn ⋮---- func (r *Repository) withName(ctx context.Context, name string) context.Context ⋮---- func nameFromCtx(ctx context.Context) string ```` ## File: internal/client/repository/badger/badger_repository_validator_set_test.go ````go package badger ⋮---- import ( "math/big" "testing" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "math/big" "testing" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ⋮---- "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- func TestRepository_ValidatorSet(t *testing.T) ⋮---- // Create two validator sets with different epochs ⋮---- // Test saving validator sets ⋮---- // Save newer epoch first ⋮---- // Save older epoch ⋮---- // Try to save the same epoch again ⋮---- // Test getting validator set by epoch ⋮---- // Get newer epoch ⋮---- // Get older epoch ⋮---- // Get non-existent epoch ⋮---- // Test getting latest validator set via epoch lookup ⋮---- // Latest should be vs1 (epoch 2) even though we saved it first ⋮---- // Test getting latest validator set epoch ⋮---- // Latest epoch should be vs1's epoch (2) even though we saved it first ⋮---- // Test getting validator set header by epoch ⋮---- // Get header for newer epoch ⋮---- // Verify header matches expected values from validator set ⋮---- // Get header for older epoch ⋮---- // Get non-existent epoch header ⋮---- // Test getting latest validator set header ⋮---- // Latest header should be from vs1 (epoch 2) ⋮---- // Test getting individual validators by key ⋮---- // Test with vs1 (epoch 2) ⋮---- // Get validator by key should return the correct validator ⋮---- // Test with vs2 (epoch 1) ⋮---- // Test non-existent validator ⋮---- // Test non-existent epoch ⋮---- func TestRepository_ValidatorSet_EmptyRepository(t *testing.T) ⋮---- func TestRepository_GetOldestValidatorSetEpoch(t *testing.T) ⋮---- func TestRepository_ValidatorSet_EpochOrdering(t *testing.T) ⋮---- // Create validator sets with different epochs in non-chronological order ⋮---- // Save them in random order require.NoError(t, repo.SaveValidatorSet(t.Context(), vs2)) // epoch 1 require.NoError(t, repo.SaveValidatorSet(t.Context(), vs4)) // epoch 3 require.NoError(t, repo.SaveValidatorSet(t.Context(), vs3)) // epoch 10 require.NoError(t, repo.SaveValidatorSet(t.Context(), vs1)) // epoch 5 ⋮---- assert.Equal(t, vs3, latest) // epoch 10 should be latest ⋮---- assert.Equal(t, vs3.Epoch, latestEpoch) // epoch 10 should be latest ⋮---- func TestRepository_ValidatorSet_ValidatorIndexing(t *testing.T) ⋮---- // Create a validator set with multiple validators having multiple keys ⋮---- // Should be able to find validator by any of their keys ⋮---- wrongKeyTag := key.Tag + 100 // Use a different key tag ⋮---- // Should not find validator with wrong key tag but same payload ⋮---- func TestRepository_ValidatorSet_MultiKeyStorageProblem(t *testing.T) ⋮---- // Create a validator with multiple keys to test storage duplication ⋮---- // Modify the first validator to have 3 different keys ⋮---- // Retrieve the validator set and check if deduplication works correctly ⋮---- // The validator should appear only once despite having multiple keys ⋮---- // Find our multi-key validator in the retrieved set var foundValidator *symbiotic.Validator ⋮---- // Verify the validator has all its keys ⋮---- func TestRepository_LatestSignedValidatorSetEpoch(t *testing.T) ⋮---- // Create validator sets with different epochs ⋮---- // Save the validator sets first (required for referential integrity) ⋮---- // Save latest signed epoch for vs1 (epoch 1) ⋮---- // Get latest signed epoch - should be vs1.Epoch (1) ⋮---- // Save latest signed epoch for vs3 (epoch 3) - should overwrite ⋮---- // Get latest signed epoch - should now be vs3.Epoch (3) ⋮---- // Save latest signed epoch for vs2 (epoch 5) - should overwrite again ⋮---- // Get latest signed epoch - should now be vs2.Epoch (5) ⋮---- // At this point: // - Latest validator set epoch should be 5 (highest saved epoch) // - Latest signed validator set epoch should be 5 (from previous test) ⋮---- // Now save a signed epoch that's lower than the latest validator set err = repo.SaveLatestSignedValidatorSetEpoch(t.Context(), vs1) // epoch 1 ⋮---- // Latest validator set epoch should remain 5 ⋮---- // But latest signed epoch should now be 1 ⋮---- func TestRepository_LatestSignedValidatorSetEpoch_EmptyRepository(t *testing.T) ⋮---- // This should work - the implementation doesn't enforce referential integrity ⋮---- // Should be able to retrieve it ⋮---- func TestRepository_LatestSignedValidatorSetEpoch_Ordering(t *testing.T) ⋮---- // Save signed epochs in a specific order and verify each one testOrder := []int{2, 0, 4, 1, 5, 3} // Indices into validatorSets array ⋮---- // Verify it was saved correctly ⋮---- // Final latest signed epoch should be from the last saved (index 3 = epoch 5) ⋮---- // But latest validator set epoch should be the highest saved epoch (15) ⋮---- func TestRepository_ValidatorSet_ActiveIndex(t *testing.T) ⋮---- // Create validator set with mixed active/inactive validators ⋮---- // Modify validators to have specific active/inactive states and addresses // Note: validators must be sorted by operator address ascending ⋮---- IsActive: true, // Should get active index 0 (first when sorted by address) ⋮---- IsActive: false, // Should get active index 0 (inactive) - positioned between two active validators ⋮---- IsActive: true, // Should get active index 1 (second active validator, despite inactive validator in between) ⋮---- // Save validator set ⋮---- // Test first active validator (0x0000... should be index 0) ⋮---- // Test second active validator (0x3333... should be index 1, even though inactive 0x2222... is between them) ⋮---- // Test inactive validator ⋮---- func TestRepository_FirstUncommittedValidatorSetEpoch(t *testing.T) ⋮---- // Save first uncommitted epoch ⋮---- // Get first uncommitted epoch ⋮---- // Update to a different epoch ⋮---- // Verify it was updated ⋮---- func TestRepository_FirstUncommittedValidatorSetEpoch_EmptyRepository(t *testing.T) ⋮---- // Should return 0 and no error when not set (based on implementation) ⋮---- func TestRepository_GetValidatorSetsByEpoch(t *testing.T) ⋮---- // Create three validator sets with epochs 1, 2, 3 ⋮---- // Save all three validator sets ⋮---- // Query starting from epoch 2 ⋮---- // Should return exactly 2 validator sets (epochs 2 and 3) ⋮---- // First result should be epoch 2 ⋮---- // Second result should be epoch 3 ⋮---- // Query starting from epoch 1 - should return all 3 ⋮---- // Query starting from epoch 3 - should return only epoch 3 ⋮---- // Query starting from epoch 10 (doesn't exist) - should return empty ⋮---- func setupTestRepository(t *testing.T) *Repository ⋮---- func randomValidatorSet(t *testing.T, epoch symbiotic.Epoch) symbiotic.ValidatorSet ```` ## File: internal/client/repository/badger/badger_repository_validator_set.go ````go package badger ⋮---- import ( "context" "encoding/binary" "fmt" "math/big" "github.com/dgraph-io/badger/v4" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/go-errors/errors" "github.com/samber/lo" pb "github.com/symbioticfi/relay/internal/client/repository/badger/proto/v1" "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" "encoding/binary" "fmt" "math/big" ⋮---- "github.com/dgraph-io/badger/v4" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/go-errors/errors" "github.com/samber/lo" ⋮---- pb "github.com/symbioticfi/relay/internal/client/repository/badger/proto/v1" "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- const ( latestValidatorSetEpochKey = "latest_validator_set_epoch" latestSignedValidatorSetEpochKey = "latest_signed_validator_set_epoch" firstUncommittedValidatorSetEpoch = "first_uncommitted_validator_set_epoch" ) ⋮---- // keyValidatorSetHeader returns key for validator set header // Format: "validator_set_header:" + epoch.Bytes() // Using epoch.Bytes() ensures proper lexicographic sorting func keyValidatorSetHeader(epoch symbiotic.Epoch) []byte ⋮---- // keyValidatorSetHeaderPrefix returns prefix for all validator set headers func keyValidatorSetHeaderPrefix() []byte ⋮---- func keyValidatorByOperator(epoch symbiotic.Epoch, operator common.Address) []byte ⋮---- func keyValidatorKeyLookup(epoch symbiotic.Epoch, keyTag symbiotic.KeyTag, publicKeyHash common.Hash) []byte ⋮---- func keyValidatorSetStatus(epoch symbiotic.Epoch) []byte ⋮---- func keyValidatorSetMetadata(epoch symbiotic.Epoch) []byte ⋮---- func (r *Repository) SaveValidatorSetMetadata(ctx context.Context, data symbiotic.ValidatorSetMetadata) error ⋮---- func (r *Repository) GetValidatorSetMetadata(ctx context.Context, epoch symbiotic.Epoch) (symbiotic.ValidatorSetMetadata, error) ⋮---- var metadata symbiotic.ValidatorSetMetadata ⋮---- func (r *Repository) SaveValidatorSet(ctx context.Context, valset symbiotic.ValidatorSet) error ⋮---- // Check if this epoch already exists by checking the header ⋮---- // Save the validator set header for its epoch ⋮---- // Check if this is a newer epoch than the latest one ⋮---- // Update latest validator set epoch only if this is a newer epoch ⋮---- // Save individual validators and their key indexes ⋮---- // Save the validator data once ⋮---- // Create an index for each key that points to the validator's operator address ⋮---- // Store the total active validator count for this epoch ⋮---- func (r *Repository) SaveLatestSignedValidatorSetEpoch(ctx context.Context, valset symbiotic.ValidatorSet) error ⋮---- func (r *Repository) SaveFirstUncommittedValidatorSetEpoch(ctx context.Context, epoch symbiotic.Epoch) error ⋮---- func (r *Repository) UpdateValidatorSetStatusAndRemovePendingProof(ctx context.Context, valset symbiotic.ValidatorSet) error ⋮---- func (r *Repository) UpdateValidatorSetStatus(ctx context.Context, valset symbiotic.ValidatorSet) error ⋮---- func (r *Repository) GetValidatorSetHeaderByEpoch(ctx context.Context, epoch symbiotic.Epoch) (symbiotic.ValidatorSetHeader, error) ⋮---- var header symbiotic.ValidatorSetHeader ⋮---- func (r *Repository) getAllValidatorsByEpoch(txn *badger.Txn, epoch symbiotic.Epoch) (symbiotic.Validators, error) ⋮---- var validators symbiotic.Validators ⋮---- func (r *Repository) GetValidatorSetsStartingFromEpoch(ctx context.Context, startEpoch symbiotic.Epoch) ([]symbiotic.ValidatorSet, error) ⋮---- var validatorSets []symbiotic.ValidatorSet ⋮---- // Create iterator starting from startEpoch ⋮---- func (r *Repository) GetValidatorSetByEpoch(ctx context.Context, epoch symbiotic.Epoch) (symbiotic.ValidatorSet, error) ⋮---- var vs symbiotic.ValidatorSet ⋮---- // Get the validator set header ⋮---- // Get all validators for this epoch ⋮---- // Extract bitmap indices from header data ⋮---- // Build the validator set from header + validators ⋮---- func (r *Repository) GetLatestValidatorSetHeader(ctx context.Context) (symbiotic.ValidatorSetHeader, error) ⋮---- // Get the latest epoch ⋮---- // Get the validator set header for that epoch in the same transaction ⋮---- func (r *Repository) GetLatestValidatorSetEpoch(ctx context.Context) (symbiotic.Epoch, error) ⋮---- var epoch symbiotic.Epoch ⋮---- func keyActiveValidatorCount(epoch symbiotic.Epoch) []byte ⋮---- func (r *Repository) GetActiveValidatorCountByEpoch(ctx context.Context, epoch symbiotic.Epoch) (uint32, error) ⋮---- var count uint32 ⋮---- func (r *Repository) GetOldestValidatorSetEpoch(ctx context.Context) (symbiotic.Epoch, error) ⋮---- func (r *Repository) GetLatestSignedValidatorSetEpoch(ctx context.Context) (symbiotic.Epoch, error) ⋮---- func (r *Repository) GetFirstUncommittedValidatorSetEpoch(ctx context.Context) (symbiotic.Epoch, error) ⋮---- func (r *Repository) GetValidatorByKey(ctx context.Context, epoch symbiotic.Epoch, keyTag symbiotic.KeyTag, publicKey []byte) (symbiotic.Validator, uint32, error) ⋮---- var validator symbiotic.Validator var activeIndex uint32 ⋮---- // First, find the operator address from the key lookup table ⋮---- // Now, retrieve the full validator data ⋮---- // This would indicate data inconsistency ⋮---- func validatorToBytes(validator symbiotic.Validator, activeIndex uint32) ([]byte, error) ⋮---- func bytesToValidator(data []byte) (symbiotic.Validator, uint32, error) ⋮---- func validatorSetHeaderToBytes(valset symbiotic.ValidatorSet) ([]byte, error) ⋮---- var aggIndices, commIndices []byte ⋮---- func bytesToValidatorSetHeader(data []byte) (symbiotic.ValidatorSetHeader, error) ⋮---- func extractAdditionalInfoFromHeaderData(data []byte) (aggIndices []uint32, commIndices []uint32, err error) ⋮---- func validatorSetMetadataToBytes(data symbiotic.ValidatorSetMetadata) ([]byte, error) ⋮---- func bytesToValidatorSetMetadata(data []byte) (symbiotic.ValidatorSetMetadata, error) ```` ## File: internal/client/repository/badger/badger_repository.go ````go package badger ⋮---- import ( "log/slog" "sync" "time" "github.com/dgraph-io/badger/v4" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/go-playground/validator/v10" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "google.golang.org/protobuf/proto" ) ⋮---- "log/slog" "sync" "time" ⋮---- "github.com/dgraph-io/badger/v4" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/go-playground/validator/v10" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "google.golang.org/protobuf/proto" ⋮---- type Config struct { Dir string `validate:"required"` Metrics metrics `validate:"required"` MutexCleanupInterval time.Duration // How often to run mutex cleanup (e.g., 1 hour). Zero disables cleanup. MutexCleanupStaleTimeout time.Duration // Remove mutexes not used for this duration, default 1 hour. } ⋮---- MutexCleanupInterval time.Duration // How often to run mutex cleanup (e.g., 1 hour). Zero disables cleanup. MutexCleanupStaleTimeout time.Duration // Remove mutexes not used for this duration, default 1 hour. ⋮---- func (c Config) Validate() error ⋮---- type metrics interface { ObserveRepoQueryDuration(queryName string, status string, d time.Duration) ObserveRepoQueryTotalDuration(queryName string, status string, d time.Duration) } ⋮---- type Repository struct { db *badger.DB metrics metrics signatureMutexMap sync.Map // map[requestId]*mutexWithUseTime proofsMutexMap sync.Map // map[requestId]*mutexWithUseTime valsetMutexMap sync.Map // map[epoch]*mutexWithUseTime cleanupStop chan struct{} ⋮---- signatureMutexMap sync.Map // map[requestId]*mutexWithUseTime proofsMutexMap sync.Map // map[requestId]*mutexWithUseTime valsetMutexMap sync.Map // map[epoch]*mutexWithUseTime ⋮---- func New(cfg Config) (*Repository, error) ⋮---- // Start mutex cleanup goroutine if configured ⋮---- func (r *Repository) Close() error ⋮---- // Stop the mutex cleanup goroutine before closing the database ⋮---- type doNothingLog struct{} ⋮---- func (l doNothingLog) Errorf(s string, args ...interface func (l doNothingLog) Warningf(s string, args ...interface func (l doNothingLog) Infof(s string, args ...interface func (l doNothingLog) Debugf(s string, args ...interface ⋮---- type DoNothingMetrics struct { } ⋮---- func (m DoNothingMetrics) ObserveRepoQueryDuration(queryName string, status string, d time.Duration) func (m DoNothingMetrics) ObserveRepoQueryTotalDuration(queryName string, status string, d time.Duration) ⋮---- func marshalProto(msg proto.Message) ([]byte, error) ⋮---- func unmarshalProto(data []byte, msg proto.Message) error ⋮---- // startMutexCleanup starts a background goroutine that periodically cleans up stale mutexes func (r *Repository) startMutexCleanup(interval, staleTimeout time.Duration) ⋮---- // If interval is 0, cleanup is disabled ⋮---- // stopMutexCleanup stops the background cleanup goroutine func (r *Repository) stopMutexCleanup() ⋮---- // cleanupStaleMutexes removes mutexes that haven't been used for longer than cleanupStaleAfter func (r *Repository) cleanupStaleMutexes(staleTimeout time.Duration) ⋮---- // Default stale timeout to 1 hour if not set ⋮---- // cleanupMutexMap removes stale mutexes from a single sync.Map using double-check pattern func cleanupMutexMap(mutexMap *sync.Map, staleThreshold time.Time) int ⋮---- var count int ⋮---- // First check: if recently accessed, skip ⋮---- // Try to acquire the lock to ensure it's not in use ⋮---- // Double-check last access time after acquiring lock // This handles the race where updateAccess() was called between the first check and TryLock ⋮---- // Safe to delete now ⋮---- var errCorruptedRequestIDEpochLink = errors.New("corrupted request id epoch link") ⋮---- func keyRequestIDEpoch(epoch symbiotic.Epoch, requestID common.Hash) []byte ⋮---- func keyRequestIDEpochPrefix(epoch symbiotic.Epoch) []byte ⋮---- func keyRequestIDEpochAll() []byte ⋮---- const ( epochLen = 8 hashLen = 32 ) ⋮---- // extractRequestIDFromEpochKey extracts request ID from the epoch key link // Key format: "request_id_epoch" (16 bytes) + epoch (8 bytes) + requestID (32 bytes) func extractRequestIDFromEpochKey(key []byte) (common.Hash, error) ```` ## File: internal/client/repository/badger/cached_repository_test.go ````go package badger ⋮---- import ( "context" "math/big" "testing" "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/require" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" "math/big" "testing" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/require" ⋮---- symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- func TestCachedRepository_NetworkConfig(t *testing.T) ⋮---- // Create temporary directory for test ⋮---- // Create base repository ⋮---- // Create cached repository ⋮---- // Create test network config ⋮---- // Test cache miss - config doesn't exist ⋮---- // Save config ⋮---- // Test cache hit - should retrieve from cache ⋮---- // Test cache hit again - should still work ⋮---- func TestCachedRepository_InheritedMethods(t *testing.T) ⋮---- // Test that inherited methods work (non-cached methods) // This tests that embedding is working correctly ⋮---- func TestCachedRepository_ValidatorSet(t *testing.T) ⋮---- // Create test validator set ⋮---- // Test cache miss - validator set doesn't exist ⋮---- // Save validator set ```` ## File: internal/client/repository/badger/cached_repository.go ````go package badger ⋮---- import ( "context" "github.com/go-errors/errors" "github.com/symbioticfi/relay/internal/client/repository/cache" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" ⋮---- "github.com/go-errors/errors" ⋮---- "github.com/symbioticfi/relay/internal/client/repository/cache" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- type CachedConfig struct { NetworkConfigCacheSize int ValidatorSetCacheSize int } ⋮---- type CachedRepository struct { *Repository networkConfigCache cache.Cache[symbiotic.Epoch, symbiotic.NetworkConfig] validatorSetCache cache.Cache[symbiotic.Epoch, symbiotic.ValidatorSet] validatorSetMetadataCache cache.Cache[symbiotic.Epoch, symbiotic.ValidatorSetMetadata] } ⋮---- func NewCached(repo *Repository, cfg CachedConfig) (*CachedRepository, error) ⋮---- func (r *CachedRepository) GetConfigByEpoch(ctx context.Context, epoch symbiotic.Epoch) (symbiotic.NetworkConfig, error) ⋮---- // Try cache first ⋮---- // Cache miss - load from underlying repository ⋮---- // Store in cache for future use ⋮---- func (r *CachedRepository) SaveConfig(ctx context.Context, config symbiotic.NetworkConfig, epoch symbiotic.Epoch) error ⋮---- // Cache the newly saved config ⋮---- func (r *CachedRepository) GetValidatorSetByEpoch(ctx context.Context, epoch symbiotic.Epoch) (symbiotic.ValidatorSet, error) ⋮---- func (r *CachedRepository) GetValidatorSetMetadata(ctx context.Context, epoch symbiotic.Epoch) (symbiotic.ValidatorSetMetadata, error) ⋮---- func (r *CachedRepository) SaveValidatorSet(ctx context.Context, validatorSet symbiotic.ValidatorSet) error ⋮---- // Cache the newly saved validator set ⋮---- func (r *CachedRepository) SaveValidatorSetMetadata(ctx context.Context, validatorSetMetadata symbiotic.ValidatorSetMetadata) error ```` ## File: internal/client/repository/cache/generic_cache.go ````go package cache ⋮---- import ( "github.com/elastic/go-freelru" "github.com/go-errors/errors" ) ⋮---- "github.com/elastic/go-freelru" "github.com/go-errors/errors" ⋮---- // Cache provides a generic LRU cache interface type Cache[K comparable, V any] interface { Get(key K) (V, bool) Add(key K, value V) } ⋮---- // Config holds cache configuration type Config struct { Size int } ⋮---- // lruCache implements Cache using freelru type lruCache[K comparable, V any] struct { cache *freelru.ShardedLRU[K, V] } ⋮---- // NewCache creates a new generic LRU cache func NewCache[K comparable, V any](cfg Config, hashFunc func(K) uint32) (Cache[K, V], error) ⋮---- cfg.Size = 50 // default cache size ⋮---- func (c *lruCache[K, V]) Get(key K) (V, bool) ⋮---- func (c *lruCache[K, V]) Add(key K, value V) ```` ## File: internal/entity/entity_aggregation_proof_sync_test.go ````go package entity ⋮---- import ( "testing" "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/require" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "testing" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/require" ⋮---- symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- func TestAggregationProofSync_Integration(t *testing.T) ⋮---- // Step 1: Create request for missing aggregation proofs ⋮---- // Step 2: Create response with available proofs (only 2 out of 3) ⋮---- // hash3 is missing - peer doesn't have it ⋮---- // Step 3: Process response and track stats ⋮---- // Simulate processing each requested hash ⋮---- // Proof found and processed successfully _ = proof // Use the proof ⋮---- // Proof not found in response - no error, just missing // This is normal behavior when peers don't have all proofs ⋮---- // Step 4: Simulate some processing errors for remaining proof stats.VerificationFailCount = 1 // hash3 had verification error ```` ## File: internal/entity/entity_error.go ````go package entity ⋮---- type StringError string ⋮---- func (e StringError) Error() string ⋮---- const ( ErrEntityNotFound = StringError("entity not found") ```` ## File: internal/entity/entity_signature_map_test.go ````go package entity ⋮---- import ( "math/big" "testing" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "math/big" "testing" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ⋮---- symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- func TestSignatureMap_SetValidatorPresent(t *testing.T) ⋮---- // Setup common test data ⋮---- vm := NewSignatureMap(requestID, symbiotic.Epoch(epoch), 2) // 2 total validators for setup ⋮---- // Verify validator index is marked as present ⋮---- // Verify voting power is updated expectedVotingPower := symbiotic.ToVotingPower(big.NewInt(100)) // activeValidator1's voting power ⋮---- // Set first validator present (index 0) ⋮---- // Set second validator present (index 1) ⋮---- // Verify both validator indexes are marked as present ⋮---- // Verify total voting power is cumulative expectedVotingPower := symbiotic.ToVotingPower(big.NewInt(300)) // 100 + 200 ⋮---- // Set validator index present first time ⋮---- // Try to set the same validator index present again ⋮---- // Verify voting power is not double-counted expectedVotingPower := symbiotic.ToVotingPower(big.NewInt(100)) // Should still be 100, not 200 ⋮---- func TestSignatureMap_ThresholdReached(t *testing.T) ⋮---- func TestSignatureMap_IntegrationScenarios(t *testing.T) ⋮---- // Setup validators with different voting powers ⋮---- // Total active voting power: 750 // Set quorum threshold to 67% (approximately 500) ⋮---- vm := NewSignatureMap(requestID, symbiotic.Epoch(epoch), 4) // 4 total validators ⋮---- // Verify initial state ⋮---- // Add first validator (100) - threshold not reached ⋮---- // Add second validator (100 + 200 = 300) - threshold not reached ⋮---- // Add third validator (300 + 300 = 600) - threshold reached! ⋮---- // Add fourth validator (600 + 150 = 750) - threshold still reached ⋮---- IsActive: false, // Inactive - not available for signatures ⋮---- // Total active voting power: 300 (only first two validators) // Set high quorum threshold that can't be reached ⋮---- // Add all available active validators (first two are active) ⋮---- // Even with all active validators, threshold should not be reached ⋮---- // Total active voting power: 500 // Set quorum threshold to 100% ⋮---- // Add first validator - threshold not reached ⋮---- // Add second validator - threshold exactly reached ⋮---- func TestSignatureMap_GetMissingValidators(t *testing.T) ⋮---- // All validators should be missing ⋮---- // Set validators 0 and 2 as present ⋮---- // Only validators 1 and 3 should be missing ⋮---- // Set all validators as present ⋮---- // No validators should be missing ⋮---- // Single validator should be missing ⋮---- // After setting present ⋮---- func TestBitmapFromBytes(t *testing.T) ⋮---- // Create a bitmap with some values ⋮---- // Serialize to bytes ⋮---- // Deserialize from bytes ⋮---- // Verify the restored bitmap has the same values ⋮---- // Create empty bitmap ⋮---- // Verify the restored bitmap is empty ⋮---- // Test with invalid byte sequence ⋮---- // Create bitmap with large indices ⋮---- // Verify all large indices are preserved ⋮---- // Test multiple roundtrips to ensure consistency ⋮---- // Serialize ⋮---- // Deserialize ⋮---- // Verify equality ⋮---- // Use restored for next iteration ```` ## File: internal/entity/entity_signature_map.go ````go package entity ⋮---- import ( "math/big" "github.com/RoaringBitmap/roaring/v2" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "math/big" ⋮---- "github.com/RoaringBitmap/roaring/v2" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" ⋮---- symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- type SignatureMap struct { RequestID common.Hash Epoch symbiotic.Epoch SignedValidatorsBitmap Bitmap CurrentVotingPower symbiotic.VotingPower TotalValidators uint32 } ⋮---- func NewSignatureMap(requestID common.Hash, epoch symbiotic.Epoch, totalValidators uint32) SignatureMap ⋮---- func (vm *SignatureMap) SetValidatorPresent(activeIndex uint32, votingPower symbiotic.VotingPower) error ⋮---- func (vm *SignatureMap) ThresholdReached(quorumThreshold symbiotic.VotingPower) bool ⋮---- func (vm *SignatureMap) GetMissingValidators() Bitmap ⋮---- type Bitmap struct { *roaring.Bitmap } ⋮---- func NewBitmap() Bitmap ⋮---- func NewBitmapOf(dat ...uint32) Bitmap ⋮---- func BitmapFromBytes(b []byte) (Bitmap, error) ```` ## File: internal/entity/entity_signature_request.go ````go package entity ⋮---- import ( "github.com/ethereum/go-ethereum/common" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "github.com/ethereum/go-ethereum/common" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- // SignatureRequestWithID represents a signature request with its request ID type SignatureRequestWithID struct { RequestID common.Hash SignatureRequest symbiotic.SignatureRequest } ```` ## File: internal/entity/entity_signature_sync.go ````go package entity ⋮---- import ( "github.com/ethereum/go-ethereum/common" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "github.com/ethereum/go-ethereum/common" ⋮---- symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- // WantSignaturesRequest represents a request to resync signatures for a specific epoch. // Contains missing validator indices for each incomplete signature request. type WantSignaturesRequest struct { WantSignatures map[common.Hash]Bitmap // requestID -> missing validator indices bitmap } ⋮---- WantSignatures map[common.Hash]Bitmap // requestID -> missing validator indices bitmap ⋮---- // WantSignaturesResponse contains signatures grouped by Request id. // Each signature includes the validator index for consistent mapping. type WantSignaturesResponse struct { Signatures map[common.Hash][]ValidatorSignature } ⋮---- // ValidatorSignature pairs a signature with its validator index in the active validator set. // The validator index corresponds to the position in ValidatorSet.Validators.GetActiveValidators(). type ValidatorSignature struct { ValidatorIndex uint32 // Index in active validator set Signature symbiotic.Signature // The actual signature data } ⋮---- ValidatorIndex uint32 // Index in active validator set Signature symbiotic.Signature // The actual signature data ⋮---- // SignatureProcessingStats contains detailed statistics for processing received signatures type SignatureProcessingStats struct { ProcessedCount int // Successfully processed signatures UnrequestedSignatureCount int // Signatures for validators we didn't request UnrequestedHashCount int // Signatures for hashes we didn't request SignatureRequestFailCount int // Failed to get signature request ProcessingFailCount int // Failed to process signature AlreadyExistCount int // Signature already exists (ErrEntityAlreadyExist) } ⋮---- ProcessedCount int // Successfully processed signatures UnrequestedSignatureCount int // Signatures for validators we didn't request UnrequestedHashCount int // Signatures for hashes we didn't request SignatureRequestFailCount int // Failed to get signature request ProcessingFailCount int // Failed to process signature AlreadyExistCount int // Signature already exists (ErrEntityAlreadyExist) ⋮---- // TotalErrors returns the total number of errors encountered func (s SignatureProcessingStats) TotalErrors() int ⋮---- // WantAggregationProofsRequest represents a request to resync aggregation proofs for specific signature requests. // Contains request ids for which aggregation proofs are needed. type WantAggregationProofsRequest struct { RequestIDs []common.Hash // requestID list for missing aggregation proofs } ⋮---- RequestIDs []common.Hash // requestID list for missing aggregation proofs ⋮---- // WantAggregationProofsResponse contains aggregation proofs grouped by request id. // Each aggregation proof corresponds to a complete signature aggregation for a request. type WantAggregationProofsResponse struct { Proofs map[common.Hash]symbiotic.AggregationProof // requestID -> aggregation proof } ⋮---- Proofs map[common.Hash]symbiotic.AggregationProof // requestID -> aggregation proof ⋮---- // AggregationProofProcessingStats contains detailed statistics for processing received aggregation proofs type AggregationProofProcessingStats struct { ProcessedCount int // Successfully processed aggregation proofs UnrequestedProofCount int // Proofs for hashes we didn't request VerificationFailCount int // Failed to verify aggregation proof ProcessingFailCount int // Failed to process aggregation proof AlreadyExistCount int // Aggregation proof already exists (ErrEntityAlreadyExist) } ⋮---- ProcessedCount int // Successfully processed aggregation proofs UnrequestedProofCount int // Proofs for hashes we didn't request VerificationFailCount int // Failed to verify aggregation proof ProcessingFailCount int // Failed to process aggregation proof AlreadyExistCount int // Aggregation proof already exists (ErrEntityAlreadyExist) ```` ## File: internal/entity/p2p_entity.go ````go package entity ⋮---- type SenderInfo struct { // Sender is a p2p peer id Sender string PublicKey []byte } ⋮---- // Sender is a p2p peer id ⋮---- // P2PMessage is a generic message structure for P2P communication, containing SenderInfo and a message of type T. type P2PMessage[T any] struct { SenderInfo SenderInfo Message T } ```` ## File: internal/gen/api/v1/api_grpc.pb.go ````go // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: v1/api.proto ⋮---- package v1 ⋮---- import ( context "context" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" ) ⋮---- context "context" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" ⋮---- // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. // Requires gRPC-Go v1.64.0 or later. const _ = grpc.SupportPackageIsVersion9 ⋮---- const ( SymbioticAPIService_SignMessage_FullMethodName = "/api.proto.v1.SymbioticAPIService/SignMessage" SymbioticAPIService_GetAggregationProof_FullMethodName = "/api.proto.v1.SymbioticAPIService/GetAggregationProof" SymbioticAPIService_GetAggregationProofsByEpoch_FullMethodName = "/api.proto.v1.SymbioticAPIService/GetAggregationProofsByEpoch" SymbioticAPIService_GetCurrentEpoch_FullMethodName = "/api.proto.v1.SymbioticAPIService/GetCurrentEpoch" SymbioticAPIService_GetSignatures_FullMethodName = "/api.proto.v1.SymbioticAPIService/GetSignatures" SymbioticAPIService_GetSignaturesByEpoch_FullMethodName = "/api.proto.v1.SymbioticAPIService/GetSignaturesByEpoch" SymbioticAPIService_GetSignatureRequestIDsByEpoch_FullMethodName = "/api.proto.v1.SymbioticAPIService/GetSignatureRequestIDsByEpoch" SymbioticAPIService_GetSignatureRequestsByEpoch_FullMethodName = "/api.proto.v1.SymbioticAPIService/GetSignatureRequestsByEpoch" SymbioticAPIService_GetSignatureRequest_FullMethodName = "/api.proto.v1.SymbioticAPIService/GetSignatureRequest" SymbioticAPIService_GetAggregationStatus_FullMethodName = "/api.proto.v1.SymbioticAPIService/GetAggregationStatus" SymbioticAPIService_GetValidatorSet_FullMethodName = "/api.proto.v1.SymbioticAPIService/GetValidatorSet" SymbioticAPIService_GetValidatorByAddress_FullMethodName = "/api.proto.v1.SymbioticAPIService/GetValidatorByAddress" SymbioticAPIService_GetValidatorByKey_FullMethodName = "/api.proto.v1.SymbioticAPIService/GetValidatorByKey" SymbioticAPIService_GetLocalValidator_FullMethodName = "/api.proto.v1.SymbioticAPIService/GetLocalValidator" SymbioticAPIService_GetValidatorSetHeader_FullMethodName = "/api.proto.v1.SymbioticAPIService/GetValidatorSetHeader" SymbioticAPIService_GetLastCommitted_FullMethodName = "/api.proto.v1.SymbioticAPIService/GetLastCommitted" SymbioticAPIService_GetLastAllCommitted_FullMethodName = "/api.proto.v1.SymbioticAPIService/GetLastAllCommitted" SymbioticAPIService_GetValidatorSetMetadata_FullMethodName = "/api.proto.v1.SymbioticAPIService/GetValidatorSetMetadata" SymbioticAPIService_ListenSignatures_FullMethodName = "/api.proto.v1.SymbioticAPIService/ListenSignatures" SymbioticAPIService_ListenProofs_FullMethodName = "/api.proto.v1.SymbioticAPIService/ListenProofs" SymbioticAPIService_ListenValidatorSet_FullMethodName = "/api.proto.v1.SymbioticAPIService/ListenValidatorSet" ) ⋮---- // SymbioticAPIServiceClient is the client API for SymbioticAPIService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. ⋮---- // SymbioticAPI provides access to the Symbiotic relay functions type SymbioticAPIServiceClient interface { // Sign a message SignMessage(ctx context.Context, in *SignMessageRequest, opts ...grpc.CallOption) (*SignMessageResponse, error) // Get aggregation proof GetAggregationProof(ctx context.Context, in *GetAggregationProofRequest, opts ...grpc.CallOption) (*GetAggregationProofResponse, error) // Get aggregation proofs by epoch GetAggregationProofsByEpoch(ctx context.Context, in *GetAggregationProofsByEpochRequest, opts ...grpc.CallOption) (*GetAggregationProofsByEpochResponse, error) // Get current epoch GetCurrentEpoch(ctx context.Context, in *GetCurrentEpochRequest, opts ...grpc.CallOption) (*GetCurrentEpochResponse, error) // Get signature by request id GetSignatures(ctx context.Context, in *GetSignaturesRequest, opts ...grpc.CallOption) (*GetSignaturesResponse, error) // Get signature by epoch GetSignaturesByEpoch(ctx context.Context, in *GetSignaturesByEpochRequest, opts ...grpc.CallOption) (*GetSignaturesByEpochResponse, error) // Get all signature request IDs by epoch GetSignatureRequestIDsByEpoch(ctx context.Context, in *GetSignatureRequestIDsByEpochRequest, opts ...grpc.CallOption) (*GetSignatureRequestIDsByEpochResponse, error) // Get all signature requests by epoch GetSignatureRequestsByEpoch(ctx context.Context, in *GetSignatureRequestsByEpochRequest, opts ...grpc.CallOption) (*GetSignatureRequestsByEpochResponse, error) // Get signature request by request id GetSignatureRequest(ctx context.Context, in *GetSignatureRequestRequest, opts ...grpc.CallOption) (*GetSignatureRequestResponse, error) // Get aggregation status, can be sent only to aggregator nodes GetAggregationStatus(ctx context.Context, in *GetAggregationStatusRequest, opts ...grpc.CallOption) (*GetAggregationStatusResponse, error) // Get current validator set GetValidatorSet(ctx context.Context, in *GetValidatorSetRequest, opts ...grpc.CallOption) (*GetValidatorSetResponse, error) // Get validator by address GetValidatorByAddress(ctx context.Context, in *GetValidatorByAddressRequest, opts ...grpc.CallOption) (*GetValidatorByAddressResponse, error) // Get validator by key GetValidatorByKey(ctx context.Context, in *GetValidatorByKeyRequest, opts ...grpc.CallOption) (*GetValidatorByKeyResponse, error) // Get local validator GetLocalValidator(ctx context.Context, in *GetLocalValidatorRequest, opts ...grpc.CallOption) (*GetLocalValidatorResponse, error) // Get validator set header GetValidatorSetHeader(ctx context.Context, in *GetValidatorSetHeaderRequest, opts ...grpc.CallOption) (*GetValidatorSetHeaderResponse, error) // Get last committed epoch for a specific settlement chain GetLastCommitted(ctx context.Context, in *GetLastCommittedRequest, opts ...grpc.CallOption) (*GetLastCommittedResponse, error) // Get last committed epochs for all settlement chains GetLastAllCommitted(ctx context.Context, in *GetLastAllCommittedRequest, opts ...grpc.CallOption) (*GetLastAllCommittedResponse, error) // Get validator set metadata like extra data and request id to fetch aggregation and signature requests GetValidatorSetMetadata(ctx context.Context, in *GetValidatorSetMetadataRequest, opts ...grpc.CallOption) (*GetValidatorSetMetadataResponse, error) // Stream signatures in real-time. If start_epoch is provided, sends historical data first ListenSignatures(ctx context.Context, in *ListenSignaturesRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[ListenSignaturesResponse], error) // Stream aggregation proofs in real-time. If start_epoch is provided, sends historical data first ListenProofs(ctx context.Context, in *ListenProofsRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[ListenProofsResponse], error) // Stream validator set changes in real-time. If start_epoch is provided, sends historical data first ListenValidatorSet(ctx context.Context, in *ListenValidatorSetRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[ListenValidatorSetResponse], error) } ⋮---- // Sign a message ⋮---- // Get aggregation proof ⋮---- // Get aggregation proofs by epoch ⋮---- // Get current epoch ⋮---- // Get signature by request id ⋮---- // Get signature by epoch ⋮---- // Get all signature request IDs by epoch ⋮---- // Get all signature requests by epoch ⋮---- // Get signature request by request id ⋮---- // Get aggregation status, can be sent only to aggregator nodes ⋮---- // Get current validator set ⋮---- // Get validator by address ⋮---- // Get validator by key ⋮---- // Get local validator ⋮---- // Get validator set header ⋮---- // Get last committed epoch for a specific settlement chain ⋮---- // Get last committed epochs for all settlement chains ⋮---- // Get validator set metadata like extra data and request id to fetch aggregation and signature requests ⋮---- // Stream signatures in real-time. If start_epoch is provided, sends historical data first ⋮---- // Stream aggregation proofs in real-time. If start_epoch is provided, sends historical data first ⋮---- // Stream validator set changes in real-time. If start_epoch is provided, sends historical data first ⋮---- type symbioticAPIServiceClient struct { cc grpc.ClientConnInterface } ⋮---- func NewSymbioticAPIServiceClient(cc grpc.ClientConnInterface) SymbioticAPIServiceClient ⋮---- func (c *symbioticAPIServiceClient) SignMessage(ctx context.Context, in *SignMessageRequest, opts ...grpc.CallOption) (*SignMessageResponse, error) ⋮---- func (c *symbioticAPIServiceClient) GetAggregationProof(ctx context.Context, in *GetAggregationProofRequest, opts ...grpc.CallOption) (*GetAggregationProofResponse, error) ⋮---- func (c *symbioticAPIServiceClient) GetAggregationProofsByEpoch(ctx context.Context, in *GetAggregationProofsByEpochRequest, opts ...grpc.CallOption) (*GetAggregationProofsByEpochResponse, error) ⋮---- func (c *symbioticAPIServiceClient) GetCurrentEpoch(ctx context.Context, in *GetCurrentEpochRequest, opts ...grpc.CallOption) (*GetCurrentEpochResponse, error) ⋮---- func (c *symbioticAPIServiceClient) GetSignatures(ctx context.Context, in *GetSignaturesRequest, opts ...grpc.CallOption) (*GetSignaturesResponse, error) ⋮---- func (c *symbioticAPIServiceClient) GetSignaturesByEpoch(ctx context.Context, in *GetSignaturesByEpochRequest, opts ...grpc.CallOption) (*GetSignaturesByEpochResponse, error) ⋮---- func (c *symbioticAPIServiceClient) GetSignatureRequestIDsByEpoch(ctx context.Context, in *GetSignatureRequestIDsByEpochRequest, opts ...grpc.CallOption) (*GetSignatureRequestIDsByEpochResponse, error) ⋮---- func (c *symbioticAPIServiceClient) GetSignatureRequestsByEpoch(ctx context.Context, in *GetSignatureRequestsByEpochRequest, opts ...grpc.CallOption) (*GetSignatureRequestsByEpochResponse, error) ⋮---- func (c *symbioticAPIServiceClient) GetSignatureRequest(ctx context.Context, in *GetSignatureRequestRequest, opts ...grpc.CallOption) (*GetSignatureRequestResponse, error) ⋮---- func (c *symbioticAPIServiceClient) GetAggregationStatus(ctx context.Context, in *GetAggregationStatusRequest, opts ...grpc.CallOption) (*GetAggregationStatusResponse, error) ⋮---- func (c *symbioticAPIServiceClient) GetValidatorSet(ctx context.Context, in *GetValidatorSetRequest, opts ...grpc.CallOption) (*GetValidatorSetResponse, error) ⋮---- func (c *symbioticAPIServiceClient) GetValidatorByAddress(ctx context.Context, in *GetValidatorByAddressRequest, opts ...grpc.CallOption) (*GetValidatorByAddressResponse, error) ⋮---- func (c *symbioticAPIServiceClient) GetValidatorByKey(ctx context.Context, in *GetValidatorByKeyRequest, opts ...grpc.CallOption) (*GetValidatorByKeyResponse, error) ⋮---- func (c *symbioticAPIServiceClient) GetLocalValidator(ctx context.Context, in *GetLocalValidatorRequest, opts ...grpc.CallOption) (*GetLocalValidatorResponse, error) ⋮---- func (c *symbioticAPIServiceClient) GetValidatorSetHeader(ctx context.Context, in *GetValidatorSetHeaderRequest, opts ...grpc.CallOption) (*GetValidatorSetHeaderResponse, error) ⋮---- func (c *symbioticAPIServiceClient) GetLastCommitted(ctx context.Context, in *GetLastCommittedRequest, opts ...grpc.CallOption) (*GetLastCommittedResponse, error) ⋮---- func (c *symbioticAPIServiceClient) GetLastAllCommitted(ctx context.Context, in *GetLastAllCommittedRequest, opts ...grpc.CallOption) (*GetLastAllCommittedResponse, error) ⋮---- func (c *symbioticAPIServiceClient) GetValidatorSetMetadata(ctx context.Context, in *GetValidatorSetMetadataRequest, opts ...grpc.CallOption) (*GetValidatorSetMetadataResponse, error) ⋮---- func (c *symbioticAPIServiceClient) ListenSignatures(ctx context.Context, in *ListenSignaturesRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[ListenSignaturesResponse], error) ⋮---- // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. ⋮---- func (c *symbioticAPIServiceClient) ListenProofs(ctx context.Context, in *ListenProofsRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[ListenProofsResponse], error) ⋮---- func (c *symbioticAPIServiceClient) ListenValidatorSet(ctx context.Context, in *ListenValidatorSetRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[ListenValidatorSetResponse], error) ⋮---- // SymbioticAPIServiceServer is the server API for SymbioticAPIService service. // All implementations must embed UnimplementedSymbioticAPIServiceServer // for forward compatibility. ⋮---- type SymbioticAPIServiceServer interface { // Sign a message SignMessage(context.Context, *SignMessageRequest) (*SignMessageResponse, error) // Get aggregation proof GetAggregationProof(context.Context, *GetAggregationProofRequest) (*GetAggregationProofResponse, error) // Get aggregation proofs by epoch GetAggregationProofsByEpoch(context.Context, *GetAggregationProofsByEpochRequest) (*GetAggregationProofsByEpochResponse, error) // Get current epoch GetCurrentEpoch(context.Context, *GetCurrentEpochRequest) (*GetCurrentEpochResponse, error) // Get signature by request id GetSignatures(context.Context, *GetSignaturesRequest) (*GetSignaturesResponse, error) // Get signature by epoch GetSignaturesByEpoch(context.Context, *GetSignaturesByEpochRequest) (*GetSignaturesByEpochResponse, error) // Get all signature request IDs by epoch GetSignatureRequestIDsByEpoch(context.Context, *GetSignatureRequestIDsByEpochRequest) (*GetSignatureRequestIDsByEpochResponse, error) // Get all signature requests by epoch GetSignatureRequestsByEpoch(context.Context, *GetSignatureRequestsByEpochRequest) (*GetSignatureRequestsByEpochResponse, error) // Get signature request by request id GetSignatureRequest(context.Context, *GetSignatureRequestRequest) (*GetSignatureRequestResponse, error) // Get aggregation status, can be sent only to aggregator nodes GetAggregationStatus(context.Context, *GetAggregationStatusRequest) (*GetAggregationStatusResponse, error) // Get current validator set GetValidatorSet(context.Context, *GetValidatorSetRequest) (*GetValidatorSetResponse, error) // Get validator by address GetValidatorByAddress(context.Context, *GetValidatorByAddressRequest) (*GetValidatorByAddressResponse, error) // Get validator by key GetValidatorByKey(context.Context, *GetValidatorByKeyRequest) (*GetValidatorByKeyResponse, error) // Get local validator GetLocalValidator(context.Context, *GetLocalValidatorRequest) (*GetLocalValidatorResponse, error) // Get validator set header GetValidatorSetHeader(context.Context, *GetValidatorSetHeaderRequest) (*GetValidatorSetHeaderResponse, error) // Get last committed epoch for a specific settlement chain GetLastCommitted(context.Context, *GetLastCommittedRequest) (*GetLastCommittedResponse, error) // Get last committed epochs for all settlement chains GetLastAllCommitted(context.Context, *GetLastAllCommittedRequest) (*GetLastAllCommittedResponse, error) // Get validator set metadata like extra data and request id to fetch aggregation and signature requests GetValidatorSetMetadata(context.Context, *GetValidatorSetMetadataRequest) (*GetValidatorSetMetadataResponse, error) // Stream signatures in real-time. If start_epoch is provided, sends historical data first ListenSignatures(*ListenSignaturesRequest, grpc.ServerStreamingServer[ListenSignaturesResponse]) error // Stream aggregation proofs in real-time. If start_epoch is provided, sends historical data first ListenProofs(*ListenProofsRequest, grpc.ServerStreamingServer[ListenProofsResponse]) error // Stream validator set changes in real-time. If start_epoch is provided, sends historical data first ListenValidatorSet(*ListenValidatorSetRequest, grpc.ServerStreamingServer[ListenValidatorSetResponse]) error mustEmbedUnimplementedSymbioticAPIServiceServer() } ⋮---- // UnimplementedSymbioticAPIServiceServer must be embedded to have // forward compatible implementations. ⋮---- // NOTE: this should be embedded by value instead of pointer to avoid a nil // pointer dereference when methods are called. type UnimplementedSymbioticAPIServiceServer struct{} ⋮---- func (UnimplementedSymbioticAPIServiceServer) mustEmbedUnimplementedSymbioticAPIServiceServer() func (UnimplementedSymbioticAPIServiceServer) testEmbeddedByValue() ⋮---- // UnsafeSymbioticAPIServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to SymbioticAPIServiceServer will // result in compilation errors. type UnsafeSymbioticAPIServiceServer interface { mustEmbedUnimplementedSymbioticAPIServiceServer() } ⋮---- func RegisterSymbioticAPIServiceServer(s grpc.ServiceRegistrar, srv SymbioticAPIServiceServer) ⋮---- // If the following call pancis, it indicates UnimplementedSymbioticAPIServiceServer was // embedded by pointer and is nil. This will cause panics if an // unimplemented method is ever invoked, so we test this at initialization // time to prevent it from happening at runtime later due to I/O. ⋮---- func _SymbioticAPIService_SignMessage_Handler(srv interface ⋮---- func _SymbioticAPIService_GetAggregationProof_Handler(srv interface ⋮---- func _SymbioticAPIService_GetAggregationProofsByEpoch_Handler(srv interface ⋮---- func _SymbioticAPIService_GetCurrentEpoch_Handler(srv interface ⋮---- func _SymbioticAPIService_GetSignatures_Handler(srv interface ⋮---- func _SymbioticAPIService_GetSignaturesByEpoch_Handler(srv interface ⋮---- func _SymbioticAPIService_GetSignatureRequestIDsByEpoch_Handler(srv interface ⋮---- func _SymbioticAPIService_GetSignatureRequestsByEpoch_Handler(srv interface ⋮---- func _SymbioticAPIService_GetSignatureRequest_Handler(srv interface ⋮---- func _SymbioticAPIService_GetAggregationStatus_Handler(srv interface ⋮---- func _SymbioticAPIService_GetValidatorSet_Handler(srv interface ⋮---- func _SymbioticAPIService_GetValidatorByAddress_Handler(srv interface ⋮---- func _SymbioticAPIService_GetValidatorByKey_Handler(srv interface ⋮---- func _SymbioticAPIService_GetLocalValidator_Handler(srv interface ⋮---- func _SymbioticAPIService_GetValidatorSetHeader_Handler(srv interface ⋮---- func _SymbioticAPIService_GetLastCommitted_Handler(srv interface ⋮---- func _SymbioticAPIService_GetLastAllCommitted_Handler(srv interface ⋮---- func _SymbioticAPIService_GetValidatorSetMetadata_Handler(srv interface ⋮---- func _SymbioticAPIService_ListenSignatures_Handler(srv interface ⋮---- func _SymbioticAPIService_ListenProofs_Handler(srv interface ⋮---- func _SymbioticAPIService_ListenValidatorSet_Handler(srv interface ⋮---- // SymbioticAPIService_ServiceDesc is the grpc.ServiceDesc for SymbioticAPIService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var SymbioticAPIService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "api.proto.v1.SymbioticAPIService", HandlerType: (*SymbioticAPIServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "SignMessage", Handler: _SymbioticAPIService_SignMessage_Handler, }, { MethodName: "GetAggregationProof", Handler: _SymbioticAPIService_GetAggregationProof_Handler, }, { MethodName: "GetAggregationProofsByEpoch", Handler: _SymbioticAPIService_GetAggregationProofsByEpoch_Handler, }, { MethodName: "GetCurrentEpoch", Handler: _SymbioticAPIService_GetCurrentEpoch_Handler, }, { MethodName: "GetSignatures", Handler: _SymbioticAPIService_GetSignatures_Handler, }, { MethodName: "GetSignaturesByEpoch", Handler: _SymbioticAPIService_GetSignaturesByEpoch_Handler, }, { MethodName: "GetSignatureRequestIDsByEpoch", Handler: _SymbioticAPIService_GetSignatureRequestIDsByEpoch_Handler, }, { MethodName: "GetSignatureRequestsByEpoch", Handler: _SymbioticAPIService_GetSignatureRequestsByEpoch_Handler, }, { MethodName: "GetSignatureRequest", Handler: _SymbioticAPIService_GetSignatureRequest_Handler, }, { MethodName: "GetAggregationStatus", Handler: _SymbioticAPIService_GetAggregationStatus_Handler, }, { MethodName: "GetValidatorSet", Handler: _SymbioticAPIService_GetValidatorSet_Handler, }, { MethodName: "GetValidatorByAddress", Handler: _SymbioticAPIService_GetValidatorByAddress_Handler, }, { MethodName: "GetValidatorByKey", Handler: _SymbioticAPIService_GetValidatorByKey_Handler, }, { MethodName: "GetLocalValidator", Handler: _SymbioticAPIService_GetLocalValidator_Handler, }, { MethodName: "GetValidatorSetHeader", Handler: _SymbioticAPIService_GetValidatorSetHeader_Handler, }, { MethodName: "GetLastCommitted", Handler: _SymbioticAPIService_GetLastCommitted_Handler, }, { MethodName: "GetLastAllCommitted", Handler: _SymbioticAPIService_GetLastAllCommitted_Handler, }, { MethodName: "GetValidatorSetMetadata", Handler: _SymbioticAPIService_GetValidatorSetMetadata_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "ListenSignatures", Handler: _SymbioticAPIService_ListenSignatures_Handler, ServerStreams: true, }, { StreamName: "ListenProofs", Handler: _SymbioticAPIService_ListenProofs_Handler, ServerStreams: true, }, { StreamName: "ListenValidatorSet", Handler: _SymbioticAPIService_ListenValidatorSet_Handler, ServerStreams: true, }, }, Metadata: "v1/api.proto", } ```` ## File: internal/gen/api/v1/api.pb.go ````go // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.6 // protoc (unknown) // source: v1/api.proto ⋮---- package v1 ⋮---- import ( _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" reflect "reflect" sync "sync" unsafe "unsafe" ) ⋮---- _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" reflect "reflect" sync "sync" unsafe "unsafe" ⋮---- const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) ⋮---- // Verify that this generated code is sufficiently up-to-date. ⋮---- // Verify that runtime/protoimpl is sufficiently up-to-date. ⋮---- // Validator set status enumeration type ValidatorSetStatus int32 ⋮---- const ( // Default/unknown status ValidatorSetStatus_VALIDATOR_SET_STATUS_UNSPECIFIED ValidatorSetStatus = 0 // Derived status ValidatorSetStatus_VALIDATOR_SET_STATUS_DERIVED ValidatorSetStatus = 1 // Aggregated status ValidatorSetStatus_VALIDATOR_SET_STATUS_AGGREGATED ValidatorSetStatus = 2 // Committed status ValidatorSetStatus_VALIDATOR_SET_STATUS_COMMITTED ValidatorSetStatus = 3 // Missed status ValidatorSetStatus_VALIDATOR_SET_STATUS_MISSED ValidatorSetStatus = 4 ) ⋮---- // Default/unknown status ⋮---- // Derived status ⋮---- // Aggregated status ⋮---- // Committed status ⋮---- // Missed status ⋮---- // Enum value maps for ValidatorSetStatus. var ( ValidatorSetStatus_name = map[int32]string{ 0: "VALIDATOR_SET_STATUS_UNSPECIFIED", 1: "VALIDATOR_SET_STATUS_DERIVED", 2: "VALIDATOR_SET_STATUS_AGGREGATED", 3: "VALIDATOR_SET_STATUS_COMMITTED", 4: "VALIDATOR_SET_STATUS_MISSED", } ValidatorSetStatus_value = map[string]int32{ "VALIDATOR_SET_STATUS_UNSPECIFIED": 0, "VALIDATOR_SET_STATUS_DERIVED": 1, "VALIDATOR_SET_STATUS_AGGREGATED": 2, "VALIDATOR_SET_STATUS_COMMITTED": 3, "VALIDATOR_SET_STATUS_MISSED": 4, } ) ⋮---- func (x ValidatorSetStatus) Enum() *ValidatorSetStatus ⋮---- func (x ValidatorSetStatus) String() string ⋮---- func (ValidatorSetStatus) Descriptor() protoreflect.EnumDescriptor ⋮---- func (ValidatorSetStatus) Type() protoreflect.EnumType ⋮---- func (x ValidatorSetStatus) Number() protoreflect.EnumNumber ⋮---- // Deprecated: Use ValidatorSetStatus.Descriptor instead. func (ValidatorSetStatus) EnumDescriptor() ([]byte, []int) ⋮---- // Signing process status enumeration type SigningStatus int32 ⋮---- const ( // Default/unknown status SigningStatus_SIGNING_STATUS_UNSPECIFIED SigningStatus = 0 // Request has been created and is waiting for signatures SigningStatus_SIGNING_STATUS_PENDING SigningStatus = 1 // Signing process completed successfully with proof SigningStatus_SIGNING_STATUS_COMPLETED SigningStatus = 2 // Signing process failed SigningStatus_SIGNING_STATUS_FAILED SigningStatus = 3 // Signing request timed out SigningStatus_SIGNING_STATUS_TIMEOUT SigningStatus = 4 ) ⋮---- // Request has been created and is waiting for signatures ⋮---- // Signing process completed successfully with proof ⋮---- // Signing process failed ⋮---- // Signing request timed out ⋮---- // Enum value maps for SigningStatus. var ( SigningStatus_name = map[int32]string{ 0: "SIGNING_STATUS_UNSPECIFIED", 1: "SIGNING_STATUS_PENDING", 2: "SIGNING_STATUS_COMPLETED", 3: "SIGNING_STATUS_FAILED", 4: "SIGNING_STATUS_TIMEOUT", } SigningStatus_value = map[string]int32{ "SIGNING_STATUS_UNSPECIFIED": 0, "SIGNING_STATUS_PENDING": 1, "SIGNING_STATUS_COMPLETED": 2, "SIGNING_STATUS_FAILED": 3, "SIGNING_STATUS_TIMEOUT": 4, } ) ⋮---- // Deprecated: Use SigningStatus.Descriptor instead. ⋮---- // Error code enumeration type ErrorCode int32 ⋮---- const ( // Default/unknown error ErrorCode_ERROR_CODE_UNSPECIFIED ErrorCode = 0 // No data found ErrorCode_ERROR_CODE_NO_DATA ErrorCode = 1 // Internal server error ErrorCode_ERROR_CODE_INTERNAL ErrorCode = 2 // Not an aggregator node ErrorCode_ERROR_CODE_NOT_AGGREGATOR ErrorCode = 3 ) ⋮---- // Default/unknown error ⋮---- // No data found ⋮---- // Internal server error ⋮---- // Not an aggregator node ⋮---- // Enum value maps for ErrorCode. var ( ErrorCode_name = map[int32]string{ 0: "ERROR_CODE_UNSPECIFIED", 1: "ERROR_CODE_NO_DATA", 2: "ERROR_CODE_INTERNAL", 3: "ERROR_CODE_NOT_AGGREGATOR", } ErrorCode_value = map[string]int32{ "ERROR_CODE_UNSPECIFIED": 0, "ERROR_CODE_NO_DATA": 1, "ERROR_CODE_INTERNAL": 2, "ERROR_CODE_NOT_AGGREGATOR": 3, } ) ⋮---- // Deprecated: Use ErrorCode.Descriptor instead. ⋮---- // Request message for signing a message type SignMessageRequest struct { state protoimpl.MessageState `protogen:"open.v1"` // Key tag identifier (0-127) KeyTag uint32 `protobuf:"varint,1,opt,name=key_tag,json=keyTag,proto3" json:"key_tag,omitempty"` // Message to be signed Message []byte `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` // Required epoch (optional, if not provided latest committed epoch will be used) RequiredEpoch *uint64 `protobuf:"varint,3,opt,name=required_epoch,json=requiredEpoch,proto3,oneof" json:"required_epoch,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Key tag identifier (0-127) ⋮---- // Message to be signed ⋮---- // Required epoch (optional, if not provided latest committed epoch will be used) ⋮---- func (x *SignMessageRequest) Reset() ⋮---- func (*SignMessageRequest) ProtoMessage() ⋮---- func (x *SignMessageRequest) ProtoReflect() protoreflect.Message ⋮---- // Deprecated: Use SignMessageRequest.ProtoReflect.Descriptor instead. ⋮---- func (x *SignMessageRequest) GetKeyTag() uint32 ⋮---- func (x *SignMessageRequest) GetMessage() []byte ⋮---- func (x *SignMessageRequest) GetRequiredEpoch() uint64 ⋮---- // Response message for sign message request type SignMessageResponse struct { state protoimpl.MessageState `protogen:"open.v1"` // Hash of the signature request RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` // Epoch number Epoch uint64 `protobuf:"varint,2,opt,name=epoch,proto3" json:"epoch,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Hash of the signature request ⋮---- // Epoch number ⋮---- // Deprecated: Use SignMessageResponse.ProtoReflect.Descriptor instead. ⋮---- func (x *SignMessageResponse) GetRequestId() string ⋮---- func (x *SignMessageResponse) GetEpoch() uint64 ⋮---- // Request message for listening to signatures stream type ListenSignaturesRequest struct { state protoimpl.MessageState `protogen:"open.v1"` // Optional: start epoch. If provided, stream will first send all historical signatures starting from this epoch, then continue with real-time updates // If not provided, only signatures generated after stream creation will be sent StartEpoch *uint64 `protobuf:"varint,1,opt,name=start_epoch,json=startEpoch,proto3,oneof" json:"start_epoch,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Optional: start epoch. If provided, stream will first send all historical signatures starting from this epoch, then continue with real-time updates // If not provided, only signatures generated after stream creation will be sent ⋮---- // Deprecated: Use ListenSignaturesRequest.ProtoReflect.Descriptor instead. ⋮---- func (x *ListenSignaturesRequest) GetStartEpoch() uint64 ⋮---- // Response message for signatures stream type ListenSignaturesResponse struct { state protoimpl.MessageState `protogen:"open.v1"` // Id of the signature request RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` // Epoch number Epoch uint64 `protobuf:"varint,2,opt,name=epoch,proto3" json:"epoch,omitempty"` // Signature data Signature *Signature `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Id of the signature request ⋮---- // Signature data ⋮---- // Deprecated: Use ListenSignaturesResponse.ProtoReflect.Descriptor instead. ⋮---- func (x *ListenSignaturesResponse) GetSignature() *Signature ⋮---- // Request message for listening to aggregation proofs stream type ListenProofsRequest struct { state protoimpl.MessageState `protogen:"open.v1"` // Optional: start epoch. If provided, stream will first send all historical proofs starting from this epoch, then continue with real-time updates // If not provided, only proofs generated after stream creation will be sent StartEpoch *uint64 `protobuf:"varint,1,opt,name=start_epoch,json=startEpoch,proto3,oneof" json:"start_epoch,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Optional: start epoch. If provided, stream will first send all historical proofs starting from this epoch, then continue with real-time updates // If not provided, only proofs generated after stream creation will be sent ⋮---- // Deprecated: Use ListenProofsRequest.ProtoReflect.Descriptor instead. ⋮---- // Response message for aggregation proofs stream type ListenProofsResponse struct { state protoimpl.MessageState `protogen:"open.v1"` // Id of the request RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` // Epoch number Epoch uint64 `protobuf:"varint,2,opt,name=epoch,proto3" json:"epoch,omitempty"` // Final aggregation proof AggregationProof *AggregationProof `protobuf:"bytes,3,opt,name=aggregation_proof,json=aggregationProof,proto3" json:"aggregation_proof,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Id of the request ⋮---- // Final aggregation proof ⋮---- // Deprecated: Use ListenProofsResponse.ProtoReflect.Descriptor instead. ⋮---- func (x *ListenProofsResponse) GetAggregationProof() *AggregationProof ⋮---- // Request message for listening to validator set changes stream type ListenValidatorSetRequest struct { state protoimpl.MessageState `protogen:"open.v1"` // Optional: start epoch. If provided, stream will first send all historical validator sets starting from this epoch, then continue with real-time updates // If not provided, only validator sets generated after stream creation will be sent StartEpoch *uint64 `protobuf:"varint,1,opt,name=start_epoch,json=startEpoch,proto3,oneof" json:"start_epoch,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Optional: start epoch. If provided, stream will first send all historical validator sets starting from this epoch, then continue with real-time updates // If not provided, only validator sets generated after stream creation will be sent ⋮---- // Deprecated: Use ListenValidatorSetRequest.ProtoReflect.Descriptor instead. ⋮---- // Response message for validator set changes stream type ListenValidatorSetResponse struct { state protoimpl.MessageState `protogen:"open.v1"` // The validator set ValidatorSet *ValidatorSet `protobuf:"bytes,1,opt,name=validator_set,json=validatorSet,proto3" json:"validator_set,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // The validator set ⋮---- // Deprecated: Use ListenValidatorSetResponse.ProtoReflect.Descriptor instead. ⋮---- func (x *ListenValidatorSetResponse) GetValidatorSet() *ValidatorSet ⋮---- // Request message for getting aggregation proof type GetAggregationProofRequest struct { state protoimpl.MessageState `protogen:"open.v1"` RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Deprecated: Use GetAggregationProofRequest.ProtoReflect.Descriptor instead. ⋮---- type GetAggregationProofsByEpochRequest struct { state protoimpl.MessageState `protogen:"open.v1"` // Epoch number Epoch uint64 `protobuf:"varint,1,opt,name=epoch,proto3" json:"epoch,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Deprecated: Use GetAggregationProofsByEpochRequest.ProtoReflect.Descriptor instead. ⋮---- // Request message for getting current epoch type GetCurrentEpochRequest struct { state protoimpl.MessageState `protogen:"open.v1"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Deprecated: Use GetCurrentEpochRequest.ProtoReflect.Descriptor instead. ⋮---- // Request message for getting signatures type GetSignaturesRequest struct { state protoimpl.MessageState `protogen:"open.v1"` RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Deprecated: Use GetSignaturesRequest.ProtoReflect.Descriptor instead. ⋮---- // Request message for getting signatures by epoch type GetSignaturesByEpochRequest struct { state protoimpl.MessageState `protogen:"open.v1"` // Epoch number Epoch uint64 `protobuf:"varint,1,opt,name=epoch,proto3" json:"epoch,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Deprecated: Use GetSignaturesByEpochRequest.ProtoReflect.Descriptor instead. ⋮---- // Response message for getting signatures type GetSignaturesResponse struct { state protoimpl.MessageState `protogen:"open.v1"` // List of signatures Signatures []*Signature `protobuf:"bytes,1,rep,name=signatures,proto3" json:"signatures,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // List of signatures ⋮---- // Deprecated: Use GetSignaturesResponse.ProtoReflect.Descriptor instead. ⋮---- func (x *GetSignaturesResponse) GetSignatures() []*Signature ⋮---- // Response message for getting signatures by epoch type GetSignaturesByEpochResponse struct { state protoimpl.MessageState `protogen:"open.v1"` // List of signatures Signatures []*Signature `protobuf:"bytes,1,rep,name=signatures,proto3" json:"signatures,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Deprecated: Use GetSignaturesByEpochResponse.ProtoReflect.Descriptor instead. ⋮---- // Request message for getting all signature request IDs by epoch type GetSignatureRequestIDsByEpochRequest struct { state protoimpl.MessageState `protogen:"open.v1"` // Epoch number Epoch uint64 `protobuf:"varint,1,opt,name=epoch,proto3" json:"epoch,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Deprecated: Use GetSignatureRequestIDsByEpochRequest.ProtoReflect.Descriptor instead. ⋮---- // Response message for getting all signature request IDs by epoch type GetSignatureRequestIDsByEpochResponse struct { state protoimpl.MessageState `protogen:"open.v1"` // List of all signature request IDs for the epoch RequestIds []string `protobuf:"bytes,1,rep,name=request_ids,json=requestIds,proto3" json:"request_ids,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // List of all signature request IDs for the epoch ⋮---- // Deprecated: Use GetSignatureRequestIDsByEpochResponse.ProtoReflect.Descriptor instead. ⋮---- func (x *GetSignatureRequestIDsByEpochResponse) GetRequestIds() []string ⋮---- // Request message for getting all signature requests by epoch type GetSignatureRequestsByEpochRequest struct { state protoimpl.MessageState `protogen:"open.v1"` // Epoch number Epoch uint64 `protobuf:"varint,1,opt,name=epoch,proto3" json:"epoch,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Deprecated: Use GetSignatureRequestsByEpochRequest.ProtoReflect.Descriptor instead. ⋮---- // Response message for getting all signature requests by epoch type GetSignatureRequestsByEpochResponse struct { state protoimpl.MessageState `protogen:"open.v1"` // List of all signature requests for the epoch SignatureRequests []*SignatureRequest `protobuf:"bytes,1,rep,name=signature_requests,json=signatureRequests,proto3" json:"signature_requests,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // List of all signature requests for the epoch ⋮---- // Deprecated: Use GetSignatureRequestsByEpochResponse.ProtoReflect.Descriptor instead. ⋮---- func (x *GetSignatureRequestsByEpochResponse) GetSignatureRequests() []*SignatureRequest ⋮---- // Request message for getting signature request type GetSignatureRequestRequest struct { state protoimpl.MessageState `protogen:"open.v1"` RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Deprecated: Use GetSignatureRequestRequest.ProtoReflect.Descriptor instead. ⋮---- // Request message for getting aggregation status type GetAggregationStatusRequest struct { state protoimpl.MessageState `protogen:"open.v1"` RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Deprecated: Use GetAggregationStatusRequest.ProtoReflect.Descriptor instead. ⋮---- // Request message for getting validator set type GetValidatorSetRequest struct { state protoimpl.MessageState `protogen:"open.v1"` // Epoch number (optional, if not provided current epoch will be used) Epoch *uint64 `protobuf:"varint,1,opt,name=epoch,proto3,oneof" json:"epoch,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Epoch number (optional, if not provided current epoch will be used) ⋮---- // Deprecated: Use GetValidatorSetRequest.ProtoReflect.Descriptor instead. ⋮---- // Request message for getting validator by address type GetValidatorByAddressRequest struct { state protoimpl.MessageState `protogen:"open.v1"` // Epoch number (optional, if not provided current epoch will be used) Epoch *uint64 `protobuf:"varint,1,opt,name=epoch,proto3,oneof" json:"epoch,omitempty"` // Validator address (required) Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Validator address (required) ⋮---- // Deprecated: Use GetValidatorByAddressRequest.ProtoReflect.Descriptor instead. ⋮---- func (x *GetValidatorByAddressRequest) GetAddress() string ⋮---- // Request message for getting validator by key type GetValidatorByKeyRequest struct { state protoimpl.MessageState `protogen:"open.v1"` // Epoch number (optional, if not provided current epoch will be used) Epoch *uint64 `protobuf:"varint,1,opt,name=epoch,proto3,oneof" json:"epoch,omitempty"` // Validator key tag (required) KeyTag uint32 `protobuf:"varint,2,opt,name=key_tag,json=keyTag,proto3" json:"key_tag,omitempty"` // Validator on chain (public) key (required) OnChainKey []byte `protobuf:"bytes,3,opt,name=on_chain_key,json=onChainKey,proto3" json:"on_chain_key,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Validator key tag (required) ⋮---- // Validator on chain (public) key (required) ⋮---- // Deprecated: Use GetValidatorByKeyRequest.ProtoReflect.Descriptor instead. ⋮---- func (x *GetValidatorByKeyRequest) GetOnChainKey() []byte ⋮---- // Request message for getting local validator type GetLocalValidatorRequest struct { state protoimpl.MessageState `protogen:"open.v1"` // Epoch number (optional, if not provided current epoch will be used) Epoch *uint64 `protobuf:"varint,1,opt,name=epoch,proto3,oneof" json:"epoch,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Deprecated: Use GetLocalValidatorRequest.ProtoReflect.Descriptor instead. ⋮---- // Request message for getting validator set header type GetValidatorSetHeaderRequest struct { state protoimpl.MessageState `protogen:"open.v1"` // Epoch number (optional, if not provided current epoch will be used) Epoch *uint64 `protobuf:"varint,1,opt,name=epoch,proto3,oneof" json:"epoch,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Deprecated: Use GetValidatorSetHeaderRequest.ProtoReflect.Descriptor instead. ⋮---- // Request message for getting validator set metadata type GetValidatorSetMetadataRequest struct { state protoimpl.MessageState `protogen:"open.v1"` // Epoch number (optional, if not provided current epoch will be used) Epoch *uint64 `protobuf:"varint,1,opt,name=epoch,proto3,oneof" json:"epoch,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Deprecated: Use GetValidatorSetMetadataRequest.ProtoReflect.Descriptor instead. ⋮---- // Response message for getting current epoch type GetCurrentEpochResponse struct { state protoimpl.MessageState `protogen:"open.v1"` // Epoch number Epoch uint64 `protobuf:"varint,1,opt,name=epoch,proto3" json:"epoch,omitempty"` // Epoch start time StartTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Epoch start time ⋮---- // Deprecated: Use GetCurrentEpochResponse.ProtoReflect.Descriptor instead. ⋮---- func (x *GetCurrentEpochResponse) GetStartTime() *timestamppb.Timestamp ⋮---- // SignatureRequest represents a signature request type SignatureRequest struct { state protoimpl.MessageState `protogen:"open.v1"` // Request ID RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` // Key tag identifier (0-127) KeyTag uint32 `protobuf:"varint,2,opt,name=key_tag,json=keyTag,proto3" json:"key_tag,omitempty"` // Message to be signed Message []byte `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` // Required epoch RequiredEpoch uint64 `protobuf:"varint,4,opt,name=required_epoch,json=requiredEpoch,proto3" json:"required_epoch,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Request ID ⋮---- // Required epoch ⋮---- // Deprecated: Use SignatureRequest.ProtoReflect.Descriptor instead. ⋮---- // Response message for getting signature request type GetSignatureRequestResponse struct { state protoimpl.MessageState `protogen:"open.v1"` SignatureRequest *SignatureRequest `protobuf:"bytes,1,opt,name=signature_request,json=signatureRequest,proto3" json:"signature_request,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Deprecated: Use GetSignatureRequestResponse.ProtoReflect.Descriptor instead. ⋮---- func (x *GetSignatureRequestResponse) GetSignatureRequest() *SignatureRequest ⋮---- // Response message for getting aggregation proof type GetAggregationProofResponse struct { state protoimpl.MessageState `protogen:"open.v1"` AggregationProof *AggregationProof `protobuf:"bytes,1,opt,name=aggregation_proof,json=aggregationProof,proto3" json:"aggregation_proof,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Deprecated: Use GetAggregationProofResponse.ProtoReflect.Descriptor instead. ⋮---- type GetAggregationProofsByEpochResponse struct { state protoimpl.MessageState `protogen:"open.v1"` AggregationProofs []*AggregationProof `protobuf:"bytes,1,rep,name=aggregation_proofs,json=aggregationProofs,proto3" json:"aggregation_proofs,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Deprecated: Use GetAggregationProofsByEpochResponse.ProtoReflect.Descriptor instead. ⋮---- func (x *GetAggregationProofsByEpochResponse) GetAggregationProofs() []*AggregationProof ⋮---- type AggregationProof struct { state protoimpl.MessageState `protogen:"open.v1"` // Message hash MessageHash []byte `protobuf:"bytes,2,opt,name=message_hash,json=messageHash,proto3" json:"message_hash,omitempty"` // Proof data Proof []byte `protobuf:"bytes,3,opt,name=proof,proto3" json:"proof,omitempty"` // Request ID RequestId string `protobuf:"bytes,4,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Message hash ⋮---- // Proof data ⋮---- // Deprecated: Use AggregationProof.ProtoReflect.Descriptor instead. ⋮---- func (x *AggregationProof) GetMessageHash() []byte ⋮---- func (x *AggregationProof) GetProof() []byte ⋮---- // Response message for getting aggregation status type GetAggregationStatusResponse struct { state protoimpl.MessageState `protogen:"open.v1"` // Current voting power of the aggregator (big integer as string) CurrentVotingPower string `protobuf:"bytes,1,opt,name=current_voting_power,json=currentVotingPower,proto3" json:"current_voting_power,omitempty"` // List of operator addresses that signed the request SignerOperators []string `protobuf:"bytes,2,rep,name=signer_operators,json=signerOperators,proto3" json:"signer_operators,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Current voting power of the aggregator (big integer as string) ⋮---- // List of operator addresses that signed the request ⋮---- // Deprecated: Use GetAggregationStatusResponse.ProtoReflect.Descriptor instead. ⋮---- func (x *GetAggregationStatusResponse) GetCurrentVotingPower() string ⋮---- func (x *GetAggregationStatusResponse) GetSignerOperators() []string ⋮---- // Digital signature type Signature struct { state protoimpl.MessageState `protogen:"open.v1"` // Signature data Signature []byte `protobuf:"bytes,1,opt,name=signature,proto3" json:"signature,omitempty"` // Message hash MessageHash []byte `protobuf:"bytes,2,opt,name=message_hash,json=messageHash,proto3" json:"message_hash,omitempty"` // Public key PublicKey []byte `protobuf:"bytes,3,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` // Request ID RequestId string `protobuf:"bytes,4,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Public key ⋮---- // Deprecated: Use Signature.ProtoReflect.Descriptor instead. ⋮---- func (x *Signature) GetPublicKey() []byte ⋮---- // Response message for getting validator set type GetValidatorSetResponse struct { state protoimpl.MessageState `protogen:"open.v1"` // The validator set ValidatorSet *ValidatorSet `protobuf:"bytes,1,opt,name=validator_set,json=validatorSet,proto3" json:"validator_set,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Deprecated: Use GetValidatorSetResponse.ProtoReflect.Descriptor instead. ⋮---- // Response message for getting validator by address type GetValidatorByAddressResponse struct { state protoimpl.MessageState `protogen:"open.v1"` // The validator Validator *Validator `protobuf:"bytes,1,opt,name=validator,proto3" json:"validator,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // The validator ⋮---- // Deprecated: Use GetValidatorByAddressResponse.ProtoReflect.Descriptor instead. ⋮---- func (x *GetValidatorByAddressResponse) GetValidator() *Validator ⋮---- // Response message for getting validator by key type GetValidatorByKeyResponse struct { state protoimpl.MessageState `protogen:"open.v1"` // The validator Validator *Validator `protobuf:"bytes,1,opt,name=validator,proto3" json:"validator,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Deprecated: Use GetValidatorByKeyResponse.ProtoReflect.Descriptor instead. ⋮---- // Response message for getting local validator type GetLocalValidatorResponse struct { state protoimpl.MessageState `protogen:"open.v1"` // The validator Validator *Validator `protobuf:"bytes,1,opt,name=validator,proto3" json:"validator,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Deprecated: Use GetLocalValidatorResponse.ProtoReflect.Descriptor instead. ⋮---- type ExtraData struct { state protoimpl.MessageState `protogen:"open.v1"` Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Deprecated: Use ExtraData.ProtoReflect.Descriptor instead. ⋮---- func (x *ExtraData) GetKey() []byte ⋮---- func (x *ExtraData) GetValue() []byte ⋮---- // Response message for getting validator set header type GetValidatorSetMetadataResponse struct { state protoimpl.MessageState `protogen:"open.v1"` ExtraData []*ExtraData `protobuf:"bytes,1,rep,name=extra_data,json=extraData,proto3" json:"extra_data,omitempty"` CommitmentData []byte `protobuf:"bytes,2,opt,name=commitment_data,json=commitmentData,proto3" json:"commitment_data,omitempty"` RequestId string `protobuf:"bytes,3,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Deprecated: Use GetValidatorSetMetadataResponse.ProtoReflect.Descriptor instead. ⋮---- func (x *GetValidatorSetMetadataResponse) GetExtraData() []*ExtraData ⋮---- func (x *GetValidatorSetMetadataResponse) GetCommitmentData() []byte ⋮---- type GetValidatorSetHeaderResponse struct { state protoimpl.MessageState `protogen:"open.v1"` // Version of the validator set Version uint32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` // Key tag required to commit next validator set RequiredKeyTag uint32 `protobuf:"varint,2,opt,name=required_key_tag,json=requiredKeyTag,proto3" json:"required_key_tag,omitempty"` // Validator set epoch Epoch uint64 `protobuf:"varint,3,opt,name=epoch,proto3" json:"epoch,omitempty"` // Epoch capture timestamp CaptureTimestamp *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=capture_timestamp,json=captureTimestamp,proto3" json:"capture_timestamp,omitempty"` // Quorum threshold (big integer as string) QuorumThreshold string `protobuf:"bytes,5,opt,name=quorum_threshold,json=quorumThreshold,proto3" json:"quorum_threshold,omitempty"` // Total voting power (big integer as string) TotalVotingPower string `protobuf:"bytes,6,opt,name=total_voting_power,json=totalVotingPower,proto3" json:"total_voting_power,omitempty"` // Validators SSZ Merkle root (hex string) ValidatorsSszMroot string `protobuf:"bytes,7,opt,name=validators_ssz_mroot,json=validatorsSszMroot,proto3" json:"validators_ssz_mroot,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Version of the validator set ⋮---- // Key tag required to commit next validator set ⋮---- // Validator set epoch ⋮---- // Epoch capture timestamp ⋮---- // Quorum threshold (big integer as string) ⋮---- // Total voting power (big integer as string) ⋮---- // Validators SSZ Merkle root (hex string) ⋮---- // Deprecated: Use GetValidatorSetHeaderResponse.ProtoReflect.Descriptor instead. ⋮---- func (x *GetValidatorSetHeaderResponse) GetVersion() uint32 ⋮---- func (x *GetValidatorSetHeaderResponse) GetRequiredKeyTag() uint32 ⋮---- func (x *GetValidatorSetHeaderResponse) GetCaptureTimestamp() *timestamppb.Timestamp ⋮---- func (x *GetValidatorSetHeaderResponse) GetQuorumThreshold() string ⋮---- func (x *GetValidatorSetHeaderResponse) GetTotalVotingPower() string ⋮---- func (x *GetValidatorSetHeaderResponse) GetValidatorsSszMroot() string ⋮---- // Validator information type Validator struct { state protoimpl.MessageState `protogen:"open.v1"` // Operator address (hex string) Operator string `protobuf:"bytes,1,opt,name=operator,proto3" json:"operator,omitempty"` // Voting power of the validator (big integer as string) VotingPower string `protobuf:"bytes,2,opt,name=voting_power,json=votingPower,proto3" json:"voting_power,omitempty"` // Indicates if the validator is active IsActive bool `protobuf:"varint,3,opt,name=is_active,json=isActive,proto3" json:"is_active,omitempty"` // List of cryptographic keys Keys []*Key `protobuf:"bytes,4,rep,name=keys,proto3" json:"keys,omitempty"` // List of validator vaults Vaults []*ValidatorVault `protobuf:"bytes,5,rep,name=vaults,proto3" json:"vaults,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Operator address (hex string) ⋮---- // Voting power of the validator (big integer as string) ⋮---- // Indicates if the validator is active ⋮---- // List of cryptographic keys ⋮---- // List of validator vaults ⋮---- // Deprecated: Use Validator.ProtoReflect.Descriptor instead. ⋮---- func (x *Validator) GetOperator() string ⋮---- func (x *Validator) GetVotingPower() string ⋮---- func (x *Validator) GetIsActive() bool ⋮---- func (x *Validator) GetKeys() []*Key ⋮---- func (x *Validator) GetVaults() []*ValidatorVault ⋮---- // Cryptographic key type Key struct { state protoimpl.MessageState `protogen:"open.v1"` // Key tag identifier (0-127) Tag uint32 `protobuf:"varint,1,opt,name=tag,proto3" json:"tag,omitempty"` // Key payload Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Key payload ⋮---- // Deprecated: Use Key.ProtoReflect.Descriptor instead. ⋮---- func (x *Key) GetTag() uint32 ⋮---- func (x *Key) GetPayload() []byte ⋮---- // Validator vault information type ValidatorVault struct { state protoimpl.MessageState `protogen:"open.v1"` // Chain identifier ChainId uint64 `protobuf:"varint,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` // Vault address Vault string `protobuf:"bytes,2,opt,name=vault,proto3" json:"vault,omitempty"` // Voting power for this vault (big integer as string) VotingPower string `protobuf:"bytes,3,opt,name=voting_power,json=votingPower,proto3" json:"voting_power,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Chain identifier ⋮---- // Vault address ⋮---- // Voting power for this vault (big integer as string) ⋮---- // Deprecated: Use ValidatorVault.ProtoReflect.Descriptor instead. ⋮---- func (x *ValidatorVault) GetChainId() uint64 ⋮---- func (x *ValidatorVault) GetVault() string ⋮---- // Request message for getting last committed epoch for a specific settlement chain type GetLastCommittedRequest struct { state protoimpl.MessageState `protogen:"open.v1"` // Settlement chain ID SettlementChainId uint64 `protobuf:"varint,1,opt,name=settlement_chain_id,json=settlementChainId,proto3" json:"settlement_chain_id,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Settlement chain ID ⋮---- // Deprecated: Use GetLastCommittedRequest.ProtoReflect.Descriptor instead. ⋮---- func (x *GetLastCommittedRequest) GetSettlementChainId() uint64 ⋮---- // Response message for getting last committed epoch type GetLastCommittedResponse struct { state protoimpl.MessageState `protogen:"open.v1"` // Settlement chain ID SettlementChainId uint64 `protobuf:"varint,1,opt,name=settlement_chain_id,json=settlementChainId,proto3" json:"settlement_chain_id,omitempty"` EpochInfo *ChainEpochInfo `protobuf:"bytes,2,opt,name=epoch_info,json=epochInfo,proto3" json:"epoch_info,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Deprecated: Use GetLastCommittedResponse.ProtoReflect.Descriptor instead. ⋮---- func (x *GetLastCommittedResponse) GetEpochInfo() *ChainEpochInfo ⋮---- // Request message for getting last committed epochs for all chains type GetLastAllCommittedRequest struct { state protoimpl.MessageState `protogen:"open.v1"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Deprecated: Use GetLastAllCommittedRequest.ProtoReflect.Descriptor instead. ⋮---- // Response message for getting all last committed epochs type GetLastAllCommittedResponse struct { state protoimpl.MessageState `protogen:"open.v1"` // List of settlement chains with their last committed epochs EpochInfos map[uint64]*ChainEpochInfo `protobuf:"bytes,1,rep,name=epoch_infos,json=epochInfos,proto3" json:"epoch_infos,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` // Suggested epoch info for signatures, it is the minimum commited epoch among all chains SuggestedEpochInfo *ChainEpochInfo `protobuf:"bytes,2,opt,name=suggested_epoch_info,json=suggestedEpochInfo,proto3" json:"suggested_epoch_info,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // List of settlement chains with their last committed epochs ⋮---- // Suggested epoch info for signatures, it is the minimum commited epoch among all chains ⋮---- // Deprecated: Use GetLastAllCommittedResponse.ProtoReflect.Descriptor instead. ⋮---- func (x *GetLastAllCommittedResponse) GetEpochInfos() map[uint64]*ChainEpochInfo ⋮---- func (x *GetLastAllCommittedResponse) GetSuggestedEpochInfo() *ChainEpochInfo ⋮---- // Settlement chain with its last committed epoch type ChainEpochInfo struct { state protoimpl.MessageState `protogen:"open.v1"` // Last committed epoch for this chain LastCommittedEpoch uint64 `protobuf:"varint,1,opt,name=last_committed_epoch,json=lastCommittedEpoch,proto3" json:"last_committed_epoch,omitempty"` // Epoch start time StartTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Last committed epoch for this chain ⋮---- // Deprecated: Use ChainEpochInfo.ProtoReflect.Descriptor instead. ⋮---- func (x *ChainEpochInfo) GetLastCommittedEpoch() uint64 ⋮---- type ValidatorSet struct { state protoimpl.MessageState `protogen:"open.v1"` // Version of the validator set Version uint32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` // Key tag required to commit next validator set RequiredKeyTag uint32 `protobuf:"varint,2,opt,name=required_key_tag,json=requiredKeyTag,proto3" json:"required_key_tag,omitempty"` // Validator set epoch Epoch uint64 `protobuf:"varint,3,opt,name=epoch,proto3" json:"epoch,omitempty"` // Epoch capture timestamp CaptureTimestamp *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=capture_timestamp,json=captureTimestamp,proto3" json:"capture_timestamp,omitempty"` // Quorum threshold (big integer as string) QuorumThreshold string `protobuf:"bytes,5,opt,name=quorum_threshold,json=quorumThreshold,proto3" json:"quorum_threshold,omitempty"` // Status of validator set header Status ValidatorSetStatus `protobuf:"varint,6,opt,name=status,proto3,enum=api.proto.v1.ValidatorSetStatus" json:"status,omitempty"` // List of validators Validators []*Validator `protobuf:"bytes,7,rep,name=validators,proto3" json:"validators,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } ⋮---- // Status of validator set header ⋮---- // List of validators ⋮---- // Deprecated: Use ValidatorSet.ProtoReflect.Descriptor instead. ⋮---- func (x *ValidatorSet) GetStatus() ValidatorSetStatus ⋮---- func (x *ValidatorSet) GetValidators() []*Validator ⋮---- var File_v1_api_proto protoreflect.FileDescriptor ⋮---- const file_v1_api_proto_rawDesc = "" + "\n" + "\fv1/api.proto\x12\fapi.proto.v1\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1cgoogle/api/annotations.proto\"\x86\x01\n" + "\x12SignMessageRequest\x12\x17\n" + "\akey_tag\x18\x01 \x01(\rR\x06keyTag\x12\x18\n" + "\amessage\x18\x02 \x01(\fR\amessage\x12*\n" + "\x0erequired_epoch\x18\x03 \x01(\x04H\x00R\rrequiredEpoch\x88\x01\x01B\x11\n" + "\x0f_required_epoch\"J\n" + "\x13SignMessageResponse\x12\x1d\n" + "\n" + "request_id\x18\x01 \x01(\tR\trequestId\x12\x14\n" + "\x05epoch\x18\x02 \x01(\x04R\x05epoch\"O\n" + "\x17ListenSignaturesRequest\x12$\n" + "\vstart_epoch\x18\x01 \x01(\x04H\x00R\n" + "startEpoch\x88\x01\x01B\x0e\n" + "\f_start_epoch\"\x86\x01\n" + "\x18ListenSignaturesResponse\x12\x1d\n" + "\n" + "request_id\x18\x01 \x01(\tR\trequestId\x12\x14\n" + "\x05epoch\x18\x02 \x01(\x04R\x05epoch\x125\n" + "\tsignature\x18\x03 \x01(\v2\x17.api.proto.v1.SignatureR\tsignature\"K\n" + "\x13ListenProofsRequest\x12$\n" + "\vstart_epoch\x18\x01 \x01(\x04H\x00R\n" + "startEpoch\x88\x01\x01B\x0e\n" + "\f_start_epoch\"\x98\x01\n" + "\x14ListenProofsResponse\x12\x1d\n" + "\n" + "request_id\x18\x01 \x01(\tR\trequestId\x12\x14\n" + "\x05epoch\x18\x02 \x01(\x04R\x05epoch\x12K\n" + "\x11aggregation_proof\x18\x03 \x01(\v2\x1e.api.proto.v1.AggregationProofR\x10aggregationProof\"Q\n" + "\x19ListenValidatorSetRequest\x12$\n" + "\vstart_epoch\x18\x01 \x01(\x04H\x00R\n" + "startEpoch\x88\x01\x01B\x0e\n" + "\f_start_epoch\"]\n" + "\x1aListenValidatorSetResponse\x12?\n" + "\rvalidator_set\x18\x01 \x01(\v2\x1a.api.proto.v1.ValidatorSetR\fvalidatorSet\";\n" + "\x1aGetAggregationProofRequest\x12\x1d\n" + "\n" + "request_id\x18\x01 \x01(\tR\trequestId\":\n" + "\"GetAggregationProofsByEpochRequest\x12\x14\n" + "\x05epoch\x18\x01 \x01(\x04R\x05epoch\"\x18\n" + "\x16GetCurrentEpochRequest\"5\n" + "\x14GetSignaturesRequest\x12\x1d\n" + "\n" + "request_id\x18\x01 \x01(\tR\trequestId\"3\n" + "\x1bGetSignaturesByEpochRequest\x12\x14\n" + "\x05epoch\x18\x01 \x01(\x04R\x05epoch\"P\n" + "\x15GetSignaturesResponse\x127\n" + "\n" + "signatures\x18\x01 \x03(\v2\x17.api.proto.v1.SignatureR\n" + "signatures\"W\n" + "\x1cGetSignaturesByEpochResponse\x127\n" + "\n" + "signatures\x18\x01 \x03(\v2\x17.api.proto.v1.SignatureR\n" + "signatures\"<\n" + "$GetSignatureRequestIDsByEpochRequest\x12\x14\n" + "\x05epoch\x18\x01 \x01(\x04R\x05epoch\"H\n" + "%GetSignatureRequestIDsByEpochResponse\x12\x1f\n" + "\vrequest_ids\x18\x01 \x03(\tR\n" + "requestIds\":\n" + "\"GetSignatureRequestsByEpochRequest\x12\x14\n" + "\x05epoch\x18\x01 \x01(\x04R\x05epoch\"t\n" + "#GetSignatureRequestsByEpochResponse\x12M\n" + "\x12signature_requests\x18\x01 \x03(\v2\x1e.api.proto.v1.SignatureRequestR\x11signatureRequests\";\n" + "\x1aGetSignatureRequestRequest\x12\x1d\n" + "\n" + "request_id\x18\x01 \x01(\tR\trequestId\"<\n" + "\x1bGetAggregationStatusRequest\x12\x1d\n" + "\n" + "request_id\x18\x01 \x01(\tR\trequestId\"=\n" + "\x16GetValidatorSetRequest\x12\x19\n" + "\x05epoch\x18\x01 \x01(\x04H\x00R\x05epoch\x88\x01\x01B\b\n" + "\x06_epoch\"]\n" + "\x1cGetValidatorByAddressRequest\x12\x19\n" + "\x05epoch\x18\x01 \x01(\x04H\x00R\x05epoch\x88\x01\x01\x12\x18\n" + "\aaddress\x18\x02 \x01(\tR\aaddressB\b\n" + "\x06_epoch\"z\n" + "\x18GetValidatorByKeyRequest\x12\x19\n" + "\x05epoch\x18\x01 \x01(\x04H\x00R\x05epoch\x88\x01\x01\x12\x17\n" + "\akey_tag\x18\x02 \x01(\rR\x06keyTag\x12 \n" + "\fon_chain_key\x18\x03 \x01(\fR\n" + "onChainKeyB\b\n" + "\x06_epoch\"?\n" + "\x18GetLocalValidatorRequest\x12\x19\n" + "\x05epoch\x18\x01 \x01(\x04H\x00R\x05epoch\x88\x01\x01B\b\n" + "\x06_epoch\"C\n" + "\x1cGetValidatorSetHeaderRequest\x12\x19\n" + "\x05epoch\x18\x01 \x01(\x04H\x00R\x05epoch\x88\x01\x01B\b\n" + "\x06_epoch\"E\n" + "\x1eGetValidatorSetMetadataRequest\x12\x19\n" + "\x05epoch\x18\x01 \x01(\x04H\x00R\x05epoch\x88\x01\x01B\b\n" + "\x06_epoch\"j\n" + "\x17GetCurrentEpochResponse\x12\x14\n" + "\x05epoch\x18\x01 \x01(\x04R\x05epoch\x129\n" + "\n" + "start_time\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\tstartTime\"\x8b\x01\n" + "\x10SignatureRequest\x12\x1d\n" + "\n" + "request_id\x18\x01 \x01(\tR\trequestId\x12\x17\n" + "\akey_tag\x18\x02 \x01(\rR\x06keyTag\x12\x18\n" + "\amessage\x18\x03 \x01(\fR\amessage\x12%\n" + "\x0erequired_epoch\x18\x04 \x01(\x04R\rrequiredEpoch\"j\n" + "\x1bGetSignatureRequestResponse\x12K\n" + "\x11signature_request\x18\x01 \x01(\v2\x1e.api.proto.v1.SignatureRequestR\x10signatureRequest\"j\n" + "\x1bGetAggregationProofResponse\x12K\n" + "\x11aggregation_proof\x18\x01 \x01(\v2\x1e.api.proto.v1.AggregationProofR\x10aggregationProof\"t\n" + "#GetAggregationProofsByEpochResponse\x12M\n" + "\x12aggregation_proofs\x18\x01 \x03(\v2\x1e.api.proto.v1.AggregationProofR\x11aggregationProofs\"j\n" + "\x10AggregationProof\x12!\n" + "\fmessage_hash\x18\x02 \x01(\fR\vmessageHash\x12\x14\n" + "\x05proof\x18\x03 \x01(\fR\x05proof\x12\x1d\n" + "\n" + "request_id\x18\x04 \x01(\tR\trequestId\"{\n" + "\x1cGetAggregationStatusResponse\x120\n" + "\x14current_voting_power\x18\x01 \x01(\tR\x12currentVotingPower\x12)\n" + "\x10signer_operators\x18\x02 \x03(\tR\x0fsignerOperators\"\x8a\x01\n" + "\tSignature\x12\x1c\n" + "\tsignature\x18\x01 \x01(\fR\tsignature\x12!\n" + "\fmessage_hash\x18\x02 \x01(\fR\vmessageHash\x12\x1d\n" + "\n" + "public_key\x18\x03 \x01(\fR\tpublicKey\x12\x1d\n" + "\n" + "request_id\x18\x04 \x01(\tR\trequestId\"Z\n" + "\x17GetValidatorSetResponse\x12?\n" + "\rvalidator_set\x18\x01 \x01(\v2\x1a.api.proto.v1.ValidatorSetR\fvalidatorSet\"V\n" + "\x1dGetValidatorByAddressResponse\x125\n" + "\tvalidator\x18\x01 \x01(\v2\x17.api.proto.v1.ValidatorR\tvalidator\"R\n" + "\x19GetValidatorByKeyResponse\x125\n" + "\tvalidator\x18\x01 \x01(\v2\x17.api.proto.v1.ValidatorR\tvalidator\"R\n" + "\x19GetLocalValidatorResponse\x125\n" + "\tvalidator\x18\x01 \x01(\v2\x17.api.proto.v1.ValidatorR\tvalidator\"3\n" + "\tExtraData\x12\x10\n" + "\x03key\x18\x01 \x01(\fR\x03key\x12\x14\n" + "\x05value\x18\x02 \x01(\fR\x05value\"\xa1\x01\n" + "\x1fGetValidatorSetMetadataResponse\x126\n" + "\n" + "extra_data\x18\x01 \x03(\v2\x17.api.proto.v1.ExtraDataR\textraData\x12'\n" + "\x0fcommitment_data\x18\x02 \x01(\fR\x0ecommitmentData\x12\x1d\n" + "\n" + "request_id\x18\x03 \x01(\tR\trequestId\"\xcd\x02\n" + "\x1dGetValidatorSetHeaderResponse\x12\x18\n" + "\aversion\x18\x01 \x01(\rR\aversion\x12(\n" + "\x10required_key_tag\x18\x02 \x01(\rR\x0erequiredKeyTag\x12\x14\n" + "\x05epoch\x18\x03 \x01(\x04R\x05epoch\x12G\n" + "\x11capture_timestamp\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampR\x10captureTimestamp\x12)\n" + "\x10quorum_threshold\x18\x05 \x01(\tR\x0fquorumThreshold\x12,\n" + "\x12total_voting_power\x18\x06 \x01(\tR\x10totalVotingPower\x120\n" + "\x14validators_ssz_mroot\x18\a \x01(\tR\x12validatorsSszMroot\"\xc4\x01\n" + "\tValidator\x12\x1a\n" + "\boperator\x18\x01 \x01(\tR\boperator\x12!\n" + "\fvoting_power\x18\x02 \x01(\tR\vvotingPower\x12\x1b\n" + "\tis_active\x18\x03 \x01(\bR\bisActive\x12%\n" + "\x04keys\x18\x04 \x03(\v2\x11.api.proto.v1.KeyR\x04keys\x124\n" + "\x06vaults\x18\x05 \x03(\v2\x1c.api.proto.v1.ValidatorVaultR\x06vaults\"1\n" + "\x03Key\x12\x10\n" + "\x03tag\x18\x01 \x01(\rR\x03tag\x12\x18\n" + "\apayload\x18\x02 \x01(\fR\apayload\"d\n" + "\x0eValidatorVault\x12\x19\n" + "\bchain_id\x18\x01 \x01(\x04R\achainId\x12\x14\n" + "\x05vault\x18\x02 \x01(\tR\x05vault\x12!\n" + "\fvoting_power\x18\x03 \x01(\tR\vvotingPower\"I\n" + "\x17GetLastCommittedRequest\x12.\n" + "\x13settlement_chain_id\x18\x01 \x01(\x04R\x11settlementChainId\"\x87\x01\n" + "\x18GetLastCommittedResponse\x12.\n" + "\x13settlement_chain_id\x18\x01 \x01(\x04R\x11settlementChainId\x12;\n" + "\n" + "epoch_info\x18\x02 \x01(\v2\x1c.api.proto.v1.ChainEpochInfoR\tepochInfo\"\x1c\n" + "\x1aGetLastAllCommittedRequest\"\xa6\x02\n" + "\x1bGetLastAllCommittedResponse\x12Z\n" + "\vepoch_infos\x18\x01 \x03(\v29.api.proto.v1.GetLastAllCommittedResponse.EpochInfosEntryR\n" + "epochInfos\x12N\n" + "\x14suggested_epoch_info\x18\x02 \x01(\v2\x1c.api.proto.v1.ChainEpochInfoR\x12suggestedEpochInfo\x1a[\n" + "\x0fEpochInfosEntry\x12\x10\n" + "\x03key\x18\x01 \x01(\x04R\x03key\x122\n" + "\x05value\x18\x02 \x01(\v2\x1c.api.proto.v1.ChainEpochInfoR\x05value:\x028\x01\"}\n" + "\x0eChainEpochInfo\x120\n" + "\x14last_committed_epoch\x18\x01 \x01(\x04R\x12lastCommittedEpoch\x129\n" + "\n" + "start_time\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\tstartTime\"\xcf\x02\n" + "\fValidatorSet\x12\x18\n" + "\aversion\x18\x01 \x01(\rR\aversion\x12(\n" + "\x10required_key_tag\x18\x02 \x01(\rR\x0erequiredKeyTag\x12\x14\n" + "\x05epoch\x18\x03 \x01(\x04R\x05epoch\x12G\n" + "\x11capture_timestamp\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampR\x10captureTimestamp\x12)\n" + "\x10quorum_threshold\x18\x05 \x01(\tR\x0fquorumThreshold\x128\n" + "\x06status\x18\x06 \x01(\x0e2 .api.proto.v1.ValidatorSetStatusR\x06status\x127\n" + "\n" + "validators\x18\a \x03(\v2\x17.api.proto.v1.ValidatorR\n" + "validators*\xc6\x01\n" + "\x12ValidatorSetStatus\x12$\n" + " VALIDATOR_SET_STATUS_UNSPECIFIED\x10\x00\x12 \n" + "\x1cVALIDATOR_SET_STATUS_DERIVED\x10\x01\x12#\n" + "\x1fVALIDATOR_SET_STATUS_AGGREGATED\x10\x02\x12\"\n" + "\x1eVALIDATOR_SET_STATUS_COMMITTED\x10\x03\x12\x1f\n" + "\x1bVALIDATOR_SET_STATUS_MISSED\x10\x04*\xa0\x01\n" + "\rSigningStatus\x12\x1e\n" + "\x1aSIGNING_STATUS_UNSPECIFIED\x10\x00\x12\x1a\n" + "\x16SIGNING_STATUS_PENDING\x10\x01\x12\x1c\n" + "\x18SIGNING_STATUS_COMPLETED\x10\x02\x12\x19\n" + "\x15SIGNING_STATUS_FAILED\x10\x03\x12\x1a\n" + "\x16SIGNING_STATUS_TIMEOUT\x10\x04*w\n" + "\tErrorCode\x12\x1a\n" + "\x16ERROR_CODE_UNSPECIFIED\x10\x00\x12\x16\n" + "\x12ERROR_CODE_NO_DATA\x10\x01\x12\x17\n" + "\x13ERROR_CODE_INTERNAL\x10\x02\x12\x1d\n" + "\x19ERROR_CODE_NOT_AGGREGATOR\x10\x032\x8d\x18\n" + "\x13SymbioticAPIService\x12g\n" + "\vSignMessage\x12 .api.proto.v1.SignMessageRequest\x1a!.api.proto.v1.SignMessageResponse\"\x13\x82\xd3\xe4\x93\x02\r:\x01*\"\b/v1/sign\x12\x96\x01\n" + "\x13GetAggregationProof\x12(.api.proto.v1.GetAggregationProofRequest\x1a).api.proto.v1.GetAggregationProofResponse\"*\x82\xd3\xe4\x93\x02$\x12\"/v1/aggregation/proof/{request_id}\x12\xb0\x01\n" + "\x1bGetAggregationProofsByEpoch\x120.api.proto.v1.GetAggregationProofsByEpochRequest\x1a1.api.proto.v1.GetAggregationProofsByEpochResponse\",\x82\xd3\xe4\x93\x02&\x12$/v1/aggregation/proofs/epoch/{epoch}\x12y\n" + "\x0fGetCurrentEpoch\x12$.api.proto.v1.GetCurrentEpochRequest\x1a%.api.proto.v1.GetCurrentEpochResponse\"\x19\x82\xd3\xe4\x93\x02\x13\x12\x11/v1/epoch/current\x12}\n" + "\rGetSignatures\x12\".api.proto.v1.GetSignaturesRequest\x1a#.api.proto.v1.GetSignaturesResponse\"#\x82\xd3\xe4\x93\x02\x1d\x12\x1b/v1/signatures/{request_id}\x12\x93\x01\n" + "\x14GetSignaturesByEpoch\x12).api.proto.v1.GetSignaturesByEpochRequest\x1a*.api.proto.v1.GetSignaturesByEpochResponse\"$\x82\xd3\xe4\x93\x02\x1e\x12\x1c/v1/signatures/epoch/{epoch}\x12\xb9\x01\n" + "\x1dGetSignatureRequestIDsByEpoch\x122.api.proto.v1.GetSignatureRequestIDsByEpochRequest\x1a3.api.proto.v1.GetSignatureRequestIDsByEpochResponse\"/\x82\xd3\xe4\x93\x02)\x12'/v1/signature-request-ids/epoch/{epoch}\x12\xb0\x01\n" + "\x1bGetSignatureRequestsByEpoch\x120.api.proto.v1.GetSignatureRequestsByEpochRequest\x1a1.api.proto.v1.GetSignatureRequestsByEpochResponse\",\x82\xd3\xe4\x93\x02&\x12$/v1/signature-requests/epoch/{epoch}\x12\x96\x01\n" + "\x13GetSignatureRequest\x12(.api.proto.v1.GetSignatureRequestRequest\x1a).api.proto.v1.GetSignatureRequestResponse\"*\x82\xd3\xe4\x93\x02$\x12\"/v1/signature-request/{request_id}\x12\x9a\x01\n" + "\x14GetAggregationStatus\x12).api.proto.v1.GetAggregationStatusRequest\x1a*.api.proto.v1.GetAggregationStatusResponse\"+\x82\xd3\xe4\x93\x02%\x12#/v1/aggregation/status/{request_id}\x12y\n" + "\x0fGetValidatorSet\x12$.api.proto.v1.GetValidatorSetRequest\x1a%.api.proto.v1.GetValidatorSetResponse\"\x19\x82\xd3\xe4\x93\x02\x13\x12\x11/v1/validator-set\x12\x99\x01\n" + "\x15GetValidatorByAddress\x12*.api.proto.v1.GetValidatorByAddressRequest\x1a+.api.proto.v1.GetValidatorByAddressResponse\"'\x82\xd3\xe4\x93\x02!\x12\x1f/v1/validator/address/{address}\x12\x98\x01\n" + "\x11GetValidatorByKey\x12&.api.proto.v1.GetValidatorByKeyRequest\x1a'.api.proto.v1.GetValidatorByKeyResponse\"2\x82\xd3\xe4\x93\x02,\x12*/v1/validator/key/{key_tag}/{on_chain_key}\x12\x81\x01\n" + "\x11GetLocalValidator\x12&.api.proto.v1.GetLocalValidatorRequest\x1a'.api.proto.v1.GetLocalValidatorResponse\"\x1b\x82\xd3\xe4\x93\x02\x15\x12\x13/v1/validator/local\x12\x92\x01\n" + "\x15GetValidatorSetHeader\x12*.api.proto.v1.GetValidatorSetHeaderRequest\x1a+.api.proto.v1.GetValidatorSetHeaderResponse\" \x82\xd3\xe4\x93\x02\x1a\x12\x18/v1/validator-set/header\x12\x94\x01\n" + "\x10GetLastCommitted\x12%.api.proto.v1.GetLastCommittedRequest\x1a&.api.proto.v1.GetLastCommittedResponse\"1\x82\xd3\xe4\x93\x02+\x12)/v1/committed/chain/{settlement_chain_id}\x12\x85\x01\n" + "\x13GetLastAllCommitted\x12(.api.proto.v1.GetLastAllCommittedRequest\x1a).api.proto.v1.GetLastAllCommittedResponse\"\x19\x82\xd3\xe4\x93\x02\x13\x12\x11/v1/committed/all\x12\x9a\x01\n" + "\x17GetValidatorSetMetadata\x12,.api.proto.v1.GetValidatorSetMetadataRequest\x1a-.api.proto.v1.GetValidatorSetMetadataResponse\"\"\x82\xd3\xe4\x93\x02\x1c\x12\x1a/v1/validator-set/metadata\x12\x82\x01\n" + "\x10ListenSignatures\x12%.api.proto.v1.ListenSignaturesRequest\x1a&.api.proto.v1.ListenSignaturesResponse\"\x1d\x82\xd3\xe4\x93\x02\x17\x12\x15/v1/stream/signatures0\x01\x12r\n" + "\fListenProofs\x12!.api.proto.v1.ListenProofsRequest\x1a\".api.proto.v1.ListenProofsResponse\"\x19\x82\xd3\xe4\x93\x02\x13\x12\x11/v1/stream/proofs0\x01\x12\x8b\x01\n" + "\x12ListenValidatorSet\x12'.api.proto.v1.ListenValidatorSetRequest\x1a(.api.proto.v1.ListenValidatorSetResponse\" \x82\xd3\xe4\x93\x02\x1a\x12\x18/v1/stream/validator-set0\x01B\x99\x01\n" + "\x10com.api.proto.v1B\bApiProtoP\x01Z)github.com/symbioticfi/relay/api/proto/v1\xa2\x02\x03APX\xaa\x02\fApi.Proto.V1\xca\x02\fApi\\Proto\\V1\xe2\x02\x18Api\\Proto\\V1\\GPBMetadata\xea\x02\x0eApi::Proto::V1b\x06proto3" ⋮---- var ( file_v1_api_proto_rawDescOnce sync.Once file_v1_api_proto_rawDescData []byte ) ⋮---- func file_v1_api_proto_rawDescGZIP() []byte ⋮---- var file_v1_api_proto_enumTypes = make([]protoimpl.EnumInfo, 3) var file_v1_api_proto_msgTypes = make([]protoimpl.MessageInfo, 52) var file_v1_api_proto_goTypes = []any{ (ValidatorSetStatus)(0), // 0: api.proto.v1.ValidatorSetStatus (SigningStatus)(0), // 1: api.proto.v1.SigningStatus (ErrorCode)(0), // 2: api.proto.v1.ErrorCode (*SignMessageRequest)(nil), // 3: api.proto.v1.SignMessageRequest (*SignMessageResponse)(nil), // 4: api.proto.v1.SignMessageResponse (*ListenSignaturesRequest)(nil), // 5: api.proto.v1.ListenSignaturesRequest (*ListenSignaturesResponse)(nil), // 6: api.proto.v1.ListenSignaturesResponse (*ListenProofsRequest)(nil), // 7: api.proto.v1.ListenProofsRequest (*ListenProofsResponse)(nil), // 8: api.proto.v1.ListenProofsResponse (*ListenValidatorSetRequest)(nil), // 9: api.proto.v1.ListenValidatorSetRequest (*ListenValidatorSetResponse)(nil), // 10: api.proto.v1.ListenValidatorSetResponse (*GetAggregationProofRequest)(nil), // 11: api.proto.v1.GetAggregationProofRequest (*GetAggregationProofsByEpochRequest)(nil), // 12: api.proto.v1.GetAggregationProofsByEpochRequest (*GetCurrentEpochRequest)(nil), // 13: api.proto.v1.GetCurrentEpochRequest (*GetSignaturesRequest)(nil), // 14: api.proto.v1.GetSignaturesRequest (*GetSignaturesByEpochRequest)(nil), // 15: api.proto.v1.GetSignaturesByEpochRequest (*GetSignaturesResponse)(nil), // 16: api.proto.v1.GetSignaturesResponse (*GetSignaturesByEpochResponse)(nil), // 17: api.proto.v1.GetSignaturesByEpochResponse (*GetSignatureRequestIDsByEpochRequest)(nil), // 18: api.proto.v1.GetSignatureRequestIDsByEpochRequest (*GetSignatureRequestIDsByEpochResponse)(nil), // 19: api.proto.v1.GetSignatureRequestIDsByEpochResponse (*GetSignatureRequestsByEpochRequest)(nil), // 20: api.proto.v1.GetSignatureRequestsByEpochRequest (*GetSignatureRequestsByEpochResponse)(nil), // 21: api.proto.v1.GetSignatureRequestsByEpochResponse (*GetSignatureRequestRequest)(nil), // 22: api.proto.v1.GetSignatureRequestRequest (*GetAggregationStatusRequest)(nil), // 23: api.proto.v1.GetAggregationStatusRequest (*GetValidatorSetRequest)(nil), // 24: api.proto.v1.GetValidatorSetRequest (*GetValidatorByAddressRequest)(nil), // 25: api.proto.v1.GetValidatorByAddressRequest (*GetValidatorByKeyRequest)(nil), // 26: api.proto.v1.GetValidatorByKeyRequest (*GetLocalValidatorRequest)(nil), // 27: api.proto.v1.GetLocalValidatorRequest (*GetValidatorSetHeaderRequest)(nil), // 28: api.proto.v1.GetValidatorSetHeaderRequest (*GetValidatorSetMetadataRequest)(nil), // 29: api.proto.v1.GetValidatorSetMetadataRequest (*GetCurrentEpochResponse)(nil), // 30: api.proto.v1.GetCurrentEpochResponse (*SignatureRequest)(nil), // 31: api.proto.v1.SignatureRequest (*GetSignatureRequestResponse)(nil), // 32: api.proto.v1.GetSignatureRequestResponse (*GetAggregationProofResponse)(nil), // 33: api.proto.v1.GetAggregationProofResponse (*GetAggregationProofsByEpochResponse)(nil), // 34: api.proto.v1.GetAggregationProofsByEpochResponse (*AggregationProof)(nil), // 35: api.proto.v1.AggregationProof (*GetAggregationStatusResponse)(nil), // 36: api.proto.v1.GetAggregationStatusResponse (*Signature)(nil), // 37: api.proto.v1.Signature (*GetValidatorSetResponse)(nil), // 38: api.proto.v1.GetValidatorSetResponse (*GetValidatorByAddressResponse)(nil), // 39: api.proto.v1.GetValidatorByAddressResponse (*GetValidatorByKeyResponse)(nil), // 40: api.proto.v1.GetValidatorByKeyResponse (*GetLocalValidatorResponse)(nil), // 41: api.proto.v1.GetLocalValidatorResponse (*ExtraData)(nil), // 42: api.proto.v1.ExtraData (*GetValidatorSetMetadataResponse)(nil), // 43: api.proto.v1.GetValidatorSetMetadataResponse (*GetValidatorSetHeaderResponse)(nil), // 44: api.proto.v1.GetValidatorSetHeaderResponse (*Validator)(nil), // 45: api.proto.v1.Validator (*Key)(nil), // 46: api.proto.v1.Key (*ValidatorVault)(nil), // 47: api.proto.v1.ValidatorVault (*GetLastCommittedRequest)(nil), // 48: api.proto.v1.GetLastCommittedRequest (*GetLastCommittedResponse)(nil), // 49: api.proto.v1.GetLastCommittedResponse (*GetLastAllCommittedRequest)(nil), // 50: api.proto.v1.GetLastAllCommittedRequest (*GetLastAllCommittedResponse)(nil), // 51: api.proto.v1.GetLastAllCommittedResponse (*ChainEpochInfo)(nil), // 52: api.proto.v1.ChainEpochInfo (*ValidatorSet)(nil), // 53: api.proto.v1.ValidatorSet nil, // 54: api.proto.v1.GetLastAllCommittedResponse.EpochInfosEntry (*timestamppb.Timestamp)(nil), // 55: google.protobuf.Timestamp } ⋮---- (ValidatorSetStatus)(0), // 0: api.proto.v1.ValidatorSetStatus (SigningStatus)(0), // 1: api.proto.v1.SigningStatus (ErrorCode)(0), // 2: api.proto.v1.ErrorCode (*SignMessageRequest)(nil), // 3: api.proto.v1.SignMessageRequest (*SignMessageResponse)(nil), // 4: api.proto.v1.SignMessageResponse (*ListenSignaturesRequest)(nil), // 5: api.proto.v1.ListenSignaturesRequest (*ListenSignaturesResponse)(nil), // 6: api.proto.v1.ListenSignaturesResponse (*ListenProofsRequest)(nil), // 7: api.proto.v1.ListenProofsRequest (*ListenProofsResponse)(nil), // 8: api.proto.v1.ListenProofsResponse (*ListenValidatorSetRequest)(nil), // 9: api.proto.v1.ListenValidatorSetRequest (*ListenValidatorSetResponse)(nil), // 10: api.proto.v1.ListenValidatorSetResponse (*GetAggregationProofRequest)(nil), // 11: api.proto.v1.GetAggregationProofRequest (*GetAggregationProofsByEpochRequest)(nil), // 12: api.proto.v1.GetAggregationProofsByEpochRequest (*GetCurrentEpochRequest)(nil), // 13: api.proto.v1.GetCurrentEpochRequest (*GetSignaturesRequest)(nil), // 14: api.proto.v1.GetSignaturesRequest (*GetSignaturesByEpochRequest)(nil), // 15: api.proto.v1.GetSignaturesByEpochRequest (*GetSignaturesResponse)(nil), // 16: api.proto.v1.GetSignaturesResponse (*GetSignaturesByEpochResponse)(nil), // 17: api.proto.v1.GetSignaturesByEpochResponse (*GetSignatureRequestIDsByEpochRequest)(nil), // 18: api.proto.v1.GetSignatureRequestIDsByEpochRequest (*GetSignatureRequestIDsByEpochResponse)(nil), // 19: api.proto.v1.GetSignatureRequestIDsByEpochResponse (*GetSignatureRequestsByEpochRequest)(nil), // 20: api.proto.v1.GetSignatureRequestsByEpochRequest (*GetSignatureRequestsByEpochResponse)(nil), // 21: api.proto.v1.GetSignatureRequestsByEpochResponse (*GetSignatureRequestRequest)(nil), // 22: api.proto.v1.GetSignatureRequestRequest (*GetAggregationStatusRequest)(nil), // 23: api.proto.v1.GetAggregationStatusRequest (*GetValidatorSetRequest)(nil), // 24: api.proto.v1.GetValidatorSetRequest (*GetValidatorByAddressRequest)(nil), // 25: api.proto.v1.GetValidatorByAddressRequest (*GetValidatorByKeyRequest)(nil), // 26: api.proto.v1.GetValidatorByKeyRequest (*GetLocalValidatorRequest)(nil), // 27: api.proto.v1.GetLocalValidatorRequest (*GetValidatorSetHeaderRequest)(nil), // 28: api.proto.v1.GetValidatorSetHeaderRequest (*GetValidatorSetMetadataRequest)(nil), // 29: api.proto.v1.GetValidatorSetMetadataRequest (*GetCurrentEpochResponse)(nil), // 30: api.proto.v1.GetCurrentEpochResponse (*SignatureRequest)(nil), // 31: api.proto.v1.SignatureRequest (*GetSignatureRequestResponse)(nil), // 32: api.proto.v1.GetSignatureRequestResponse (*GetAggregationProofResponse)(nil), // 33: api.proto.v1.GetAggregationProofResponse (*GetAggregationProofsByEpochResponse)(nil), // 34: api.proto.v1.GetAggregationProofsByEpochResponse (*AggregationProof)(nil), // 35: api.proto.v1.AggregationProof (*GetAggregationStatusResponse)(nil), // 36: api.proto.v1.GetAggregationStatusResponse (*Signature)(nil), // 37: api.proto.v1.Signature (*GetValidatorSetResponse)(nil), // 38: api.proto.v1.GetValidatorSetResponse (*GetValidatorByAddressResponse)(nil), // 39: api.proto.v1.GetValidatorByAddressResponse (*GetValidatorByKeyResponse)(nil), // 40: api.proto.v1.GetValidatorByKeyResponse (*GetLocalValidatorResponse)(nil), // 41: api.proto.v1.GetLocalValidatorResponse (*ExtraData)(nil), // 42: api.proto.v1.ExtraData (*GetValidatorSetMetadataResponse)(nil), // 43: api.proto.v1.GetValidatorSetMetadataResponse (*GetValidatorSetHeaderResponse)(nil), // 44: api.proto.v1.GetValidatorSetHeaderResponse (*Validator)(nil), // 45: api.proto.v1.Validator (*Key)(nil), // 46: api.proto.v1.Key (*ValidatorVault)(nil), // 47: api.proto.v1.ValidatorVault (*GetLastCommittedRequest)(nil), // 48: api.proto.v1.GetLastCommittedRequest (*GetLastCommittedResponse)(nil), // 49: api.proto.v1.GetLastCommittedResponse (*GetLastAllCommittedRequest)(nil), // 50: api.proto.v1.GetLastAllCommittedRequest (*GetLastAllCommittedResponse)(nil), // 51: api.proto.v1.GetLastAllCommittedResponse (*ChainEpochInfo)(nil), // 52: api.proto.v1.ChainEpochInfo (*ValidatorSet)(nil), // 53: api.proto.v1.ValidatorSet nil, // 54: api.proto.v1.GetLastAllCommittedResponse.EpochInfosEntry (*timestamppb.Timestamp)(nil), // 55: google.protobuf.Timestamp ⋮---- var file_v1_api_proto_depIdxs = []int32{ 37, // 0: api.proto.v1.ListenSignaturesResponse.signature:type_name -> api.proto.v1.Signature 35, // 1: api.proto.v1.ListenProofsResponse.aggregation_proof:type_name -> api.proto.v1.AggregationProof 53, // 2: api.proto.v1.ListenValidatorSetResponse.validator_set:type_name -> api.proto.v1.ValidatorSet 37, // 3: api.proto.v1.GetSignaturesResponse.signatures:type_name -> api.proto.v1.Signature 37, // 4: api.proto.v1.GetSignaturesByEpochResponse.signatures:type_name -> api.proto.v1.Signature 31, // 5: api.proto.v1.GetSignatureRequestsByEpochResponse.signature_requests:type_name -> api.proto.v1.SignatureRequest 55, // 6: api.proto.v1.GetCurrentEpochResponse.start_time:type_name -> google.protobuf.Timestamp 31, // 7: api.proto.v1.GetSignatureRequestResponse.signature_request:type_name -> api.proto.v1.SignatureRequest 35, // 8: api.proto.v1.GetAggregationProofResponse.aggregation_proof:type_name -> api.proto.v1.AggregationProof 35, // 9: api.proto.v1.GetAggregationProofsByEpochResponse.aggregation_proofs:type_name -> api.proto.v1.AggregationProof 53, // 10: api.proto.v1.GetValidatorSetResponse.validator_set:type_name -> api.proto.v1.ValidatorSet 45, // 11: api.proto.v1.GetValidatorByAddressResponse.validator:type_name -> api.proto.v1.Validator 45, // 12: api.proto.v1.GetValidatorByKeyResponse.validator:type_name -> api.proto.v1.Validator 45, // 13: api.proto.v1.GetLocalValidatorResponse.validator:type_name -> api.proto.v1.Validator 42, // 14: api.proto.v1.GetValidatorSetMetadataResponse.extra_data:type_name -> api.proto.v1.ExtraData 55, // 15: api.proto.v1.GetValidatorSetHeaderResponse.capture_timestamp:type_name -> google.protobuf.Timestamp 46, // 16: api.proto.v1.Validator.keys:type_name -> api.proto.v1.Key 47, // 17: api.proto.v1.Validator.vaults:type_name -> api.proto.v1.ValidatorVault 52, // 18: api.proto.v1.GetLastCommittedResponse.epoch_info:type_name -> api.proto.v1.ChainEpochInfo 54, // 19: api.proto.v1.GetLastAllCommittedResponse.epoch_infos:type_name -> api.proto.v1.GetLastAllCommittedResponse.EpochInfosEntry 52, // 20: api.proto.v1.GetLastAllCommittedResponse.suggested_epoch_info:type_name -> api.proto.v1.ChainEpochInfo 55, // 21: api.proto.v1.ChainEpochInfo.start_time:type_name -> google.protobuf.Timestamp 55, // 22: api.proto.v1.ValidatorSet.capture_timestamp:type_name -> google.protobuf.Timestamp 0, // 23: api.proto.v1.ValidatorSet.status:type_name -> api.proto.v1.ValidatorSetStatus 45, // 24: api.proto.v1.ValidatorSet.validators:type_name -> api.proto.v1.Validator 52, // 25: api.proto.v1.GetLastAllCommittedResponse.EpochInfosEntry.value:type_name -> api.proto.v1.ChainEpochInfo 3, // 26: api.proto.v1.SymbioticAPIService.SignMessage:input_type -> api.proto.v1.SignMessageRequest 11, // 27: api.proto.v1.SymbioticAPIService.GetAggregationProof:input_type -> api.proto.v1.GetAggregationProofRequest 12, // 28: api.proto.v1.SymbioticAPIService.GetAggregationProofsByEpoch:input_type -> api.proto.v1.GetAggregationProofsByEpochRequest 13, // 29: api.proto.v1.SymbioticAPIService.GetCurrentEpoch:input_type -> api.proto.v1.GetCurrentEpochRequest 14, // 30: api.proto.v1.SymbioticAPIService.GetSignatures:input_type -> api.proto.v1.GetSignaturesRequest 15, // 31: api.proto.v1.SymbioticAPIService.GetSignaturesByEpoch:input_type -> api.proto.v1.GetSignaturesByEpochRequest 18, // 32: api.proto.v1.SymbioticAPIService.GetSignatureRequestIDsByEpoch:input_type -> api.proto.v1.GetSignatureRequestIDsByEpochRequest 20, // 33: api.proto.v1.SymbioticAPIService.GetSignatureRequestsByEpoch:input_type -> api.proto.v1.GetSignatureRequestsByEpochRequest 22, // 34: api.proto.v1.SymbioticAPIService.GetSignatureRequest:input_type -> api.proto.v1.GetSignatureRequestRequest 23, // 35: api.proto.v1.SymbioticAPIService.GetAggregationStatus:input_type -> api.proto.v1.GetAggregationStatusRequest 24, // 36: api.proto.v1.SymbioticAPIService.GetValidatorSet:input_type -> api.proto.v1.GetValidatorSetRequest 25, // 37: api.proto.v1.SymbioticAPIService.GetValidatorByAddress:input_type -> api.proto.v1.GetValidatorByAddressRequest 26, // 38: api.proto.v1.SymbioticAPIService.GetValidatorByKey:input_type -> api.proto.v1.GetValidatorByKeyRequest 27, // 39: api.proto.v1.SymbioticAPIService.GetLocalValidator:input_type -> api.proto.v1.GetLocalValidatorRequest 28, // 40: api.proto.v1.SymbioticAPIService.GetValidatorSetHeader:input_type -> api.proto.v1.GetValidatorSetHeaderRequest 48, // 41: api.proto.v1.SymbioticAPIService.GetLastCommitted:input_type -> api.proto.v1.GetLastCommittedRequest 50, // 42: api.proto.v1.SymbioticAPIService.GetLastAllCommitted:input_type -> api.proto.v1.GetLastAllCommittedRequest 29, // 43: api.proto.v1.SymbioticAPIService.GetValidatorSetMetadata:input_type -> api.proto.v1.GetValidatorSetMetadataRequest 5, // 44: api.proto.v1.SymbioticAPIService.ListenSignatures:input_type -> api.proto.v1.ListenSignaturesRequest 7, // 45: api.proto.v1.SymbioticAPIService.ListenProofs:input_type -> api.proto.v1.ListenProofsRequest 9, // 46: api.proto.v1.SymbioticAPIService.ListenValidatorSet:input_type -> api.proto.v1.ListenValidatorSetRequest 4, // 47: api.proto.v1.SymbioticAPIService.SignMessage:output_type -> api.proto.v1.SignMessageResponse 33, // 48: api.proto.v1.SymbioticAPIService.GetAggregationProof:output_type -> api.proto.v1.GetAggregationProofResponse 34, // 49: api.proto.v1.SymbioticAPIService.GetAggregationProofsByEpoch:output_type -> api.proto.v1.GetAggregationProofsByEpochResponse 30, // 50: api.proto.v1.SymbioticAPIService.GetCurrentEpoch:output_type -> api.proto.v1.GetCurrentEpochResponse 16, // 51: api.proto.v1.SymbioticAPIService.GetSignatures:output_type -> api.proto.v1.GetSignaturesResponse 17, // 52: api.proto.v1.SymbioticAPIService.GetSignaturesByEpoch:output_type -> api.proto.v1.GetSignaturesByEpochResponse 19, // 53: api.proto.v1.SymbioticAPIService.GetSignatureRequestIDsByEpoch:output_type -> api.proto.v1.GetSignatureRequestIDsByEpochResponse 21, // 54: api.proto.v1.SymbioticAPIService.GetSignatureRequestsByEpoch:output_type -> api.proto.v1.GetSignatureRequestsByEpochResponse 32, // 55: api.proto.v1.SymbioticAPIService.GetSignatureRequest:output_type -> api.proto.v1.GetSignatureRequestResponse 36, // 56: api.proto.v1.SymbioticAPIService.GetAggregationStatus:output_type -> api.proto.v1.GetAggregationStatusResponse 38, // 57: api.proto.v1.SymbioticAPIService.GetValidatorSet:output_type -> api.proto.v1.GetValidatorSetResponse 39, // 58: api.proto.v1.SymbioticAPIService.GetValidatorByAddress:output_type -> api.proto.v1.GetValidatorByAddressResponse 40, // 59: api.proto.v1.SymbioticAPIService.GetValidatorByKey:output_type -> api.proto.v1.GetValidatorByKeyResponse 41, // 60: api.proto.v1.SymbioticAPIService.GetLocalValidator:output_type -> api.proto.v1.GetLocalValidatorResponse 44, // 61: api.proto.v1.SymbioticAPIService.GetValidatorSetHeader:output_type -> api.proto.v1.GetValidatorSetHeaderResponse 49, // 62: api.proto.v1.SymbioticAPIService.GetLastCommitted:output_type -> api.proto.v1.GetLastCommittedResponse 51, // 63: api.proto.v1.SymbioticAPIService.GetLastAllCommitted:output_type -> api.proto.v1.GetLastAllCommittedResponse 43, // 64: api.proto.v1.SymbioticAPIService.GetValidatorSetMetadata:output_type -> api.proto.v1.GetValidatorSetMetadataResponse 6, // 65: api.proto.v1.SymbioticAPIService.ListenSignatures:output_type -> api.proto.v1.ListenSignaturesResponse 8, // 66: api.proto.v1.SymbioticAPIService.ListenProofs:output_type -> api.proto.v1.ListenProofsResponse 10, // 67: api.proto.v1.SymbioticAPIService.ListenValidatorSet:output_type -> api.proto.v1.ListenValidatorSetResponse 47, // [47:68] is the sub-list for method output_type 26, // [26:47] is the sub-list for method input_type 26, // [26:26] is the sub-list for extension type_name 26, // [26:26] is the sub-list for extension extendee 0, // [0:26] is the sub-list for field type_name } ⋮---- 37, // 0: api.proto.v1.ListenSignaturesResponse.signature:type_name -> api.proto.v1.Signature 35, // 1: api.proto.v1.ListenProofsResponse.aggregation_proof:type_name -> api.proto.v1.AggregationProof 53, // 2: api.proto.v1.ListenValidatorSetResponse.validator_set:type_name -> api.proto.v1.ValidatorSet 37, // 3: api.proto.v1.GetSignaturesResponse.signatures:type_name -> api.proto.v1.Signature 37, // 4: api.proto.v1.GetSignaturesByEpochResponse.signatures:type_name -> api.proto.v1.Signature 31, // 5: api.proto.v1.GetSignatureRequestsByEpochResponse.signature_requests:type_name -> api.proto.v1.SignatureRequest 55, // 6: api.proto.v1.GetCurrentEpochResponse.start_time:type_name -> google.protobuf.Timestamp 31, // 7: api.proto.v1.GetSignatureRequestResponse.signature_request:type_name -> api.proto.v1.SignatureRequest 35, // 8: api.proto.v1.GetAggregationProofResponse.aggregation_proof:type_name -> api.proto.v1.AggregationProof 35, // 9: api.proto.v1.GetAggregationProofsByEpochResponse.aggregation_proofs:type_name -> api.proto.v1.AggregationProof 53, // 10: api.proto.v1.GetValidatorSetResponse.validator_set:type_name -> api.proto.v1.ValidatorSet 45, // 11: api.proto.v1.GetValidatorByAddressResponse.validator:type_name -> api.proto.v1.Validator 45, // 12: api.proto.v1.GetValidatorByKeyResponse.validator:type_name -> api.proto.v1.Validator 45, // 13: api.proto.v1.GetLocalValidatorResponse.validator:type_name -> api.proto.v1.Validator 42, // 14: api.proto.v1.GetValidatorSetMetadataResponse.extra_data:type_name -> api.proto.v1.ExtraData 55, // 15: api.proto.v1.GetValidatorSetHeaderResponse.capture_timestamp:type_name -> google.protobuf.Timestamp 46, // 16: api.proto.v1.Validator.keys:type_name -> api.proto.v1.Key 47, // 17: api.proto.v1.Validator.vaults:type_name -> api.proto.v1.ValidatorVault 52, // 18: api.proto.v1.GetLastCommittedResponse.epoch_info:type_name -> api.proto.v1.ChainEpochInfo 54, // 19: api.proto.v1.GetLastAllCommittedResponse.epoch_infos:type_name -> api.proto.v1.GetLastAllCommittedResponse.EpochInfosEntry 52, // 20: api.proto.v1.GetLastAllCommittedResponse.suggested_epoch_info:type_name -> api.proto.v1.ChainEpochInfo 55, // 21: api.proto.v1.ChainEpochInfo.start_time:type_name -> google.protobuf.Timestamp 55, // 22: api.proto.v1.ValidatorSet.capture_timestamp:type_name -> google.protobuf.Timestamp 0, // 23: api.proto.v1.ValidatorSet.status:type_name -> api.proto.v1.ValidatorSetStatus 45, // 24: api.proto.v1.ValidatorSet.validators:type_name -> api.proto.v1.Validator 52, // 25: api.proto.v1.GetLastAllCommittedResponse.EpochInfosEntry.value:type_name -> api.proto.v1.ChainEpochInfo 3, // 26: api.proto.v1.SymbioticAPIService.SignMessage:input_type -> api.proto.v1.SignMessageRequest 11, // 27: api.proto.v1.SymbioticAPIService.GetAggregationProof:input_type -> api.proto.v1.GetAggregationProofRequest 12, // 28: api.proto.v1.SymbioticAPIService.GetAggregationProofsByEpoch:input_type -> api.proto.v1.GetAggregationProofsByEpochRequest 13, // 29: api.proto.v1.SymbioticAPIService.GetCurrentEpoch:input_type -> api.proto.v1.GetCurrentEpochRequest 14, // 30: api.proto.v1.SymbioticAPIService.GetSignatures:input_type -> api.proto.v1.GetSignaturesRequest 15, // 31: api.proto.v1.SymbioticAPIService.GetSignaturesByEpoch:input_type -> api.proto.v1.GetSignaturesByEpochRequest 18, // 32: api.proto.v1.SymbioticAPIService.GetSignatureRequestIDsByEpoch:input_type -> api.proto.v1.GetSignatureRequestIDsByEpochRequest 20, // 33: api.proto.v1.SymbioticAPIService.GetSignatureRequestsByEpoch:input_type -> api.proto.v1.GetSignatureRequestsByEpochRequest 22, // 34: api.proto.v1.SymbioticAPIService.GetSignatureRequest:input_type -> api.proto.v1.GetSignatureRequestRequest 23, // 35: api.proto.v1.SymbioticAPIService.GetAggregationStatus:input_type -> api.proto.v1.GetAggregationStatusRequest 24, // 36: api.proto.v1.SymbioticAPIService.GetValidatorSet:input_type -> api.proto.v1.GetValidatorSetRequest 25, // 37: api.proto.v1.SymbioticAPIService.GetValidatorByAddress:input_type -> api.proto.v1.GetValidatorByAddressRequest 26, // 38: api.proto.v1.SymbioticAPIService.GetValidatorByKey:input_type -> api.proto.v1.GetValidatorByKeyRequest 27, // 39: api.proto.v1.SymbioticAPIService.GetLocalValidator:input_type -> api.proto.v1.GetLocalValidatorRequest 28, // 40: api.proto.v1.SymbioticAPIService.GetValidatorSetHeader:input_type -> api.proto.v1.GetValidatorSetHeaderRequest 48, // 41: api.proto.v1.SymbioticAPIService.GetLastCommitted:input_type -> api.proto.v1.GetLastCommittedRequest 50, // 42: api.proto.v1.SymbioticAPIService.GetLastAllCommitted:input_type -> api.proto.v1.GetLastAllCommittedRequest 29, // 43: api.proto.v1.SymbioticAPIService.GetValidatorSetMetadata:input_type -> api.proto.v1.GetValidatorSetMetadataRequest 5, // 44: api.proto.v1.SymbioticAPIService.ListenSignatures:input_type -> api.proto.v1.ListenSignaturesRequest 7, // 45: api.proto.v1.SymbioticAPIService.ListenProofs:input_type -> api.proto.v1.ListenProofsRequest 9, // 46: api.proto.v1.SymbioticAPIService.ListenValidatorSet:input_type -> api.proto.v1.ListenValidatorSetRequest 4, // 47: api.proto.v1.SymbioticAPIService.SignMessage:output_type -> api.proto.v1.SignMessageResponse 33, // 48: api.proto.v1.SymbioticAPIService.GetAggregationProof:output_type -> api.proto.v1.GetAggregationProofResponse 34, // 49: api.proto.v1.SymbioticAPIService.GetAggregationProofsByEpoch:output_type -> api.proto.v1.GetAggregationProofsByEpochResponse 30, // 50: api.proto.v1.SymbioticAPIService.GetCurrentEpoch:output_type -> api.proto.v1.GetCurrentEpochResponse 16, // 51: api.proto.v1.SymbioticAPIService.GetSignatures:output_type -> api.proto.v1.GetSignaturesResponse 17, // 52: api.proto.v1.SymbioticAPIService.GetSignaturesByEpoch:output_type -> api.proto.v1.GetSignaturesByEpochResponse 19, // 53: api.proto.v1.SymbioticAPIService.GetSignatureRequestIDsByEpoch:output_type -> api.proto.v1.GetSignatureRequestIDsByEpochResponse 21, // 54: api.proto.v1.SymbioticAPIService.GetSignatureRequestsByEpoch:output_type -> api.proto.v1.GetSignatureRequestsByEpochResponse 32, // 55: api.proto.v1.SymbioticAPIService.GetSignatureRequest:output_type -> api.proto.v1.GetSignatureRequestResponse 36, // 56: api.proto.v1.SymbioticAPIService.GetAggregationStatus:output_type -> api.proto.v1.GetAggregationStatusResponse 38, // 57: api.proto.v1.SymbioticAPIService.GetValidatorSet:output_type -> api.proto.v1.GetValidatorSetResponse 39, // 58: api.proto.v1.SymbioticAPIService.GetValidatorByAddress:output_type -> api.proto.v1.GetValidatorByAddressResponse 40, // 59: api.proto.v1.SymbioticAPIService.GetValidatorByKey:output_type -> api.proto.v1.GetValidatorByKeyResponse 41, // 60: api.proto.v1.SymbioticAPIService.GetLocalValidator:output_type -> api.proto.v1.GetLocalValidatorResponse 44, // 61: api.proto.v1.SymbioticAPIService.GetValidatorSetHeader:output_type -> api.proto.v1.GetValidatorSetHeaderResponse 49, // 62: api.proto.v1.SymbioticAPIService.GetLastCommitted:output_type -> api.proto.v1.GetLastCommittedResponse 51, // 63: api.proto.v1.SymbioticAPIService.GetLastAllCommitted:output_type -> api.proto.v1.GetLastAllCommittedResponse 43, // 64: api.proto.v1.SymbioticAPIService.GetValidatorSetMetadata:output_type -> api.proto.v1.GetValidatorSetMetadataResponse 6, // 65: api.proto.v1.SymbioticAPIService.ListenSignatures:output_type -> api.proto.v1.ListenSignaturesResponse 8, // 66: api.proto.v1.SymbioticAPIService.ListenProofs:output_type -> api.proto.v1.ListenProofsResponse 10, // 67: api.proto.v1.SymbioticAPIService.ListenValidatorSet:output_type -> api.proto.v1.ListenValidatorSetResponse 47, // [47:68] is the sub-list for method output_type 26, // [26:47] is the sub-list for method input_type 26, // [26:26] is the sub-list for extension type_name 26, // [26:26] is the sub-list for extension extendee 0, // [0:26] is the sub-list for field type_name ⋮---- func init() func file_v1_api_proto_init() ⋮---- type x struct{} ```` ## File: internal/gen/api/v1/api.pb.gw.go ````go // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. // source: v1/api.proto ⋮---- /* Package v1 is a reverse proxy. It translates gRPC into RESTful JSON APIs. */ package v1 ⋮---- import ( "context" "errors" "io" "net/http" "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" "google.golang.org/protobuf/proto" ) ⋮---- "context" "errors" "io" "net/http" ⋮---- "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" "google.golang.org/protobuf/proto" ⋮---- // Suppress "imported and not used" errors var ( _ codes.Code _ io.Reader _ status.Status _ = errors.New _ = runtime.String _ = utilities.NewDoubleArray _ = metadata.Join ) ⋮---- func request_SymbioticAPIService_SignMessage_0(ctx context.Context, marshaler runtime.Marshaler, client SymbioticAPIServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) ⋮---- var ( protoReq SignMessageRequest metadata runtime.ServerMetadata ) ⋮---- func local_request_SymbioticAPIService_SignMessage_0(ctx context.Context, marshaler runtime.Marshaler, server SymbioticAPIServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) ⋮---- func request_SymbioticAPIService_GetAggregationProof_0(ctx context.Context, marshaler runtime.Marshaler, client SymbioticAPIServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) ⋮---- var ( protoReq GetAggregationProofRequest metadata runtime.ServerMetadata err error ) ⋮---- func local_request_SymbioticAPIService_GetAggregationProof_0(ctx context.Context, marshaler runtime.Marshaler, server SymbioticAPIServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) ⋮---- func request_SymbioticAPIService_GetAggregationProofsByEpoch_0(ctx context.Context, marshaler runtime.Marshaler, client SymbioticAPIServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) ⋮---- var ( protoReq GetAggregationProofsByEpochRequest metadata runtime.ServerMetadata err error ) ⋮---- func local_request_SymbioticAPIService_GetAggregationProofsByEpoch_0(ctx context.Context, marshaler runtime.Marshaler, server SymbioticAPIServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) ⋮---- func request_SymbioticAPIService_GetCurrentEpoch_0(ctx context.Context, marshaler runtime.Marshaler, client SymbioticAPIServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) ⋮---- var ( protoReq GetCurrentEpochRequest metadata runtime.ServerMetadata ) ⋮---- func local_request_SymbioticAPIService_GetCurrentEpoch_0(ctx context.Context, marshaler runtime.Marshaler, server SymbioticAPIServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) ⋮---- func request_SymbioticAPIService_GetSignatures_0(ctx context.Context, marshaler runtime.Marshaler, client SymbioticAPIServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) ⋮---- var ( protoReq GetSignaturesRequest metadata runtime.ServerMetadata err error ) ⋮---- func local_request_SymbioticAPIService_GetSignatures_0(ctx context.Context, marshaler runtime.Marshaler, server SymbioticAPIServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) ⋮---- func request_SymbioticAPIService_GetSignaturesByEpoch_0(ctx context.Context, marshaler runtime.Marshaler, client SymbioticAPIServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) ⋮---- var ( protoReq GetSignaturesByEpochRequest metadata runtime.ServerMetadata err error ) ⋮---- func local_request_SymbioticAPIService_GetSignaturesByEpoch_0(ctx context.Context, marshaler runtime.Marshaler, server SymbioticAPIServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) ⋮---- func request_SymbioticAPIService_GetSignatureRequestIDsByEpoch_0(ctx context.Context, marshaler runtime.Marshaler, client SymbioticAPIServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) ⋮---- var ( protoReq GetSignatureRequestIDsByEpochRequest metadata runtime.ServerMetadata err error ) ⋮---- func local_request_SymbioticAPIService_GetSignatureRequestIDsByEpoch_0(ctx context.Context, marshaler runtime.Marshaler, server SymbioticAPIServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) ⋮---- func request_SymbioticAPIService_GetSignatureRequestsByEpoch_0(ctx context.Context, marshaler runtime.Marshaler, client SymbioticAPIServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) ⋮---- var ( protoReq GetSignatureRequestsByEpochRequest metadata runtime.ServerMetadata err error ) ⋮---- func local_request_SymbioticAPIService_GetSignatureRequestsByEpoch_0(ctx context.Context, marshaler runtime.Marshaler, server SymbioticAPIServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) ⋮---- func request_SymbioticAPIService_GetSignatureRequest_0(ctx context.Context, marshaler runtime.Marshaler, client SymbioticAPIServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) ⋮---- var ( protoReq GetSignatureRequestRequest metadata runtime.ServerMetadata err error ) ⋮---- func local_request_SymbioticAPIService_GetSignatureRequest_0(ctx context.Context, marshaler runtime.Marshaler, server SymbioticAPIServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) ⋮---- func request_SymbioticAPIService_GetAggregationStatus_0(ctx context.Context, marshaler runtime.Marshaler, client SymbioticAPIServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) ⋮---- var ( protoReq GetAggregationStatusRequest metadata runtime.ServerMetadata err error ) ⋮---- func local_request_SymbioticAPIService_GetAggregationStatus_0(ctx context.Context, marshaler runtime.Marshaler, server SymbioticAPIServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) ⋮---- var filter_SymbioticAPIService_GetValidatorSet_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ⋮---- func request_SymbioticAPIService_GetValidatorSet_0(ctx context.Context, marshaler runtime.Marshaler, client SymbioticAPIServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) ⋮---- var ( protoReq GetValidatorSetRequest metadata runtime.ServerMetadata ) ⋮---- func local_request_SymbioticAPIService_GetValidatorSet_0(ctx context.Context, marshaler runtime.Marshaler, server SymbioticAPIServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) ⋮---- var filter_SymbioticAPIService_GetValidatorByAddress_0 = &utilities.DoubleArray{Encoding: map[string]int{"address": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} ⋮---- func request_SymbioticAPIService_GetValidatorByAddress_0(ctx context.Context, marshaler runtime.Marshaler, client SymbioticAPIServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) ⋮---- var ( protoReq GetValidatorByAddressRequest metadata runtime.ServerMetadata err error ) ⋮---- func local_request_SymbioticAPIService_GetValidatorByAddress_0(ctx context.Context, marshaler runtime.Marshaler, server SymbioticAPIServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) ⋮---- var filter_SymbioticAPIService_GetValidatorByKey_0 = &utilities.DoubleArray{Encoding: map[string]int{"key_tag": 0, "on_chain_key": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} ⋮---- func request_SymbioticAPIService_GetValidatorByKey_0(ctx context.Context, marshaler runtime.Marshaler, client SymbioticAPIServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) ⋮---- var ( protoReq GetValidatorByKeyRequest metadata runtime.ServerMetadata err error ) ⋮---- func local_request_SymbioticAPIService_GetValidatorByKey_0(ctx context.Context, marshaler runtime.Marshaler, server SymbioticAPIServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) ⋮---- var filter_SymbioticAPIService_GetLocalValidator_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ⋮---- func request_SymbioticAPIService_GetLocalValidator_0(ctx context.Context, marshaler runtime.Marshaler, client SymbioticAPIServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) ⋮---- var ( protoReq GetLocalValidatorRequest metadata runtime.ServerMetadata ) ⋮---- func local_request_SymbioticAPIService_GetLocalValidator_0(ctx context.Context, marshaler runtime.Marshaler, server SymbioticAPIServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) ⋮---- var filter_SymbioticAPIService_GetValidatorSetHeader_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ⋮---- func request_SymbioticAPIService_GetValidatorSetHeader_0(ctx context.Context, marshaler runtime.Marshaler, client SymbioticAPIServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) ⋮---- var ( protoReq GetValidatorSetHeaderRequest metadata runtime.ServerMetadata ) ⋮---- func local_request_SymbioticAPIService_GetValidatorSetHeader_0(ctx context.Context, marshaler runtime.Marshaler, server SymbioticAPIServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) ⋮---- func request_SymbioticAPIService_GetLastCommitted_0(ctx context.Context, marshaler runtime.Marshaler, client SymbioticAPIServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) ⋮---- var ( protoReq GetLastCommittedRequest metadata runtime.ServerMetadata err error ) ⋮---- func local_request_SymbioticAPIService_GetLastCommitted_0(ctx context.Context, marshaler runtime.Marshaler, server SymbioticAPIServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) ⋮---- func request_SymbioticAPIService_GetLastAllCommitted_0(ctx context.Context, marshaler runtime.Marshaler, client SymbioticAPIServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) ⋮---- var ( protoReq GetLastAllCommittedRequest metadata runtime.ServerMetadata ) ⋮---- func local_request_SymbioticAPIService_GetLastAllCommitted_0(ctx context.Context, marshaler runtime.Marshaler, server SymbioticAPIServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) ⋮---- var filter_SymbioticAPIService_GetValidatorSetMetadata_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ⋮---- func request_SymbioticAPIService_GetValidatorSetMetadata_0(ctx context.Context, marshaler runtime.Marshaler, client SymbioticAPIServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) ⋮---- var ( protoReq GetValidatorSetMetadataRequest metadata runtime.ServerMetadata ) ⋮---- func local_request_SymbioticAPIService_GetValidatorSetMetadata_0(ctx context.Context, marshaler runtime.Marshaler, server SymbioticAPIServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) ⋮---- var filter_SymbioticAPIService_ListenSignatures_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ⋮---- func request_SymbioticAPIService_ListenSignatures_0(ctx context.Context, marshaler runtime.Marshaler, client SymbioticAPIServiceClient, req *http.Request, pathParams map[string]string) (SymbioticAPIService_ListenSignaturesClient, runtime.ServerMetadata, error) ⋮---- var ( protoReq ListenSignaturesRequest metadata runtime.ServerMetadata ) ⋮---- var filter_SymbioticAPIService_ListenProofs_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ⋮---- func request_SymbioticAPIService_ListenProofs_0(ctx context.Context, marshaler runtime.Marshaler, client SymbioticAPIServiceClient, req *http.Request, pathParams map[string]string) (SymbioticAPIService_ListenProofsClient, runtime.ServerMetadata, error) ⋮---- var ( protoReq ListenProofsRequest metadata runtime.ServerMetadata ) ⋮---- var filter_SymbioticAPIService_ListenValidatorSet_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ⋮---- func request_SymbioticAPIService_ListenValidatorSet_0(ctx context.Context, marshaler runtime.Marshaler, client SymbioticAPIServiceClient, req *http.Request, pathParams map[string]string) (SymbioticAPIService_ListenValidatorSetClient, runtime.ServerMetadata, error) ⋮---- var ( protoReq ListenValidatorSetRequest metadata runtime.ServerMetadata ) ⋮---- // RegisterSymbioticAPIServiceHandlerServer registers the http handlers for service SymbioticAPIService to "mux". // UnaryRPC :call SymbioticAPIServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterSymbioticAPIServiceHandlerFromEndpoint instead. // GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call. func RegisterSymbioticAPIServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SymbioticAPIServiceServer) error ⋮---- var stream runtime.ServerTransportStream ⋮---- // RegisterSymbioticAPIServiceHandlerFromEndpoint is same as RegisterSymbioticAPIServiceHandler but // automatically dials to "endpoint" and closes the connection when "ctx" gets done. func RegisterSymbioticAPIServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) ⋮---- // RegisterSymbioticAPIServiceHandler registers the http handlers for service SymbioticAPIService to "mux". // The handlers forward requests to the grpc endpoint over "conn". func RegisterSymbioticAPIServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error ⋮---- // RegisterSymbioticAPIServiceHandlerClient registers the http handlers for service SymbioticAPIService // to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "SymbioticAPIServiceClient". // Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "SymbioticAPIServiceClient" // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in // "SymbioticAPIServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. func RegisterSymbioticAPIServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SymbioticAPIServiceClient) error ⋮---- var ( pattern_SymbioticAPIService_SignMessage_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "sign"}, "")) ⋮---- var ( forward_SymbioticAPIService_SignMessage_0 = runtime.ForwardResponseMessage forward_SymbioticAPIService_GetAggregationProof_0 = runtime.ForwardResponseMessage forward_SymbioticAPIService_GetAggregationProofsByEpoch_0 = runtime.ForwardResponseMessage forward_SymbioticAPIService_GetCurrentEpoch_0 = runtime.ForwardResponseMessage forward_SymbioticAPIService_GetSignatures_0 = runtime.ForwardResponseMessage forward_SymbioticAPIService_GetSignaturesByEpoch_0 = runtime.ForwardResponseMessage forward_SymbioticAPIService_GetSignatureRequestIDsByEpoch_0 = runtime.ForwardResponseMessage forward_SymbioticAPIService_GetSignatureRequestsByEpoch_0 = runtime.ForwardResponseMessage forward_SymbioticAPIService_GetSignatureRequest_0 = runtime.ForwardResponseMessage forward_SymbioticAPIService_GetAggregationStatus_0 = runtime.ForwardResponseMessage forward_SymbioticAPIService_GetValidatorSet_0 = runtime.ForwardResponseMessage forward_SymbioticAPIService_GetValidatorByAddress_0 = runtime.ForwardResponseMessage forward_SymbioticAPIService_GetValidatorByKey_0 = runtime.ForwardResponseMessage forward_SymbioticAPIService_GetLocalValidator_0 = runtime.ForwardResponseMessage forward_SymbioticAPIService_GetValidatorSetHeader_0 = runtime.ForwardResponseMessage forward_SymbioticAPIService_GetLastCommitted_0 = runtime.ForwardResponseMessage forward_SymbioticAPIService_GetLastAllCommitted_0 = runtime.ForwardResponseMessage forward_SymbioticAPIService_GetValidatorSetMetadata_0 = runtime.ForwardResponseMessage forward_SymbioticAPIService_ListenSignatures_0 = runtime.ForwardResponseStream forward_SymbioticAPIService_ListenProofs_0 = runtime.ForwardResponseStream forward_SymbioticAPIService_ListenValidatorSet_0 = runtime.ForwardResponseStream ) ```` ## File: internal/usecase/aggregation-policy/low-cost/low_cost_policy.go ````go package lowCostPolicy ⋮---- import ( symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/internal/entity" ) ⋮---- symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- "github.com/symbioticfi/relay/internal/entity" ⋮---- type LowCostPolicy struct { maxUnsigners uint64 } ⋮---- func NewLowCostPolicy(maxUnsigners uint64) *LowCostPolicy ⋮---- func (lcp *LowCostPolicy) ShouldAggregate(signatureMap entity.SignatureMap, validatorSet symbiotic.ValidatorSet) bool ```` ## File: internal/usecase/aggregation-policy/low-latency/low_latency_policy.go ````go package lowLatencyPolicy ⋮---- import ( "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- type LowLatencyPolicy struct { } ⋮---- func NewLowLatencyPolicy() *LowLatencyPolicy ⋮---- func (llp *LowLatencyPolicy) ShouldAggregate(signatureMap entity.SignatureMap, validatorSet symbiotic.ValidatorSet) bool ```` ## File: internal/usecase/aggregation-policy/types/types.go ````go package aggregationPolicyTypes ⋮---- import ( "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- type AggregationPolicy interface { ShouldAggregate(signatureMap entity.SignatureMap, validatorSet symbiotic.ValidatorSet) bool } ```` ## File: internal/usecase/aggregation-policy/aggregation_policies.go ````go package aggregationPolicy ⋮---- import ( "errors" lowCostPolicy "github.com/symbioticfi/relay/internal/usecase/aggregation-policy/low-cost" lowLatencyPolicy "github.com/symbioticfi/relay/internal/usecase/aggregation-policy/low-latency" aggregationPolicyTypes "github.com/symbioticfi/relay/internal/usecase/aggregation-policy/types" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "errors" ⋮---- lowCostPolicy "github.com/symbioticfi/relay/internal/usecase/aggregation-policy/low-cost" lowLatencyPolicy "github.com/symbioticfi/relay/internal/usecase/aggregation-policy/low-latency" aggregationPolicyTypes "github.com/symbioticfi/relay/internal/usecase/aggregation-policy/types" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- func NewAggregationPolicy(aggregationPolicyType symbiotic.AggregationPolicyType, maxUnsigners uint64) (aggregationPolicyTypes.AggregationPolicy, error) ```` ## File: internal/usecase/aggregator-app/mocks/aggregator_app.go ````go // Code generated by MockGen. DO NOT EDIT. // Source: aggregator_app.go // // Generated by this command: ⋮---- // mockgen -source=aggregator_app.go -destination=mocks/aggregator_app.go -package=mocks ⋮---- // Package mocks is a generated GoMock package. package mocks ⋮---- import ( context "context" reflect "reflect" time "time" common "github.com/ethereum/go-ethereum/common" entity "github.com/symbioticfi/relay/internal/entity" entity0 "github.com/symbioticfi/relay/symbiotic/entity" crypto "github.com/symbioticfi/relay/symbiotic/usecase/crypto" gomock "go.uber.org/mock/gomock" ) ⋮---- context "context" reflect "reflect" time "time" ⋮---- common "github.com/ethereum/go-ethereum/common" entity "github.com/symbioticfi/relay/internal/entity" entity0 "github.com/symbioticfi/relay/symbiotic/entity" crypto "github.com/symbioticfi/relay/symbiotic/usecase/crypto" gomock "go.uber.org/mock/gomock" ⋮---- // Mockrepository is a mock of repository interface. type Mockrepository struct { ctrl *gomock.Controller recorder *MockrepositoryMockRecorder isgomock struct{} ⋮---- // MockrepositoryMockRecorder is the mock recorder for Mockrepository. type MockrepositoryMockRecorder struct { mock *Mockrepository } ⋮---- // NewMockrepository creates a new mock instance. func NewMockrepository(ctrl *gomock.Controller) *Mockrepository ⋮---- // EXPECT returns an object that allows the caller to indicate expected use. func (m *Mockrepository) EXPECT() *MockrepositoryMockRecorder ⋮---- // GetAggregationProof mocks base method. func (m *Mockrepository) GetAggregationProof(ctx context.Context, requestID common.Hash) (entity0.AggregationProof, error) ⋮---- // GetAggregationProof indicates an expected call of GetAggregationProof. ⋮---- // GetAllSignatures mocks base method. func (m *Mockrepository) GetAllSignatures(ctx context.Context, requestID common.Hash) ([]entity0.Signature, error) ⋮---- // GetAllSignatures indicates an expected call of GetAllSignatures. ⋮---- // GetConfigByEpoch mocks base method. func (m *Mockrepository) GetConfigByEpoch(ctx context.Context, epoch entity0.Epoch) (entity0.NetworkConfig, error) ⋮---- // GetConfigByEpoch indicates an expected call of GetConfigByEpoch. ⋮---- // GetSignatureMap mocks base method. func (m *Mockrepository) GetSignatureMap(ctx context.Context, requestID common.Hash) (entity.SignatureMap, error) ⋮---- // GetSignatureMap indicates an expected call of GetSignatureMap. ⋮---- // GetSignatureRequest mocks base method. func (m *Mockrepository) GetSignatureRequest(arg0 context.Context, requestID common.Hash) (entity0.SignatureRequest, error) ⋮---- // GetSignatureRequest indicates an expected call of GetSignatureRequest. ⋮---- // GetValidatorSetByEpoch mocks base method. func (m *Mockrepository) GetValidatorSetByEpoch(ctx context.Context, epoch entity0.Epoch) (entity0.ValidatorSet, error) ⋮---- // GetValidatorSetByEpoch indicates an expected call of GetValidatorSetByEpoch. ⋮---- // Mockp2pClient is a mock of p2pClient interface. type Mockp2pClient struct { ctrl *gomock.Controller recorder *Mockp2pClientMockRecorder isgomock struct{} ⋮---- // Mockp2pClientMockRecorder is the mock recorder for Mockp2pClient. type Mockp2pClientMockRecorder struct { mock *Mockp2pClient } ⋮---- // NewMockp2pClient creates a new mock instance. func NewMockp2pClient(ctrl *gomock.Controller) *Mockp2pClient ⋮---- // BroadcastSignatureAggregatedMessage mocks base method. func (m *Mockp2pClient) BroadcastSignatureAggregatedMessage(ctx context.Context, proof entity0.AggregationProof) error ⋮---- // BroadcastSignatureAggregatedMessage indicates an expected call of BroadcastSignatureAggregatedMessage. ⋮---- // Mockmetrics is a mock of metrics interface. type Mockmetrics struct { ctrl *gomock.Controller recorder *MockmetricsMockRecorder isgomock struct{} ⋮---- // MockmetricsMockRecorder is the mock recorder for Mockmetrics. type MockmetricsMockRecorder struct { mock *Mockmetrics } ⋮---- // NewMockmetrics creates a new mock instance. func NewMockmetrics(ctrl *gomock.Controller) *Mockmetrics ⋮---- // ObserveAppAggregateDuration mocks base method. func (m *Mockmetrics) ObserveAppAggregateDuration(d time.Duration) ⋮---- // ObserveAppAggregateDuration indicates an expected call of ObserveAppAggregateDuration. ⋮---- // ObserveOnlyAggregateDuration mocks base method. func (m *Mockmetrics) ObserveOnlyAggregateDuration(d time.Duration) ⋮---- // ObserveOnlyAggregateDuration indicates an expected call of ObserveOnlyAggregateDuration. ⋮---- // Mockaggregator is a mock of aggregator interface. type Mockaggregator struct { ctrl *gomock.Controller recorder *MockaggregatorMockRecorder isgomock struct{} ⋮---- // MockaggregatorMockRecorder is the mock recorder for Mockaggregator. type MockaggregatorMockRecorder struct { mock *Mockaggregator } ⋮---- // NewMockaggregator creates a new mock instance. func NewMockaggregator(ctrl *gomock.Controller) *Mockaggregator ⋮---- // Aggregate mocks base method. func (m *Mockaggregator) Aggregate(valset entity0.ValidatorSet, keyTag entity0.KeyTag, messageHash []byte, signatures []entity0.Signature) (entity0.AggregationProof, error) ⋮---- // Aggregate indicates an expected call of Aggregate. ⋮---- // MockkeyProvider is a mock of keyProvider interface. type MockkeyProvider struct { ctrl *gomock.Controller recorder *MockkeyProviderMockRecorder isgomock struct{} ⋮---- // MockkeyProviderMockRecorder is the mock recorder for MockkeyProvider. type MockkeyProviderMockRecorder struct { mock *MockkeyProvider } ⋮---- // NewMockkeyProvider creates a new mock instance. func NewMockkeyProvider(ctrl *gomock.Controller) *MockkeyProvider ⋮---- // GetOnchainKeyFromCache mocks base method. func (m *MockkeyProvider) GetOnchainKeyFromCache(keyTag entity0.KeyTag) (entity0.CompactPublicKey, error) ⋮---- // GetOnchainKeyFromCache indicates an expected call of GetOnchainKeyFromCache. ⋮---- // GetPrivateKey mocks base method. func (m *MockkeyProvider) GetPrivateKey(keyTag entity0.KeyTag) (crypto.PrivateKey, error) ⋮---- // GetPrivateKey indicates an expected call of GetPrivateKey. ```` ## File: internal/usecase/aggregator-app/aggregator_app_test.go ````go package aggregator_app ⋮---- import ( "context" "fmt" "math/big" "testing" "github.com/ethereum/go-ethereum/common" "github.com/samber/lo" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" "github.com/symbioticfi/relay/internal/entity" aggregationPolicy "github.com/symbioticfi/relay/internal/usecase/aggregation-policy" "github.com/symbioticfi/relay/internal/usecase/aggregator-app/mocks" keyprovider "github.com/symbioticfi/relay/internal/usecase/key-provider" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" ) ⋮---- "context" "fmt" "math/big" "testing" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/samber/lo" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" ⋮---- "github.com/symbioticfi/relay/internal/entity" aggregationPolicy "github.com/symbioticfi/relay/internal/usecase/aggregation-policy" "github.com/symbioticfi/relay/internal/usecase/aggregator-app/mocks" keyprovider "github.com/symbioticfi/relay/internal/usecase/key-provider" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" ⋮---- type testSetup struct { ctrl *gomock.Controller mockRepo *mocks.Mockrepository mockP2PClient *mocks.Mockp2pClient mockAggregator *mocks.Mockaggregator mockMetrics *mocks.Mockmetrics app *AggregatorApp privateKey crypto.PrivateKey } ⋮---- func newTestSetup(t *testing.T, policyType symbiotic.AggregationPolicyType, maxUnsigners uint64) *testSetup ⋮---- func createTestSignatureExtended(t *testing.T, pk crypto.PrivateKey) symbiotic.Signature ⋮---- // Unified test data structure that keeps ValidatorSet and SignatureMap in sync type testData struct { ValidatorSet symbiotic.ValidatorSet SignatureMap entity.SignatureMap } ⋮---- // Create unified test data with a single ValidatorSet used consistently func createTestData(requestID common.Hash, epoch symbiotic.Epoch, totalValidators, signers int, key crypto.PrivateKey) testData ⋮---- // Create validators ⋮---- VotingPower: symbiotic.ToVotingPower(big.NewInt(100)), // Each validator has 100 voting power ⋮---- // Create the unified ValidatorSet ⋮---- QuorumThreshold: symbiotic.ToVotingPower(big.NewInt(670)), // Need 670 voting power for quorum ⋮---- // Create SignatureMap using the same ValidatorSet ⋮---- // Add signers (first 'signers' number of validators) ⋮---- votingPower := validatorSet.Validators[i].VotingPower // Use actual voting power from validator ⋮---- // Convenience function for common test scenarios func createTestDataWithQuorum(requestID common.Hash, epoch symbiotic.Epoch, thresholdReached bool, key crypto.PrivateKey) testData ⋮---- // 8 signers * 100 voting power = 800 > 670 threshold ⋮---- // 6 signers * 100 voting power = 600 < 670 threshold ⋮---- // Setup mocks for successful aggregation using unified test data func setupSuccessfulAggregationMocks(setup *testSetup, msg symbiotic.Signature, testData testData) ⋮---- var signatures []symbiotic.Signature ⋮---- // Use the unified test data ⋮---- // LOW LATENCY POLICY TESTS ⋮---- func TestHandleSignatureGeneratedMessage_LowLatencyPolicy_QuorumNotReached(t *testing.T) ⋮---- // Setup mocks for quorum NOT reached case ⋮---- // Execute ⋮---- // Verify - should return nil (no error) when quorum not reached, no aggregation ⋮---- func TestHandleSignatureGeneratedMessage_LowLatencyPolicy_QuorumReached(t *testing.T) ⋮---- // Setup mocks for quorum reached case - LowLatency should aggregate immediately ⋮---- // Verify - should successfully aggregate when quorum reached ⋮---- // LOW COST POLICY TESTS ⋮---- func TestHandleSignatureGeneratedMessage_LowCostPolicy_QuorumNotReached(t *testing.T) ⋮---- func TestHandleSignatureGeneratedMessage_LowCostPolicy_QuorumReached_TooManyUnsigners(t *testing.T) ⋮---- setup := newTestSetup(t, symbiotic.AggregationPolicyLowCost, 2) // Allow max 2 unsigners ⋮---- // Setup: 10 total validators, 7 signers = 3 unsigners (exceeds maxUnsigners=2) ⋮---- // Verify - should not aggregate due to too many unsigners ⋮---- func TestHandleSignatureGeneratedMessage_LowCostPolicy_QuorumReached_AcceptableUnsigners(t *testing.T) ⋮---- setup := newTestSetup(t, symbiotic.AggregationPolicyLowCost, 3) // Allow max 3 unsigners ⋮---- // Setup: 10 total validators, 8 signers = 2 unsigners (within maxUnsigners=3) ⋮---- // Verify - should successfully aggregate when unsigners within limit ⋮---- func TestHandleSignatureGeneratedMessage_LowCostPolicy_QuorumReached_ExactUnsignersLimit(t *testing.T) ⋮---- // Setup: 10 total validators, 7 signers = 3 unsigners (exactly maxUnsigners=3) ⋮---- // Verify - should successfully aggregate when exactly at unsigners limit ⋮---- func TestHandleSignatureGeneratedMessage_LowCostPolicy_AllValidatorsSigned(t *testing.T) ⋮---- setup := newTestSetup(t, symbiotic.AggregationPolicyLowCost, 1) // Allow max 1 unsigner ⋮---- // Setup: 10 total validators, 10 signers = 0 unsigners (well within limit) ⋮---- // Verify - should successfully aggregate when all validators signed ⋮---- // EDGE CASES ⋮---- func TestHandleSignatureGeneratedMessage_LowCostPolicy_ZeroMaxUnsigners(t *testing.T) ⋮---- setup := newTestSetup(t, symbiotic.AggregationPolicyLowCost, 0) // Allow 0 unsigners ⋮---- // Setup: 5 total validators, 4 signers = 1 unsigner (exceeds maxUnsigners=0) ⋮---- // Verify - should not aggregate due to any unsigners when maxUnsigners=0 ⋮---- func TestHandleSignatureGeneratedMessage_LowCostPolicy_HighMaxUnsigners(t *testing.T) ⋮---- setup := newTestSetup(t, symbiotic.AggregationPolicyLowCost, 100) // Allow 100 unsigners ⋮---- // Setup: 10 total validators, 7 signers = 3 unsigners (well within limit) // 7 signers = 7*100 = 700 > 670 for quorum ⋮---- // Verify - should successfully aggregate with high unsigners limit ⋮---- // Test helper function to verify SignatureMap functionality with unified test data func TestSignatureMapFunctionality(t *testing.T) ⋮---- // Test with unified creation ⋮---- testingData := createTestData(requestID, 1, 5, 0, pk) // 5 validators, 0 signers initially ⋮---- // Initially no validators signed ⋮---- // Add 3 validators using their actual voting power from the validator set ⋮---- require.False(t, signatureMap.ThresholdReached(validatorSet.QuorumThreshold)) // 300 < 670 ⋮---- // Add 4 more validators (5 total = 5 * 100 = 500 voting power) ⋮---- require.False(t, signatureMap.ThresholdReached(validatorSet.QuorumThreshold)) // 500 < 670 require.True(t, signatureMap.ThresholdReached(symbiotic.ToVotingPower(big.NewInt(400)))) // 500 >= 400 ⋮---- // Verify that the SignatureMap and ValidatorSet are consistent ```` ## File: internal/usecase/aggregator-app/aggregator_app.go ````go package aggregator_app ⋮---- import ( "context" "log/slog" "time" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" validate "github.com/go-playground/validator/v10" "github.com/symbioticfi/relay/internal/entity" aggregationPolicyTypes "github.com/symbioticfi/relay/internal/usecase/aggregation-policy/types" "github.com/symbioticfi/relay/pkg/log" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" ) ⋮---- "context" "log/slog" "time" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" validate "github.com/go-playground/validator/v10" ⋮---- "github.com/symbioticfi/relay/internal/entity" aggregationPolicyTypes "github.com/symbioticfi/relay/internal/usecase/aggregation-policy/types" "github.com/symbioticfi/relay/pkg/log" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" ⋮---- //go:generate mockgen -source=aggregator_app.go -destination=mocks/aggregator_app.go -package=mocks type repository interface { GetValidatorSetByEpoch(ctx context.Context, epoch symbiotic.Epoch) (symbiotic.ValidatorSet, error) GetAggregationProof(ctx context.Context, requestID common.Hash) (symbiotic.AggregationProof, error) GetSignatureRequest(_ context.Context, requestID common.Hash) (symbiotic.SignatureRequest, error) GetAllSignatures(ctx context.Context, requestID common.Hash) ([]symbiotic.Signature, error) GetConfigByEpoch(ctx context.Context, epoch symbiotic.Epoch) (symbiotic.NetworkConfig, error) GetSignatureMap(ctx context.Context, requestID common.Hash) (entity.SignatureMap, error) } ⋮---- type p2pClient interface { BroadcastSignatureAggregatedMessage(ctx context.Context, proof symbiotic.AggregationProof) error } ⋮---- type metrics interface { ObserveOnlyAggregateDuration(d time.Duration) ObserveAppAggregateDuration(d time.Duration) } ⋮---- type aggregator interface { Aggregate(valset symbiotic.ValidatorSet, keyTag symbiotic.KeyTag, messageHash []byte, signatures []symbiotic.Signature) (symbiotic.AggregationProof, error) } ⋮---- type keyProvider interface { GetPrivateKey(keyTag symbiotic.KeyTag) (crypto.PrivateKey, error) GetOnchainKeyFromCache(keyTag symbiotic.KeyTag) (symbiotic.CompactPublicKey, error) } ⋮---- type Config struct { Repo repository `validate:"required"` P2PClient p2pClient `validate:"required"` Aggregator aggregator `validate:"required"` Metrics metrics `validate:"required"` AggregationPolicy aggregatorPolicy `validate:"required"` KeyProvider keyProvider `validate:"required"` ForceAggregator bool } ⋮---- func (c Config) Validate() error ⋮---- type AggregatorApp struct { cfg Config } ⋮---- func NewAggregatorApp(cfg Config) (*AggregatorApp, error) ⋮---- func (s *AggregatorApp) HandleSignatureProcessedMessage(ctx context.Context, msg symbiotic.Signature) error ⋮---- // Get validator set for quorum threshold checks // todo load only valset header when totalVotingPower is added to it ⋮---- func (s *AggregatorApp) GetAggregationStatus(ctx context.Context, requestID common.Hash) (symbiotic.AggregationStatus, error) ⋮---- // Get validator set for quorum threshold checks and aggregation ⋮---- func extractPublicKeys(signatures []symbiotic.Signature) []symbiotic.CompactPublicKey ```` ## File: internal/usecase/api-server/mocks/app_mock.go ````go // Code generated by MockGen. DO NOT EDIT. // Source: app.go // // Generated by this command: ⋮---- // mockgen -source=app.go -destination=mocks/app_mock.go -package=mocks ⋮---- // Package mocks is a generated GoMock package. package mocks ⋮---- import ( context "context" reflect "reflect" common "github.com/ethereum/go-ethereum/common" entity "github.com/symbioticfi/relay/internal/entity" entity0 "github.com/symbioticfi/relay/symbiotic/entity" gomock "go.uber.org/mock/gomock" ) ⋮---- context "context" reflect "reflect" ⋮---- common "github.com/ethereum/go-ethereum/common" entity "github.com/symbioticfi/relay/internal/entity" entity0 "github.com/symbioticfi/relay/symbiotic/entity" gomock "go.uber.org/mock/gomock" ⋮---- // Mocksigner is a mock of signer interface. type Mocksigner struct { ctrl *gomock.Controller recorder *MocksignerMockRecorder isgomock struct{} ⋮---- // MocksignerMockRecorder is the mock recorder for Mocksigner. type MocksignerMockRecorder struct { mock *Mocksigner } ⋮---- // NewMocksigner creates a new mock instance. func NewMocksigner(ctrl *gomock.Controller) *Mocksigner ⋮---- // EXPECT returns an object that allows the caller to indicate expected use. func (m *Mocksigner) EXPECT() *MocksignerMockRecorder ⋮---- // RequestSignature mocks base method. func (m *Mocksigner) RequestSignature(ctx context.Context, req entity0.SignatureRequest) (common.Hash, error) ⋮---- // RequestSignature indicates an expected call of RequestSignature. ⋮---- // Mockrepo is a mock of repo interface. type Mockrepo struct { ctrl *gomock.Controller recorder *MockrepoMockRecorder isgomock struct{} ⋮---- // MockrepoMockRecorder is the mock recorder for Mockrepo. type MockrepoMockRecorder struct { mock *Mockrepo } ⋮---- // NewMockrepo creates a new mock instance. func NewMockrepo(ctrl *gomock.Controller) *Mockrepo ⋮---- // GetAggregationProof mocks base method. func (m *Mockrepo) GetAggregationProof(ctx context.Context, requestID common.Hash) (entity0.AggregationProof, error) ⋮---- // GetAggregationProof indicates an expected call of GetAggregationProof. ⋮---- // GetAggregationProofsByEpoch mocks base method. func (m *Mockrepo) GetAggregationProofsByEpoch(ctx context.Context, epoch entity0.Epoch) ([]entity0.AggregationProof, error) ⋮---- // GetAggregationProofsByEpoch indicates an expected call of GetAggregationProofsByEpoch. ⋮---- // GetAggregationProofsStartingFromEpoch mocks base method. func (m *Mockrepo) GetAggregationProofsStartingFromEpoch(ctx context.Context, epoch entity0.Epoch) ([]entity0.AggregationProof, error) ⋮---- // GetAggregationProofsStartingFromEpoch indicates an expected call of GetAggregationProofsStartingFromEpoch. ⋮---- // GetAllSignatures mocks base method. func (m *Mockrepo) GetAllSignatures(ctx context.Context, requestID common.Hash) ([]entity0.Signature, error) ⋮---- // GetAllSignatures indicates an expected call of GetAllSignatures. ⋮---- // GetLatestValidatorSetEpoch mocks base method. func (m *Mockrepo) GetLatestValidatorSetEpoch(arg0 context.Context) (entity0.Epoch, error) ⋮---- // GetLatestValidatorSetEpoch indicates an expected call of GetLatestValidatorSetEpoch. ⋮---- // GetLatestValidatorSetHeader mocks base method. func (m *Mockrepo) GetLatestValidatorSetHeader(arg0 context.Context) (entity0.ValidatorSetHeader, error) ⋮---- // GetLatestValidatorSetHeader indicates an expected call of GetLatestValidatorSetHeader. ⋮---- // GetSignatureRequest mocks base method. func (m *Mockrepo) GetSignatureRequest(ctx context.Context, requestID common.Hash) (entity0.SignatureRequest, error) ⋮---- // GetSignatureRequest indicates an expected call of GetSignatureRequest. ⋮---- // GetSignatureRequestIDsByEpoch mocks base method. func (m *Mockrepo) GetSignatureRequestIDsByEpoch(ctx context.Context, epoch entity0.Epoch) ([]common.Hash, error) ⋮---- // GetSignatureRequestIDsByEpoch indicates an expected call of GetSignatureRequestIDsByEpoch. ⋮---- // GetSignatureRequestsWithIDByEpoch mocks base method. func (m *Mockrepo) GetSignatureRequestsWithIDByEpoch(ctx context.Context, epoch entity0.Epoch) ([]entity.SignatureRequestWithID, error) ⋮---- // GetSignatureRequestsWithIDByEpoch indicates an expected call of GetSignatureRequestsWithIDByEpoch. ⋮---- // GetSignaturesByEpoch mocks base method. func (m *Mockrepo) GetSignaturesByEpoch(ctx context.Context, epoch entity0.Epoch) ([]entity0.Signature, error) ⋮---- // GetSignaturesByEpoch indicates an expected call of GetSignaturesByEpoch. ⋮---- // GetSignaturesStartingFromEpoch mocks base method. func (m *Mockrepo) GetSignaturesStartingFromEpoch(ctx context.Context, epoch entity0.Epoch) ([]entity0.Signature, error) ⋮---- // GetSignaturesStartingFromEpoch indicates an expected call of GetSignaturesStartingFromEpoch. ⋮---- // GetValidatorSetByEpoch mocks base method. func (m *Mockrepo) GetValidatorSetByEpoch(arg0 context.Context, epoch entity0.Epoch) (entity0.ValidatorSet, error) ⋮---- // GetValidatorSetByEpoch indicates an expected call of GetValidatorSetByEpoch. ⋮---- // GetValidatorSetMetadata mocks base method. func (m *Mockrepo) GetValidatorSetMetadata(ctx context.Context, epoch entity0.Epoch) (entity0.ValidatorSetMetadata, error) ⋮---- // GetValidatorSetMetadata indicates an expected call of GetValidatorSetMetadata. ⋮---- // GetValidatorSetsStartingFromEpoch mocks base method. func (m *Mockrepo) GetValidatorSetsStartingFromEpoch(ctx context.Context, epoch entity0.Epoch) ([]entity0.ValidatorSet, error) ⋮---- // GetValidatorSetsStartingFromEpoch indicates an expected call of GetValidatorSetsStartingFromEpoch. ⋮---- // MockevmClient is a mock of evmClient interface. type MockevmClient struct { ctrl *gomock.Controller recorder *MockevmClientMockRecorder isgomock struct{} ⋮---- // MockevmClientMockRecorder is the mock recorder for MockevmClient. type MockevmClientMockRecorder struct { mock *MockevmClient } ⋮---- // NewMockevmClient creates a new mock instance. func NewMockevmClient(ctrl *gomock.Controller) *MockevmClient ⋮---- // GetConfig mocks base method. func (m *MockevmClient) GetConfig(ctx context.Context, timestamp entity0.Timestamp, epoch entity0.Epoch) (entity0.NetworkConfig, error) ⋮---- // GetConfig indicates an expected call of GetConfig. ⋮---- // GetCurrentEpoch mocks base method. func (m *MockevmClient) GetCurrentEpoch(ctx context.Context) (entity0.Epoch, error) ⋮---- // GetCurrentEpoch indicates an expected call of GetCurrentEpoch. ⋮---- // GetEpochStart mocks base method. func (m *MockevmClient) GetEpochStart(ctx context.Context, epoch entity0.Epoch) (entity0.Timestamp, error) ⋮---- // GetEpochStart indicates an expected call of GetEpochStart. ⋮---- // GetLastCommittedHeaderEpoch mocks base method. func (m *MockevmClient) GetLastCommittedHeaderEpoch(ctx context.Context, addr entity0.CrossChainAddress, opts ...entity0.EVMOption) (entity0.Epoch, error) ⋮---- // GetLastCommittedHeaderEpoch indicates an expected call of GetLastCommittedHeaderEpoch. ⋮---- // Mockaggregator is a mock of aggregator interface. type Mockaggregator struct { ctrl *gomock.Controller recorder *MockaggregatorMockRecorder isgomock struct{} ⋮---- // MockaggregatorMockRecorder is the mock recorder for Mockaggregator. type MockaggregatorMockRecorder struct { mock *Mockaggregator } ⋮---- // NewMockaggregator creates a new mock instance. func NewMockaggregator(ctrl *gomock.Controller) *Mockaggregator ⋮---- // GetAggregationStatus mocks base method. func (m *Mockaggregator) GetAggregationStatus(ctx context.Context, requestID common.Hash) (entity0.AggregationStatus, error) ⋮---- // GetAggregationStatus indicates an expected call of GetAggregationStatus. ⋮---- // Mockderiver is a mock of deriver interface. type Mockderiver struct { ctrl *gomock.Controller recorder *MockderiverMockRecorder isgomock struct{} ⋮---- // MockderiverMockRecorder is the mock recorder for Mockderiver. type MockderiverMockRecorder struct { mock *Mockderiver } ⋮---- // NewMockderiver creates a new mock instance. func NewMockderiver(ctrl *gomock.Controller) *Mockderiver ⋮---- // GetValidatorSet mocks base method. func (m *Mockderiver) GetValidatorSet(ctx context.Context, epoch entity0.Epoch, config entity0.NetworkConfig) (entity0.ValidatorSet, error) ⋮---- // GetValidatorSet indicates an expected call of GetValidatorSet. ⋮---- // MockkeyProvider is a mock of keyProvider interface. type MockkeyProvider struct { ctrl *gomock.Controller recorder *MockkeyProviderMockRecorder isgomock struct{} ⋮---- // MockkeyProviderMockRecorder is the mock recorder for MockkeyProvider. type MockkeyProviderMockRecorder struct { mock *MockkeyProvider } ⋮---- // NewMockkeyProvider creates a new mock instance. func NewMockkeyProvider(ctrl *gomock.Controller) *MockkeyProvider ⋮---- // GetOnchainKeyFromCache mocks base method. func (m *MockkeyProvider) GetOnchainKeyFromCache(keyTag entity0.KeyTag) (entity0.CompactPublicKey, error) ⋮---- // GetOnchainKeyFromCache indicates an expected call of GetOnchainKeyFromCache. ```` ## File: internal/usecase/api-server/app.go ````go package api_server ⋮---- import ( "context" "log/slog" "net" "net/http" "net/http/pprof" "strings" "time" "github.com/symbioticfi/relay/internal/usecase/broadcaster" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/go-playground/validator/v10" "github.com/prometheus/client_golang/prometheus/promhttp" "golang.org/x/net/http2" "golang.org/x/net/http2/h2c" "google.golang.org/grpc" "google.golang.org/grpc/health" "google.golang.org/grpc/health/grpc_health_v1" "google.golang.org/grpc/reflection" "github.com/symbioticfi/relay/internal/entity" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" "github.com/symbioticfi/relay/internal/usecase/metrics" "github.com/symbioticfi/relay/pkg/log" "github.com/symbioticfi/relay/pkg/server" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" "log/slog" "net" "net/http" "net/http/pprof" "strings" "time" ⋮---- "github.com/symbioticfi/relay/internal/usecase/broadcaster" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/go-playground/validator/v10" "github.com/prometheus/client_golang/prometheus/promhttp" "golang.org/x/net/http2" "golang.org/x/net/http2/h2c" "google.golang.org/grpc" "google.golang.org/grpc/health" "google.golang.org/grpc/health/grpc_health_v1" "google.golang.org/grpc/reflection" ⋮---- "github.com/symbioticfi/relay/internal/entity" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" "github.com/symbioticfi/relay/internal/usecase/metrics" "github.com/symbioticfi/relay/pkg/log" "github.com/symbioticfi/relay/pkg/server" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- //go:generate mockgen -source=app.go -destination=mocks/app_mock.go -package=mocks type signer interface { RequestSignature(ctx context.Context, req symbiotic.SignatureRequest) (common.Hash, error) } ⋮---- type repo interface { GetAggregationProof(ctx context.Context, requestID common.Hash) (symbiotic.AggregationProof, error) GetValidatorSetByEpoch(_ context.Context, epoch symbiotic.Epoch) (symbiotic.ValidatorSet, error) GetAllSignatures(ctx context.Context, requestID common.Hash) ([]symbiotic.Signature, error) GetSignatureRequest(ctx context.Context, requestID common.Hash) (symbiotic.SignatureRequest, error) GetLatestValidatorSetHeader(_ context.Context) (symbiotic.ValidatorSetHeader, error) GetLatestValidatorSetEpoch(_ context.Context) (symbiotic.Epoch, error) GetValidatorSetMetadata(ctx context.Context, epoch symbiotic.Epoch) (symbiotic.ValidatorSetMetadata, error) GetSignaturesStartingFromEpoch(ctx context.Context, epoch symbiotic.Epoch) ([]symbiotic.Signature, error) GetSignaturesByEpoch(ctx context.Context, epoch symbiotic.Epoch) ([]symbiotic.Signature, error) GetSignatureRequestIDsByEpoch(ctx context.Context, epoch symbiotic.Epoch) ([]common.Hash, error) GetSignatureRequestsWithIDByEpoch(ctx context.Context, epoch symbiotic.Epoch) ([]entity.SignatureRequestWithID, error) GetAggregationProofsStartingFromEpoch(ctx context.Context, epoch symbiotic.Epoch) ([]symbiotic.AggregationProof, error) GetAggregationProofsByEpoch(ctx context.Context, epoch symbiotic.Epoch) ([]symbiotic.AggregationProof, error) GetValidatorSetsStartingFromEpoch(ctx context.Context, epoch symbiotic.Epoch) ([]symbiotic.ValidatorSet, error) } type evmClient interface { GetCurrentEpoch(ctx context.Context) (symbiotic.Epoch, error) GetEpochStart(ctx context.Context, epoch symbiotic.Epoch) (symbiotic.Timestamp, error) GetConfig(ctx context.Context, timestamp symbiotic.Timestamp, epoch symbiotic.Epoch) (symbiotic.NetworkConfig, error) GetLastCommittedHeaderEpoch(ctx context.Context, addr symbiotic.CrossChainAddress, opts ...symbiotic.EVMOption) (_ symbiotic.Epoch, err error) } ⋮---- type aggregator interface { GetAggregationStatus(ctx context.Context, requestID common.Hash) (symbiotic.AggregationStatus, error) } ⋮---- type deriver interface { GetValidatorSet(ctx context.Context, epoch symbiotic.Epoch, config symbiotic.NetworkConfig) (symbiotic.ValidatorSet, error) } ⋮---- type keyProvider interface { GetOnchainKeyFromCache(keyTag symbiotic.KeyTag) (symbiotic.CompactPublicKey, error) } ⋮---- type Config struct { Address string `validate:"required"` ReadHeaderTimeout time.Duration `validate:"required,gt=0"` ShutdownTimeout time.Duration `validate:"required,gt=0"` Signer signer `validate:"required"` Repo repo `validate:"required"` EvmClient evmClient `validate:"required"` Deriver deriver `validate:"required"` KeyProvider keyProvider `validate:"required"` Aggregator aggregator ServeMetrics bool ServePprof bool ServeHTTPGateway bool Metrics *metrics.Metrics `validate:"required"` VerboseLogging bool MaxAllowedStreamsCount int `validate:"required,gt=0"` } ⋮---- func (c Config) Validate() error ⋮---- // grpcHandler implements the gRPC service interface type grpcHandler struct { apiv1.SymbioticAPIServiceServer cfg Config proofsHub *broadcaster.Hub[symbiotic.AggregationProof] signatureHub *broadcaster.Hub[symbiotic.Signature] validatorSetsHub *broadcaster.Hub[symbiotic.ValidatorSet] } type SymbioticServer struct { grpcServer *grpc.Server httpServer *http.Server listener net.Listener cfg Config handler *grpcHandler startGatewayFunc func() error } ⋮---- func NewSymbioticServer(ctx context.Context, cfg Config) (*SymbioticServer, error) ⋮---- // Create listener ⋮---- // Create gRPC server with interceptors ⋮---- //nolint:contextcheck // the context comes from th stream ⋮---- // Create and register the handler ⋮---- // Register health service ⋮---- // Register reflection service for development ⋮---- // Create HTTP server for documentation with panic recovery ⋮---- // Wrap the entire mux with panic recovery ⋮---- // Register HTTP gateway if enabled var startGatewayFunc func() error ⋮---- // Root redirect to docs ⋮---- // Health check endpoint ⋮---- // Debug pprof endpoints if enabled ⋮---- // Serve API documentation ⋮---- // Serve metrics endpoint if enabled ⋮---- // Create HTTP/2 server that can handle both HTTP and gRPC ⋮---- // createMuxHandler creates a handler that multiplexes between gRPC and HTTP func createMuxHandler(grpcServer *grpc.Server, httpHandler http.Handler) http.Handler ⋮---- // Check if this is a gRPC request ⋮---- // Handle gRPC request ⋮---- // Handle as HTTP request (documentation, health checks, etc.) ⋮---- func (a *SymbioticServer) Start(ctx context.Context) error ⋮---- // Start serving in a goroutine ⋮---- // Initialize HTTP gateway connection after server starts ⋮---- // Retry connection to gRPC server with exponential backoff const maxRetries = 5 var lastErr error ⋮---- // Wait for context cancellation or server error ⋮---- // Graceful shutdown with timeout ⋮---- // Shutdown HTTP server //nolint:contextcheck // we need to use background context here as the original context is already cancelled ⋮---- // Force stop gRPC server ⋮---- // Graceful stop for gRPC server ⋮---- func (a *SymbioticServer) HandleProofAggregated() func(context.Context, symbiotic.AggregationProof) error ⋮---- func (a *SymbioticServer) HandleSignatureProcessed() func(context.Context, symbiotic.Signature) error ⋮---- func (a *SymbioticServer) HandleValidatorSet() func(context.Context, symbiotic.ValidatorSet) error ```` ## File: internal/usecase/api-server/get_aggregation_proof_v1_test.go ````go package api_server ⋮---- import ( "testing" "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "github.com/symbioticfi/relay/internal/entity" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" "github.com/symbioticfi/relay/internal/usecase/api-server/mocks" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "testing" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ⋮---- "github.com/symbioticfi/relay/internal/entity" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" "github.com/symbioticfi/relay/internal/usecase/api-server/mocks" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- func TestGetAggregationProof_Success_ReturnsProof(t *testing.T) ⋮---- func TestGetAggregationProof_NotFound_ReturnsNotFoundError(t *testing.T) ⋮---- func TestGetAggregationProof_RepositoryError_ReturnsError(t *testing.T) ```` ## File: internal/usecase/api-server/get_aggregation_proof_v1.go ````go package api_server ⋮---- import ( "context" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/symbioticfi/relay/internal/entity" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) ⋮---- "context" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/symbioticfi/relay/internal/entity" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ⋮---- // GetAggregationProof handles the gRPC GetAggregationProof request func (h *grpcHandler) GetAggregationProof(ctx context.Context, req *apiv1.GetAggregationProofRequest) (*apiv1.GetAggregationProofResponse, error) ⋮---- func convertAggregationProofToPB(proof symbiotic.AggregationProof) *apiv1.AggregationProof ```` ## File: internal/usecase/api-server/get_aggregation_proofs_by_epoch_v1_test.go ````go package api_server ⋮---- import ( "context" "testing" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/stretchr/testify/require" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" "testing" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/stretchr/testify/require" ⋮---- apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- func TestGetAggregationProofsByEpoch_Success(t *testing.T) ⋮---- func TestGetAggregationProofsByEpoch_EmptyResult(t *testing.T) ⋮---- func TestGetAggregationProofsByEpoch_RepositoryError(t *testing.T) ```` ## File: internal/usecase/api-server/get_aggregation_proofs_by_epoch_v1.go ````go package api_server ⋮---- import ( "context" "github.com/go-errors/errors" "github.com/samber/lo" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" ⋮---- "github.com/go-errors/errors" "github.com/samber/lo" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- // GetAggregationProofsByEpoch handles the gRPC GetAggregationProofsByEpoch request func (h *grpcHandler) GetAggregationProofsByEpoch(ctx context.Context, req *apiv1.GetAggregationProofsByEpochRequest) (*apiv1.GetAggregationProofsByEpochResponse, error) ```` ## File: internal/usecase/api-server/get_aggregation_status_v1_test.go ````go package api_server ⋮---- import ( "math/big" "testing" "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "github.com/symbioticfi/relay/internal/entity" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" "github.com/symbioticfi/relay/internal/usecase/api-server/mocks" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "math/big" "testing" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ⋮---- "github.com/symbioticfi/relay/internal/entity" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" "github.com/symbioticfi/relay/internal/usecase/api-server/mocks" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- func TestGetAggregationStatus_Success_ReturnsStatusWithSortedOperators(t *testing.T) ⋮---- func TestGetAggregationStatus_NoAggregator_ReturnsError(t *testing.T) ⋮---- func TestGetAggregationStatus_NotFound_ReturnsNotFoundError(t *testing.T) ⋮---- func TestGetAggregationStatus_AggregatorError_ReturnsError(t *testing.T) ```` ## File: internal/usecase/api-server/get_aggregation_status_v1.go ````go package api_server ⋮---- import ( "context" "sort" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/samber/lo" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "github.com/symbioticfi/relay/internal/entity" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" "sort" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/samber/lo" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ⋮---- "github.com/symbioticfi/relay/internal/entity" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- // GetAggregationStatus handles the gRPC GetAggregationStatus request func (h *grpcHandler) GetAggregationStatus(ctx context.Context, req *apiv1.GetAggregationStatusRequest) (*apiv1.GetAggregationStatusResponse, error) ```` ## File: internal/usecase/api-server/get_current_epoch_v1_test.go ````go package api_server ⋮---- import ( "context" "testing" "time" "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "github.com/symbioticfi/relay/internal/entity" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" "github.com/symbioticfi/relay/internal/usecase/api-server/mocks" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" "testing" "time" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ⋮---- "github.com/symbioticfi/relay/internal/entity" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" "github.com/symbioticfi/relay/internal/usecase/api-server/mocks" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- func TestGetCurrentEpoch_Success_ReturnsEpochAndStartTime(t *testing.T) ⋮---- captureTimestamp := symbiotic.Timestamp(1640995200) // 2022-01-01 00:00:00 UTC ⋮---- func TestGetCurrentEpoch_NotFound_ReturnsNotFoundError(t *testing.T) ⋮---- func TestGetCurrentEpoch_RepositoryError_ReturnsError(t *testing.T) ```` ## File: internal/usecase/api-server/get_current_epoch_v1.go ````go package api_server ⋮---- import ( "context" "time" "github.com/go-errors/errors" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "google.golang.org/protobuf/types/known/timestamppb" "github.com/symbioticfi/relay/internal/entity" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" ) ⋮---- "context" "time" ⋮---- "github.com/go-errors/errors" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "google.golang.org/protobuf/types/known/timestamppb" ⋮---- "github.com/symbioticfi/relay/internal/entity" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" ⋮---- // GetCurrentEpoch handles the gRPC GetCurrentEpoch request func (h *grpcHandler) GetCurrentEpoch(ctx context.Context, req *apiv1.GetCurrentEpochRequest) (*apiv1.GetCurrentEpochResponse, error) ```` ## File: internal/usecase/api-server/get_last_all_committed_v1_test.go ````go package api_server ⋮---- import ( "context" "testing" "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" "github.com/symbioticfi/relay/internal/usecase/api-server/mocks" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" deriverMocks "github.com/symbioticfi/relay/symbiotic/usecase/valset-deriver/mocks" ) ⋮---- "context" "testing" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" ⋮---- apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" "github.com/symbioticfi/relay/internal/usecase/api-server/mocks" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" deriverMocks "github.com/symbioticfi/relay/symbiotic/usecase/valset-deriver/mocks" ⋮---- func TestGetLastAllCommitted_Success_ReturnsAllChainsWithMinimum(t *testing.T) ⋮---- func TestGetLastAllCommitted_GetConfigFails_ReturnsError(t *testing.T) ⋮---- func TestGetLastAllCommitted_GetLastCommittedEpochFails_ReturnsError(t *testing.T) ⋮---- func TestGetLastAllCommitted_GetEpochStartFails_ReturnsError(t *testing.T) ```` ## File: internal/usecase/api-server/get_last_all_committed_v1.go ````go package api_server ⋮---- import ( "context" "time" "github.com/go-errors/errors" "github.com/symbioticfi/relay/internal/entity" "google.golang.org/protobuf/types/known/timestamppb" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" "time" ⋮---- "github.com/go-errors/errors" "github.com/symbioticfi/relay/internal/entity" "google.golang.org/protobuf/types/known/timestamppb" ⋮---- apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- // GetLastAllCommitted handles the gRPC GetLastAllCommitted request func (h *grpcHandler) GetLastAllCommitted(ctx context.Context, _ *apiv1.GetLastAllCommittedRequest) (*apiv1.GetLastAllCommittedResponse, error) ⋮---- var minLastCommited *apiv1.ChainEpochInfo ```` ## File: internal/usecase/api-server/get_last_committed_v1_test.go ````go package api_server ⋮---- import ( "context" "testing" "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" "github.com/symbioticfi/relay/internal/usecase/api-server/mocks" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" deriverMocks "github.com/symbioticfi/relay/symbiotic/usecase/valset-deriver/mocks" ) ⋮---- "context" "testing" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ⋮---- apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" "github.com/symbioticfi/relay/internal/usecase/api-server/mocks" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" deriverMocks "github.com/symbioticfi/relay/symbiotic/usecase/valset-deriver/mocks" ⋮---- func TestGetLastCommitted_Success_ReturnsLastCommittedEpoch(t *testing.T) ⋮---- func TestGetLastCommitted_ZeroChainID_ReturnsInvalidArgumentError(t *testing.T) ⋮---- func TestGetLastCommitted_ChainNotFound_ReturnsNotFoundError(t *testing.T) ⋮---- func TestGetLastCommitted_GetLastCommittedHeaderEpochFails_ReturnsError(t *testing.T) ⋮---- func TestGetLastCommitted_GetEpochStartFails_ReturnsError(t *testing.T) ⋮---- func TestGetLastCommitted_GetConfigFails_ReturnsError(t *testing.T) ```` ## File: internal/usecase/api-server/get_last_committed_v1.go ````go package api_server ⋮---- import ( "context" "time" "github.com/go-errors/errors" "github.com/symbioticfi/relay/internal/entity" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "google.golang.org/protobuf/types/known/timestamppb" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" "time" ⋮---- "github.com/go-errors/errors" "github.com/symbioticfi/relay/internal/entity" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "google.golang.org/protobuf/types/known/timestamppb" ⋮---- apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- // GetLastCommitted handles the gRPC GetLastCommitted request func (h *grpcHandler) GetLastCommitted(ctx context.Context, req *apiv1.GetLastCommittedRequest) (*apiv1.GetLastCommittedResponse, error) ⋮---- var settlementChain *symbiotic.CrossChainAddress ⋮---- // TODO: Get the epoch start time ```` ## File: internal/usecase/api-server/get_local_validator_v1_test.go ````go package api_server ⋮---- import ( "context" "testing" "github.com/go-errors/errors" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" "github.com/symbioticfi/relay/internal/usecase/api-server/mocks" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" "testing" ⋮---- "github.com/go-errors/errors" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" ⋮---- apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" "github.com/symbioticfi/relay/internal/usecase/api-server/mocks" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- func TestGetLocalValidator_Success(t *testing.T) ⋮---- func TestGetLocalValidator_UseCurrentEpoch(t *testing.T) ⋮---- func TestGetLocalValidator_ErrorWhenEpochFromFuture(t *testing.T) ⋮---- func TestGetLocalValidator_ErrorWhenKeyProviderFails(t *testing.T) ⋮---- func TestGetLocalValidator_ErrorWhenValidatorNotFound(t *testing.T) ⋮---- func TestGetLocalValidator_ErrorWhenRepositoryFails(t *testing.T) ```` ## File: internal/usecase/api-server/get_local_validator_v1.go ````go package api_server ⋮---- import ( "context" "github.com/go-errors/errors" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) ⋮---- "context" ⋮---- "github.com/go-errors/errors" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ⋮---- // GetLocalValidator handles the gRPC GetLocalValidator request func (h *grpcHandler) GetLocalValidator(ctx context.Context, req *apiv1.GetLocalValidatorRequest) (*apiv1.GetLocalValidatorResponse, error) ```` ## File: internal/usecase/api-server/get_signature_request_ids_by_epoch_v1_test.go ````go package api_server ⋮---- import ( "context" "testing" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/stretchr/testify/require" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" "testing" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/stretchr/testify/require" ⋮---- apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- func TestGetSignatureRequestIDsByEpoch_Success(t *testing.T) ⋮---- func TestGetSignatureRequestIDsByEpoch_EmptyResult(t *testing.T) ⋮---- func TestGetSignatureRequestIDsByEpoch_RepositoryError(t *testing.T) ```` ## File: internal/usecase/api-server/get_signature_request_ids_by_epoch_v1.go ````go package api_server ⋮---- import ( "context" "github.com/samber/lo" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" ⋮---- "github.com/samber/lo" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- // GetSignatureRequestIDsByEpoch handles the gRPC GetSignatureRequestIDsByEpoch request func (h *grpcHandler) GetSignatureRequestIDsByEpoch(ctx context.Context, req *apiv1.GetSignatureRequestIDsByEpochRequest) (*apiv1.GetSignatureRequestIDsByEpochResponse, error) ```` ## File: internal/usecase/api-server/get_signature_request_v1_test.go ````go package api_server ⋮---- import ( "context" "testing" "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/require" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "github.com/symbioticfi/relay/internal/entity" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" "testing" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/require" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ⋮---- "github.com/symbioticfi/relay/internal/entity" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- func TestGetSignatureRequest_Success(t *testing.T) ⋮---- // Verify request ID is included ⋮---- func TestGetSignatureRequest_NotFound(t *testing.T) ⋮---- // Check that it's a NotFound error ⋮---- func TestGetSignatureRequest_RepositoryError(t *testing.T) ```` ## File: internal/usecase/api-server/get_signature_request_v1.go ````go package api_server ⋮---- import ( "context" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "github.com/symbioticfi/relay/internal/entity" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" ) ⋮---- "context" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ⋮---- "github.com/symbioticfi/relay/internal/entity" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" ⋮---- // GetSignatureRequest handles the gRPC GetSignatureRequest request func (h *grpcHandler) GetSignatureRequest(ctx context.Context, req *apiv1.GetSignatureRequestRequest) (*apiv1.GetSignatureRequestResponse, error) ```` ## File: internal/usecase/api-server/get_signature_requests_by_epoch_v1_test.go ````go package api_server ⋮---- import ( "context" "testing" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/stretchr/testify/require" "github.com/symbioticfi/relay/internal/entity" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" "testing" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/stretchr/testify/require" ⋮---- "github.com/symbioticfi/relay/internal/entity" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- func TestGetSignatureRequestsByEpoch_Success(t *testing.T) ⋮---- // Verify first request ⋮---- // Verify second request ⋮---- func TestGetSignatureRequestsByEpoch_EmptyResult(t *testing.T) ⋮---- func TestGetSignatureRequestsByEpoch_RepositoryError(t *testing.T) ```` ## File: internal/usecase/api-server/get_signature_requests_by_epoch_v1.go ````go package api_server ⋮---- import ( "context" "github.com/go-errors/errors" "github.com/samber/lo" "github.com/symbioticfi/relay/internal/entity" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" ⋮---- "github.com/go-errors/errors" "github.com/samber/lo" "github.com/symbioticfi/relay/internal/entity" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- // GetSignatureRequestsByEpoch handles the gRPC GetSignatureRequestsByEpoch request func (h *grpcHandler) GetSignatureRequestsByEpoch(ctx context.Context, req *apiv1.GetSignatureRequestsByEpochRequest) (*apiv1.GetSignatureRequestsByEpochResponse, error) ```` ## File: internal/usecase/api-server/get_signature_v1.go ````go package api_server ⋮---- import ( "context" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/samber/lo" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "github.com/symbioticfi/relay/internal/entity" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/samber/lo" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ⋮---- "github.com/symbioticfi/relay/internal/entity" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- // GetSignatures handles the gRPC GetSignatures request func (h *grpcHandler) GetSignatures(ctx context.Context, req *apiv1.GetSignaturesRequest) (*apiv1.GetSignaturesResponse, error) ⋮---- func convertSignaturesToPB(signatures []symbiotic.Signature) []*apiv1.Signature ⋮---- func convertSignatureToPB(sig symbiotic.Signature) *apiv1.Signature ```` ## File: internal/usecase/api-server/get_signatures_by_epoch_v1_test.go ````go package api_server ⋮---- import ( "context" "testing" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/stretchr/testify/require" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" ) ⋮---- "context" "testing" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/stretchr/testify/require" ⋮---- apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" ⋮---- func TestGetSignaturesByEpoch_Success(t *testing.T) ⋮---- func TestGetSignaturesByEpoch_EmptyResult(t *testing.T) ⋮---- func TestGetSignaturesByEpoch_RepositoryError(t *testing.T) ```` ## File: internal/usecase/api-server/get_signatures_by_epoch_v1.go ````go package api_server ⋮---- import ( "context" "github.com/go-errors/errors" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" ⋮---- "github.com/go-errors/errors" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- // GetSignaturesByEpoch handles the gRPC GetSignaturesByEpoch request func (h *grpcHandler) GetSignaturesByEpoch(ctx context.Context, req *apiv1.GetSignaturesByEpochRequest) (*apiv1.GetSignaturesByEpochResponse, error) ```` ## File: internal/usecase/api-server/get_signatures_v1_test.go ````go package api_server ⋮---- import ( "testing" "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "github.com/symbioticfi/relay/internal/entity" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" "github.com/symbioticfi/relay/internal/usecase/api-server/mocks" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" ) ⋮---- "testing" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ⋮---- "github.com/symbioticfi/relay/internal/entity" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" "github.com/symbioticfi/relay/internal/usecase/api-server/mocks" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" ⋮---- func TestGetSignatures_Success_ReturnsAllSignatures(t *testing.T) ⋮---- func TestGetSignatures_NotFound_ReturnsNotFoundError(t *testing.T) ⋮---- func TestGetSignatures_RepositoryError_ReturnsError(t *testing.T) ```` ## File: internal/usecase/api-server/get_validator_by_address_v1_test.go ````go package api_server ⋮---- import ( "context" "testing" "github.com/go-errors/errors" "github.com/stretchr/testify/require" "github.com/symbioticfi/relay/internal/entity" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" "testing" ⋮---- "github.com/go-errors/errors" "github.com/stretchr/testify/require" ⋮---- "github.com/symbioticfi/relay/internal/entity" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- func TestGetValidatorByAddress_ValidatorFoundInRepo(t *testing.T) ⋮---- // Create test data ⋮---- expectedValidator := validatorSet.Validators[0] // First validator has address 0x123 ⋮---- // Setup mocks - validator set found in repository ⋮---- // Execute the method under test ⋮---- // Assertions ⋮---- func TestGetValidatorByAddress_ValidatorSetNotInRepo_DerivedFail(t *testing.T) ⋮---- // Setup mocks - validator set not in repository, needs to be derived ⋮---- func TestGetValidatorByAddress_UseCurrentEpoch_WhenNoEpochSpecified(t *testing.T) ⋮---- // Setup mocks - no epoch specified, should use current epoch ⋮---- // Execute the method under test - no epoch specified ⋮---- func TestGetValidatorByAddress_ErrorWhenEpochFromFuture(t *testing.T) ⋮---- // Setup mocks ⋮---- func TestGetValidatorByAddress_ErrorWhenInvalidAddress(t *testing.T) ⋮---- func TestGetValidatorByAddress_ErrorWhenValidatorNotFound(t *testing.T) ⋮---- // Create test data without the requested validator ⋮---- func TestGetValidatorByAddress_ErrorWhenGetCurrentEpochFails(t *testing.T) ⋮---- func TestGetValidatorByAddress_ErrorWhenRepositoryFails(t *testing.T) ```` ## File: internal/usecase/api-server/get_validator_by_address_v1.go ````go package api_server ⋮---- import ( "context" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/samber/lo" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/samber/lo" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ⋮---- apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- // GetValidatorByAddress handles the gRPC GetValidatorByAddress request func (h *grpcHandler) GetValidatorByAddress(ctx context.Context, req *apiv1.GetValidatorByAddressRequest) (*apiv1.GetValidatorByAddressResponse, error) ⋮---- // epoch from future ⋮---- // parse validator address ⋮---- // get validator set for the epoch ⋮---- // find validator by address ```` ## File: internal/usecase/api-server/get_validator_by_key_v1_test.go ````go package api_server ⋮---- import ( "context" "testing" "github.com/go-errors/errors" "github.com/stretchr/testify/require" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" "testing" ⋮---- "github.com/go-errors/errors" "github.com/stretchr/testify/require" ⋮---- apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- func TestGetValidatorByKey_Success(t *testing.T) ⋮---- func TestGetValidatorByKey_UseCurrentEpoch(t *testing.T) ⋮---- func TestGetValidatorByKey_ErrorWhenEpochFromFuture(t *testing.T) ⋮---- func TestGetValidatorByKey_ErrorWhenKeyTagIsZero(t *testing.T) ⋮---- func TestGetValidatorByKey_ErrorWhenOnChainKeyIsEmpty(t *testing.T) ⋮---- func TestGetValidatorByKey_ErrorWhenValidatorNotFound(t *testing.T) ⋮---- func TestGetValidatorByKey_ErrorWhenRepositoryFails(t *testing.T) ```` ## File: internal/usecase/api-server/get_validator_by_key_v1.go ````go package api_server ⋮---- import ( "bytes" "context" "github.com/go-errors/errors" "github.com/samber/lo" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) ⋮---- "bytes" "context" ⋮---- "github.com/go-errors/errors" "github.com/samber/lo" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ⋮---- // GetValidatorByKey handles the gRPC GetValidatorByKey request func (h *grpcHandler) GetValidatorByKey(ctx context.Context, req *apiv1.GetValidatorByKeyRequest) (*apiv1.GetValidatorByKeyResponse, error) ```` ## File: internal/usecase/api-server/get_validator_set_header_v1_test.go ````go package api_server ⋮---- import ( "context" "testing" "github.com/go-errors/errors" "github.com/stretchr/testify/require" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" "testing" ⋮---- "github.com/go-errors/errors" "github.com/stretchr/testify/require" ⋮---- apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- func TestGetValidatorSetHeader_ValidatorSetFoundInRepo(t *testing.T) ⋮---- // Create test data ⋮---- expectedHeader, err := validatorSet.GetHeader() // Use the real GetHeader method ⋮---- // Setup mocks - validator set found in repository ⋮---- // Execute the method under test ⋮---- // Assertions ⋮---- func TestGetValidatorSetHeader_UseCurrentEpoch_WhenNoEpochSpecified(t *testing.T) ⋮---- // Setup mocks - no epoch specified, should use current epoch ⋮---- // Execute the method under test - no epoch specified ⋮---- func TestGetValidatorSetHeader_ErrorWhenEpochFromFuture(t *testing.T) ⋮---- // Setup mocks ⋮---- func TestGetValidatorSetHeader_ErrorWhenGetCurrentEpochFails(t *testing.T) ⋮---- func TestGetValidatorSetHeader_ErrorWhenRepositoryFails(t *testing.T) ```` ## File: internal/usecase/api-server/get_validator_set_header_v1.go ````go package api_server ⋮---- import ( "context" "time" "github.com/go-errors/errors" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "google.golang.org/protobuf/types/known/timestamppb" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" "time" ⋮---- "github.com/go-errors/errors" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "google.golang.org/protobuf/types/known/timestamppb" ⋮---- apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- // GetValidatorSetHeader handles the gRPC GetValidatorSetHeader request func (h *grpcHandler) GetValidatorSetHeader(ctx context.Context, req *apiv1.GetValidatorSetHeaderRequest) (*apiv1.GetValidatorSetHeaderResponse, error) ⋮---- // epoch from future ⋮---- // get header from validator set ```` ## File: internal/usecase/api-server/get_validator_set_v1_test.go ````go package api_server ⋮---- import ( "context" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" "github.com/symbioticfi/relay/internal/usecase/api-server/mocks" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" "testing" ⋮---- "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ⋮---- apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" "github.com/symbioticfi/relay/internal/usecase/api-server/mocks" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- func TestGetValidatorSet_WithoutEpoch_ReturnsLatestValidatorSet(t *testing.T) ⋮---- func TestGetValidatorSet_WithSpecificEpoch_ReturnsRequestedValidatorSet(t *testing.T) ⋮---- func TestGetValidatorSet_FutureEpoch_ReturnsInvalidArgumentError(t *testing.T) ⋮---- func TestGetValidatorSet_GetLatestEpochFails_ReturnsError(t *testing.T) ⋮---- func TestConvertValidatorSetStatusToPB_AllStatuses(t *testing.T) ```` ## File: internal/usecase/api-server/get_validator_set_v1.go ````go package api_server ⋮---- import ( "context" "time" "github.com/go-errors/errors" "github.com/samber/lo" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "google.golang.org/protobuf/types/known/timestamppb" "github.com/symbioticfi/relay/internal/entity" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" "time" ⋮---- "github.com/go-errors/errors" "github.com/samber/lo" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "google.golang.org/protobuf/types/known/timestamppb" ⋮---- "github.com/symbioticfi/relay/internal/entity" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- // GetValidatorSet handles the gRPC GetValidatorSet request func (h *grpcHandler) GetValidatorSet(ctx context.Context, req *apiv1.GetValidatorSetRequest) (*apiv1.GetValidatorSetResponse, error) ⋮---- // epoch from future ⋮---- // getValidatorSetForEpoch retrieves validator set for a given epoch, either from repo or by deriving it func (h *grpcHandler) getValidatorSetForEpoch(ctx context.Context, epochRequested symbiotic.Epoch) (symbiotic.ValidatorSet, error) ⋮---- func convertValidatorSetToPB(valSet symbiotic.ValidatorSet) *apiv1.ValidatorSet ⋮---- func convertValidatorToPB(v symbiotic.Validator) *apiv1.Validator ⋮---- func convertValidatorSetStatusToPB(status symbiotic.ValidatorSetStatus) apiv1.ValidatorSetStatus ```` ## File: internal/usecase/api-server/get_validatorset_metadata_v1_test.go ````go package api_server ⋮---- import ( "context" "testing" "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "github.com/symbioticfi/relay/internal/entity" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" "github.com/symbioticfi/relay/internal/usecase/api-server/mocks" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" "testing" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ⋮---- "github.com/symbioticfi/relay/internal/entity" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" "github.com/symbioticfi/relay/internal/usecase/api-server/mocks" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- func TestGetValidatorSetMetadata_WithoutEpoch_ReturnsLatestMetadata(t *testing.T) ⋮---- func TestGetValidatorSetMetadata_WithEpoch_ReturnsMetadataForEpoch(t *testing.T) ⋮---- func TestGetValidatorSetMetadata_NotFound_ReturnsNotFoundError(t *testing.T) ⋮---- func TestGetValidatorSetMetadata_RepositoryError_ReturnsError(t *testing.T) ⋮---- func TestGetValidatorSetMetadata_GetLatestEpochFails_ReturnsError(t *testing.T) ```` ## File: internal/usecase/api-server/get_validatorset_metadata_v1.go ````go package api_server ⋮---- import ( "context" "github.com/go-errors/errors" "github.com/samber/lo" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "github.com/symbioticfi/relay/internal/entity" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" ⋮---- "github.com/go-errors/errors" "github.com/samber/lo" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ⋮---- "github.com/symbioticfi/relay/internal/entity" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- // GetValidatorSetMetadata handles the gRPC GetValidatorSetMetadata request func (h *grpcHandler) GetValidatorSetMetadata(ctx context.Context, req *apiv1.GetValidatorSetMetadataRequest) (*apiv1.GetValidatorSetMetadataResponse, error) ⋮---- var epochRequested symbiotic.Epoch ```` ## File: internal/usecase/api-server/helpers_test.go ````go package api_server ⋮---- import ( "math/big" "testing" "time" "github.com/ethereum/go-ethereum/common" "go.uber.org/mock/gomock" "github.com/symbioticfi/relay/internal/usecase/api-server/mocks" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" deriverMocks "github.com/symbioticfi/relay/symbiotic/usecase/valset-deriver/mocks" ) ⋮---- "math/big" "testing" "time" ⋮---- "github.com/ethereum/go-ethereum/common" "go.uber.org/mock/gomock" ⋮---- "github.com/symbioticfi/relay/internal/usecase/api-server/mocks" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" deriverMocks "github.com/symbioticfi/relay/symbiotic/usecase/valset-deriver/mocks" ⋮---- // testSetup contains all the mocks and test helper functions // This unified setup can be used for all API server endpoint tests type testSetup struct { ctrl *gomock.Controller mockEvmClient *deriverMocks.MockEvmClient mockRepo *mocks.Mockrepo mockDeriver *mocks.Mockderiver handler *grpcHandler } ⋮---- // newTestSetup creates a new test setup with mocked dependencies // This reuses the same construction pattern as production code func newTestSetup(t *testing.T) *testSetup ⋮---- // Create Config using the same structure as production ⋮---- Address: ":8080", // not used in unit tests ⋮---- // Inject mocked dependencies ⋮---- // Create grpcHandler using the same pattern as production ⋮---- // createTestValidatorSet creates a sample validator set for testing // This is the simpler version used for GetValidatorSetHeader tests func createTestValidatorSet(epoch symbiotic.Epoch) symbiotic.ValidatorSet ⋮---- CaptureTimestamp: 1640995200, // 2022-01-01 00:00:00 UTC ⋮---- // createTestValidatorSetWithMultipleValidators creates a sample validator set with multiple validators for testing // This is the richer version used for GetValidatorByAddress tests func createTestValidatorSetWithMultipleValidators(epoch symbiotic.Epoch) symbiotic.ValidatorSet ```` ## File: internal/usecase/api-server/http_test.go ````go package api_server ⋮---- import ( "bytes" "fmt" "net/http" "net/http/httptest" "strings" "testing" "github.com/go-errors/errors" ) ⋮---- "bytes" "fmt" "net/http" "net/http/httptest" "strings" "testing" ⋮---- "github.com/go-errors/errors" ⋮---- // mockFlusher implements http.Flusher for testing type mockFlusher struct { flushCount int } ⋮---- func (m *mockFlusher) Flush() ⋮---- // mockResponseWriter implements http.ResponseWriter and http.Flusher for testing type mockResponseWriter struct { mockFlusher header http.Header body bytes.Buffer statusCode int } ⋮---- func newMockResponseWriter() *mockResponseWriter ⋮---- func (m *mockResponseWriter) Header() http.Header ⋮---- func (m *mockResponseWriter) Write(b []byte) (int, error) ⋮---- func (m *mockResponseWriter) WriteHeader(statusCode int) ⋮---- func TestSSEResponseWriter_CompleteMessages(t *testing.T) ⋮---- // Write complete JSON messages ⋮---- // Check output is in SSE format ⋮---- // Check that flush was called for each message ⋮---- // Verify headers were set correctly ⋮---- func TestSSEResponseWriter_PartialWrites(t *testing.T) ⋮---- // Simulate json.Encoder behavior: writes in chunks without newline ⋮---- // Write chunks one by one ⋮---- // After first write, no output should be produced (no complete line yet) ⋮---- // Still no output (no newline yet) ⋮---- // Now we should have complete output ⋮---- // Should have flushed once (after complete line) ⋮---- func TestSSEResponseWriter_EmptyLines(t *testing.T) ⋮---- // Write with empty lines ⋮---- // Empty lines should be skipped ⋮---- func TestSSEResponseWriter_MultipleMessagesWithPartials(t *testing.T) ⋮---- // Write complete message followed by partial ⋮---- // Check that first message was output ⋮---- // Complete the partial message ⋮---- // Now both messages should be present ⋮---- func TestSSEResponseWriter_BufferOverflow(t *testing.T) ⋮---- // Create a message larger than 5MB (the maxBufferSize) without newline ⋮---- func TestSSEResponseWriter_WriteError(t *testing.T) ⋮---- // Create a mock that fails on write ⋮---- // Should still return the bytes we accepted from input ⋮---- // failingResponseWriter always fails on Write type failingResponseWriter struct { header http.Header } ⋮---- func TestSSEResponseWriter_BufferPersistence(t *testing.T) ⋮---- // Write partial message ⋮---- // Check buffer contains partial data ⋮---- // Write more partial data ⋮---- // Buffer should have grown ⋮---- // Complete the message ⋮---- // Buffer should be empty (or contain only remaining data) ⋮---- // Verify complete message was output ⋮---- func TestSSEResponseWriter_EmptyWrite(t *testing.T) ⋮---- // Write empty data ⋮---- // Should produce no output ⋮---- func TestSSEResponseWriter_NilFlusher(t *testing.T) ⋮---- flusher: nil, // nil flusher ⋮---- // Write should fail with nil flusher ⋮---- func TestSSEResponseWriter_ConcurrentWrites(t *testing.T) ⋮---- // Perform concurrent writes const numGoroutines = 10 ⋮---- // Wait for all goroutines ⋮---- // Should have written all messages (order may vary due to concurrency) ⋮---- func TestSSEResponseWriter_FlushWithNilFlusher(t *testing.T) ⋮---- // Flush should not panic with nil flusher ⋮---- func TestSSEResponseWriter_RealWorldScenario(t *testing.T) ⋮---- // Simulate real httptest.ResponseRecorder behavior ⋮---- // Simulate json.Encoder writing large objects in chunks // This is the actual problematic scenario described in the issue ⋮---- // Simulate chunked writes (what json.Encoder does) ⋮---- // Don't add newline until the end ⋮---- // Verify the complete JSON was output as a single SSE event ⋮---- // Count number of SSE events (should be 1) ⋮---- // Verify the JSON is complete and valid ```` ## File: internal/usecase/api-server/http.go ````go package api_server ⋮---- import ( "bytes" "context" "fmt" "io" "log/slog" "net/http" "strings" "sync" "github.com/go-errors/errors" "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" ) ⋮---- "bytes" "context" "fmt" "io" "log/slog" "net/http" "strings" "sync" ⋮---- "github.com/go-errors/errors" "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" ⋮---- const maxBufferSize = 5 * 1024 * 1024 // 5MB ⋮---- // sseResponseWriter wraps http.ResponseWriter to convert newline-delimited JSON to SSE format type sseResponseWriter struct { http.ResponseWriter flusher http.Flusher headersWritten bool buffer bytes.Buffer // Buffer for incomplete lines mu sync.Mutex // Protect buffer from concurrent writes } ⋮---- buffer bytes.Buffer // Buffer for incomplete lines mu sync.Mutex // Protect buffer from concurrent writes ⋮---- // WriteHeader intercepts header writes to set SSE headers func (s *sseResponseWriter) WriteHeader(statusCode int) ⋮---- // Override content-type for SSE ⋮---- func (s *sseResponseWriter) Write(b []byte) (int, error) ⋮---- // Process complete lines (those ending with \n) ⋮---- // No complete line yet - restore partial data to buffer // ReadBytes with EOF consumes all data from buffer, so we put it back ⋮---- // Unexpected error from ReadBytes ⋮---- // Write in SSE format: data: {json}\n\n ⋮---- // Return the number of bytes we accepted from the input ⋮---- func (s *sseResponseWriter) Flush() ⋮---- // setupHttpProxy configures the HTTP-to-gRPC gateway proxy // Returns a start function that should be called after the gRPC server starts listening func setupHttpProxy(ctx context.Context, grpcAddr string, httpMux *http.ServeMux) func() error ⋮---- // Create gRPC client connection to the actual gRPC server via TCP ⋮---- grpc.MaxCallRecvMsgSize(10*1024*1024), // 10MB grpc.MaxCallSendMsgSize(10*1024*1024), // 10MB ⋮---- var conn *grpc.ClientConn ⋮---- // Start function that will be called after gRPC server is listening ⋮---- var err error ⋮---- // Mount the gateway under /api prefix with CORS and streaming support ⋮---- // Check if gateway is initialized ⋮---- // Set CORS headers ⋮---- w.Header().Set("Access-Control-Max-Age", "86400") // 24 hours ⋮---- // Handle preflight OPTIONS request ⋮---- // For streaming endpoints, wrap the response writer to intercept and convert to SSE ⋮---- // Wrap with SSE writer that will handle headers and format conversion ```` ## File: internal/usecase/api-server/interceptors_test.go ````go package api_server ⋮---- import ( "context" "testing" "github.com/go-errors/errors" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "github.com/symbioticfi/relay/internal/entity" ) ⋮---- "context" "testing" ⋮---- "github.com/go-errors/errors" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ⋮---- "github.com/symbioticfi/relay/internal/entity" ⋮---- func TestConvertToGRPCError_NilError_ReturnsNil(t *testing.T) ⋮---- func TestConvertToGRPCError_AlreadyGRPCError_ReturnsAsIs(t *testing.T) ⋮---- func TestConvertToGRPCError_ErrNotAnAggregator_ReturnsPermissionDenied(t *testing.T) ⋮---- func TestConvertToGRPCError_ErrEntityNotFound_ReturnsNotFound(t *testing.T) ⋮---- func TestConvertToGRPCError_ErrChainNotFound_ReturnsNotFound(t *testing.T) ⋮---- func TestConvertToGRPCError_ErrEntityAlreadyExist_ReturnsAlreadyExists(t *testing.T) ⋮---- func TestConvertToGRPCError_ErrNoPeers_ReturnsUnavailable(t *testing.T) ⋮---- func TestConvertToGRPCError_ContextCanceled_ReturnsCanceled(t *testing.T) ⋮---- func TestConvertToGRPCError_ContextDeadlineExceeded_ReturnsDeadlineExceeded(t *testing.T) ⋮---- func TestConvertToGRPCError_UnknownError_ReturnsInternal(t *testing.T) ⋮---- func TestErrorHandlingInterceptor_HandlerReturnsNil_ReturnsSuccess(t *testing.T) ⋮---- func TestErrorHandlingInterceptor_HandlerReturnsError_ConvertsError(t *testing.T) ⋮---- func TestErrorHandlingInterceptor_HandlerReturnsGRPCError_ReturnsAsIs(t *testing.T) ⋮---- type mockServerStream struct { grpc.ServerStream ctx context.Context } ⋮---- func (m *mockServerStream) Context() context.Context ⋮---- func TestStreamErrorHandlingInterceptor_HandlerReturnsNil_ReturnsSuccess(t *testing.T) ⋮---- func TestStreamErrorHandlingInterceptor_HandlerReturnsError_ConvertsError(t *testing.T) ⋮---- func TestStreamErrorHandlingInterceptor_HandlerReturnsGRPCError_ReturnsAsIs(t *testing.T) ```` ## File: internal/usecase/api-server/interceptors.go ````go package api_server ⋮---- import ( "context" "log/slog" "github.com/go-errors/errors" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "github.com/symbioticfi/relay/internal/entity" ) ⋮---- "context" "log/slog" ⋮---- "github.com/go-errors/errors" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ⋮---- "github.com/symbioticfi/relay/internal/entity" ⋮---- // convertToGRPCError converts internal errors to gRPC status errors func convertToGRPCError(ctx context.Context, err error) error ⋮---- // If the error is already a gRPC status error, return it as-is ⋮---- // Handle known entity errors ⋮---- // Log internal errors ⋮---- // ErrorHandlingInterceptor handles error conversion for unary RPCs func ErrorHandlingInterceptor() grpc.UnaryServerInterceptor ⋮---- // StreamErrorHandlingInterceptor handles error conversion for streaming RPCs func StreamErrorHandlingInterceptor() grpc.StreamServerInterceptor ```` ## File: internal/usecase/api-server/listen_proofs_v1_test.go ````go package api_server ⋮---- import ( "context" "testing" "time" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" "google.golang.org/grpc/metadata" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" "github.com/symbioticfi/relay/internal/usecase/api-server/mocks" "github.com/symbioticfi/relay/internal/usecase/broadcaster" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" "testing" "time" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" "google.golang.org/grpc/metadata" ⋮---- apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" "github.com/symbioticfi/relay/internal/usecase/api-server/mocks" "github.com/symbioticfi/relay/internal/usecase/broadcaster" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- type mockProofsStream struct { ctx context.Context sentItems []*apiv1.ListenProofsResponse sendError error sendCalled chan struct{} ⋮---- func (m *mockProofsStream) Context() context.Context ⋮---- func (m *mockProofsStream) Send(msg *apiv1.ListenProofsResponse) error ⋮---- func (m *mockProofsStream) SendMsg(interface ⋮---- func (m *mockProofsStream) RecvMsg(interface ⋮---- func (m *mockProofsStream) SetHeader(metadata.MD) error ⋮---- func (m *mockProofsStream) SendHeader(metadata.MD) error ⋮---- func (m *mockProofsStream) SetTrailer(metadata.MD) ⋮---- func TestListenProofs_OnlyHistoricalData(t *testing.T) ⋮---- func TestListenProofs_OnlyBroadcast(t *testing.T) ⋮---- func TestListenProofs_HistoricalAndBroadcast(t *testing.T) ⋮---- func TestListenProofs_RepositoryError(t *testing.T) ⋮---- func TestListenProofs_StreamSendError(t *testing.T) ⋮---- func TestListenProofs_MultipleBroadcasts(t *testing.T) ⋮---- func TestListenProofs_MaxStreamsReached_ReturnsError(t *testing.T) ⋮---- func TestListenProofs_EmptyHistoricalData(t *testing.T) ```` ## File: internal/usecase/api-server/listen_proofs_v1.go ````go package api_server ⋮---- import ( "github.com/google/uuid" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) ⋮---- "github.com/google/uuid" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ⋮---- func (h *grpcHandler) ListenProofs( req *apiv1.ListenProofsRequest, stream grpc.ServerStreamingServer[apiv1.ListenProofsResponse], ) error ```` ## File: internal/usecase/api-server/listen_signature_v1.go ````go package api_server ⋮---- import ( "github.com/google/uuid" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) ⋮---- "github.com/google/uuid" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ⋮---- func (h *grpcHandler) ListenSignatures( req *apiv1.ListenSignaturesRequest, stream grpc.ServerStreamingServer[apiv1.ListenSignaturesResponse], ) error ```` ## File: internal/usecase/api-server/listen_signatures_v1_test.go ````go package api_server ⋮---- import ( "context" "testing" "time" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" "google.golang.org/grpc/metadata" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" "github.com/symbioticfi/relay/internal/usecase/api-server/mocks" "github.com/symbioticfi/relay/internal/usecase/broadcaster" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" ) ⋮---- "context" "testing" "time" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" "google.golang.org/grpc/metadata" ⋮---- apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" "github.com/symbioticfi/relay/internal/usecase/api-server/mocks" "github.com/symbioticfi/relay/internal/usecase/broadcaster" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" ⋮---- type mockSignaturesStream struct { ctx context.Context sentItems []*apiv1.ListenSignaturesResponse sendError error sendCalled chan struct{} ⋮---- func (m *mockSignaturesStream) Context() context.Context ⋮---- func (m *mockSignaturesStream) Send(msg *apiv1.ListenSignaturesResponse) error ⋮---- func (m *mockSignaturesStream) SendMsg(interface ⋮---- func (m *mockSignaturesStream) RecvMsg(interface ⋮---- func (m *mockSignaturesStream) SetHeader(metadata.MD) error ⋮---- func (m *mockSignaturesStream) SendHeader(metadata.MD) error ⋮---- func (m *mockSignaturesStream) SetTrailer(metadata.MD) ⋮---- func TestListenSignatures_OnlyHistoricalData(t *testing.T) ⋮---- func TestListenSignatures_OnlyBroadcast(t *testing.T) ⋮---- func TestListenSignatures_HistoricalAndBroadcast(t *testing.T) ⋮---- func TestListenSignatures_RepositoryError(t *testing.T) ⋮---- func TestListenSignatures_StreamSendError(t *testing.T) ⋮---- func TestListenSignatures_MultipleBroadcasts(t *testing.T) ⋮---- func TestListenSignatures_MaxStreamsReached_ReturnsError(t *testing.T) ```` ## File: internal/usecase/api-server/listen_validator_set_v1_test.go ````go package api_server ⋮---- import ( "context" "testing" "time" "github.com/go-errors/errors" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" "google.golang.org/grpc/metadata" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" "github.com/symbioticfi/relay/internal/usecase/api-server/mocks" "github.com/symbioticfi/relay/internal/usecase/broadcaster" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" "testing" "time" ⋮---- "github.com/go-errors/errors" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" "google.golang.org/grpc/metadata" ⋮---- apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" "github.com/symbioticfi/relay/internal/usecase/api-server/mocks" "github.com/symbioticfi/relay/internal/usecase/broadcaster" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- type mockValidatorSetsStream struct { ctx context.Context sentItems []*apiv1.ListenValidatorSetResponse sendError error sendCalled chan struct{} ⋮---- func (m *mockValidatorSetsStream) Context() context.Context ⋮---- func (m *mockValidatorSetsStream) Send(msg *apiv1.ListenValidatorSetResponse) error ⋮---- func (m *mockValidatorSetsStream) SendMsg(interface ⋮---- func (m *mockValidatorSetsStream) RecvMsg(interface ⋮---- func (m *mockValidatorSetsStream) SetHeader(metadata.MD) error ⋮---- func (m *mockValidatorSetsStream) SendHeader(metadata.MD) error ⋮---- func (m *mockValidatorSetsStream) SetTrailer(metadata.MD) ⋮---- func TestListenValidatorSet_OnlyHistoricalData(t *testing.T) ⋮---- func TestListenValidatorSet_OnlyBroadcast(t *testing.T) ⋮---- func TestListenValidatorSet_HistoricalAndBroadcast(t *testing.T) ⋮---- func TestListenValidatorSet_RepositoryError(t *testing.T) ⋮---- func TestListenValidatorSet_StreamSendError(t *testing.T) ⋮---- func TestListenValidatorSet_MultipleBroadcasts(t *testing.T) ⋮---- func TestListenValidatorSet_EmptyHistoricalData(t *testing.T) ⋮---- func TestListenValidatorSet_ConcurrentBroadcasts(t *testing.T) ⋮---- func TestListenValidatorSet_MaxStreamsReached_ReturnsError(t *testing.T) ```` ## File: internal/usecase/api-server/listen_validator_set_v1.go ````go package api_server ⋮---- import ( "github.com/google/uuid" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) ⋮---- "github.com/google/uuid" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ⋮---- func (h *grpcHandler) ListenValidatorSet( req *apiv1.ListenValidatorSetRequest, stream grpc.ServerStreamingServer[apiv1.ListenValidatorSetResponse], ) error ⋮---- func convertValidatorSetToStreamResponse(valSet symbiotic.ValidatorSet) *apiv1.ListenValidatorSetResponse ```` ## File: internal/usecase/api-server/sign_message_v1_test.go ````go package api_server ⋮---- import ( "context" "testing" "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" "github.com/symbioticfi/relay/internal/usecase/api-server/mocks" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" "testing" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" ⋮---- apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" "github.com/symbioticfi/relay/internal/usecase/api-server/mocks" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- func TestSignMessage_WithRequiredEpoch_Success(t *testing.T) ⋮---- func TestSignMessage_WithoutRequiredEpoch_UsesLatestEpoch(t *testing.T) ⋮---- func TestSignMessage_GetLatestEpochFails_ReturnsError(t *testing.T) ⋮---- func TestSignMessage_RequestSignatureFails_ReturnsError(t *testing.T) ```` ## File: internal/usecase/api-server/sign_message_v1.go ````go package api_server ⋮---- import ( "context" apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" ⋮---- apiv1 "github.com/symbioticfi/relay/internal/gen/api/v1" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- // SignMessage handles the gRPC SignMessage request func (h *grpcHandler) SignMessage(ctx context.Context, req *apiv1.SignMessageRequest) (*apiv1.SignMessageResponse, error) ```` ## File: internal/usecase/broadcaster/doc.go ````go // Package broadcaster provides a generic Hub implementation for dynamic fan-out messaging. // // The Hub allows publishers to broadcast messages to a dynamic set of subscribers. // Subscribers can join and leave at any time (0 to N subscribers). ⋮---- // Usage example: ⋮---- // // Create a hub for string messages with custom buffer size // hub := broadcaster.NewHub[string]( // broadcaster.WithBufferSize[string](100), // ) ⋮---- // // Subscribe to receive messages // ch := hub.Subscribe("subscriber-1") // defer hub.Unsubscribe("subscriber-1") ⋮---- // // Receive messages in a goroutine // go func() { // for msg := range ch { // fmt.Println("Received:", msg) // } // }() ⋮---- // // Broadcast to all subscribers (non-blocking) // hub.Broadcast("Hello, World!") ⋮---- // // Check subscriber count // count := hub.Count() // fmt.Printf("Active subscribers: %d\n", count) ⋮---- // Thread Safety: ⋮---- // All Hub methods are thread-safe and can be called concurrently from multiple goroutines. ⋮---- // Backpressure Handling: ⋮---- // The Hub uses buffered channels for each subscriber. If a subscriber's channel buffer is full, // the Broadcast method will drop the message for that subscriber (non-blocking). // Use BroadcastWait if you need to ensure all subscribers receive the message (blocking). package broadcaster ```` ## File: internal/usecase/broadcaster/hub_test.go ````go package broadcaster ⋮---- import ( "sync" "testing" "time" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) ⋮---- "sync" "testing" "time" ⋮---- "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ⋮---- func TestHub_SubscribeUnsubscribe(t *testing.T) ⋮---- // Subscribe ⋮---- // Subscribe another ⋮---- // Unsubscribe ⋮---- func TestHub_SubscribeIdempotent(t *testing.T) ⋮---- // Subscribe twice with same ID ⋮---- // Should return same channel ⋮---- func TestHub_BroadcastToAll(t *testing.T) ⋮---- // Subscribe multiple subscribers ⋮---- // Broadcast message ⋮---- // All should receive the message ⋮---- func TestHub_BroadcastWithNoSubscribers(t *testing.T) ⋮---- // Should not panic ⋮---- func TestHub_BroadcastDropsWhenBufferFull(t *testing.T) ⋮---- // Fill the buffer ⋮---- hub.Broadcast("msg2") // This should be dropped ⋮---- // Read one message ⋮---- // Channel should be empty now ⋮---- // Expected - no more messages ⋮---- func TestHub_BroadcastWaitBlocks(t *testing.T) ⋮---- // BroadcastWait should block until we read ⋮---- // Give it time to block ⋮---- // Should still be blocking ⋮---- // Expected ⋮---- // Read from channel to unblock ⋮---- // Now should complete ⋮---- func TestHub_ConcurrentAccess(t *testing.T) ⋮---- var wg sync.WaitGroup ⋮---- // Start subscribers ⋮---- // Start broadcasting ⋮---- // Start receiving ⋮---- func TestHub_UnsubscribeClosesChannel(t *testing.T) ⋮---- // Channel should be closed ⋮---- func TestHub_Close(t *testing.T) ⋮---- // All channels should be closed ⋮---- // Count should be 0 ⋮---- func TestHub_WithOptions(t *testing.T) ⋮---- func TestHub_BroadcastAfterUnsubscribe(t *testing.T) ⋮---- // Unsubscribe one ⋮---- // Broadcast should only go to remaining subscriber ⋮---- // sub2 should receive ⋮---- // sub1 should be closed ```` ## File: internal/usecase/broadcaster/hub.go ````go package broadcaster ⋮---- import ( "log/slog" "sync" ) ⋮---- "log/slog" "sync" ⋮---- // Hub is a generic broadcaster that manages dynamic fan-out of messages to subscribers // T is the type of messages being broadcast type Hub[T any] struct { mu sync.RWMutex subscribers map[string]*subscriber[T] bufferSize int } ⋮---- // subscriber represents a single subscriber with its channel type subscriber[T any] struct { id string ch chan T stopped bool mu sync.Mutex } ⋮---- // HubOption configures the Hub type HubOption[T any] func(*Hub[T]) ⋮---- // WithBufferSize sets the buffer size for subscriber channels func WithBufferSize[T any](size int) HubOption[T] ⋮---- // NewHub creates a new Hub with optional configuration func NewHub[T any](opts ...HubOption[T]) *Hub[T] ⋮---- bufferSize: 100, // default buffer size ⋮---- // Subscribe adds a new subscriber with the given ID and returns the channel to receive messages // If a subscriber with the same ID already exists, it returns the existing channel func (h *Hub[T]) Subscribe(id string) chan T ⋮---- // Check if subscriber already exists ⋮---- // Unsubscribe removes a subscriber and closes its channel func (h *Hub[T]) Unsubscribe(id string) ⋮---- // Broadcast sends a message to all active subscribers // Slow subscribers will have messages dropped (non-blocking send) func (h *Hub[T]) Broadcast(msg T) ⋮---- // successfully sent ⋮---- // channel is full, drop message ⋮---- // BroadcastWait sends a message to all active subscribers and waits for all sends to complete // This is a blocking operation that ensures all subscribers receive the message func (h *Hub[T]) BroadcastWait(msg T) ⋮---- // Blocking send ⋮---- // Count returns the number of active subscribers func (h *Hub[T]) Count() int ⋮---- // Close unsubscribes all subscribers and cleans up resources func (h *Hub[T]) Close() ```` ## File: internal/usecase/entity-processor/mocks/entity_processor.go ````go // Code generated by MockGen. DO NOT EDIT. // Source: entity_processor.go // // Generated by this command: ⋮---- // mockgen -source=entity_processor.go -destination=mocks/entity_processor.go -package=mocks ⋮---- // Package mocks is a generated GoMock package. package mocks ⋮---- import ( context "context" reflect "reflect" common "github.com/ethereum/go-ethereum/common" entity "github.com/symbioticfi/relay/symbiotic/entity" gomock "go.uber.org/mock/gomock" ) ⋮---- context "context" reflect "reflect" ⋮---- common "github.com/ethereum/go-ethereum/common" entity "github.com/symbioticfi/relay/symbiotic/entity" gomock "go.uber.org/mock/gomock" ⋮---- // MockRepository is a mock of Repository interface. type MockRepository struct { ctrl *gomock.Controller recorder *MockRepositoryMockRecorder isgomock struct{} ⋮---- // MockRepositoryMockRecorder is the mock recorder for MockRepository. type MockRepositoryMockRecorder struct { mock *MockRepository } ⋮---- // NewMockRepository creates a new mock instance. func NewMockRepository(ctrl *gomock.Controller) *MockRepository ⋮---- // EXPECT returns an object that allows the caller to indicate expected use. func (m *MockRepository) EXPECT() *MockRepositoryMockRecorder ⋮---- // GetAggregationProof mocks base method. func (m *MockRepository) GetAggregationProof(ctx context.Context, requestID common.Hash) (entity.AggregationProof, error) ⋮---- // GetAggregationProof indicates an expected call of GetAggregationProof. ⋮---- // GetSignatureByIndex mocks base method. func (m *MockRepository) GetSignatureByIndex(ctx context.Context, requestID common.Hash, validatorIndex uint32) (entity.Signature, error) ⋮---- // GetSignatureByIndex indicates an expected call of GetSignatureByIndex. ⋮---- // GetValidatorByKey mocks base method. func (m *MockRepository) GetValidatorByKey(ctx context.Context, epoch entity.Epoch, keyTag entity.KeyTag, publicKey []byte) (entity.Validator, uint32, error) ⋮---- // GetValidatorByKey indicates an expected call of GetValidatorByKey. ⋮---- // GetValidatorSetByEpoch mocks base method. func (m *MockRepository) GetValidatorSetByEpoch(ctx context.Context, epoch entity.Epoch) (entity.ValidatorSet, error) ⋮---- // GetValidatorSetByEpoch indicates an expected call of GetValidatorSetByEpoch. ⋮---- // SaveProof mocks base method. func (m *MockRepository) SaveProof(ctx context.Context, aggregationProof entity.AggregationProof) error ⋮---- // SaveProof indicates an expected call of SaveProof. ⋮---- // SaveSignature mocks base method. func (m *MockRepository) SaveSignature(ctx context.Context, signature entity.Signature, validator entity.Validator, activeIndex uint32) error ⋮---- // SaveSignature indicates an expected call of SaveSignature. ⋮---- // MockAggregator is a mock of Aggregator interface. type MockAggregator struct { ctrl *gomock.Controller recorder *MockAggregatorMockRecorder isgomock struct{} ⋮---- // MockAggregatorMockRecorder is the mock recorder for MockAggregator. type MockAggregatorMockRecorder struct { mock *MockAggregator } ⋮---- // NewMockAggregator creates a new mock instance. func NewMockAggregator(ctrl *gomock.Controller) *MockAggregator ⋮---- // Verify mocks base method. func (m *MockAggregator) Verify(valset entity.ValidatorSet, keyTag entity.KeyTag, aggregationProof entity.AggregationProof) (bool, error) ⋮---- // Verify indicates an expected call of Verify. ⋮---- // MockAggProofSignal is a mock of AggProofSignal interface. type MockAggProofSignal struct { ctrl *gomock.Controller recorder *MockAggProofSignalMockRecorder isgomock struct{} ⋮---- // MockAggProofSignalMockRecorder is the mock recorder for MockAggProofSignal. type MockAggProofSignalMockRecorder struct { mock *MockAggProofSignal } ⋮---- // NewMockAggProofSignal creates a new mock instance. func NewMockAggProofSignal(ctrl *gomock.Controller) *MockAggProofSignal ⋮---- // Emit mocks base method. func (m *MockAggProofSignal) Emit(payload entity.AggregationProof) error ⋮---- // Emit indicates an expected call of Emit. ```` ## File: internal/usecase/entity-processor/entity_processor_test.go ````go package entity_processor ⋮---- import ( "crypto/rand" "math/big" "testing" "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" "golang.org/x/sync/errgroup" "github.com/symbioticfi/relay/internal/client/repository/badger" "github.com/symbioticfi/relay/internal/entity" "github.com/symbioticfi/relay/internal/usecase/entity-processor/mocks" "github.com/symbioticfi/relay/pkg/signals" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" ) ⋮---- "crypto/rand" "math/big" "testing" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" "golang.org/x/sync/errgroup" ⋮---- "github.com/symbioticfi/relay/internal/client/repository/badger" "github.com/symbioticfi/relay/internal/entity" "github.com/symbioticfi/relay/internal/usecase/entity-processor/mocks" "github.com/symbioticfi/relay/pkg/signals" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" ⋮---- func TestEntityProcessor_ProcessSignature(t *testing.T) ⋮---- // Setup validator set header with high quorum threshold (1000) ⋮---- // Setup validator set header with low quorum threshold (50) ⋮---- expectPendingExists: false, // Should be removed due to quorum ⋮---- // Setup validator set header with high quorum threshold ⋮---- // Setup validator set header with quorum threshold of 150 ⋮---- // First signature - not enough for quorum ⋮---- // Verify pending exists after first signature ⋮---- // Return second signature that will reach quorum ⋮---- expectPendingExists: false, // Should be removed after reaching quorum ⋮---- // Don't setup validator set header - will cause error ⋮---- // Verify signature map was created/updated ⋮---- // Verify at least one validator is present in the bitmap ⋮---- // Verify pending collection state ⋮---- func TestEntityProcessor_ProcessSignature_ConcurrentSignatures(t *testing.T) ⋮---- // Setup validator set header with quorum threshold of 300 ⋮---- // Simulate 4 concurrent signatures ⋮---- // Process signatures sequentially (testing transaction consistency) ⋮---- // Verify final state ⋮---- // Since all signatures use the same key tag, they would resolve to the same validator // So we should have at least one validator present ⋮---- // Pending collection should be empty (quorum reached) ⋮---- func TestEntityProcessor_ProcessSignature_Conflict(t *testing.T) ⋮---- func TestEntityProcessor_ProcessSignature_DuplicateSignatureForSameValidator(t *testing.T) ⋮---- // First signature should succeed ⋮---- // Duplicate signature should fail ⋮---- func TestEntityProcessor_ProcessSignature_ExactQuorumThreshold(t *testing.T) ⋮---- // Set quorum threshold to exactly 100 ⋮---- // Should reach quorum and remove from pending ⋮---- // Helper functions ⋮---- func createMockAggregator(t *testing.T) *mocks.MockAggregator ⋮---- // Default behavior: return true for verification ⋮---- func createMockAggProofSignal(t *testing.T) *mocks.MockAggProofSignal ⋮---- // Default behavior: return nil for emit ⋮---- func createMockSignatureProcessedSignal(t *testing.T) *signals.Signal[symbiotic.Signature] ⋮---- func setupTestRepository(t *testing.T) *badger.Repository ⋮---- func randomBytes(t *testing.T, n int) []byte ⋮---- func computeMessageHash(t *testing.T, keyTag symbiotic.KeyTag, message []byte) []byte ⋮---- func randomSignatureRequest(t *testing.T, epoch symbiotic.Epoch) symbiotic.SignatureRequest ⋮---- func randomSignatureExtendedForKeyWithParams(t *testing.T, privateKey crypto.PrivateKey, req symbiotic.SignatureRequest) symbiotic.Signature ⋮---- // signatureExtendedForRequest creates a Signature for a given SignatureRequest using the same message func signatureExtendedForRequest(t *testing.T, privateKey crypto.PrivateKey, req symbiotic.SignatureRequest) symbiotic.Signature ⋮---- func createValidatorSetWithCount(t *testing.T, epoch symbiotic.Epoch, quorumThreshold *big.Int, validatorCount int) (symbiotic.ValidatorSet, []map[symbiotic.KeyTag]crypto.PrivateKey) ⋮---- // Generate a valid key for the validator ⋮---- Payload: privateKeyBLS.PublicKey().OnChain(), // Use the actual on-chain representation ⋮---- Payload: privateKeyECDSA.PublicKey().OnChain(), // Use the actual on-chain representation ⋮---- validatorsList.SortByOperatorAddressAsc() // Sort validators by operator address ⋮---- func setupValidatorSetHeader(t *testing.T, repo *badger.Repository, epoch symbiotic.Epoch, quorumThreshold *big.Int) (symbiotic.ValidatorSet, []map[symbiotic.KeyTag]crypto.PrivateKey) ⋮---- vs, privateKeys := createValidatorSetWithCount(t, epoch, quorumThreshold, 4) // Default to 4 validators for backward compatibility ⋮---- func TestEntityProcessor_ProcessAggregationProof_SuccessfullyProcesses(t *testing.T) ⋮---- // Setup validator set for this epoch (required by ProcessAggregationProof) ⋮---- // Process aggregation proof ⋮---- // Verify aggregation proof was saved ⋮---- // Verify pending aggregation proof was removed ⋮---- func TestEntityProcessor_ProcessAggregationProof_HandlesMissingPendingGracefully(t *testing.T) ⋮---- // Process aggregation proof without pending entry (should succeed) ⋮---- // Verify aggregation proof was still saved ⋮---- func TestEntityProcessor_ProcessAggregationProof_FailsWhenAlreadyExists(t *testing.T) ⋮---- // Attempt to process same aggregation proof should fail ⋮---- func TestEntityProcessor_ProcessSignature_SavesAggregationProofPendingForAggregationKeys(t *testing.T) ⋮---- // Process signature ⋮---- // Verify aggregation proof pending was also saved ⋮---- func TestEntityProcessor_ProcessSignature_SaveAggregationProofPendingForNonAggregationKeys(t *testing.T) ⋮---- req.KeyTag = symbiotic.KeyTag(0x10) // Ensure it's NOT an aggregation key (EcdsaSecp256k1) ⋮---- // Verify signature request was saved but NOT to pending collection ⋮---- // Verify no pending aggregation proof requests ⋮---- func TestEntityProcessor_ProcessSignature_FullSignatureToAggregationProofFlow(t *testing.T) ⋮---- // Step 1: Process signature (should create pending aggregation proof) ⋮---- // Verify pending aggregation proof exists ⋮---- // Step 2: Process aggregation proof (should remove from pending) ```` ## File: internal/usecase/entity-processor/entity_processor.go ````go package entity_processor ⋮---- import ( "context" "log/slog" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" validate "github.com/go-playground/validator/v10" "github.com/symbioticfi/relay/internal/entity" "github.com/symbioticfi/relay/pkg/log" "github.com/symbioticfi/relay/pkg/signals" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" "log/slog" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" validate "github.com/go-playground/validator/v10" ⋮---- "github.com/symbioticfi/relay/internal/entity" "github.com/symbioticfi/relay/pkg/log" "github.com/symbioticfi/relay/pkg/signals" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- //go:generate mockgen -source=entity_processor.go -destination=mocks/entity_processor.go -package=mocks ⋮---- // Repository defines the interface needed by the entity processor type Repository interface { SaveSignature(ctx context.Context, signature symbiotic.Signature, validator symbiotic.Validator, activeIndex uint32) error GetSignatureByIndex(ctx context.Context, requestID common.Hash, validatorIndex uint32) (symbiotic.Signature, error) GetValidatorByKey(ctx context.Context, epoch symbiotic.Epoch, keyTag symbiotic.KeyTag, publicKey []byte) (symbiotic.Validator, uint32, error) GetValidatorSetByEpoch(ctx context.Context, epoch symbiotic.Epoch) (symbiotic.ValidatorSet, error) GetAggregationProof(ctx context.Context, requestID common.Hash) (symbiotic.AggregationProof, error) SaveProof(ctx context.Context, aggregationProof symbiotic.AggregationProof) error } ⋮---- type Aggregator interface { Verify(valset symbiotic.ValidatorSet, keyTag symbiotic.KeyTag, aggregationProof symbiotic.AggregationProof) (bool, error) } ⋮---- type AggProofSignal interface { Emit(payload symbiotic.AggregationProof) error } ⋮---- type Config struct { Repo Repository `validate:"required"` Aggregator Aggregator `validate:"required"` AggProofSignal AggProofSignal `validate:"required"` SignatureProcessedSignal *signals.Signal[symbiotic.Signature] `validate:"required"` } ⋮---- func (c Config) Validate() error ⋮---- // EntityProcessor handles both signature and aggregation proof processing with SignatureMap operations type EntityProcessor struct { cfg Config } ⋮---- // NewEntityProcessor creates a new entity processor func NewEntityProcessor(cfg Config) (*EntityProcessor, error) ⋮---- // ProcessSignature processes a signature with SignatureMap operations and optionally saves SignatureRequest func (s *EntityProcessor) ProcessSignature(ctx context.Context, signature symbiotic.Signature, self bool) error ⋮---- // if self signature ignore validator check and signature existence check ⋮---- // check if signature already exists ⋮---- // Emit signal after successful processing ⋮---- // ProcessAggregationProof processes an aggregation proof by saving it and removing from pending collection func (s *EntityProcessor) ProcessAggregationProof(ctx context.Context, aggregationProof symbiotic.AggregationProof) error ⋮---- // Emit signal after successful save ```` ## File: internal/usecase/key-provider/cache_key_provider.go ````go package keyprovider ⋮---- import ( "sync" "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "sync" ⋮---- "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- type CacheKeyProvider struct { KeyProvider nodeKeyMap *sync.Map // map[keyTag]CompactPublicKey } ⋮---- nodeKeyMap *sync.Map // map[keyTag]CompactPublicKey ⋮---- func NewCacheKeyProvider(kp KeyProvider) *CacheKeyProvider ⋮---- func (c *CacheKeyProvider) GetOnchainKeyFromCache(keyTag entity.KeyTag) (entity.CompactPublicKey, error) ```` ## File: internal/usecase/key-provider/env_provider.go ````go package keyprovider ⋮---- import ( "encoding/base64" "os" "strings" "sync" "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" "github.com/go-errors/errors" ) ⋮---- "encoding/base64" "os" "strings" "sync" ⋮---- "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" ⋮---- "github.com/go-errors/errors" ⋮---- type EnvKeyProvider struct { cache map[string]crypto.PrivateKey mu sync.RWMutex } ⋮---- func NewEnvKeyProvider() *EnvKeyProvider ⋮---- func (e *EnvKeyProvider) GetPrivateKey(keyTag symbiotic.KeyTag) (crypto.PrivateKey, error) ⋮---- func (e *EnvKeyProvider) GetPrivateKeyByNamespaceTypeId( namespace string, keyType symbiotic.KeyType, keyId int, ) (crypto.PrivateKey, error) ⋮---- func (e *EnvKeyProvider) GetPrivateKeyByAlias(alias string) (crypto.PrivateKey, error) ⋮---- func (e *EnvKeyProvider) HasKey(keyTag symbiotic.KeyTag) (bool, error) ⋮---- func (e *EnvKeyProvider) HasKeyByAlias(alias string) (bool, error) ⋮---- func (e *EnvKeyProvider) HasKeyByNamespaceTypeId(namespace string, keyType symbiotic.KeyType, id int) (bool, error) ```` ## File: internal/usecase/key-provider/key_provider.go ````go package keyprovider ⋮---- import ( "strconv" "strings" "github.com/go-errors/errors" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" ) ⋮---- "strconv" "strings" ⋮---- "github.com/go-errors/errors" ⋮---- symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" ⋮---- const ( SYMBIOTIC_KEY_NAMESPACE = "symb" EVM_KEY_NAMESPACE = "evm" P2P_KEY_NAMESPACE = "p2p" // DEFAULT_EVM_CHAIN_ID chain id used to identify the default key for all chains DEFAULT_EVM_CHAIN_ID = 0 P2P_HOST_IDENTITY_KEY_ID = 1 ) ⋮---- // DEFAULT_EVM_CHAIN_ID chain id used to identify the default key for all chains ⋮---- type KeyProvider interface { GetPrivateKey(keyTag symbiotic.KeyTag) (crypto.PrivateKey, error) GetPrivateKeyByAlias(alias string) (crypto.PrivateKey, error) GetPrivateKeyByNamespaceTypeId(namespace string, keyType symbiotic.KeyType, id int) (crypto.PrivateKey, error) HasKey(keyTag symbiotic.KeyTag) (bool, error) HasKeyByAlias(alias string) (bool, error) HasKeyByNamespaceTypeId(namespace string, keyType symbiotic.KeyType, id int) (bool, error) } ⋮---- func KeyTagToAliasWithNS(namespace string, keyTag symbiotic.KeyTag) (string, error) ⋮---- // https://github.com/symbioticfi/middleware-sdk-mirror/blob/change-header/src/contracts/libraries/utils/KeyTags.sol#L24-L40 ⋮---- func KeyTagToAlias(keyTag symbiotic.KeyTag) (string, error) ⋮---- func ToAlias(namespace string, keyType symbiotic.KeyType, keyId int) (string, error) ⋮---- //nolint:revive // we need to return the ns too func AliasToKeyTypeId(alias string) (string, symbiotic.KeyType, int, error) ```` ## File: internal/usecase/key-provider/key_store_provider_test.go ````go package keyprovider ⋮---- import ( "testing" "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" "github.com/stretchr/testify/require" ) ⋮---- "testing" ⋮---- "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" ⋮---- "github.com/stretchr/testify/require" ⋮---- func TestNewKeystore(t *testing.T) ⋮---- func TestAddKey(t *testing.T) ⋮---- func TestForceAddKey(t *testing.T) ⋮---- func TestCreateAndReopen(t *testing.T) ⋮---- func TestDefaultEVMKey(t *testing.T) ⋮---- // shouldn't work for other chains ```` ## File: internal/usecase/key-provider/key_store_provider.go ````go package keyprovider ⋮---- import ( "log/slog" "os" "path/filepath" "time" "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" "github.com/go-errors/errors" "github.com/pavlo-v-chernykh/keystore-go/v4" ) ⋮---- "log/slog" "os" "path/filepath" "time" ⋮---- "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" ⋮---- "github.com/go-errors/errors" "github.com/pavlo-v-chernykh/keystore-go/v4" ⋮---- type KeystoreProvider struct { ks keystore.KeyStore filePath string } ⋮---- func NewKeystoreProvider(filePath, password string) (*KeystoreProvider, error) ⋮---- func (k *KeystoreProvider) GetAliases() []string ⋮---- func (k *KeystoreProvider) GetPrivateKey(keyTag symbiotic.KeyTag) (crypto.PrivateKey, error) ⋮---- func (k *KeystoreProvider) GetPrivateKeyByAlias(alias string) (crypto.PrivateKey, error) ⋮---- func (k *KeystoreProvider) GetPrivateKeyByNamespaceTypeId(namespace string, keyType symbiotic.KeyType, id int) (crypto.PrivateKey, error) ⋮---- // For EVM keys, we check for default key with chain ID 0 if the requested chain id is absent ⋮---- func (k *KeystoreProvider) HasKey(keyTag symbiotic.KeyTag) (bool, error) ⋮---- func (k *KeystoreProvider) HasKeyByAlias(alias string) (bool, error) ⋮---- func (k *KeystoreProvider) HasKeyByNamespaceTypeId(namespace string, keyType symbiotic.KeyType, id int) (bool, error) ⋮---- func (k *KeystoreProvider) AddKey(namespace string, keyTag symbiotic.KeyTag, privateKey crypto.PrivateKey, password string, force bool) error ⋮---- func (k *KeystoreProvider) DeleteKey(keyTag symbiotic.KeyTag, password string) error ⋮---- func (k *KeystoreProvider) AddKeyByNamespaceTypeId(ns string, tp symbiotic.KeyType, id int, privateKey crypto.PrivateKey, password string, force bool) error ⋮---- func (k *KeystoreProvider) DeleteKeyByNamespaceTypeId(ns string, tp symbiotic.KeyType, id int, password string) error ⋮---- func (k *KeystoreProvider) dump(password string) error ```` ## File: internal/usecase/key-provider/simple_key_provider.go ````go package keyprovider ⋮---- import ( "log/slog" "sync" "github.com/go-errors/errors" "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" ) ⋮---- "log/slog" "sync" ⋮---- "github.com/go-errors/errors" ⋮---- "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" ⋮---- type SimpleKeystoreProvider struct { keys map[string]crypto.PrivateKey mu sync.RWMutex } ⋮---- func NewSimpleKeystoreProvider() (*SimpleKeystoreProvider, error) ⋮---- func (k *SimpleKeystoreProvider) GetPrivateKey(keyTag symbiotic.KeyTag) (crypto.PrivateKey, error) ⋮---- func (k *SimpleKeystoreProvider) GetPrivateKeyByAlias(alias string) (crypto.PrivateKey, error) ⋮---- func (k *SimpleKeystoreProvider) GetPrivateKeyByNamespaceTypeId(namespace string, keyType symbiotic.KeyType, id int) (crypto.PrivateKey, error) ⋮---- // For EVM keys, we check for default key with chain ID 0 if the requested chain id is absent ⋮---- func (k *SimpleKeystoreProvider) HasKey(keyTag symbiotic.KeyTag) (bool, error) ⋮---- func (k *SimpleKeystoreProvider) HasKeyByAlias(alias string) (bool, error) ⋮---- func (k *SimpleKeystoreProvider) HasKeyByNamespaceTypeId(namespace string, keyType symbiotic.KeyType, id int) (bool, error) ⋮---- func (k *SimpleKeystoreProvider) AddKey(keyTag symbiotic.KeyTag, privateKey crypto.PrivateKey) error ⋮---- func (k *SimpleKeystoreProvider) AddKeyByNamespaceTypeId(ns string, tp symbiotic.KeyType, id int, privateKey crypto.PrivateKey) error ⋮---- func (k *SimpleKeystoreProvider) DeleteKey(keyTag symbiotic.KeyTag) error ```` ## File: internal/usecase/metrics/metrics_app.go ````go package metrics ⋮---- import ( "context" "time" "github.com/go-errors/errors" "github.com/go-playground/validator/v10" "github.com/symbioticfi/relay/pkg/log" "github.com/symbioticfi/relay/pkg/server" ) ⋮---- "context" "time" ⋮---- "github.com/go-errors/errors" "github.com/go-playground/validator/v10" ⋮---- "github.com/symbioticfi/relay/pkg/log" "github.com/symbioticfi/relay/pkg/server" ⋮---- type AppConfig struct { Address string `validate:"required"` ReadHeaderTimeout time.Duration `validate:"required,gt=0"` } ⋮---- func (c AppConfig) Validate() error ⋮---- type App struct { srv *server.MetricsServer } ⋮---- func NewApp(cfg AppConfig) (*App, error) ⋮---- func (a *App) Start(ctx context.Context) error ```` ## File: internal/usecase/metrics/metrics_grpc.go ````go package metrics ⋮---- import ( "context" "time" "github.com/prometheus/client_golang/prometheus" "google.golang.org/grpc" "google.golang.org/grpc/status" ) ⋮---- "context" "time" ⋮---- "github.com/prometheus/client_golang/prometheus" "google.golang.org/grpc" "google.golang.org/grpc/status" ⋮---- // GRPCMetrics holds Prometheus metrics for gRPC requests type GRPCMetrics struct { requestDuration *prometheus.HistogramVec requestsTotal *prometheus.CounterVec requestsInFlight *prometheus.GaugeVec } ⋮---- // UnaryServerInterceptor returns a gRPC unary interceptor for metrics collection func (m *Metrics) UnaryServerInterceptor() grpc.UnaryServerInterceptor ⋮---- // Track in-flight requests ⋮---- // Start timing ⋮---- // Call the handler ⋮---- // Calculate duration ⋮---- // Determine status code ⋮---- // Record metrics ⋮---- // StreamServerInterceptor returns a gRPC stream interceptor for metrics collection func (m *Metrics) StreamServerInterceptor() grpc.StreamServerInterceptor ```` ## File: internal/usecase/metrics/metrics.go ````go package metrics ⋮---- import ( "math/big" "strconv" "time" "github.com/prometheus/client_golang/prometheus" ) ⋮---- "math/big" "strconv" "time" ⋮---- "github.com/prometheus/client_golang/prometheus" ⋮---- type Config struct { Registerer prometheus.Registerer } ⋮---- type Metrics struct { GRPCMetrics // signatures and aggregation pkSignDuration prometheus.Summary appSignDuration prometheus.Summary onlyAggregateDuration prometheus.Summary appAggregationDuration prometheus.Summary aggregationProofSize *prometheus.HistogramVec // p2p p2pPeerMessagesSent *prometheus.CounterVec p2pSyncProcessedSignatures *prometheus.CounterVec p2pSyncRequestedHashes prometheus.Counter p2pSyncProcessedAggProofs *prometheus.CounterVec p2pSyncRequestedAggProofHashes prometheus.Counter // repo repoQueryDuration *prometheus.HistogramVec repoQueryTotalDuration *prometheus.HistogramVec // evm evmMethodCall *prometheus.HistogramVec evmCommitGasUsed *prometheus.HistogramVec evmCommitGasPrice *prometheus.HistogramVec } ⋮---- // signatures and aggregation ⋮---- // p2p ⋮---- // repo ⋮---- // evm ⋮---- func New(cfg Config) *Metrics ⋮---- func newMetrics(registerer prometheus.Registerer) *Metrics ⋮---- var all []prometheus.Collector ⋮---- 256, // 256B 512, // 512B 1024, // 1KB 2048, // 2KB 4096, // 4KB 8192, // 8KB 16384, // 16KB 32768, // 32KB 65536, // 64KB 131072, // 128KB 262144, // 256KB 393216, // 384KB 524288, // 512KB 786432, // 768KB 1048576, // 1MB ⋮---- func (m *Metrics) ObservePKSignDuration(d time.Duration) ⋮---- func (m *Metrics) ObserveAppSignDuration(d time.Duration) ⋮---- func (m *Metrics) ObserveOnlyAggregateDuration(d time.Duration) ⋮---- func (m *Metrics) ObserveAppAggregateDuration(d time.Duration) ⋮---- func (m *Metrics) ObserveP2PPeerMessageSent(messageType, status string) ⋮---- func (m *Metrics) ObserveEVMMethodCall(method string, chainID uint64, status string, d time.Duration) ⋮---- func (m *Metrics) ObserveCommitValsetHeaderParams(chainID uint64, gasUsed uint64, effectiveGasPrice *big.Int) ⋮---- func (m *Metrics) ObserveP2PSyncSignaturesProcessed(resultType string, count int) ⋮---- func (m *Metrics) ObserveP2PSyncRequestedHashes(count int) ⋮---- func (m *Metrics) ObserveP2PSyncAggregationProofsProcessed(resultType string, count int) ⋮---- func (m *Metrics) ObserveP2PSyncRequestedAggregationProofs(count int) ⋮---- func (m *Metrics) ObserveAggregationProofSize(proofSizeBytes int, activeValidatorCount int) ⋮---- func (m *Metrics) ObserveRepoQueryDuration(queryName, status string, d time.Duration) ⋮---- func (m *Metrics) ObserveRepoQueryTotalDuration(queryName, status string, d time.Duration) ```` ## File: internal/usecase/signature-listener/mocks/signature_listener_uc.go ````go // Code generated by MockGen. DO NOT EDIT. // Source: signature_listener_uc.go // // Generated by this command: ⋮---- // mockgen -source=signature_listener_uc.go -destination=mocks/signature_listener_uc.go -package=mocks ⋮---- // Package mocks is a generated GoMock package. package mocks ⋮---- import ( context "context" reflect "reflect" entity "github.com/symbioticfi/relay/symbiotic/entity" gomock "go.uber.org/mock/gomock" ) ⋮---- context "context" reflect "reflect" ⋮---- entity "github.com/symbioticfi/relay/symbiotic/entity" gomock "go.uber.org/mock/gomock" ⋮---- // Mockrepo is a mock of repo interface. type Mockrepo struct { ctrl *gomock.Controller recorder *MockrepoMockRecorder isgomock struct{} ⋮---- // MockrepoMockRecorder is the mock recorder for Mockrepo. type MockrepoMockRecorder struct { mock *Mockrepo } ⋮---- // NewMockrepo creates a new mock instance. func NewMockrepo(ctrl *gomock.Controller) *Mockrepo ⋮---- // EXPECT returns an object that allows the caller to indicate expected use. func (m *Mockrepo) EXPECT() *MockrepoMockRecorder ⋮---- // GetValidatorByKey mocks base method. func (m *Mockrepo) GetValidatorByKey(ctx context.Context, epoch entity.Epoch, keyTag entity.KeyTag, publicKey []byte) (entity.Validator, uint32, error) ⋮---- // GetValidatorByKey indicates an expected call of GetValidatorByKey. ⋮---- // GetValidatorSetByEpoch mocks base method. func (m *Mockrepo) GetValidatorSetByEpoch(ctx context.Context, epoch entity.Epoch) (entity.ValidatorSet, error) ⋮---- // GetValidatorSetByEpoch indicates an expected call of GetValidatorSetByEpoch. ⋮---- // MockentityProcessor is a mock of entityProcessor interface. type MockentityProcessor struct { ctrl *gomock.Controller recorder *MockentityProcessorMockRecorder isgomock struct{} ⋮---- // MockentityProcessorMockRecorder is the mock recorder for MockentityProcessor. type MockentityProcessorMockRecorder struct { mock *MockentityProcessor } ⋮---- // NewMockentityProcessor creates a new mock instance. func NewMockentityProcessor(ctrl *gomock.Controller) *MockentityProcessor ⋮---- // ProcessSignature mocks base method. func (m *MockentityProcessor) ProcessSignature(ctx context.Context, signature entity.Signature, self bool) error ⋮---- // ProcessSignature indicates an expected call of ProcessSignature. ```` ## File: internal/usecase/signature-listener/signature_listener_uc_test.go ````go package signature_listener ⋮---- import ( "crypto/rand" "math/big" "testing" "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" "github.com/symbioticfi/relay/internal/client/repository/badger" intEntity "github.com/symbioticfi/relay/internal/entity" entity_processor "github.com/symbioticfi/relay/internal/usecase/entity-processor" "github.com/symbioticfi/relay/internal/usecase/entity-processor/mocks" "github.com/symbioticfi/relay/pkg/signals" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" ) ⋮---- "crypto/rand" "math/big" "testing" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" ⋮---- "github.com/symbioticfi/relay/internal/client/repository/badger" intEntity "github.com/symbioticfi/relay/internal/entity" entity_processor "github.com/symbioticfi/relay/internal/usecase/entity-processor" "github.com/symbioticfi/relay/internal/usecase/entity-processor/mocks" "github.com/symbioticfi/relay/pkg/signals" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" ⋮---- func TestHandleSignatureReceivedMessage_HappyPath(t *testing.T) ⋮---- // Create real private key for signing ⋮---- // Create signature with the private key ⋮---- // Create validator set with the matching public key ⋮---- // Create P2P message with real signature ⋮---- // Execute ⋮---- // Verify that signature was saved ⋮---- // Verify the signature matches what we expect ⋮---- // Verify that signature map was updated ⋮---- type testSetup struct { repo *badger.Repository useCase *SignatureListenerUseCase } ⋮---- func newTestSetup(t *testing.T) *testSetup ⋮---- // Create mock aggregator for entity processor ⋮---- // Create mock aggregation proof signal for entity processor ⋮---- // Create mock signature processed signal for entity processor ⋮---- func newPrivateKey(t *testing.T) crypto.PrivateKey ⋮---- func (setup *testSetup) createTestValidatorSetWithKey(t *testing.T, privateKey crypto.PrivateKey) symbiotic.ValidatorSet ⋮---- // Save the validator set to the repository ⋮---- func createTestP2PMessageWithSignature(privateKey crypto.PrivateKey, hash []byte, signature []byte) intEntity.P2PMessage[symbiotic.Signature] ```` ## File: internal/usecase/signature-listener/signature_listener_uc.go ````go package signature_listener ⋮---- import ( "context" "log/slog" "github.com/go-errors/errors" validate "github.com/go-playground/validator/v10" "github.com/symbioticfi/relay/internal/entity" "github.com/symbioticfi/relay/pkg/log" "github.com/symbioticfi/relay/pkg/signals" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" "log/slog" ⋮---- "github.com/go-errors/errors" validate "github.com/go-playground/validator/v10" ⋮---- "github.com/symbioticfi/relay/internal/entity" "github.com/symbioticfi/relay/pkg/log" "github.com/symbioticfi/relay/pkg/signals" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- //go:generate mockgen -source=signature_listener_uc.go -destination=mocks/signature_listener_uc.go -package=mocks ⋮---- type repo interface { GetValidatorByKey(ctx context.Context, epoch symbiotic.Epoch, keyTag symbiotic.KeyTag, publicKey []byte) (symbiotic.Validator, uint32, error) GetValidatorSetByEpoch(ctx context.Context, epoch symbiotic.Epoch) (symbiotic.ValidatorSet, error) } ⋮---- type entityProcessor interface { ProcessSignature(ctx context.Context, signature symbiotic.Signature, self bool) error } ⋮---- type Config struct { Repo repo `validate:"required"` EntityProcessor entityProcessor `validate:"required"` SignalCfg signals.Config `validate:"required"` SelfP2PID string `validate:"required"` } ⋮---- type SignatureListenerUseCase struct { cfg Config } ⋮---- func New(cfg Config) (*SignatureListenerUseCase, error) ⋮---- func (s *SignatureListenerUseCase) HandleSignatureReceivedMessage(ctx context.Context, p2pMsg entity.P2PMessage[symbiotic.Signature]) error ⋮---- // ignore if signature already exists ```` ## File: internal/usecase/signer-app/mocks/signer_app.go ````go // Code generated by MockGen. DO NOT EDIT. // Source: signer_app.go // // Generated by this command: ⋮---- // mockgen -source=signer_app.go -destination=mocks/signer_app.go -package=mocks ⋮---- // Package mocks is a generated GoMock package. package mocks ⋮---- import ( context "context" reflect "reflect" time "time" common "github.com/ethereum/go-ethereum/common" entity "github.com/symbioticfi/relay/symbiotic/entity" crypto "github.com/symbioticfi/relay/symbiotic/usecase/crypto" gomock "go.uber.org/mock/gomock" ) ⋮---- context "context" reflect "reflect" time "time" ⋮---- common "github.com/ethereum/go-ethereum/common" entity "github.com/symbioticfi/relay/symbiotic/entity" crypto "github.com/symbioticfi/relay/symbiotic/usecase/crypto" gomock "go.uber.org/mock/gomock" ⋮---- // Mockrepo is a mock of repo interface. type Mockrepo struct { ctrl *gomock.Controller recorder *MockrepoMockRecorder isgomock struct{} ⋮---- // MockrepoMockRecorder is the mock recorder for Mockrepo. type MockrepoMockRecorder struct { mock *Mockrepo } ⋮---- // NewMockrepo creates a new mock instance. func NewMockrepo(ctrl *gomock.Controller) *Mockrepo ⋮---- // EXPECT returns an object that allows the caller to indicate expected use. func (m *Mockrepo) EXPECT() *MockrepoMockRecorder ⋮---- // GetSignaturePending mocks base method. func (m *Mockrepo) GetSignaturePending(ctx context.Context, limit int) ([]common.Hash, error) ⋮---- // GetSignaturePending indicates an expected call of GetSignaturePending. ⋮---- // GetSignatureRequest mocks base method. func (m *Mockrepo) GetSignatureRequest(ctx context.Context, requestID common.Hash) (entity.SignatureRequest, error) ⋮---- // GetSignatureRequest indicates an expected call of GetSignatureRequest. ⋮---- // GetValidatorSetByEpoch mocks base method. func (m *Mockrepo) GetValidatorSetByEpoch(ctx context.Context, epoch entity.Epoch) (entity.ValidatorSet, error) ⋮---- // GetValidatorSetByEpoch indicates an expected call of GetValidatorSetByEpoch. ⋮---- // RemoveSignaturePending mocks base method. func (m *Mockrepo) RemoveSignaturePending(ctx context.Context, epoch entity.Epoch, requestID common.Hash) error ⋮---- // RemoveSignaturePending indicates an expected call of RemoveSignaturePending. ⋮---- // SaveSignatureRequest mocks base method. func (m *Mockrepo) SaveSignatureRequest(ctx context.Context, requestID common.Hash, req entity.SignatureRequest) error ⋮---- // SaveSignatureRequest indicates an expected call of SaveSignatureRequest. ⋮---- // Mockp2pService is a mock of p2pService interface. type Mockp2pService struct { ctrl *gomock.Controller recorder *Mockp2pServiceMockRecorder isgomock struct{} ⋮---- // Mockp2pServiceMockRecorder is the mock recorder for Mockp2pService. type Mockp2pServiceMockRecorder struct { mock *Mockp2pService } ⋮---- // NewMockp2pService creates a new mock instance. func NewMockp2pService(ctrl *gomock.Controller) *Mockp2pService ⋮---- // BroadcastSignatureGeneratedMessage mocks base method. func (m *Mockp2pService) BroadcastSignatureGeneratedMessage(ctx context.Context, msg entity.Signature) error ⋮---- // BroadcastSignatureGeneratedMessage indicates an expected call of BroadcastSignatureGeneratedMessage. ⋮---- // MockkeyProvider is a mock of keyProvider interface. type MockkeyProvider struct { ctrl *gomock.Controller recorder *MockkeyProviderMockRecorder isgomock struct{} ⋮---- // MockkeyProviderMockRecorder is the mock recorder for MockkeyProvider. type MockkeyProviderMockRecorder struct { mock *MockkeyProvider } ⋮---- // NewMockkeyProvider creates a new mock instance. func NewMockkeyProvider(ctrl *gomock.Controller) *MockkeyProvider ⋮---- // GetOnchainKeyFromCache mocks base method. func (m *MockkeyProvider) GetOnchainKeyFromCache(keyTag entity.KeyTag) (entity.CompactPublicKey, error) ⋮---- // GetOnchainKeyFromCache indicates an expected call of GetOnchainKeyFromCache. ⋮---- // GetPrivateKey mocks base method. func (m *MockkeyProvider) GetPrivateKey(keyTag entity.KeyTag) (crypto.PrivateKey, error) ⋮---- // GetPrivateKey indicates an expected call of GetPrivateKey. ⋮---- // Mockmetrics is a mock of metrics interface. type Mockmetrics struct { ctrl *gomock.Controller recorder *MockmetricsMockRecorder isgomock struct{} ⋮---- // MockmetricsMockRecorder is the mock recorder for Mockmetrics. type MockmetricsMockRecorder struct { mock *Mockmetrics } ⋮---- // NewMockmetrics creates a new mock instance. func NewMockmetrics(ctrl *gomock.Controller) *Mockmetrics ⋮---- // ObserveAppSignDuration mocks base method. func (m *Mockmetrics) ObserveAppSignDuration(d time.Duration) ⋮---- // ObserveAppSignDuration indicates an expected call of ObserveAppSignDuration. ⋮---- // ObservePKSignDuration mocks base method. func (m *Mockmetrics) ObservePKSignDuration(d time.Duration) ⋮---- // ObservePKSignDuration indicates an expected call of ObservePKSignDuration. ⋮---- // MockentityProcessor is a mock of entityProcessor interface. type MockentityProcessor struct { ctrl *gomock.Controller recorder *MockentityProcessorMockRecorder isgomock struct{} ⋮---- // MockentityProcessorMockRecorder is the mock recorder for MockentityProcessor. type MockentityProcessorMockRecorder struct { mock *MockentityProcessor } ⋮---- // NewMockentityProcessor creates a new mock instance. func NewMockentityProcessor(ctrl *gomock.Controller) *MockentityProcessor ⋮---- // ProcessAggregationProof mocks base method. func (m *MockentityProcessor) ProcessAggregationProof(ctx context.Context, proof entity.AggregationProof) error ⋮---- // ProcessAggregationProof indicates an expected call of ProcessAggregationProof. ⋮---- // ProcessSignature mocks base method. func (m *MockentityProcessor) ProcessSignature(ctx context.Context, signature entity.Signature, self bool) error ⋮---- // ProcessSignature indicates an expected call of ProcessSignature. ```` ## File: internal/usecase/signer-app/signer_app_handle_signature_aggregated_message.go ````go package signer_app ⋮---- import ( "context" "log/slog" "github.com/go-errors/errors" "github.com/symbioticfi/relay/internal/entity" "github.com/symbioticfi/relay/pkg/log" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" "log/slog" ⋮---- "github.com/go-errors/errors" ⋮---- "github.com/symbioticfi/relay/internal/entity" "github.com/symbioticfi/relay/pkg/log" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- func (s *SignerApp) HandleSignaturesAggregatedMessage(ctx context.Context, p2pMsg entity.P2PMessage[symbiotic.AggregationProof]) error ⋮---- // if the aggregation proof already exists, we have already seen the message and broadcasted it so short-circuit ```` ## File: internal/usecase/signer-app/signer_app_test.go ````go package signer_app ⋮---- import ( "crypto/rand" "log/slog" "math/big" "testing" "time" "github.com/ethereum/go-ethereum/common" "github.com/samber/lo" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" "github.com/symbioticfi/relay/internal/client/repository/badger" entity_processor "github.com/symbioticfi/relay/internal/usecase/entity-processor" entity_mocks "github.com/symbioticfi/relay/internal/usecase/entity-processor/mocks" keyprovider "github.com/symbioticfi/relay/internal/usecase/key-provider" "github.com/symbioticfi/relay/internal/usecase/signer-app/mocks" "github.com/symbioticfi/relay/pkg/signals" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" ) ⋮---- "crypto/rand" "log/slog" "math/big" "testing" "time" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/samber/lo" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" ⋮---- "github.com/symbioticfi/relay/internal/client/repository/badger" entity_processor "github.com/symbioticfi/relay/internal/usecase/entity-processor" entity_mocks "github.com/symbioticfi/relay/internal/usecase/entity-processor/mocks" keyprovider "github.com/symbioticfi/relay/internal/usecase/key-provider" "github.com/symbioticfi/relay/internal/usecase/signer-app/mocks" "github.com/symbioticfi/relay/pkg/signals" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" ⋮---- func TestSign_HappyPath(t *testing.T) ⋮---- // Add the private key to the real key provider ⋮---- // Mock the remaining dependencies ⋮---- // Sign ⋮---- // Verify that signature request was saved ⋮---- // Verify that signature is correct ⋮---- type testSetup struct { ctrl *gomock.Controller repo *badger.Repository keyProvider *keyprovider.SimpleKeystoreProvider mockP2P *mocks.Mockp2pService mockMetrics *mocks.Mockmetrics app *SignerApp } ⋮---- func newTestSetup(t *testing.T) *testSetup ⋮---- // Create mocks for other dependencies ⋮---- // Create mock aggregator for entity processor ⋮---- // Create mock aggregation proof signal for entity processor ⋮---- // Create mock signature processed signal for entity processor ⋮---- func createTestSignatureRequest(msg string) symbiotic.SignatureRequest ⋮---- func newPrivateKey(t *testing.T) crypto.PrivateKey ⋮---- func createTestValidatorSet(t *testing.T, setup *testSetup, privateKey crypto.PrivateKey) symbiotic.ValidatorSet ```` ## File: internal/usecase/signer-app/signer_app.go ````go package signer_app ⋮---- import ( "context" "log/slog" "time" "github.com/symbioticfi/relay/internal/entity" "github.com/symbioticfi/relay/pkg/log" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" validate "github.com/go-playground/validator/v10" "k8s.io/client-go/util/workqueue" ) ⋮---- "context" "log/slog" "time" ⋮---- "github.com/symbioticfi/relay/internal/entity" "github.com/symbioticfi/relay/pkg/log" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" validate "github.com/go-playground/validator/v10" "k8s.io/client-go/util/workqueue" ⋮---- //go:generate mockgen -source=signer_app.go -destination=mocks/signer_app.go -package=mocks ⋮---- type repo interface { SaveSignatureRequest(ctx context.Context, requestID common.Hash, req symbiotic.SignatureRequest) error RemoveSignaturePending(ctx context.Context, epoch symbiotic.Epoch, requestID common.Hash) error GetSignaturePending(ctx context.Context, limit int) ([]common.Hash, error) GetSignatureRequest(ctx context.Context, requestID common.Hash) (symbiotic.SignatureRequest, error) GetValidatorSetByEpoch(ctx context.Context, epoch symbiotic.Epoch) (symbiotic.ValidatorSet, error) } ⋮---- type p2pService interface { BroadcastSignatureGeneratedMessage(ctx context.Context, msg symbiotic.Signature) error } ⋮---- type keyProvider interface { GetPrivateKey(keyTag symbiotic.KeyTag) (crypto.PrivateKey, error) GetOnchainKeyFromCache(keyTag symbiotic.KeyTag) (symbiotic.CompactPublicKey, error) } ⋮---- type metrics interface { ObservePKSignDuration(d time.Duration) ObserveAppSignDuration(d time.Duration) } ⋮---- type entityProcessor interface { ProcessSignature(ctx context.Context, signature symbiotic.Signature, self bool) error ProcessAggregationProof(ctx context.Context, proof symbiotic.AggregationProof) error } ⋮---- type Config struct { KeyProvider keyProvider `validate:"required"` Repo repo `validate:"required"` EntityProcessor entityProcessor `validate:"required"` Metrics metrics `validate:"required"` } ⋮---- func (c Config) Validate() error ⋮---- type SignerApp struct { cfg Config queue *workqueue.Typed[common.Hash] } ⋮---- func NewSignerApp(cfg Config) (*SignerApp, error) ⋮---- // RequestSignature creates a signature request and queues it for signing, returns requestID // The actual signing is done in the background by workers func (s *SignerApp) RequestSignature(ctx context.Context, req symbiotic.SignatureRequest) (common.Hash, error) ⋮---- // does not return the actual signature yet ⋮---- func (s *SignerApp) completeSign(ctx context.Context, req symbiotic.SignatureRequest, p2pService p2pService) error ⋮---- func (s *SignerApp) HandleSignatureRequests(ctx context.Context, workerCount int, p2pService p2pService) error ⋮---- // start workers ⋮---- func (s *SignerApp) worker(ctx context.Context, id int, p2pService p2pService) ⋮---- func (s *SignerApp) handleMissedSignaturesOnce(ctx context.Context) error ```` ## File: internal/usecase/sync-provider/sync_provider_build_want_aggregation_proofs_request.go ````go package sync_provider ⋮---- import ( "context" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" ⋮---- "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- // BuildWantAggregationProofsRequest builds a request for missing aggregation proofs from recent epochs func (s *Syncer) BuildWantAggregationProofsRequest(ctx context.Context) (entity.WantAggregationProofsRequest, error) ⋮---- // Get the latest epoch ⋮---- var allRequestIDs []common.Hash ⋮---- // Iterate through epochs from newest to oldest to prioritize recent requests ⋮---- var lastHash common.Hash ⋮---- // Paginate through signature requests without aggregation proofs for this epoch ⋮---- break // No more requests for this epoch ⋮---- // Collect request ids ⋮---- continue // Skip non-aggregation requests ⋮---- // check if proof exists ⋮---- // remove pending from db ⋮---- // ignore not found and tx conflict errors, as they indicate the proof was already processed or is being processed ⋮---- continue // Proof already exists, skip ⋮---- lastHash = req.RequestID // Update for pagination ⋮---- // Handle epoch == 0 to avoid underflow in unsigned arithmetic ```` ## File: internal/usecase/sync-provider/sync_provider_build_want_signatures_map.go ````go package sync_provider ⋮---- import ( "context" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" ⋮---- "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- func (s *Syncer) BuildWantSignaturesRequest(ctx context.Context) (entity.WantSignaturesRequest, error) ⋮---- // Collect all pending signature requests across epochs ⋮---- // buildWantSignaturesMap constructs a map of request id to missing validator bitmaps // for pending signature requests across multiple epochs. // // The method performs the following operations: // 1. Determines the epoch range to scan (from latest epoch back to EpochsToSync epochs) // 2. Iterates through epochs from newest to oldest to prioritize recent requests // 3. For each epoch, fetches pending signature requests in batches // 4. For each request, identifies validators that haven't provided signatures yet // 5. Builds a map where keys are request ids and values are bitmaps of missing validators ⋮---- // The scanning is limited by MaxSignatureRequestsPerSync to prevent excessive memory usage // and network overhead during synchronization. ⋮---- // Behavior: // - Scans epochs in reverse order (newest first) to prioritize recent requests // - Stops scanning when MaxSignatureRequestsPerSync limit is reached // - Only includes requests that have missing signatures (non-empty bitmaps) // - Uses pagination to handle large numbers of requests per epoch func (s *Syncer) buildWantSignaturesMap(ctx context.Context) (map[common.Hash]entity.Bitmap, error) ⋮---- // Get the latest epoch ⋮---- // Calculate the starting epoch (go back EpochsToSync epochs) var startEpoch symbiotic.Epoch ⋮---- var lastHash common.Hash ⋮---- // Process each request to find missing signatures ⋮---- // Get current signature map ⋮---- // No signatures yet, all validators are missing ⋮---- // Get missing validators from signature map ⋮---- // If we got fewer requests than requested, we've reached the end for this epoch ```` ## File: internal/usecase/sync-provider/sync_provider_handle_want_aggregation_proofs_request.go ````go package sync_provider ⋮---- import ( "context" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" ⋮---- "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- // HandleWantAggregationProofsRequest handles incoming requests for aggregation proofs from peers func (s *Syncer) HandleWantAggregationProofsRequest(ctx context.Context, request entity.WantAggregationProofsRequest) (entity.WantAggregationProofsResponse, error) ⋮---- // Process each requested hash ⋮---- // Stop if we've reached the maximum response count ⋮---- // Try to get the aggregation proof ⋮---- // Aggregation proof not found, skip this request ⋮---- // Add the proof to the response ```` ## File: internal/usecase/sync-provider/sync_provider_handle_want_signatures.go ````go package sync_provider ⋮---- import ( "context" "log/slog" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/symbioticfi/relay/internal/entity" ) ⋮---- "context" "log/slog" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" ⋮---- "github.com/symbioticfi/relay/internal/entity" ⋮---- // HandleWantSignaturesRequest processes a peer's request for missing signatures and returns // the requested signatures that are available in local storage. // // The method performs the following operations: // 1. Iterates through each request id in the incoming request // 2. For each requested validator index, directly retrieves the signature using GetSignatureByIndex // 3. Builds a response containing validator signatures organized by request id ⋮---- // The response is limited by MaxResponseSignatureCount to prevent memory exhaustion // and network congestion during P2P synchronization. ⋮---- // Behavior: // - Processes requests in iteration order (map iteration is non-deterministic) // - Stops processing when MaxResponseSignatureCount limit is reached // - Skips validator indices where signatures are not found locally // - Returns empty signatures map for request ids where no matching signatures are found func (s *Syncer) HandleWantSignaturesRequest(ctx context.Context, request entity.WantSignaturesRequest) (entity.WantSignaturesResponse, error) ⋮---- // Check signature count limit before processing each request ⋮---- var validatorSigs []entity.ValidatorSignature ⋮---- // Iterate over requested validator indices and get signatures directly ⋮---- // Check limit before processing each signature ⋮---- // Get signature by validator index directly ⋮---- // Signature not found for this validator index, skip ```` ## File: internal/usecase/sync-provider/sync_provider_process_received_aggregation_proofs.go ````go package sync_provider ⋮---- import ( "context" "github.com/go-errors/errors" "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" ⋮---- "github.com/go-errors/errors" ⋮---- "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- // ProcessReceivedAggregationProofs processes aggregation proofs received from peers func (s *Syncer) ProcessReceivedAggregationProofs(ctx context.Context, response entity.WantAggregationProofsResponse) (entity.AggregationProofProcessingStats, error) ⋮---- // Process each received aggregation proof ⋮---- // processSingleAggregationProof processes a single aggregation proof func (s *Syncer) processSingleAggregationProof(ctx context.Context, proof symbiotic.AggregationProof, stats *entity.AggregationProofProcessingStats) ⋮---- // Process the aggregation proof using the signature processor ⋮---- return // Continue processing other proofs ```` ## File: internal/usecase/sync-provider/sync_provider_process_received_signatures.go ````go package sync_provider ⋮---- import ( "context" "log/slog" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/symbioticfi/relay/internal/entity" ) ⋮---- "context" "log/slog" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" ⋮---- "github.com/symbioticfi/relay/internal/entity" ⋮---- // ProcessReceivedSignatures validates and processes signatures received from peer nodes during // synchronization, updating local storage and tracking statistics for monitoring. // // The method performs the following validation and processing steps: // 1. Validates that received signatures were actually requested (hash and validator index matching) // 2. Retrieves original signature request metadata (epoch, key type, etc.) // 3. Reconstructs and validates public keys from signature data // 4. Cross-references validator information to ensure consistency // 5. Processes valid signatures through the signature processor // 6. Emits signature received signals for downstream components // 7. Tracks comprehensive statistics for all outcomes ⋮---- // The method is designed to be resilient against malformed or malicious peer responses, // validating all received data before processing and continuing on errors. ⋮---- // Behavior: // - Validates all received signatures against original requests // - Skips invalid signatures and continues processing others // - Handles duplicate signatures gracefully (tracks but doesn't error) // - Emits signals for successfully processed signatures // - Returns comprehensive statistics for monitoring and debugging // - Logs warnings for validation failures and errors func (s *Syncer) ProcessReceivedSignatures(ctx context.Context, response entity.WantSignaturesResponse, wantSignatures map[common.Hash]entity.Bitmap) entity.SignatureProcessingStats ⋮---- var stats entity.SignatureProcessingStats ⋮---- // Validate that we actually requested this validator's signature ⋮---- // Get the original signature request to extract epoch and other details ```` ## File: internal/usecase/sync-provider/sync_provider_test.go ````go package sync_provider ⋮---- import ( "crypto/rand" "fmt" "math/big" "testing" "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" "github.com/symbioticfi/relay/internal/client/repository/badger" "github.com/symbioticfi/relay/internal/entity" entity_processor "github.com/symbioticfi/relay/internal/usecase/entity-processor" "github.com/symbioticfi/relay/internal/usecase/entity-processor/mocks" "github.com/symbioticfi/relay/pkg/signals" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" ) ⋮---- "crypto/rand" "fmt" "math/big" "testing" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" ⋮---- "github.com/symbioticfi/relay/internal/client/repository/badger" "github.com/symbioticfi/relay/internal/entity" entity_processor "github.com/symbioticfi/relay/internal/usecase/entity-processor" "github.com/symbioticfi/relay/internal/usecase/entity-processor/mocks" "github.com/symbioticfi/relay/pkg/signals" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" ⋮---- func TestAskSignatures_HandleWantSignaturesRequest_Integration(t *testing.T) ⋮---- // Create test data ⋮---- // Save signature request and signature on peer ⋮---- // Save signature request on both repos so peer can respond to requests ⋮---- // Requester needs SignatureMap for BuildWantSignaturesRequest to work ⋮---- // Create peer syncer first (with a temporary mock) ⋮---- // Create requester syncer ⋮---- // Verify requester initially has no signatures ⋮---- require.Len(t, initialSignatures, 1) // Already has one signature from param1 ⋮---- // Verify requester has signature request ⋮---- // Call BuildWantSignaturesRequest on requester ⋮---- // Verify requester now has the signature ⋮---- // Verify the signature is correct ⋮---- func createMockAggregator(t *testing.T) *mocks.MockAggregator ⋮---- // Default behavior: return true for verification ⋮---- func createMockAggProofSignal(t *testing.T) *mocks.MockAggProofSignal ⋮---- // Default behavior: return nil for emit ⋮---- func createMockSignatureProcessedSignal(t *testing.T) *signals.Signal[symbiotic.Signature] ⋮---- func createTestRepo(t *testing.T) *badger.Repository ⋮---- func createTestSignatureRequest(t *testing.T) symbiotic.SignatureRequest ⋮---- Message: randomBytes(t, 100), // Random message makes each request unique ⋮---- func newPrivateKey(t *testing.T) crypto.PrivateKey ⋮---- func createTestValidatorSet(t *testing.T, privateKey ...crypto.PrivateKey) symbiotic.ValidatorSet ⋮---- func createTestValidatorSetWithMultipleValidators(t *testing.T, count int) (symbiotic.ValidatorSet, []crypto.PrivateKey) ⋮---- Payload: privateKey.PublicKey().OnChain(), // Same key for all validators for simplicity ⋮---- func randomBytes(t *testing.T, n int) []byte ⋮---- func TestHandleWantSignaturesRequest_EmptyRequest(t *testing.T) ⋮---- func TestHandleWantSignaturesRequest_MaxResponseSignatureCountLimit(t *testing.T) ⋮---- // Create test data with multiple signatures validatorSet, privateKeys := createTestValidatorSetWithMultipleValidators(t, 5) // Create 5 validators ⋮---- // Setup repository with validator set and signature request ⋮---- // Store multiple signatures by validator index ⋮---- var requestID common.Hash // Save signatures for multiple validator indices (simulate multiple validators) ⋮---- MaxResponseSignatureCount: 2, // Low limit ⋮---- requestID: entity.NewBitmapOf(0, 1, 2, 3, 4), // Request all 5 signatures ⋮---- require.Len(t, response.Signatures[requestID], 2) // Should return only 2 signatures due to limit ⋮---- MaxResponseSignatureCount: 3, // Allow 3 signatures ⋮---- requestID: entity.NewBitmapOf(0, 1, 2), // Request exactly 3 signatures ⋮---- func TestHandleWantSignaturesRequest_MultipleRequestIDs(t *testing.T) ⋮---- // Store signatures for both requests ⋮---- validatorSet, privateKeys := createTestValidatorSetWithMultipleValidators(t, 2) // Create 2 validators ⋮---- // Setup repository ⋮---- // Save signature for first request ⋮---- // Save signature for second request ⋮---- param1.RequestID(): entity.NewBitmapOf(0), // Request validator 0 from first request param2.RequestID(): entity.NewBitmapOf(1), // Request validator 1 from second request ⋮---- func TestHandleWantSignaturesRequest_PartialSignatureAvailability(t *testing.T) ⋮---- validatorSet, privateKeys := createTestValidatorSetWithMultipleValidators(t, 4) // Create 4 validators ⋮---- // Save signatures only for validator indices 0 and 2 (skip 1 and 3) ⋮---- requestID: entity.NewBitmapOf(0, 1, 2, 3), // Request all 4, but only 0 and 2 exist ⋮---- // Check that we got the right validator indices ```` ## File: internal/usecase/sync-provider/sync_provider.go ````go package sync_provider ⋮---- import ( "context" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/go-playground/validator/v10" "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/go-playground/validator/v10" ⋮---- "github.com/symbioticfi/relay/internal/entity" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- type repo interface { GetSignatureMap(ctx context.Context, requestID common.Hash) (entity.SignatureMap, error) GetLatestValidatorSetEpoch(ctx context.Context) (symbiotic.Epoch, error) GetSignatureRequest(ctx context.Context, requestID common.Hash) (symbiotic.SignatureRequest, error) GetValidatorByKey(ctx context.Context, epoch symbiotic.Epoch, keyTag symbiotic.KeyTag, publicKey []byte) (symbiotic.Validator, uint32, error) GetAllSignatures(ctx context.Context, requestID common.Hash) ([]symbiotic.Signature, error) GetSignatureByIndex(ctx context.Context, requestID common.Hash, validatorIndex uint32) (symbiotic.Signature, error) GetSignatureRequestsWithoutAggregationProof(ctx context.Context, epoch symbiotic.Epoch, limit int, lastHash common.Hash) ([]symbiotic.SignatureRequestWithID, error) GetAggregationProof(ctx context.Context, requestID common.Hash) (symbiotic.AggregationProof, error) RemoveAggregationProofPending(ctx context.Context, epoch symbiotic.Epoch, requestID common.Hash) error } ⋮---- type entityProcessor interface { ProcessSignature(ctx context.Context, signature symbiotic.Signature, self bool) error ProcessAggregationProof(ctx context.Context, proof symbiotic.AggregationProof) error } ⋮---- type Config struct { Repo repo `validate:"required"` EntityProcessor entityProcessor `validate:"required"` EpochsToSync uint64 `validate:"gte=0"` MaxSignatureRequestsPerSync int `validate:"gt=0"` MaxResponseSignatureCount int `validate:"gt=0"` MaxAggProofRequestsPerSync int `validate:"gt=0"` MaxResponseAggProofCount int `validate:"gt=0"` } ⋮---- type Syncer struct { cfg Config } ⋮---- func New(cfg Config) (*Syncer, error) ```` ## File: internal/usecase/sync-runner/sync_runner.go ````go package sync_runner ⋮---- import ( "context" "log/slog" "time" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/go-playground/validator/v10" "github.com/symbioticfi/relay/internal/entity" "github.com/symbioticfi/relay/pkg/log" ) ⋮---- "context" "log/slog" "time" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/go-playground/validator/v10" ⋮---- "github.com/symbioticfi/relay/internal/entity" "github.com/symbioticfi/relay/pkg/log" ⋮---- type p2pService interface { SendWantSignaturesRequest(ctx context.Context, request entity.WantSignaturesRequest) (entity.WantSignaturesResponse, error) SendWantAggregationProofsRequest(ctx context.Context, request entity.WantAggregationProofsRequest) (entity.WantAggregationProofsResponse, error) } ⋮---- type provider interface { BuildWantSignaturesRequest(ctx context.Context) (entity.WantSignaturesRequest, error) ProcessReceivedSignatures(ctx context.Context, response entity.WantSignaturesResponse, wantSignatures map[common.Hash]entity.Bitmap) entity.SignatureProcessingStats BuildWantAggregationProofsRequest(ctx context.Context) (entity.WantAggregationProofsRequest, error) ProcessReceivedAggregationProofs(ctx context.Context, response entity.WantAggregationProofsResponse) (entity.AggregationProofProcessingStats, error) } ⋮---- type metrics interface { ObserveP2PSyncSignaturesProcessed(resultType string, count int) ObserveP2PSyncRequestedHashes(count int) ObserveP2PSyncAggregationProofsProcessed(resultType string, count int) ObserveP2PSyncRequestedAggregationProofs(count int) } ⋮---- type Config struct { Enabled bool P2PService p2pService `validate:"required"` Provider provider `validate:"required"` SyncPeriod time.Duration `validate:"gt=0"` SyncTimeout time.Duration `validate:"gt=0"` Metrics metrics `validate:"required"` } ⋮---- type Runner struct { cfg Config } ⋮---- func New(cfg Config) (*Runner, error) ⋮---- func (s *Runner) Start(ctx context.Context) error ⋮---- // Run signature sync ⋮---- // Run aggregation proof sync independently ⋮---- func (s *Runner) runSignatureSync(ctx context.Context) error ⋮---- // Create context with timeout for signature sync ⋮---- func (s *Runner) runAggregationProofSync(ctx context.Context) error ⋮---- // Create context with timeout for aggregation proof sync ```` ## File: internal/usecase/valset-listener/valset_generator_handle_agg_proof.go ````go package valset_listener ⋮---- import ( "context" "log/slog" "time" "github.com/go-errors/errors" "github.com/symbioticfi/relay/internal/entity" "github.com/symbioticfi/relay/pkg/log" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" "log/slog" "time" ⋮---- "github.com/go-errors/errors" ⋮---- "github.com/symbioticfi/relay/internal/entity" "github.com/symbioticfi/relay/pkg/log" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- const ( minCommitterPollIntervalSeconds = uint64(5) ⋮---- func (s *Service) StartCommitterLoop(ctx context.Context) error ⋮---- // get the latest epoch and try to find schedule of committers and start committing ⋮---- // force to tick immediately as soon as it starts ⋮---- // get latest known valset ⋮---- // if latest valset is already committed, nothing to do ⋮---- // get lat committed epoch // TODO(oxsteins): if this is too slow, might have to update status-tracker to catchup quickly and store last committed epoch in db // currently it is polling one by one and asynchronously so might not catchup early enough for committer to work // (alrxy) i think it's better to do in listener cuz listener provides valsets and configs, it will be more consistent ⋮---- func (s *Service) processPendingProof(ctx context.Context, proofKey symbiotic.ProofCommitKey) error ⋮---- // get proof ⋮---- func (s *Service) detectLastCommittedEpoch(ctx context.Context, config symbiotic.NetworkConfig) symbiotic.Epoch ⋮---- // skip chain if networking issue, we will recheck again anyway and if the rpc/chain recovers we will detect issue later ⋮---- // commitValsetToAllSettlements commits the validator set header to all configured settlement chains. // // Performance Optimization: This method uses entity.BlockNumberLatest instead of finalized blocks // when checking commitment status. This optimization reduces latency by ~12-15 seconds // on Ethereum (approximately 2 finalization epochs), allowing faster detection of already-committed // headers and reducing unnecessary duplicate commitment transactions. ⋮---- // Safety: The pending proof cleanup happens separately in the status tracker, which uses finalized // blocks to verify commitments before removing pending proofs. This ensures data consistency: // - This method: uses latest blocks for fast pre-flight checks (avoid duplicate tx submissions) // - Status tracker: uses finalized blocks for authoritative verification (safe pending proof removal) ⋮---- // Trade-off: Using latest blocks for pre-flight checks introduces a small reorg risk, but this is // acceptable because: // 1. False positives (thinking a header is committed when it's not due to reorg) may trigger a // duplicate transaction, but the contract will reject it // 2. False negatives (missing a commitment due to reorg) will be corrected in the next iteration // 3. The performance benefit of reduced latency outweighs the minimal reorg risk // 4. Final cleanup only happens after finalized block confirmation in the status tracker func (s *Service) commitValsetToAllSettlements(ctx context.Context, config symbiotic.NetworkConfig, header symbiotic.ValidatorSetHeader, extraData []symbiotic.ExtraData, proof []byte) error ⋮---- // todo replace it with tx check instead of call to contract // if commit tx was sent but still not finalized this check will // return false positive and trigger one more commitment tx ```` ## File: internal/usecase/valset-listener/valset_listener_uc.go ````go package valset_listener ⋮---- import ( "context" "log/slog" "math/big" "sync" "time" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/signer/core/apitypes" "github.com/go-errors/errors" "github.com/go-playground/validator/v10" "github.com/symbioticfi/relay/internal/entity" "github.com/symbioticfi/relay/pkg/log" "github.com/symbioticfi/relay/pkg/signals" "github.com/symbioticfi/relay/symbiotic/client/evm" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/aggregator" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" ) ⋮---- "context" "log/slog" "math/big" "sync" "time" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/signer/core/apitypes" "github.com/go-errors/errors" "github.com/go-playground/validator/v10" "github.com/symbioticfi/relay/internal/entity" "github.com/symbioticfi/relay/pkg/log" "github.com/symbioticfi/relay/pkg/signals" "github.com/symbioticfi/relay/symbiotic/client/evm" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/aggregator" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" ⋮---- type signer interface { RequestSignature(ctx context.Context, req symbiotic.SignatureRequest) (common.Hash, error) } ⋮---- type repo interface { GetLatestValidatorSetHeader(_ context.Context) (symbiotic.ValidatorSetHeader, error) GetOldestValidatorSetEpoch(ctx context.Context) (symbiotic.Epoch, error) GetLatestSignedValidatorSetEpoch(ctx context.Context) (symbiotic.Epoch, error) GetValidatorSetByEpoch(ctx context.Context, epoch symbiotic.Epoch) (symbiotic.ValidatorSet, error) GetValidatorSetMetadata(ctx context.Context, epoch symbiotic.Epoch) (symbiotic.ValidatorSetMetadata, error) GetConfigByEpoch(ctx context.Context, epoch symbiotic.Epoch) (symbiotic.NetworkConfig, error) GetAggregationProof(ctx context.Context, requestID common.Hash) (symbiotic.AggregationProof, error) SaveLatestSignedValidatorSetEpoch(_ context.Context, valset symbiotic.ValidatorSet) error SaveProof(ctx context.Context, aggregationProof symbiotic.AggregationProof) error SaveProofCommitPending(ctx context.Context, epoch symbiotic.Epoch, requestID common.Hash) error GetPendingProofCommitsSinceEpoch(ctx context.Context, epoch symbiotic.Epoch, limit int) ([]symbiotic.ProofCommitKey, error) RemoveProofCommitPending(ctx context.Context, epoch symbiotic.Epoch) error SaveValidatorSetMetadata(ctx context.Context, data symbiotic.ValidatorSetMetadata) error SaveConfig(ctx context.Context, config symbiotic.NetworkConfig, epoch symbiotic.Epoch) error SaveValidatorSet(ctx context.Context, valset symbiotic.ValidatorSet) error } ⋮---- type deriver interface { GetValidatorSet(ctx context.Context, epoch symbiotic.Epoch, config symbiotic.NetworkConfig) (symbiotic.ValidatorSet, error) GetNetworkData(ctx context.Context, addr symbiotic.CrossChainAddress) (symbiotic.NetworkData, error) } ⋮---- type metrics interface { ObserveAggregationProofSize(proofSize int, validatorCount int) } ⋮---- type keyProvider interface { GetPrivateKey(keyTag symbiotic.KeyTag) (crypto.PrivateKey, error) GetOnchainKeyFromCache(keyTag symbiotic.KeyTag) (symbiotic.CompactPublicKey, error) } ⋮---- type Config struct { EvmClient evm.IEvmClient `validate:"required"` Repo repo `validate:"required"` Deriver deriver `validate:"required"` PollingInterval time.Duration `validate:"required,gt=0"` Signer signer `validate:"required"` ValidatorSet *signals.Signal[symbiotic.ValidatorSet] `validate:"required"` KeyProvider keyProvider Aggregator aggregator.Aggregator Metrics metrics `validate:"required"` ForceCommitter bool EpochRetentionCount uint64 } ⋮---- func (c Config) Validate() error ⋮---- type Service struct { cfg Config mutex sync.Mutex } ⋮---- func New(cfg Config) (*Service, error) ⋮---- // LoadAllMissingEpochs runs tryLoadMissingEpochs until all missing epochs are loaded successfully func (s *Service) LoadAllMissingEpochs(ctx context.Context) error ⋮---- const maxRetries = 10 ⋮---- func (s *Service) Start(ctx context.Context) error ⋮---- func (s *Service) determineStartupSyncRange(ctx context.Context) (from symbiotic.Epoch, to symbiotic.Epoch, err error) ⋮---- func (s *Service) determineSteadySyncRange(ctx context.Context) (from symbiotic.Epoch, to symbiotic.Epoch, err error) ⋮---- func (s *Service) determineSyncRangeFromLatestWithHeader( ctx context.Context, latestHeader symbiotic.ValidatorSetHeader, currentEpoch symbiotic.Epoch, ) (from symbiotic.Epoch, to symbiotic.Epoch, err error) ⋮---- func (s *Service) tryLoadMissingEpochs(ctx context.Context, nextEpoch, currentEpoch symbiotic.Epoch) (time.Duration, error) ⋮---- // locking up mutex to prevent concurrent processing ⋮---- var ( prevValset symbiotic.ValidatorSet err error ) ⋮---- // we couldn't find previous valset in repo, maybe we start fresh node with empty db ⋮---- var ( latestEpochConfig *symbiotic.NetworkConfig latestEpochTimestamp *uint64 ) ⋮---- func (s *Service) process(ctx context.Context, prevValSet symbiotic.ValidatorSet, valSet symbiotic.ValidatorSet, config symbiotic.NetworkConfig) error ⋮---- // if we are a signer, sign the commitment, otherwise just save the metadata ⋮---- // save pending proof commit here // we store pending commit request for all nodes and not just current commiters because // if committers of this epoch fail then commiters for next epoch should still try to commit old proofs ⋮---- func (s *Service) getNetworkData(ctx context.Context, config symbiotic.NetworkConfig) (symbiotic.NetworkData, error) ⋮---- func (s *Service) headerCommitmentData( networkData symbiotic.NetworkData, header symbiotic.ValidatorSetHeader, extraData []symbiotic.ExtraData, ) ([]byte, error) ⋮---- func (s *Service) derive(ctx context.Context, epoch symbiotic.Epoch) (symbiotic.ValidatorSet, symbiotic.NetworkConfig, error) ```` ## File: internal/usecase/valset-status-tracker/status_tracker.go ````go package valsetStatusTracker ⋮---- import ( "context" "log/slog" "math" "time" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/go-playground/validator/v10" "github.com/symbioticfi/relay/internal/entity" "github.com/symbioticfi/relay/pkg/log" "github.com/symbioticfi/relay/symbiotic/client/evm" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" "log/slog" "math" "time" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/go-playground/validator/v10" ⋮---- "github.com/symbioticfi/relay/internal/entity" "github.com/symbioticfi/relay/pkg/log" "github.com/symbioticfi/relay/symbiotic/client/evm" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- var zeroHeaderHash = common.HexToHash("0x868e09d528a16744c1f38ea3c10cc2251e01a456434f91172247695087d129b7") ⋮---- type repo interface { GetConfigByEpoch(_ context.Context, epoch symbiotic.Epoch) (symbiotic.NetworkConfig, error) GetValidatorSetByEpoch(_ context.Context, epoch symbiotic.Epoch) (symbiotic.ValidatorSet, error) UpdateValidatorSetStatus(ctx context.Context, valset symbiotic.ValidatorSet) error UpdateValidatorSetStatusAndRemovePendingProof(ctx context.Context, valset symbiotic.ValidatorSet) error GetFirstUncommittedValidatorSetEpoch(ctx context.Context) (symbiotic.Epoch, error) SaveFirstUncommittedValidatorSetEpoch(_ context.Context, epoch symbiotic.Epoch) error GetLatestValidatorSetEpoch(ctx context.Context) (symbiotic.Epoch, error) } ⋮---- type Config struct { EvmClient evm.IEvmClient `validate:"required"` Repo repo `validate:"required"` PollingInterval time.Duration `validate:"required,gt=0"` } ⋮---- type Service struct { cfg Config } ⋮---- func (c Config) Validate() error ⋮---- func New(cfg Config) (*Service, error) ⋮---- // TrackMissingEpochsStatuses runs trackCommittedEpochs until all missing epochs statuses are loaded successfully func (s *Service) TrackMissingEpochsStatuses(ctx context.Context) error ⋮---- const maxRetries = 10 ⋮---- func (s *Service) Start(ctx context.Context) error ⋮---- func (s *Service) HandleProofAggregated(ctx context.Context, msg symbiotic.AggregationProof) error ⋮---- return errors.Errorf("failed to get validator set: %w", err) // if not found then it's failure case ⋮---- func (s *Service) trackCommittedEpochs(ctx context.Context) error ⋮---- var lastCommittedEpoch uint64 = math.MaxUint64 ⋮---- func (s *Service) findLatestNonZeroSettlements(ctx context.Context) ([]symbiotic.CrossChainAddress, error) ```` ## File: pkg/log/context_handler.go ````go //nolint:wrapcheck // this is the library code, don't need to wrap it package log ⋮---- import ( "context" "log/slog" ) ⋮---- "context" "log/slog" ⋮---- type ContextHandler struct { slog.Handler } ⋮---- func (h ContextHandler) Handle(ctx context.Context, r slog.Record) error ⋮---- type attrsKey struct{} ⋮---- var attrsKeyValue attrsKey ⋮---- func WithComponent(ctx context.Context, component string) context.Context ⋮---- func WithAttrs(ctx context.Context, as ...slog.Attr) context.Context ⋮---- func copyAttrs(parentAttrs []slog.Attr, addCapacity int) []slog.Attr ⋮---- func getAttrs(ctx context.Context) []slog.Attr ```` ## File: pkg/log/log_test.go ````go package log ⋮---- import ( "log/slog" "testing" "time" "github.com/go-errors/errors" ) ⋮---- "log/slog" "testing" "time" ⋮---- "github.com/go-errors/errors" ⋮---- func TestLog(t *testing.T) ⋮---- func TestComponent(t *testing.T) ⋮---- func TestComponentJSON(t *testing.T) ⋮---- func errorFunc() error ⋮---- func TestSplit(t *testing.T) ```` ## File: pkg/log/log.go ````go package log ⋮---- import ( "context" "fmt" "log/slog" "math/big" "os" "runtime" "strconv" "strings" "sync" "time" "github.com/go-errors/errors" slogmulti "github.com/samber/slog-multi" ) ⋮---- "context" "fmt" "log/slog" "math/big" "os" "runtime" "strconv" "strings" "sync" "time" ⋮---- "github.com/go-errors/errors" slogmulti "github.com/samber/slog-multi" ⋮---- var once sync.Once ⋮---- func Init(levelStr, mode string) ⋮---- func internalInit(level slog.Level, mode string) ⋮---- func parseLogLevel(levelStr string) slog.Level ⋮---- func initPretty(level slog.Level) ⋮---- func initText(level slog.Level) ⋮---- func initJson(level slog.Level) ⋮---- func errorLevel(_ context.Context, r slog.Record) bool ⋮---- func notErrorLevel(_ context.Context, r slog.Record) bool ⋮---- type humanDuration time.Duration ⋮---- func (d humanDuration) MarshalJSON() ([]byte, error) ⋮---- func replaceAttr(groups []string, a slog.Attr) slog.Attr ⋮---- // Normalize big numbers to strings to avoid scientific notation in pretty logger ⋮---- // fmtErr returns a slog.GroupValue with keys "msg" and "trace". // If the error does not implement interface { StackTrace() errors.StackTrace }, // the "trace" key is omitted. func fmtErr(err error) slog.Value ⋮---- var groupValues []slog.Attr ⋮---- type StackTracer interface { Callers() []uintptr } // Find the trace to the location of the first errors.New, // errors.Wrap, or errors.WithStack call. var st StackTracer ```` ## File: pkg/log/prettylog.go ````go //nolint:wrapcheck // this is the library code, don't need to wrap it package log ⋮---- import ( "bytes" "context" "encoding/json" "fmt" "io" "log/slog" "os" "strconv" "strings" "sync" "github.com/go-errors/errors" "gopkg.in/yaml.v2" ) ⋮---- "bytes" "context" "encoding/json" "fmt" "io" "log/slog" "os" "strconv" "strings" "sync" ⋮---- "github.com/go-errors/errors" "gopkg.in/yaml.v2" ⋮---- const ( timeFormat = "[15:04:05.000]" reset = "\033[0m" black = 30 red = 31 green = 32 yellow = 33 blue = 34 magenta = 35 cyan = 36 lightGray = 37 darkGray = 90 lightRed = 91 lightGreen = 92 lightYellow = 93 lightBlue = 94 lightMagenta = 95 lightCyan = 96 white = 97 ) ⋮---- func colorizer(colorCode int, v string) string ⋮---- type Handler struct { h slog.Handler r func([]string, slog.Attr) slog.Attr b *bytes.Buffer m *sync.Mutex writer io.Writer colorize bool outputEmptyAttrs bool } ⋮---- func New(handlerOptions *slog.HandlerOptions, options ...Option) *Handler ⋮---- func NewHandler(opts *slog.HandlerOptions) *Handler ⋮---- func (h *Handler) Enabled(ctx context.Context, level slog.Level) bool ⋮---- func (h *Handler) WithAttrs(attrs []slog.Attr) slog.Handler ⋮---- func (h *Handler) WithGroup(name string) slog.Handler ⋮---- func (h *Handler) computeAttrs( ctx context.Context, r slog.Record, ) (map[string]any, error) ⋮---- var attrs map[string]any ⋮---- func (h *Handler) Handle(ctx context.Context, r slog.Record) error ⋮---- var level string ⋮---- var timestamp string ⋮---- var component string ⋮---- var msg string ⋮---- var attrsAsBytes []byte ⋮---- //attrsAsBytes, err = json.MarshalIndent(attrs, "", " ") ⋮---- func suppressDefaults( next func([]string, slog.Attr) slog.Attr, ) func([]string, slog.Attr) slog.Attr ⋮---- type Option func(h *Handler) ⋮---- func WithDestinationWriter(writer io.Writer) Option ⋮---- func WithColor() Option ⋮---- func WithOutputEmptyAttrs() Option ```` ## File: pkg/proof/circuit.go ````go package proof ⋮---- import ( "encoding/hex" "log/slog" "math/big" "github.com/consensys/gnark-crypto/ecc/bn254" "github.com/consensys/gnark/frontend" "github.com/consensys/gnark/std/algebra/emulated/sw_bn254" "github.com/consensys/gnark/std/algebra/emulated/sw_emulated" "github.com/consensys/gnark/std/hash/mimc" gnarkSha3 "github.com/consensys/gnark/std/hash/sha3" "github.com/consensys/gnark/std/math/bits" "github.com/consensys/gnark/std/math/emulated" "github.com/consensys/gnark/std/math/uints" "github.com/ethereum/go-ethereum/crypto" ) ⋮---- "encoding/hex" "log/slog" "math/big" ⋮---- "github.com/consensys/gnark-crypto/ecc/bn254" "github.com/consensys/gnark/frontend" "github.com/consensys/gnark/std/algebra/emulated/sw_bn254" "github.com/consensys/gnark/std/algebra/emulated/sw_emulated" "github.com/consensys/gnark/std/hash/mimc" gnarkSha3 "github.com/consensys/gnark/std/hash/sha3" "github.com/consensys/gnark/std/math/bits" "github.com/consensys/gnark/std/math/emulated" "github.com/consensys/gnark/std/math/uints" "github.com/ethereum/go-ethereum/crypto" ⋮---- // Circuit defines a pre-image knowledge proof type Circuit struct { InputHash frontend.Variable `gnark:",public"` // 254 bits SignersAggVotingPower frontend.Variable `gnark:",private"` // 254 bits, virtually public Message sw_bn254.G1Affine `gnark:",private"` // virtually public Signature sw_bn254.G1Affine `gnark:",private"` SignersAggKeyG2 sw_bn254.G2Affine `gnark:",private"` ValidatorData []ValidatorDataCircuit `gnark:",private"` } ⋮---- InputHash frontend.Variable `gnark:",public"` // 254 bits SignersAggVotingPower frontend.Variable `gnark:",private"` // 254 bits, virtually public Message sw_bn254.G1Affine `gnark:",private"` // virtually public ⋮---- type ValidatorDataCircuit struct { Key sw_bn254.G1Affine VotingPower frontend.Variable IsNonSigner frontend.Variable } ⋮---- type ProveInput struct { ValidatorData []ValidatorData MessageG1 bn254.G1Affine Signature bn254.G1Affine SignersAggKeyG2 bn254.G2Affine } ⋮---- // Define declares the circuit's constraints func (circuit *Circuit) Define(api frontend.API) error ⋮---- // --------------------------------------- Prove ValSet consistency --------------------------------------- ⋮---- // calc valset hash, agg key and agg voting power ⋮---- // hash data if VALIDATOR is not a filler ⋮---- // add power if VALIDATOR is not a filler and SIGNER ⋮---- // aggregate key if VALIDATOR is not a filler and SIGNER ⋮---- // compare with public inputs ⋮---- // --------------------------------------- Prove Input consistency --------------------------------------- ⋮---- // valset consistency checked against InputHash which is Hash{valset-hash|signers-vp|message} ⋮---- inputDataHash[0] = u64Api.ByteValueOf(u64Api.ToValue(u64Api.And(u64Api.ValueOf(inputDataHash[0].Val), uints.NewU64(0x1f)))) // zero three first bits ⋮---- // --------------------------------------- Verify Signature --------------------------------------- ⋮---- // calc alpha ⋮---- //TODO optimize ⋮---- // pairing check ⋮---- func setCircuitData(circuit *Circuit, proveInput ProveInput) ```` ## File: pkg/proof/helpers_test.go ````go package proof ⋮---- import ( "math/big" "os" "strings" "testing" "github.com/consensys/gnark-crypto/ecc/bn254" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) ⋮---- "math/big" "os" "strings" "testing" ⋮---- "github.com/consensys/gnark-crypto/ecc/bn254" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ⋮---- // TestGetMaxValidators tests the GetMaxValidators function func TestGetMaxValidators(t *testing.T) ⋮---- // Set environment variable ⋮---- // TestGetOptimalN tests the getOptimalN function func TestGetOptimalN(t *testing.T) ⋮---- // Temporarily override max validators ⋮---- // TestNormalizeValset tests the NormalizeValset function func TestNormalizeValset(t *testing.T) ⋮---- // Set MAX_VALIDATORS to ensure we get a specific size ⋮---- // Should be sorted and padded to 10 ⋮---- // Check that first 3 are sorted (we need to verify sorting logic) // The sorting is done by key.X or key.Y comparison ⋮---- // Check that remaining slots are padded with zero points ⋮---- // All should be zero points ⋮---- // TestHashValset tests the HashValset function func TestHashValset(t *testing.T) ⋮---- // Add zero point validator ⋮---- // Hash should ignore the zero point validator ⋮---- // TestGetNonSignersData tests the getNonSignersData function func TestGetNonSignersData(t *testing.T) ⋮---- valset := genValset(5, []int{1, 3}) // Validators at index 1 and 3 are non-signers ⋮---- // Total voting power should be sum of all validators ⋮---- // Non-signers voting power should be sum of 2 validators ⋮---- // Aggregated key should not be infinity (we have non-signers) ⋮---- valset := genValset(3, []int{}) // All are signers ⋮---- // Total voting power ⋮---- // No non-signers ⋮---- // Aggregated key should be infinity ⋮---- valset := genValset(3, []int{0, 1, 2}) // All are non-signers ⋮---- // All voting power goes to non-signers ⋮---- // TestGetAggSignature tests the getAggSignature function func TestGetAggSignature(t *testing.T) ⋮---- valset := genValset(5, []int{1, 3}) // Validators 1 and 3 are non-signers ⋮---- // Use a simple message point for testing ⋮---- // Should not be infinity points (we have signers) ⋮---- // Should be infinity points (no signers) ⋮---- // TestGetPubkeyG1 tests the getPubkeyG1 function func TestGetPubkeyG1(t *testing.T) ⋮---- // Zero should give infinity point ⋮---- // One should give generator ⋮---- // TestGetPubkeyG2 tests the getPubkeyG2 function func TestGetPubkeyG2(t *testing.T) ⋮---- // TestProofDataMarshal tests the ProofData.Marshal function func TestProofDataMarshal(t *testing.T) ⋮---- // Fill with test data ⋮---- // Should be 256 + 64 + 64 + 32 = 416 bytes ⋮---- // Check that proof is at the beginning ⋮---- // Check commitments ⋮---- // Check commitment PoK ⋮---- // Check voting power (last 32 bytes) ⋮---- // Last 32 bytes should be zero ⋮---- // TestExists tests the exists function func TestExists(t *testing.T) ⋮---- // Create temp file ```` ## File: pkg/proof/helpers.go ````go package proof ⋮---- import ( "bytes" "math/big" "sort" "github.com/consensys/gnark-crypto/ecc/bn254" mimc_native "github.com/consensys/gnark-crypto/ecc/bn254/fr/mimc" "github.com/consensys/gnark/frontend" "github.com/consensys/gnark/std/algebra/emulated/sw_bn254" "github.com/consensys/gnark/std/hash/mimc" "github.com/consensys/gnark/std/math/bits" "github.com/consensys/gnark/std/math/uints" ) ⋮---- "bytes" "math/big" "sort" ⋮---- "github.com/consensys/gnark-crypto/ecc/bn254" mimc_native "github.com/consensys/gnark-crypto/ecc/bn254/fr/mimc" "github.com/consensys/gnark/frontend" "github.com/consensys/gnark/std/algebra/emulated/sw_bn254" "github.com/consensys/gnark/std/hash/mimc" "github.com/consensys/gnark/std/math/bits" "github.com/consensys/gnark/std/math/uints" ⋮---- func (p ProofData) Marshal() []byte ⋮---- var result bytes.Buffer ⋮---- func hashAffineG1(h *mimc.MiMC, g1 *sw_bn254.G1Affine) ⋮---- func hashAffineG2(h *mimc.MiMC, g2 *sw_bn254.G2Affine) ⋮---- func variableToBytes(api frontend.API, u64api *uints.BinaryField[uints.U64], variable frontend.Variable) []uints.U8 ⋮---- func keyToBytes(u64api *uints.BinaryField[uints.U64], key *sw_bn254.G1Affine) []uints.U8 ⋮---- func limbsToBytes(u64api *uints.BinaryField[uints.U64], limbs []frontend.Variable) []uints.U8 ⋮---- func HashValset(valset []ValidatorData) []byte ⋮---- //nolint:gosec // G602: i is always in range as we iterate over valset ⋮---- // hash by limbs as it's done inside circuit ⋮---- // outerHash.Write(innerHash.Sum(nil)) ⋮---- func getPubkeyG1(pk *big.Int) bn254.G1Affine ⋮---- var p bn254.G1Affine ⋮---- func getPubkeyG2(pk *big.Int) bn254.G2Affine ⋮---- var p bn254.G2Affine ⋮---- func getNonSignersData(valset []ValidatorData) (aggKey *bn254.G1Affine, aggVotingPower *big.Int, totalVotingPower *big.Int) ⋮---- func getAggSignature(message bn254.G1Affine, valset *[]ValidatorData) (signature *bn254.G1Affine, aggKeyG2 *bn254.G2Affine, aggKeyG1 *bn254.G1Affine) ⋮---- msg := bn254.G1Affine{X: message.X, Y: message.Y} // have to copy msg since ScalarMultiplication rewrite it ⋮---- func NormalizeValset(valset []ValidatorData) []ValidatorData ⋮---- // Sort validators by key in ascending order ⋮---- // Compare keys (lower first) ⋮---- func getOptimalN(valsetLength int) int ⋮---- var capSize int ```` ## File: pkg/proof/proof_test.go ````go package proof ⋮---- import ( "encoding/hex" "fmt" "math/big" "testing" "time" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/go-errors/errors" "github.com/stretchr/testify/require" "github.com/consensys/gnark-crypto/ecc/bn254" "github.com/consensys/gnark/backend/groth16" "github.com/consensys/gnark/constraint" ) ⋮---- "encoding/hex" "fmt" "math/big" "testing" "time" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/go-errors/errors" "github.com/stretchr/testify/require" ⋮---- "github.com/consensys/gnark-crypto/ecc/bn254" "github.com/consensys/gnark/backend/groth16" "github.com/consensys/gnark/constraint" ⋮---- func genValset(numValidators int, nonSigners []int) []ValidatorData ⋮---- //nolint:unused // will be used later func mockValset() []ValidatorData ⋮---- func calculateInputHash(validatorSetHash []byte, signersVotingPower *big.Int, messageG1 *bn254.G1Affine) common.Hash ⋮---- var packed []byte ⋮---- func TestProof(t *testing.T) ⋮---- // generate valset ⋮---- // valset := mockValset() ⋮---- func TestProofFailOnEmptyCircuitDir(t *testing.T) ⋮---- // TestNewZkProverInitialization tests the NewZkProver initialization func TestNewZkProverInitialization(t *testing.T) ⋮---- // Check all maps are initialized ⋮---- // Check maps are empty (no circuits loaded without dir) ⋮---- // Check maxValidators is set to default ⋮---- // Check circuitsDir is empty ⋮---- // We can't actually test NewZkProver with a real circuits dir // because it will try to load/compile circuits which is slow. // Instead, we manually create a prover to verify the field is set. ⋮---- // Maps should still be initialized ⋮---- // TestProveValidation tests the Prove validation paths func TestProveValidation(t *testing.T) ⋮---- // Create prover with circuits dir but no actual circuits loaded ⋮---- // Try with 25 validators (not in {10, 100, 1000}) ⋮---- // Even with 10 validators (which is in maxValidators), // we don't have actual circuit loaded ⋮---- // TestVerifyValidation tests the Verify validation paths func TestVerifyValidation(t *testing.T) ⋮---- // valsetLen = 5 should normalize to 10 // But since we don't have vk[10], it should error // Note: Verify needs at least 384 bytes for proof ⋮---- // valsetLen = 5000 exceeds all sizes, getOptimalN returns 0 ⋮---- // Even with exact match valsetLen=100, vk map is empty ⋮---- // TestPathHelpers tests the path generation helper functions func TestR1csPathTmp(t *testing.T) ⋮---- func TestPkPathTmp(t *testing.T) ⋮---- func TestVkPathTmp(t *testing.T) ⋮---- func TestSolPathTmp(t *testing.T) ```` ## File: pkg/proof/proof.go ````go package proof ⋮---- import ( "bytes" "crypto/sha256" "encoding/hex" "fmt" "log/slog" "math/big" "os" "strconv" "strings" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/consensys/gnark-crypto/ecc" "github.com/consensys/gnark-crypto/ecc/bn254" "github.com/consensys/gnark-crypto/ecc/bn254/fr" "github.com/consensys/gnark/backend" "github.com/consensys/gnark/backend/groth16" "github.com/consensys/gnark/backend/solidity" "github.com/consensys/gnark/constraint" "github.com/consensys/gnark/frontend" "github.com/consensys/gnark/frontend/cs/r1cs" ) ⋮---- "bytes" "crypto/sha256" "encoding/hex" "fmt" "log/slog" "math/big" "os" "strconv" "strings" ⋮---- "github.com/ethereum/go-ethereum/common" ⋮---- "github.com/go-errors/errors" ⋮---- "github.com/consensys/gnark-crypto/ecc" "github.com/consensys/gnark-crypto/ecc/bn254" "github.com/consensys/gnark-crypto/ecc/bn254/fr" "github.com/consensys/gnark/backend" "github.com/consensys/gnark/backend/groth16" "github.com/consensys/gnark/backend/solidity" "github.com/consensys/gnark/constraint" "github.com/consensys/gnark/frontend" "github.com/consensys/gnark/frontend/cs/r1cs" ⋮---- var ( defaultMaxValidators = []int{10, 100, 1000} ) ⋮---- func GetMaxValidators() []int ⋮---- var newMaxValidators []int ⋮---- func r1csPathTmp(circuitsDir, suffix string) string ⋮---- func pkPathTmp(circuitsDir, suffix string) string ⋮---- func vkPathTmp(circuitsDir, suffix string) string ⋮---- func solPathTmp(circuitsDir, suffix string) string ⋮---- type ProofData struct { Proof []byte Commitments []byte CommitmentPok []byte SignersAggVotingPower *big.Int } ⋮---- type ValidatorData struct { PrivateKey *big.Int Key bn254.G1Affine KeyG2 bn254.G2Affine VotingPower *big.Int IsNonSigner bool } ⋮---- type ZkProver struct { cs map[int]constraint.ConstraintSystem pk map[int]groth16.ProvingKey vk map[int]groth16.VerifyingKey circuitsDir string maxValidators []int } ⋮---- func NewZkProver(circuitsDir string) *ZkProver ⋮---- func (p *ZkProver) init() ⋮---- func (p *ZkProver) Verify(valsetLen int, publicInputHash common.Hash, proofBytes []byte) (bool, error) ⋮---- //nolint:gosec // G602: proofBytes length is validated by caller, slicing is safe ⋮---- rawProofBytes = append(rawProofBytes, []byte{0, 0, 0, 1}...) //dirty hack ⋮---- func (p *ZkProver) Prove(proveInput ProveInput) (ProofData, error) ⋮---- // witness definition ⋮---- // groth16: Prove & Verify ⋮---- // Format for the specific Solidity interface ⋮---- // Format the vector of public inputs as hex strings ⋮---- // If more than 10 inputs (unlikely), you'll need to adapt the interface ⋮---- // verify proof ⋮---- // Serialize the proof var proofBuffer bytes.Buffer ⋮---- // Assuming fpSize is 32 bytes for BN254 const fpSize = 32 ⋮---- standardProof[0] = new(big.Int).SetBytes(proofBytes[fpSize*0 : fpSize*1]) // Ar.x standardProof[1] = new(big.Int).SetBytes(proofBytes[fpSize*1 : fpSize*2]) // Ar.y standardProof[2] = new(big.Int).SetBytes(proofBytes[fpSize*2 : fpSize*3]) // Bs.x[0] standardProof[3] = new(big.Int).SetBytes(proofBytes[fpSize*3 : fpSize*4]) // Bs.x[1] standardProof[4] = new(big.Int).SetBytes(proofBytes[fpSize*4 : fpSize*5]) // Bs.y[0] standardProof[5] = new(big.Int).SetBytes(proofBytes[fpSize*5 : fpSize*6]) // Bs.y[1] standardProof[6] = new(big.Int).SetBytes(proofBytes[fpSize*6 : fpSize*7]) // Krs.x standardProof[7] = new(big.Int).SetBytes(proofBytes[fpSize*7 : fpSize*8]) // Krs.y ⋮---- commitments[0] = new(big.Int).SetBytes(proofBytes[4+fpSize*8 : 4+fpSize*9]) // Commitment.x commitments[1] = new(big.Int).SetBytes(proofBytes[4+fpSize*9 : 4+fpSize*10]) // Commitment.y ⋮---- commitmentPok[0] = new(big.Int).SetBytes(proofBytes[4+fpSize*10 : 4+fpSize*11]) // CommitmentPok.x commitmentPok[1] = new(big.Int).SetBytes(proofBytes[4+fpSize*11 : 4+fpSize*12]) // CommitmentPok.y ⋮---- //nolint:revive // function-result-limit: This function needs to return multiple complex types for cryptographic operations func (p *ZkProver) loadOrInit(valsetLen int) (constraint.ConstraintSystem, groth16.ProvingKey, groth16.VerifyingKey, error) ⋮---- var buf bytes.Buffer ⋮---- func exists(path string) bool ```` ## File: pkg/server/interceptors.go ````go package server ⋮---- import ( "context" "log/slog" "time" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "github.com/symbioticfi/relay/pkg/log" ) ⋮---- "context" "log/slog" "time" ⋮---- "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ⋮---- "github.com/symbioticfi/relay/pkg/log" ⋮---- // LoggingInterceptor provides request logging for unary RPCs func LoggingInterceptor(verboseLogging bool) grpc.UnaryServerInterceptor ⋮---- // wrappedStream wraps grpc.ServerStream to inject context type wrappedStream struct { grpc.ServerStream ctx context.Context } ⋮---- func (w *wrappedStream) Context() context.Context ⋮---- // StreamLoggingInterceptor provides request logging for streaming RPCs func StreamLoggingInterceptor(verboseLogging bool) grpc.StreamServerInterceptor ⋮---- // PanicRecoveryInterceptor recovers from panics in unary gRPC handlers func PanicRecoveryInterceptor() grpc.UnaryServerInterceptor ⋮---- // StreamPanicRecoveryInterceptor recovers from panics in streaming gRPC handlers func StreamPanicRecoveryInterceptor() grpc.StreamServerInterceptor ```` ## File: pkg/server/metrics_server.go ````go package server ⋮---- import ( "context" "log/slog" "net/http" "time" "github.com/go-chi/chi/v5" "github.com/go-errors/errors" "github.com/go-playground/validator/v10" "github.com/prometheus/client_golang/prometheus/promhttp" ) ⋮---- "context" "log/slog" "net/http" "time" ⋮---- "github.com/go-chi/chi/v5" "github.com/go-errors/errors" "github.com/go-playground/validator/v10" "github.com/prometheus/client_golang/prometheus/promhttp" ⋮---- type MetricsConfig struct { Address string ReadHeaderTimeout time.Duration } ⋮---- func (c MetricsConfig) Validate() error ⋮---- type MetricsServer struct { srv *http.Server cfg MetricsConfig } ⋮---- func NewMetricsServer(cfg MetricsConfig) (*MetricsServer, error) ⋮---- func initMetricsHandler(_ MetricsConfig) http.Handler ⋮---- func (s *MetricsServer) Serve(ctx context.Context) error ⋮---- if err := s.srv.Shutdown(ctxShutdown); err != nil { //nolint:contextcheck // we must use separate context for shutdown ```` ## File: pkg/signals/signal_test.go ````go package signals ⋮---- import ( "context" "errors" "sync" "sync/atomic" "testing" "time" "github.com/stretchr/testify/require" ) ⋮---- "context" "errors" "sync" "sync/atomic" "testing" "time" ⋮---- "github.com/stretchr/testify/require" ⋮---- func TestNew(t *testing.T) ⋮---- func TestDefaultConfig(t *testing.T) ⋮---- func TestSetHandler_Success(t *testing.T) ⋮---- func TestSetHandler_FailsWhenHandlersAlreadySet(t *testing.T) ⋮---- func TestSetHandler_FailsWhenWorkersAlreadyStarted(t *testing.T) ⋮---- func TestSetHandler_FailsWhenAllHandlersAreNil(t *testing.T) ⋮---- func TestSetHandler_FiltersNilHandlers(t *testing.T) ⋮---- func TestEmit_SuccessWithHandlers(t *testing.T) ⋮---- func TestEmit_ReturnsNilWhenNoHandlersSet(t *testing.T) ⋮---- func TestEmit_FailsWhenSignalIsStopped(t *testing.T) ⋮---- func TestEmitWithTimeout_SuccessWithinTimeout(t *testing.T) ⋮---- func TestEmitWithTimeout_TimesOutWhenQueueIsFull(t *testing.T) ⋮---- // Fill the queue ⋮---- func TestEmitWithTimeout_ReturnsNilWhenNoHandlersSet(t *testing.T) ⋮---- func TestEmitNonBlocking_SuccessWhenQueueHasSpace(t *testing.T) ⋮---- func TestEmitNonBlocking_ReturnsFalseWhenQueueIsFull(t *testing.T) ⋮---- func TestEmitNonBlocking_ReturnsFalseWhenSignalIsStopped(t *testing.T) ⋮---- func TestStartWorkers_Success(t *testing.T) ⋮---- func TestStartWorkers_FailsWhenNoHandlersSet(t *testing.T) ⋮---- func TestStartWorkers_FailsWhenWorkersAlreadyStarted(t *testing.T) ⋮---- func TestWorkerProcessing_ProcessesEventsSuccessfully(t *testing.T) ⋮---- var callCount atomic.Int32 ⋮---- // Emit events ⋮---- // Wait for processing ⋮---- func TestWorkerProcessing_ExecutesMultipleHandlersSequentially(t *testing.T) ⋮---- require.Equal(t, int32(4), callCount.Load()) // 2 events * 2 handlers ⋮---- func TestWorkerProcessing_ContinuesOnHandlerError(t *testing.T) ⋮---- // Emit event ⋮---- require.Equal(t, int32(2), callCount.Load()) // Both handlers should be called despite first one erroring ⋮---- func TestWorkerShutdown_OnContextCancellation(t *testing.T) ⋮---- // Emit an event ⋮---- // Wait for processing to start ⋮---- // Cancel context ⋮---- // Unblock handler ⋮---- // Wait for shutdown ⋮---- func TestWorkerShutdown_MultipleWorkersGracefully(t *testing.T) ⋮---- var wg sync.WaitGroup ⋮---- // Emit multiple events ⋮---- // Cancel and wait for shutdown ⋮---- func TestConcurrency_ConcurrentEmitsAreSafe(t *testing.T) ```` ## File: pkg/signals/signal.go ````go package signals ⋮---- import ( "context" "log/slog" "sync" "sync/atomic" "time" "github.com/go-errors/errors" ) ⋮---- "context" "log/slog" "sync" "sync/atomic" "time" ⋮---- "github.com/go-errors/errors" ⋮---- const ( // EmitTimeout is the default timeout for emitting events to the signal queue. EmitTimeout = 10 * time.Second ) ⋮---- // EmitTimeout is the default timeout for emitting events to the signal queue. ⋮---- // Signal provides a type-safe, concurrent event processing system with configurable worker pools. // It uses a buffered channel queue to handle events and multiple worker goroutines for parallel processing. type Signal[T any] struct { queue chan Event[T] handlers []SignalListener[T] maxWorkers int id string // Internal state started bool stopped atomic.Bool mutex sync.RWMutex } ⋮---- // Internal state ⋮---- // Config defines the configuration for a Signal instance. type Config struct { // BufferSize sets the size of the internal event queue buffer (minimum 5) BufferSize int `mapstructure:"buffer-size" validate:"gte=5"` // WorkerCount sets the number of worker goroutines to process events (5-100) WorkerCount int `mapstructure:"worker-count" validate:"gte=5,lte=100"` } ⋮---- // BufferSize sets the size of the internal event queue buffer (minimum 5) ⋮---- // WorkerCount sets the number of worker goroutines to process events (5-100) ⋮---- func DefaultConfig() Config ⋮---- // Event represents a signal event containing both payload data and execution context. type Event[T any] struct { // Payload contains the actual event data Payload T // Ctx is the context associated with this event for cancellation and timeout handling Ctx context.Context } ⋮---- // Payload contains the actual event data ⋮---- // Ctx is the context associated with this event for cancellation and timeout handling ⋮---- // SignalListener defines the function signature for handling signal events. // It receives the event context and payload, returning an error if processing fails. type SignalListener[T any] func(context.Context, T) error ⋮---- // New creates a new Signal instance with the specified configuration. // Handlers can be provided during construction or set later using SetHandlers. // The id is used for logging and error identification. // Nil handlers are automatically filtered out. func New[T any](cfg Config, id string, handlers ...SignalListener[T]) *Signal[T] ⋮---- // Filter out nil handlers var validHandlers []SignalListener[T] ⋮---- // SetHandlers sets the event handlers for this signal. // Returns an error if workers are started or handlers are already set, as handlers cannot be replaced. // This method is thread-safe and should be called before starting workers. // Accepts one or more handlers which will be executed sequentially in the order provided. ⋮---- func (s *Signal[T]) SetHandlers(handlers ...SignalListener[T]) error ⋮---- // Emit sends an event to the signal queue using the default EmitTimeout. // It will block if the queue is full until the timeout is reached. // Returns an error if workers have stopped. // Use EmitNonBlocking if you want non-blocking behavior or EmitWithTimeout for custom timeouts. func (s *Signal[T]) Emit(payload T) error ⋮---- // EmitWithTimeout sends an event to the signal queue with a custom timeout. // Returns an error if the event cannot be queued within the timeout period or if workers have stopped. func (s *Signal[T]) EmitWithTimeout(payload T, timeout time.Duration) error ⋮---- // We might not have handlers set for specific signals like the signals dealing // with aggregation on non aggregator nodes in such case we ignore the event completely // if we don't ignore the queue will get full and requests will timeout ⋮---- // EmitNonBlocking attempts to send an event without blocking. // Returns true if the event was sent, false if the queue is full or workers have stopped. func (s *Signal[T]) EmitNonBlocking(ctx context.Context, payload T) bool ⋮---- // StartWorkers starts the configured number of worker goroutines to process events from the queue. // It should be called once during application startup and cannot be called again. // All workers will gracefully shut down when the provided context is cancelled. // The signal automatically marks itself as stopped and closes the queue when all workers exit. // Returns an error if workers are already started or if no signal handler is set. func (s *Signal[T]) StartWorkers(ctx context.Context) error ⋮---- var shutdownWG sync.WaitGroup ⋮---- // Execute all handlers regardless of errors ⋮---- // Continue executing remaining handlers ⋮---- // wait for all workers to finish ```` ## File: symbiotic/client/evm/abi/IKeyRegistry.abi.json ````json [ { "type": "function", "name": "getKey", "inputs": [ { "name": "operator", "type": "address", "internalType": "address" }, { "name": "tag", "type": "uint8", "internalType": "uint8" } ], "outputs": [ { "name": "", "type": "bytes", "internalType": "bytes" } ], "stateMutability": "view" }, { "type": "function", "name": "getKeyAt", "inputs": [ { "name": "operator", "type": "address", "internalType": "address" }, { "name": "tag", "type": "uint8", "internalType": "uint8" }, { "name": "timestamp", "type": "uint48", "internalType": "uint48" } ], "outputs": [ { "name": "", "type": "bytes", "internalType": "bytes" } ], "stateMutability": "view" }, { "type": "function", "name": "getKeys", "inputs": [], "outputs": [ { "name": "", "type": "tuple[]", "internalType": "struct IKeyRegistry.OperatorWithKeys[]", "components": [ { "name": "operator", "type": "address", "internalType": "address" }, { "name": "keys", "type": "tuple[]", "internalType": "struct IKeyRegistry.Key[]", "components": [ { "name": "tag", "type": "uint8", "internalType": "uint8" }, { "name": "payload", "type": "bytes", "internalType": "bytes" } ] } ] } ], "stateMutability": "view" }, { "type": "function", "name": "getKeys", "inputs": [ { "name": "operator", "type": "address", "internalType": "address" } ], "outputs": [ { "name": "", "type": "tuple[]", "internalType": "struct IKeyRegistry.Key[]", "components": [ { "name": "tag", "type": "uint8", "internalType": "uint8" }, { "name": "payload", "type": "bytes", "internalType": "bytes" } ] } ], "stateMutability": "view" }, { "type": "function", "name": "getKeysAt", "inputs": [ { "name": "timestamp", "type": "uint48", "internalType": "uint48" } ], "outputs": [ { "name": "", "type": "tuple[]", "internalType": "struct IKeyRegistry.OperatorWithKeys[]", "components": [ { "name": "operator", "type": "address", "internalType": "address" }, { "name": "keys", "type": "tuple[]", "internalType": "struct IKeyRegistry.Key[]", "components": [ { "name": "tag", "type": "uint8", "internalType": "uint8" }, { "name": "payload", "type": "bytes", "internalType": "bytes" } ] } ] } ], "stateMutability": "view" }, { "type": "function", "name": "getKeysAt", "inputs": [ { "name": "operator", "type": "address", "internalType": "address" }, { "name": "timestamp", "type": "uint48", "internalType": "uint48" } ], "outputs": [ { "name": "", "type": "tuple[]", "internalType": "struct IKeyRegistry.Key[]", "components": [ { "name": "tag", "type": "uint8", "internalType": "uint8" }, { "name": "payload", "type": "bytes", "internalType": "bytes" } ] } ], "stateMutability": "view" }, { "type": "function", "name": "getKeysOperators", "inputs": [], "outputs": [ { "name": "", "type": "address[]", "internalType": "address[]" } ], "stateMutability": "view" }, { "type": "function", "name": "getKeysOperatorsAt", "inputs": [ { "name": "timestamp", "type": "uint48", "internalType": "uint48" } ], "outputs": [ { "name": "", "type": "address[]", "internalType": "address[]" } ], "stateMutability": "view" }, { "type": "function", "name": "getKeysOperatorsLength", "inputs": [], "outputs": [ { "name": "", "type": "uint256", "internalType": "uint256" } ], "stateMutability": "view" }, { "type": "function", "name": "getOperator", "inputs": [ { "name": "key", "type": "bytes", "internalType": "bytes" } ], "outputs": [ { "name": "", "type": "address", "internalType": "address" } ], "stateMutability": "view" }, { "type": "function", "name": "setKey", "inputs": [ { "name": "tag", "type": "uint8", "internalType": "uint8" }, { "name": "key", "type": "bytes", "internalType": "bytes" }, { "name": "signature", "type": "bytes", "internalType": "bytes" }, { "name": "extraData", "type": "bytes", "internalType": "bytes" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "event", "name": "SetKey", "inputs": [ { "name": "operator", "type": "address", "indexed": true, "internalType": "address" }, { "name": "tag", "type": "uint8", "indexed": true, "internalType": "uint8" }, { "name": "key", "type": "bytes", "indexed": true, "internalType": "bytes" }, { "name": "extraData", "type": "bytes", "indexed": false, "internalType": "bytes" } ], "anonymous": false }, { "type": "error", "name": "KeyRegistry_AlreadyUsed", "inputs": [] }, { "type": "error", "name": "KeyRegistry_InvalidKeySignature", "inputs": [] }, { "type": "error", "name": "KeyRegistry_InvalidKeyType", "inputs": [] } ] ```` ## File: symbiotic/client/evm/abi/ISettlement.abi.json ````json [ { "type": "function", "name": "NETWORK", "inputs": [], "outputs": [ { "name": "", "type": "address", "internalType": "address" } ], "stateMutability": "view" }, { "type": "function", "name": "SUBNETWORK", "inputs": [], "outputs": [ { "name": "", "type": "bytes32", "internalType": "bytes32" } ], "stateMutability": "view" }, { "type": "function", "name": "SUBNETWORK_IDENTIFIER", "inputs": [], "outputs": [ { "name": "", "type": "uint96", "internalType": "uint96" } ], "stateMutability": "view" }, { "type": "function", "name": "VALIDATOR_SET_VERSION", "inputs": [], "outputs": [ { "name": "", "type": "uint8", "internalType": "uint8" } ], "stateMutability": "view" }, { "type": "function", "name": "commitValSetHeader", "inputs": [ { "name": "header", "type": "tuple", "internalType": "struct ISettlement.ValSetHeader", "components": [ { "name": "version", "type": "uint8", "internalType": "uint8" }, { "name": "requiredKeyTag", "type": "uint8", "internalType": "uint8" }, { "name": "epoch", "type": "uint48", "internalType": "uint48" }, { "name": "captureTimestamp", "type": "uint48", "internalType": "uint48" }, { "name": "quorumThreshold", "type": "uint256", "internalType": "uint256" }, { "name": "totalVotingPower", "type": "uint256", "internalType": "uint256" }, { "name": "validatorsSszMRoot", "type": "bytes32", "internalType": "bytes32" } ] }, { "name": "extraData", "type": "tuple[]", "internalType": "struct ISettlement.ExtraData[]", "components": [ { "name": "key", "type": "bytes32", "internalType": "bytes32" }, { "name": "value", "type": "bytes32", "internalType": "bytes32" } ] }, { "name": "proof", "type": "bytes", "internalType": "bytes" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "eip712Domain", "inputs": [], "outputs": [ { "name": "fields", "type": "bytes1", "internalType": "bytes1" }, { "name": "name", "type": "string", "internalType": "string" }, { "name": "version", "type": "string", "internalType": "string" }, { "name": "chainId", "type": "uint256", "internalType": "uint256" }, { "name": "verifyingContract", "type": "address", "internalType": "address" }, { "name": "salt", "type": "bytes32", "internalType": "bytes32" }, { "name": "extensions", "type": "uint256[]", "internalType": "uint256[]" } ], "stateMutability": "view" }, { "type": "function", "name": "getCaptureTimestampFromValSetHeader", "inputs": [], "outputs": [ { "name": "", "type": "uint48", "internalType": "uint48" } ], "stateMutability": "view" }, { "type": "function", "name": "getCaptureTimestampFromValSetHeaderAt", "inputs": [ { "name": "epoch", "type": "uint48", "internalType": "uint48" } ], "outputs": [ { "name": "", "type": "uint48", "internalType": "uint48" } ], "stateMutability": "view" }, { "type": "function", "name": "getExtraData", "inputs": [ { "name": "key", "type": "bytes32", "internalType": "bytes32" } ], "outputs": [ { "name": "", "type": "bytes32", "internalType": "bytes32" } ], "stateMutability": "view" }, { "type": "function", "name": "getExtraDataAt", "inputs": [ { "name": "epoch", "type": "uint48", "internalType": "uint48" }, { "name": "key", "type": "bytes32", "internalType": "bytes32" } ], "outputs": [ { "name": "", "type": "bytes32", "internalType": "bytes32" } ], "stateMutability": "view" }, { "type": "function", "name": "getLastCommittedHeaderEpoch", "inputs": [], "outputs": [ { "name": "", "type": "uint48", "internalType": "uint48" } ], "stateMutability": "view" }, { "type": "function", "name": "getQuorumThresholdFromValSetHeader", "inputs": [], "outputs": [ { "name": "", "type": "uint256", "internalType": "uint256" } ], "stateMutability": "view" }, { "type": "function", "name": "getQuorumThresholdFromValSetHeaderAt", "inputs": [ { "name": "epoch", "type": "uint48", "internalType": "uint48" } ], "outputs": [ { "name": "", "type": "uint256", "internalType": "uint256" } ], "stateMutability": "view" }, { "type": "function", "name": "getRequiredKeyTagFromValSetHeader", "inputs": [], "outputs": [ { "name": "", "type": "uint8", "internalType": "uint8" } ], "stateMutability": "view" }, { "type": "function", "name": "getRequiredKeyTagFromValSetHeaderAt", "inputs": [ { "name": "epoch", "type": "uint48", "internalType": "uint48" } ], "outputs": [ { "name": "", "type": "uint8", "internalType": "uint8" } ], "stateMutability": "view" }, { "type": "function", "name": "getSigVerifier", "inputs": [], "outputs": [ { "name": "", "type": "address", "internalType": "address" } ], "stateMutability": "view" }, { "type": "function", "name": "getSigVerifierAt", "inputs": [ { "name": "epoch", "type": "uint48", "internalType": "uint48" }, { "name": "hint", "type": "bytes", "internalType": "bytes" } ], "outputs": [ { "name": "", "type": "address", "internalType": "address" } ], "stateMutability": "view" }, { "type": "function", "name": "getTotalVotingPowerFromValSetHeader", "inputs": [], "outputs": [ { "name": "", "type": "uint256", "internalType": "uint256" } ], "stateMutability": "view" }, { "type": "function", "name": "getTotalVotingPowerFromValSetHeaderAt", "inputs": [ { "name": "epoch", "type": "uint48", "internalType": "uint48" } ], "outputs": [ { "name": "", "type": "uint256", "internalType": "uint256" } ], "stateMutability": "view" }, { "type": "function", "name": "getValSetHeader", "inputs": [], "outputs": [ { "name": "header", "type": "tuple", "internalType": "struct ISettlement.ValSetHeader", "components": [ { "name": "version", "type": "uint8", "internalType": "uint8" }, { "name": "requiredKeyTag", "type": "uint8", "internalType": "uint8" }, { "name": "epoch", "type": "uint48", "internalType": "uint48" }, { "name": "captureTimestamp", "type": "uint48", "internalType": "uint48" }, { "name": "quorumThreshold", "type": "uint256", "internalType": "uint256" }, { "name": "totalVotingPower", "type": "uint256", "internalType": "uint256" }, { "name": "validatorsSszMRoot", "type": "bytes32", "internalType": "bytes32" } ] } ], "stateMutability": "view" }, { "type": "function", "name": "getValSetHeaderAt", "inputs": [ { "name": "epoch", "type": "uint48", "internalType": "uint48" } ], "outputs": [ { "name": "", "type": "tuple", "internalType": "struct ISettlement.ValSetHeader", "components": [ { "name": "version", "type": "uint8", "internalType": "uint8" }, { "name": "requiredKeyTag", "type": "uint8", "internalType": "uint8" }, { "name": "epoch", "type": "uint48", "internalType": "uint48" }, { "name": "captureTimestamp", "type": "uint48", "internalType": "uint48" }, { "name": "quorumThreshold", "type": "uint256", "internalType": "uint256" }, { "name": "totalVotingPower", "type": "uint256", "internalType": "uint256" }, { "name": "validatorsSszMRoot", "type": "bytes32", "internalType": "bytes32" } ] } ], "stateMutability": "view" }, { "type": "function", "name": "getValSetHeaderHash", "inputs": [], "outputs": [ { "name": "", "type": "bytes32", "internalType": "bytes32" } ], "stateMutability": "view" }, { "type": "function", "name": "getValSetHeaderHashAt", "inputs": [ { "name": "epoch", "type": "uint48", "internalType": "uint48" } ], "outputs": [ { "name": "", "type": "bytes32", "internalType": "bytes32" } ], "stateMutability": "view" }, { "type": "function", "name": "getValidatorsSszMRootFromValSetHeader", "inputs": [], "outputs": [ { "name": "", "type": "bytes32", "internalType": "bytes32" } ], "stateMutability": "view" }, { "type": "function", "name": "getValidatorsSszMRootFromValSetHeaderAt", "inputs": [ { "name": "epoch", "type": "uint48", "internalType": "uint48" } ], "outputs": [ { "name": "", "type": "bytes32", "internalType": "bytes32" } ], "stateMutability": "view" }, { "type": "function", "name": "getVersionFromValSetHeader", "inputs": [], "outputs": [ { "name": "", "type": "uint8", "internalType": "uint8" } ], "stateMutability": "view" }, { "type": "function", "name": "getVersionFromValSetHeaderAt", "inputs": [ { "name": "epoch", "type": "uint48", "internalType": "uint48" } ], "outputs": [ { "name": "", "type": "uint8", "internalType": "uint8" } ], "stateMutability": "view" }, { "type": "function", "name": "hashTypedDataV4", "inputs": [ { "name": "structHash", "type": "bytes32", "internalType": "bytes32" } ], "outputs": [ { "name": "", "type": "bytes32", "internalType": "bytes32" } ], "stateMutability": "view" }, { "type": "function", "name": "hashTypedDataV4CrossChain", "inputs": [ { "name": "structHash", "type": "bytes32", "internalType": "bytes32" } ], "outputs": [ { "name": "", "type": "bytes32", "internalType": "bytes32" } ], "stateMutability": "view" }, { "type": "function", "name": "isValSetHeaderCommittedAt", "inputs": [ { "name": "epoch", "type": "uint48", "internalType": "uint48" } ], "outputs": [ { "name": "", "type": "bool", "internalType": "bool" } ], "stateMutability": "view" }, { "type": "function", "name": "setGenesis", "inputs": [ { "name": "valSetHeader", "type": "tuple", "internalType": "struct ISettlement.ValSetHeader", "components": [ { "name": "version", "type": "uint8", "internalType": "uint8" }, { "name": "requiredKeyTag", "type": "uint8", "internalType": "uint8" }, { "name": "epoch", "type": "uint48", "internalType": "uint48" }, { "name": "captureTimestamp", "type": "uint48", "internalType": "uint48" }, { "name": "quorumThreshold", "type": "uint256", "internalType": "uint256" }, { "name": "totalVotingPower", "type": "uint256", "internalType": "uint256" }, { "name": "validatorsSszMRoot", "type": "bytes32", "internalType": "bytes32" } ] }, { "name": "extraData", "type": "tuple[]", "internalType": "struct ISettlement.ExtraData[]", "components": [ { "name": "key", "type": "bytes32", "internalType": "bytes32" }, { "name": "value", "type": "bytes32", "internalType": "bytes32" } ] } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "setSigVerifier", "inputs": [ { "name": "sigVerifier", "type": "address", "internalType": "address" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "staticDelegateCall", "inputs": [ { "name": "target", "type": "address", "internalType": "address" }, { "name": "data", "type": "bytes", "internalType": "bytes" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "verifyQuorumSig", "inputs": [ { "name": "message", "type": "bytes", "internalType": "bytes" }, { "name": "keyTag", "type": "uint8", "internalType": "uint8" }, { "name": "quorumThreshold", "type": "uint256", "internalType": "uint256" }, { "name": "proof", "type": "bytes", "internalType": "bytes" } ], "outputs": [ { "name": "", "type": "bool", "internalType": "bool" } ], "stateMutability": "view" }, { "type": "function", "name": "verifyQuorumSigAt", "inputs": [ { "name": "message", "type": "bytes", "internalType": "bytes" }, { "name": "keyTag", "type": "uint8", "internalType": "uint8" }, { "name": "quorumThreshold", "type": "uint256", "internalType": "uint256" }, { "name": "proof", "type": "bytes", "internalType": "bytes" }, { "name": "epoch", "type": "uint48", "internalType": "uint48" }, { "name": "hint", "type": "bytes", "internalType": "bytes" } ], "outputs": [ { "name": "", "type": "bool", "internalType": "bool" } ], "stateMutability": "view" }, { "type": "event", "name": "CommitValSetHeader", "inputs": [ { "name": "valSetHeader", "type": "tuple", "indexed": false, "internalType": "struct ISettlement.ValSetHeader", "components": [ { "name": "version", "type": "uint8", "internalType": "uint8" }, { "name": "requiredKeyTag", "type": "uint8", "internalType": "uint8" }, { "name": "epoch", "type": "uint48", "internalType": "uint48" }, { "name": "captureTimestamp", "type": "uint48", "internalType": "uint48" }, { "name": "quorumThreshold", "type": "uint256", "internalType": "uint256" }, { "name": "totalVotingPower", "type": "uint256", "internalType": "uint256" }, { "name": "validatorsSszMRoot", "type": "bytes32", "internalType": "bytes32" } ] }, { "name": "extraData", "type": "tuple[]", "indexed": false, "internalType": "struct ISettlement.ExtraData[]", "components": [ { "name": "key", "type": "bytes32", "internalType": "bytes32" }, { "name": "value", "type": "bytes32", "internalType": "bytes32" } ] } ], "anonymous": false }, { "type": "event", "name": "EIP712DomainChanged", "inputs": [], "anonymous": false }, { "type": "event", "name": "InitEIP712", "inputs": [ { "name": "name", "type": "string", "indexed": false, "internalType": "string" }, { "name": "version", "type": "string", "indexed": false, "internalType": "string" } ], "anonymous": false }, { "type": "event", "name": "InitSigVerifier", "inputs": [ { "name": "sigVerifier", "type": "address", "indexed": false, "internalType": "address" } ], "anonymous": false }, { "type": "event", "name": "InitSubnetwork", "inputs": [ { "name": "network", "type": "address", "indexed": false, "internalType": "address" }, { "name": "subnetworkId", "type": "uint96", "indexed": false, "internalType": "uint96" } ], "anonymous": false }, { "type": "event", "name": "Initialized", "inputs": [ { "name": "version", "type": "uint64", "indexed": false, "internalType": "uint64" } ], "anonymous": false }, { "type": "event", "name": "SetGenesis", "inputs": [ { "name": "valSetHeader", "type": "tuple", "indexed": false, "internalType": "struct ISettlement.ValSetHeader", "components": [ { "name": "version", "type": "uint8", "internalType": "uint8" }, { "name": "requiredKeyTag", "type": "uint8", "internalType": "uint8" }, { "name": "epoch", "type": "uint48", "internalType": "uint48" }, { "name": "captureTimestamp", "type": "uint48", "internalType": "uint48" }, { "name": "quorumThreshold", "type": "uint256", "internalType": "uint256" }, { "name": "totalVotingPower", "type": "uint256", "internalType": "uint256" }, { "name": "validatorsSszMRoot", "type": "bytes32", "internalType": "bytes32" } ] }, { "name": "extraData", "type": "tuple[]", "indexed": false, "internalType": "struct ISettlement.ExtraData[]", "components": [ { "name": "key", "type": "bytes32", "internalType": "bytes32" }, { "name": "value", "type": "bytes32", "internalType": "bytes32" } ] } ], "anonymous": false }, { "type": "event", "name": "SetSigVerifier", "inputs": [ { "name": "sigVerifier", "type": "address", "indexed": false, "internalType": "address" } ], "anonymous": false }, { "type": "error", "name": "CheckpointUnorderedInsertion", "inputs": [] }, { "type": "error", "name": "InvalidInitialization", "inputs": [] }, { "type": "error", "name": "InvalidKeyTag", "inputs": [] }, { "type": "error", "name": "NetworkManager_InvalidNetwork", "inputs": [] }, { "type": "error", "name": "NotInitializing", "inputs": [] }, { "type": "error", "name": "Settlement_DuplicateExtraDataKey", "inputs": [] }, { "type": "error", "name": "Settlement_InvalidCaptureTimestamp", "inputs": [] }, { "type": "error", "name": "Settlement_InvalidEpoch", "inputs": [] }, { "type": "error", "name": "Settlement_InvalidSigVerifier", "inputs": [] }, { "type": "error", "name": "Settlement_InvalidValidatorsSszMRoot", "inputs": [] }, { "type": "error", "name": "Settlement_InvalidVersion", "inputs": [] }, { "type": "error", "name": "Settlement_QuorumThresholdGtTotalVotingPower", "inputs": [] }, { "type": "error", "name": "Settlement_ValSetHeaderAlreadyCommitted", "inputs": [] }, { "type": "error", "name": "Settlement_VerificationFailed", "inputs": [] } ] ```` ## File: symbiotic/client/evm/abi/IValSetDriver.abi.json ````json [ { "type": "function", "name": "MAX_QUORUM_THRESHOLD", "inputs": [], "outputs": [ { "name": "", "type": "uint248", "internalType": "uint248" } ], "stateMutability": "view" }, { "type": "function", "name": "NETWORK", "inputs": [], "outputs": [ { "name": "", "type": "address", "internalType": "address" } ], "stateMutability": "view" }, { "type": "function", "name": "SUBNETWORK", "inputs": [], "outputs": [ { "name": "", "type": "bytes32", "internalType": "bytes32" } ], "stateMutability": "view" }, { "type": "function", "name": "SUBNETWORK_IDENTIFIER", "inputs": [], "outputs": [ { "name": "", "type": "uint96", "internalType": "uint96" } ], "stateMutability": "view" }, { "type": "function", "name": "addQuorumThreshold", "inputs": [ { "name": "quorumThreshold", "type": "tuple", "internalType": "struct IValSetDriver.QuorumThreshold", "components": [ { "name": "keyTag", "type": "uint8", "internalType": "uint8" }, { "name": "quorumThreshold", "type": "uint248", "internalType": "uint248" } ] } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "addSettlement", "inputs": [ { "name": "settlement", "type": "tuple", "internalType": "struct IValSetDriver.CrossChainAddress", "components": [ { "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "addr", "type": "address", "internalType": "address" } ] } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "addVotingPowerProvider", "inputs": [ { "name": "votingPowerProvider", "type": "tuple", "internalType": "struct IValSetDriver.CrossChainAddress", "components": [ { "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "addr", "type": "address", "internalType": "address" } ] } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "getConfig", "inputs": [], "outputs": [ { "name": "", "type": "tuple", "internalType": "struct IValSetDriver.Config", "components": [ { "name": "numAggregators", "type": "uint208", "internalType": "uint208" }, { "name": "numCommitters", "type": "uint208", "internalType": "uint208" }, { "name": "votingPowerProviders", "type": "tuple[]", "internalType": "struct IValSetDriver.CrossChainAddress[]", "components": [ { "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "addr", "type": "address", "internalType": "address" } ] }, { "name": "keysProvider", "type": "tuple", "internalType": "struct IValSetDriver.CrossChainAddress", "components": [ { "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "addr", "type": "address", "internalType": "address" } ] }, { "name": "settlements", "type": "tuple[]", "internalType": "struct IValSetDriver.CrossChainAddress[]", "components": [ { "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "addr", "type": "address", "internalType": "address" } ] }, { "name": "maxVotingPower", "type": "uint256", "internalType": "uint256" }, { "name": "minInclusionVotingPower", "type": "uint256", "internalType": "uint256" }, { "name": "maxValidatorsCount", "type": "uint208", "internalType": "uint208" }, { "name": "requiredKeyTags", "type": "uint8[]", "internalType": "uint8[]" }, { "name": "quorumThresholds", "type": "tuple[]", "internalType": "struct IValSetDriver.QuorumThreshold[]", "components": [ { "name": "keyTag", "type": "uint8", "internalType": "uint8" }, { "name": "quorumThreshold", "type": "uint248", "internalType": "uint248" } ] }, { "name": "requiredHeaderKeyTag", "type": "uint8", "internalType": "uint8" }, { "name": "verificationType", "type": "uint32", "internalType": "uint32" } ] } ], "stateMutability": "view" }, { "type": "function", "name": "getConfigAt", "inputs": [ { "name": "timestamp", "type": "uint48", "internalType": "uint48" } ], "outputs": [ { "name": "", "type": "tuple", "internalType": "struct IValSetDriver.Config", "components": [ { "name": "numAggregators", "type": "uint208", "internalType": "uint208" }, { "name": "numCommitters", "type": "uint208", "internalType": "uint208" }, { "name": "votingPowerProviders", "type": "tuple[]", "internalType": "struct IValSetDriver.CrossChainAddress[]", "components": [ { "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "addr", "type": "address", "internalType": "address" } ] }, { "name": "keysProvider", "type": "tuple", "internalType": "struct IValSetDriver.CrossChainAddress", "components": [ { "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "addr", "type": "address", "internalType": "address" } ] }, { "name": "settlements", "type": "tuple[]", "internalType": "struct IValSetDriver.CrossChainAddress[]", "components": [ { "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "addr", "type": "address", "internalType": "address" } ] }, { "name": "maxVotingPower", "type": "uint256", "internalType": "uint256" }, { "name": "minInclusionVotingPower", "type": "uint256", "internalType": "uint256" }, { "name": "maxValidatorsCount", "type": "uint208", "internalType": "uint208" }, { "name": "requiredKeyTags", "type": "uint8[]", "internalType": "uint8[]" }, { "name": "quorumThresholds", "type": "tuple[]", "internalType": "struct IValSetDriver.QuorumThreshold[]", "components": [ { "name": "keyTag", "type": "uint8", "internalType": "uint8" }, { "name": "quorumThreshold", "type": "uint248", "internalType": "uint248" } ] }, { "name": "requiredHeaderKeyTag", "type": "uint8", "internalType": "uint8" }, { "name": "verificationType", "type": "uint32", "internalType": "uint32" } ] } ], "stateMutability": "view" }, { "type": "function", "name": "getCurrentEpoch", "inputs": [], "outputs": [ { "name": "", "type": "uint48", "internalType": "uint48" } ], "stateMutability": "view" }, { "type": "function", "name": "getCurrentEpochDuration", "inputs": [], "outputs": [ { "name": "epochDuration", "type": "uint48", "internalType": "uint48" } ], "stateMutability": "view" }, { "type": "function", "name": "getCurrentEpochStart", "inputs": [], "outputs": [ { "name": "", "type": "uint48", "internalType": "uint48" } ], "stateMutability": "view" }, { "type": "function", "name": "getEpochDuration", "inputs": [ { "name": "epoch", "type": "uint48", "internalType": "uint48" } ], "outputs": [ { "name": "epochDuration", "type": "uint48", "internalType": "uint48" } ], "stateMutability": "view" }, { "type": "function", "name": "getEpochIndex", "inputs": [ { "name": "timestamp", "type": "uint48", "internalType": "uint48" } ], "outputs": [ { "name": "", "type": "uint48", "internalType": "uint48" } ], "stateMutability": "view" }, { "type": "function", "name": "getEpochStart", "inputs": [ { "name": "epoch", "type": "uint48", "internalType": "uint48" } ], "outputs": [ { "name": "", "type": "uint48", "internalType": "uint48" } ], "stateMutability": "view" }, { "type": "function", "name": "getKeysProvider", "inputs": [], "outputs": [ { "name": "", "type": "tuple", "internalType": "struct IValSetDriver.CrossChainAddress", "components": [ { "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "addr", "type": "address", "internalType": "address" } ] } ], "stateMutability": "view" }, { "type": "function", "name": "getKeysProviderAt", "inputs": [ { "name": "timestamp", "type": "uint48", "internalType": "uint48" } ], "outputs": [ { "name": "", "type": "tuple", "internalType": "struct IValSetDriver.CrossChainAddress", "components": [ { "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "addr", "type": "address", "internalType": "address" } ] } ], "stateMutability": "view" }, { "type": "function", "name": "getMaxValidatorsCount", "inputs": [], "outputs": [ { "name": "", "type": "uint208", "internalType": "uint208" } ], "stateMutability": "view" }, { "type": "function", "name": "getMaxValidatorsCountAt", "inputs": [ { "name": "timestamp", "type": "uint48", "internalType": "uint48" } ], "outputs": [ { "name": "", "type": "uint208", "internalType": "uint208" } ], "stateMutability": "view" }, { "type": "function", "name": "getMaxVotingPower", "inputs": [], "outputs": [ { "name": "", "type": "uint256", "internalType": "uint256" } ], "stateMutability": "view" }, { "type": "function", "name": "getMaxVotingPowerAt", "inputs": [ { "name": "timestamp", "type": "uint48", "internalType": "uint48" } ], "outputs": [ { "name": "", "type": "uint256", "internalType": "uint256" } ], "stateMutability": "view" }, { "type": "function", "name": "getMinInclusionVotingPower", "inputs": [], "outputs": [ { "name": "", "type": "uint256", "internalType": "uint256" } ], "stateMutability": "view" }, { "type": "function", "name": "getMinInclusionVotingPowerAt", "inputs": [ { "name": "timestamp", "type": "uint48", "internalType": "uint48" } ], "outputs": [ { "name": "", "type": "uint256", "internalType": "uint256" } ], "stateMutability": "view" }, { "type": "function", "name": "getNextEpoch", "inputs": [], "outputs": [ { "name": "", "type": "uint48", "internalType": "uint48" } ], "stateMutability": "view" }, { "type": "function", "name": "getNextEpochDuration", "inputs": [], "outputs": [ { "name": "", "type": "uint48", "internalType": "uint48" } ], "stateMutability": "view" }, { "type": "function", "name": "getNextEpochStart", "inputs": [], "outputs": [ { "name": "", "type": "uint48", "internalType": "uint48" } ], "stateMutability": "view" }, { "type": "function", "name": "getNumAggregators", "inputs": [], "outputs": [ { "name": "", "type": "uint208", "internalType": "uint208" } ], "stateMutability": "view" }, { "type": "function", "name": "getNumAggregatorsAt", "inputs": [ { "name": "timestamp", "type": "uint48", "internalType": "uint48" } ], "outputs": [ { "name": "", "type": "uint208", "internalType": "uint208" } ], "stateMutability": "view" }, { "type": "function", "name": "getNumCommitters", "inputs": [], "outputs": [ { "name": "", "type": "uint208", "internalType": "uint208" } ], "stateMutability": "view" }, { "type": "function", "name": "getNumCommittersAt", "inputs": [ { "name": "timestamp", "type": "uint48", "internalType": "uint48" } ], "outputs": [ { "name": "", "type": "uint208", "internalType": "uint208" } ], "stateMutability": "view" }, { "type": "function", "name": "getQuorumThresholds", "inputs": [], "outputs": [ { "name": "quorumThresholds", "type": "tuple[]", "internalType": "struct IValSetDriver.QuorumThreshold[]", "components": [ { "name": "keyTag", "type": "uint8", "internalType": "uint8" }, { "name": "quorumThreshold", "type": "uint248", "internalType": "uint248" } ] } ], "stateMutability": "view" }, { "type": "function", "name": "getQuorumThresholdsAt", "inputs": [ { "name": "timestamp", "type": "uint48", "internalType": "uint48" } ], "outputs": [ { "name": "quorumThresholds", "type": "tuple[]", "internalType": "struct IValSetDriver.QuorumThreshold[]", "components": [ { "name": "keyTag", "type": "uint8", "internalType": "uint8" }, { "name": "quorumThreshold", "type": "uint248", "internalType": "uint248" } ] } ], "stateMutability": "view" }, { "type": "function", "name": "getRequiredHeaderKeyTag", "inputs": [], "outputs": [ { "name": "", "type": "uint8", "internalType": "uint8" } ], "stateMutability": "view" }, { "type": "function", "name": "getRequiredHeaderKeyTagAt", "inputs": [ { "name": "timestamp", "type": "uint48", "internalType": "uint48" } ], "outputs": [ { "name": "", "type": "uint8", "internalType": "uint8" } ], "stateMutability": "view" }, { "type": "function", "name": "getRequiredKeyTags", "inputs": [], "outputs": [ { "name": "requiredKeyTags", "type": "uint8[]", "internalType": "uint8[]" } ], "stateMutability": "view" }, { "type": "function", "name": "getRequiredKeyTagsAt", "inputs": [ { "name": "timestamp", "type": "uint48", "internalType": "uint48" } ], "outputs": [ { "name": "requiredKeyTags", "type": "uint8[]", "internalType": "uint8[]" } ], "stateMutability": "view" }, { "type": "function", "name": "getSettlements", "inputs": [], "outputs": [ { "name": "settlements", "type": "tuple[]", "internalType": "struct IValSetDriver.CrossChainAddress[]", "components": [ { "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "addr", "type": "address", "internalType": "address" } ] } ], "stateMutability": "view" }, { "type": "function", "name": "getSettlementsAt", "inputs": [ { "name": "timestamp", "type": "uint48", "internalType": "uint48" } ], "outputs": [ { "name": "settlements", "type": "tuple[]", "internalType": "struct IValSetDriver.CrossChainAddress[]", "components": [ { "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "addr", "type": "address", "internalType": "address" } ] } ], "stateMutability": "view" }, { "type": "function", "name": "getVerificationType", "inputs": [], "outputs": [ { "name": "", "type": "uint32", "internalType": "uint32" } ], "stateMutability": "view" }, { "type": "function", "name": "getVerificationTypeAt", "inputs": [ { "name": "timestamp", "type": "uint48", "internalType": "uint48" } ], "outputs": [ { "name": "", "type": "uint32", "internalType": "uint32" } ], "stateMutability": "view" }, { "type": "function", "name": "getVotingPowerProviders", "inputs": [], "outputs": [ { "name": "votingPowerProviders", "type": "tuple[]", "internalType": "struct IValSetDriver.CrossChainAddress[]", "components": [ { "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "addr", "type": "address", "internalType": "address" } ] } ], "stateMutability": "view" }, { "type": "function", "name": "getVotingPowerProvidersAt", "inputs": [ { "name": "timestamp", "type": "uint48", "internalType": "uint48" } ], "outputs": [ { "name": "votingPowerProviders", "type": "tuple[]", "internalType": "struct IValSetDriver.CrossChainAddress[]", "components": [ { "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "addr", "type": "address", "internalType": "address" } ] } ], "stateMutability": "view" }, { "type": "function", "name": "isQuorumThresholdRegistered", "inputs": [ { "name": "quorumThreshold", "type": "tuple", "internalType": "struct IValSetDriver.QuorumThreshold", "components": [ { "name": "keyTag", "type": "uint8", "internalType": "uint8" }, { "name": "quorumThreshold", "type": "uint248", "internalType": "uint248" } ] } ], "outputs": [ { "name": "", "type": "bool", "internalType": "bool" } ], "stateMutability": "view" }, { "type": "function", "name": "isQuorumThresholdRegisteredAt", "inputs": [ { "name": "quorumThreshold", "type": "tuple", "internalType": "struct IValSetDriver.QuorumThreshold", "components": [ { "name": "keyTag", "type": "uint8", "internalType": "uint8" }, { "name": "quorumThreshold", "type": "uint248", "internalType": "uint248" } ] }, { "name": "timestamp", "type": "uint48", "internalType": "uint48" } ], "outputs": [ { "name": "", "type": "bool", "internalType": "bool" } ], "stateMutability": "view" }, { "type": "function", "name": "isSettlementRegistered", "inputs": [ { "name": "settlement", "type": "tuple", "internalType": "struct IValSetDriver.CrossChainAddress", "components": [ { "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "addr", "type": "address", "internalType": "address" } ] } ], "outputs": [ { "name": "", "type": "bool", "internalType": "bool" } ], "stateMutability": "view" }, { "type": "function", "name": "isSettlementRegisteredAt", "inputs": [ { "name": "settlement", "type": "tuple", "internalType": "struct IValSetDriver.CrossChainAddress", "components": [ { "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "addr", "type": "address", "internalType": "address" } ] }, { "name": "timestamp", "type": "uint48", "internalType": "uint48" } ], "outputs": [ { "name": "", "type": "bool", "internalType": "bool" } ], "stateMutability": "view" }, { "type": "function", "name": "isVotingPowerProviderRegistered", "inputs": [ { "name": "votingPowerProvider", "type": "tuple", "internalType": "struct IValSetDriver.CrossChainAddress", "components": [ { "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "addr", "type": "address", "internalType": "address" } ] } ], "outputs": [ { "name": "", "type": "bool", "internalType": "bool" } ], "stateMutability": "view" }, { "type": "function", "name": "isVotingPowerProviderRegisteredAt", "inputs": [ { "name": "votingPowerProvider", "type": "tuple", "internalType": "struct IValSetDriver.CrossChainAddress", "components": [ { "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "addr", "type": "address", "internalType": "address" } ] }, { "name": "timestamp", "type": "uint48", "internalType": "uint48" } ], "outputs": [ { "name": "", "type": "bool", "internalType": "bool" } ], "stateMutability": "view" }, { "type": "function", "name": "multicall", "inputs": [ { "name": "data", "type": "bytes[]", "internalType": "bytes[]" } ], "outputs": [ { "name": "results", "type": "bytes[]", "internalType": "bytes[]" } ], "stateMutability": "nonpayable" }, { "type": "function", "name": "removeQuorumThreshold", "inputs": [ { "name": "quorumThreshold", "type": "tuple", "internalType": "struct IValSetDriver.QuorumThreshold", "components": [ { "name": "keyTag", "type": "uint8", "internalType": "uint8" }, { "name": "quorumThreshold", "type": "uint248", "internalType": "uint248" } ] } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "removeSettlement", "inputs": [ { "name": "settlement", "type": "tuple", "internalType": "struct IValSetDriver.CrossChainAddress", "components": [ { "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "addr", "type": "address", "internalType": "address" } ] } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "removeVotingPowerProvider", "inputs": [ { "name": "votingPowerProvider", "type": "tuple", "internalType": "struct IValSetDriver.CrossChainAddress", "components": [ { "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "addr", "type": "address", "internalType": "address" } ] } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "setEpochDuration", "inputs": [ { "name": "epochDuration", "type": "uint48", "internalType": "uint48" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "setKeysProvider", "inputs": [ { "name": "keysProvider", "type": "tuple", "internalType": "struct IValSetDriver.CrossChainAddress", "components": [ { "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "addr", "type": "address", "internalType": "address" } ] } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "setMaxValidatorsCount", "inputs": [ { "name": "maxValidatorsCount", "type": "uint208", "internalType": "uint208" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "setMaxVotingPower", "inputs": [ { "name": "maxVotingPower", "type": "uint256", "internalType": "uint256" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "setMinInclusionVotingPower", "inputs": [ { "name": "minInclusionVotingPower", "type": "uint256", "internalType": "uint256" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "setNumAggregators", "inputs": [ { "name": "numAggregators", "type": "uint208", "internalType": "uint208" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "setNumCommitters", "inputs": [ { "name": "numCommitters", "type": "uint208", "internalType": "uint208" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "setRequiredHeaderKeyTag", "inputs": [ { "name": "requiredHeaderKeyTag", "type": "uint8", "internalType": "uint8" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "setRequiredKeyTags", "inputs": [ { "name": "requiredKeyTags", "type": "uint8[]", "internalType": "uint8[]" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "setVerificationType", "inputs": [ { "name": "verificationType", "type": "uint32", "internalType": "uint32" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "staticDelegateCall", "inputs": [ { "name": "target", "type": "address", "internalType": "address" }, { "name": "data", "type": "bytes", "internalType": "bytes" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "event", "name": "AddQuorumThreshold", "inputs": [ { "name": "quorumThreshold", "type": "tuple", "indexed": false, "internalType": "struct IValSetDriver.QuorumThreshold", "components": [ { "name": "keyTag", "type": "uint8", "internalType": "uint8" }, { "name": "quorumThreshold", "type": "uint248", "internalType": "uint248" } ] } ], "anonymous": false }, { "type": "event", "name": "AddSettlement", "inputs": [ { "name": "settlement", "type": "tuple", "indexed": false, "internalType": "struct IValSetDriver.CrossChainAddress", "components": [ { "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "addr", "type": "address", "internalType": "address" } ] } ], "anonymous": false }, { "type": "event", "name": "AddVotingPowerProvider", "inputs": [ { "name": "votingPowerProvider", "type": "tuple", "indexed": false, "internalType": "struct IValSetDriver.CrossChainAddress", "components": [ { "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "addr", "type": "address", "internalType": "address" } ] } ], "anonymous": false }, { "type": "event", "name": "InitEpochDuration", "inputs": [ { "name": "epochDuration", "type": "uint48", "indexed": false, "internalType": "uint48" }, { "name": "epochDurationTimestamp", "type": "uint48", "indexed": false, "internalType": "uint48" } ], "anonymous": false }, { "type": "event", "name": "InitSubnetwork", "inputs": [ { "name": "network", "type": "address", "indexed": false, "internalType": "address" }, { "name": "subnetworkId", "type": "uint96", "indexed": false, "internalType": "uint96" } ], "anonymous": false }, { "type": "event", "name": "Initialized", "inputs": [ { "name": "version", "type": "uint64", "indexed": false, "internalType": "uint64" } ], "anonymous": false }, { "type": "event", "name": "RemoveQuorumThreshold", "inputs": [ { "name": "quorumThreshold", "type": "tuple", "indexed": false, "internalType": "struct IValSetDriver.QuorumThreshold", "components": [ { "name": "keyTag", "type": "uint8", "internalType": "uint8" }, { "name": "quorumThreshold", "type": "uint248", "internalType": "uint248" } ] } ], "anonymous": false }, { "type": "event", "name": "RemoveSettlement", "inputs": [ { "name": "settlement", "type": "tuple", "indexed": false, "internalType": "struct IValSetDriver.CrossChainAddress", "components": [ { "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "addr", "type": "address", "internalType": "address" } ] } ], "anonymous": false }, { "type": "event", "name": "RemoveVotingPowerProvider", "inputs": [ { "name": "votingPowerProvider", "type": "tuple", "indexed": false, "internalType": "struct IValSetDriver.CrossChainAddress", "components": [ { "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "addr", "type": "address", "internalType": "address" } ] } ], "anonymous": false }, { "type": "event", "name": "SetEpochDuration", "inputs": [ { "name": "epochDuration", "type": "uint48", "indexed": false, "internalType": "uint48" } ], "anonymous": false }, { "type": "event", "name": "SetKeysProvider", "inputs": [ { "name": "keysProvider", "type": "tuple", "indexed": false, "internalType": "struct IValSetDriver.CrossChainAddress", "components": [ { "name": "chainId", "type": "uint64", "internalType": "uint64" }, { "name": "addr", "type": "address", "internalType": "address" } ] } ], "anonymous": false }, { "type": "event", "name": "SetMaxValidatorsCount", "inputs": [ { "name": "maxValidatorsCount", "type": "uint208", "indexed": false, "internalType": "uint208" } ], "anonymous": false }, { "type": "event", "name": "SetMaxVotingPower", "inputs": [ { "name": "maxVotingPower", "type": "uint256", "indexed": false, "internalType": "uint256" } ], "anonymous": false }, { "type": "event", "name": "SetMinInclusionVotingPower", "inputs": [ { "name": "minInclusionVotingPower", "type": "uint256", "indexed": false, "internalType": "uint256" } ], "anonymous": false }, { "type": "event", "name": "SetNumAggregators", "inputs": [ { "name": "numAggregators", "type": "uint208", "indexed": false, "internalType": "uint208" } ], "anonymous": false }, { "type": "event", "name": "SetNumCommitters", "inputs": [ { "name": "numCommitters", "type": "uint208", "indexed": false, "internalType": "uint208" } ], "anonymous": false }, { "type": "event", "name": "SetRequiredHeaderKeyTag", "inputs": [ { "name": "requiredHeaderKeyTag", "type": "uint8", "indexed": false, "internalType": "uint8" } ], "anonymous": false }, { "type": "event", "name": "SetRequiredKeyTags", "inputs": [ { "name": "requiredKeyTags", "type": "uint8[]", "indexed": false, "internalType": "uint8[]" } ], "anonymous": false }, { "type": "event", "name": "SetVerificationType", "inputs": [ { "name": "verificationType", "type": "uint32", "indexed": false, "internalType": "uint32" } ], "anonymous": false }, { "type": "error", "name": "AddressEmptyCode", "inputs": [ { "name": "target", "type": "address", "internalType": "address" } ] }, { "type": "error", "name": "CheckpointUnorderedInsertion", "inputs": [] }, { "type": "error", "name": "DuplicateKeyTag", "inputs": [] }, { "type": "error", "name": "EpochManager_InvalidEpochDuration", "inputs": [] }, { "type": "error", "name": "EpochManager_InvalidEpochDurationTimestamp", "inputs": [] }, { "type": "error", "name": "EpochManager_TooOldTimestamp", "inputs": [] }, { "type": "error", "name": "FailedCall", "inputs": [] }, { "type": "error", "name": "InvalidInitialization", "inputs": [] }, { "type": "error", "name": "InvalidKey", "inputs": [] }, { "type": "error", "name": "InvalidKeyTag", "inputs": [] }, { "type": "error", "name": "NetworkManager_InvalidNetwork", "inputs": [] }, { "type": "error", "name": "NotInitializing", "inputs": [] }, { "type": "error", "name": "ValSetDriver_ChainAlreadyAdded", "inputs": [] }, { "type": "error", "name": "ValSetDriver_InvalidCrossChainAddress", "inputs": [] }, { "type": "error", "name": "ValSetDriver_InvalidMaxValidatorsCount", "inputs": [] }, { "type": "error", "name": "ValSetDriver_InvalidQuorumThreshold", "inputs": [] }, { "type": "error", "name": "ValSetDriver_KeyTagAlreadyAdded", "inputs": [] }, { "type": "error", "name": "ValSetDriver_NotAdded", "inputs": [] }, { "type": "error", "name": "ValSetDriver_ZeroNumAggregators", "inputs": [] }, { "type": "error", "name": "ValSetDriver_ZeroNumCommitters", "inputs": [] } ] ```` ## File: symbiotic/client/evm/abi/IVotingPowerProvider.abi.json ````json [ { "type": "function", "name": "NETWORK", "inputs": [], "outputs": [ { "name": "", "type": "address", "internalType": "address" } ], "stateMutability": "view" }, { "type": "function", "name": "OPERATOR_REGISTRY", "inputs": [], "outputs": [ { "name": "", "type": "address", "internalType": "address" } ], "stateMutability": "view" }, { "type": "function", "name": "SUBNETWORK", "inputs": [], "outputs": [ { "name": "", "type": "bytes32", "internalType": "bytes32" } ], "stateMutability": "view" }, { "type": "function", "name": "SUBNETWORK_IDENTIFIER", "inputs": [], "outputs": [ { "name": "", "type": "uint96", "internalType": "uint96" } ], "stateMutability": "view" }, { "type": "function", "name": "VAULT_FACTORY", "inputs": [], "outputs": [ { "name": "", "type": "address", "internalType": "address" } ], "stateMutability": "view" }, { "type": "function", "name": "eip712Domain", "inputs": [], "outputs": [ { "name": "fields", "type": "bytes1", "internalType": "bytes1" }, { "name": "name", "type": "string", "internalType": "string" }, { "name": "version", "type": "string", "internalType": "string" }, { "name": "chainId", "type": "uint256", "internalType": "uint256" }, { "name": "verifyingContract", "type": "address", "internalType": "address" }, { "name": "salt", "type": "bytes32", "internalType": "bytes32" }, { "name": "extensions", "type": "uint256[]", "internalType": "uint256[]" } ], "stateMutability": "view" }, { "type": "function", "name": "getOperatorStakes", "inputs": [ { "name": "operator", "type": "address", "internalType": "address" } ], "outputs": [ { "name": "", "type": "tuple[]", "internalType": "struct IVotingPowerProvider.VaultValue[]", "components": [ { "name": "vault", "type": "address", "internalType": "address" }, { "name": "value", "type": "uint256", "internalType": "uint256" } ] } ], "stateMutability": "view" }, { "type": "function", "name": "getOperatorStakesAt", "inputs": [ { "name": "operator", "type": "address", "internalType": "address" }, { "name": "timestamp", "type": "uint48", "internalType": "uint48" } ], "outputs": [ { "name": "", "type": "tuple[]", "internalType": "struct IVotingPowerProvider.VaultValue[]", "components": [ { "name": "vault", "type": "address", "internalType": "address" }, { "name": "value", "type": "uint256", "internalType": "uint256" } ] } ], "stateMutability": "view" }, { "type": "function", "name": "getOperatorVaults", "inputs": [ { "name": "operator", "type": "address", "internalType": "address" } ], "outputs": [ { "name": "", "type": "address[]", "internalType": "address[]" } ], "stateMutability": "view" }, { "type": "function", "name": "getOperatorVaultsAt", "inputs": [ { "name": "operator", "type": "address", "internalType": "address" }, { "name": "timestamp", "type": "uint48", "internalType": "uint48" } ], "outputs": [ { "name": "", "type": "address[]", "internalType": "address[]" } ], "stateMutability": "view" }, { "type": "function", "name": "getOperatorVotingPowers", "inputs": [ { "name": "operator", "type": "address", "internalType": "address" }, { "name": "extraData", "type": "bytes", "internalType": "bytes" } ], "outputs": [ { "name": "", "type": "tuple[]", "internalType": "struct IVotingPowerProvider.VaultValue[]", "components": [ { "name": "vault", "type": "address", "internalType": "address" }, { "name": "value", "type": "uint256", "internalType": "uint256" } ] } ], "stateMutability": "view" }, { "type": "function", "name": "getOperatorVotingPowersAt", "inputs": [ { "name": "operator", "type": "address", "internalType": "address" }, { "name": "extraData", "type": "bytes", "internalType": "bytes" }, { "name": "timestamp", "type": "uint48", "internalType": "uint48" } ], "outputs": [ { "name": "", "type": "tuple[]", "internalType": "struct IVotingPowerProvider.VaultValue[]", "components": [ { "name": "vault", "type": "address", "internalType": "address" }, { "name": "value", "type": "uint256", "internalType": "uint256" } ] } ], "stateMutability": "view" }, { "type": "function", "name": "getOperators", "inputs": [], "outputs": [ { "name": "", "type": "address[]", "internalType": "address[]" } ], "stateMutability": "view" }, { "type": "function", "name": "getOperatorsAt", "inputs": [ { "name": "timestamp", "type": "uint48", "internalType": "uint48" } ], "outputs": [ { "name": "", "type": "address[]", "internalType": "address[]" } ], "stateMutability": "view" }, { "type": "function", "name": "getSharedVaults", "inputs": [], "outputs": [ { "name": "", "type": "address[]", "internalType": "address[]" } ], "stateMutability": "view" }, { "type": "function", "name": "getSharedVaultsAt", "inputs": [ { "name": "timestamp", "type": "uint48", "internalType": "uint48" } ], "outputs": [ { "name": "", "type": "address[]", "internalType": "address[]" } ], "stateMutability": "view" }, { "type": "function", "name": "getSlashingData", "inputs": [], "outputs": [ { "name": "", "type": "bool", "internalType": "bool" }, { "name": "", "type": "uint48", "internalType": "uint48" } ], "stateMutability": "view" }, { "type": "function", "name": "getSlashingDataAt", "inputs": [ { "name": "timestamp", "type": "uint48", "internalType": "uint48" }, { "name": "hint", "type": "bytes", "internalType": "bytes" } ], "outputs": [ { "name": "", "type": "bool", "internalType": "bool" }, { "name": "", "type": "uint48", "internalType": "uint48" } ], "stateMutability": "view" }, { "type": "function", "name": "getTokens", "inputs": [], "outputs": [ { "name": "", "type": "address[]", "internalType": "address[]" } ], "stateMutability": "view" }, { "type": "function", "name": "getTokensAt", "inputs": [ { "name": "timestamp", "type": "uint48", "internalType": "uint48" } ], "outputs": [ { "name": "", "type": "address[]", "internalType": "address[]" } ], "stateMutability": "view" }, { "type": "function", "name": "getVotingPowers", "inputs": [ { "name": "extraData", "type": "bytes[]", "internalType": "bytes[]" } ], "outputs": [ { "name": "", "type": "tuple[]", "internalType": "struct IVotingPowerProvider.OperatorVotingPower[]", "components": [ { "name": "operator", "type": "address", "internalType": "address" }, { "name": "vaults", "type": "tuple[]", "internalType": "struct IVotingPowerProvider.VaultValue[]", "components": [ { "name": "vault", "type": "address", "internalType": "address" }, { "name": "value", "type": "uint256", "internalType": "uint256" } ] } ] } ], "stateMutability": "view" }, { "type": "function", "name": "getVotingPowersAt", "inputs": [ { "name": "extraData", "type": "bytes[]", "internalType": "bytes[]" }, { "name": "timestamp", "type": "uint48", "internalType": "uint48" } ], "outputs": [ { "name": "", "type": "tuple[]", "internalType": "struct IVotingPowerProvider.OperatorVotingPower[]", "components": [ { "name": "operator", "type": "address", "internalType": "address" }, { "name": "vaults", "type": "tuple[]", "internalType": "struct IVotingPowerProvider.VaultValue[]", "components": [ { "name": "vault", "type": "address", "internalType": "address" }, { "name": "value", "type": "uint256", "internalType": "uint256" } ] } ] } ], "stateMutability": "view" }, { "type": "function", "name": "hashTypedDataV4", "inputs": [ { "name": "structHash", "type": "bytes32", "internalType": "bytes32" } ], "outputs": [ { "name": "", "type": "bytes32", "internalType": "bytes32" } ], "stateMutability": "view" }, { "type": "function", "name": "hashTypedDataV4CrossChain", "inputs": [ { "name": "structHash", "type": "bytes32", "internalType": "bytes32" } ], "outputs": [ { "name": "", "type": "bytes32", "internalType": "bytes32" } ], "stateMutability": "view" }, { "type": "function", "name": "invalidateOldSignatures", "inputs": [], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "isOperatorRegistered", "inputs": [ { "name": "operator", "type": "address", "internalType": "address" } ], "outputs": [ { "name": "", "type": "bool", "internalType": "bool" } ], "stateMutability": "view" }, { "type": "function", "name": "isOperatorRegisteredAt", "inputs": [ { "name": "operator", "type": "address", "internalType": "address" }, { "name": "timestamp", "type": "uint48", "internalType": "uint48" } ], "outputs": [ { "name": "", "type": "bool", "internalType": "bool" } ], "stateMutability": "view" }, { "type": "function", "name": "isOperatorVaultRegistered", "inputs": [ { "name": "vault", "type": "address", "internalType": "address" } ], "outputs": [ { "name": "", "type": "bool", "internalType": "bool" } ], "stateMutability": "view" }, { "type": "function", "name": "isOperatorVaultRegistered", "inputs": [ { "name": "operator", "type": "address", "internalType": "address" }, { "name": "vault", "type": "address", "internalType": "address" } ], "outputs": [ { "name": "", "type": "bool", "internalType": "bool" } ], "stateMutability": "view" }, { "type": "function", "name": "isOperatorVaultRegisteredAt", "inputs": [ { "name": "operator", "type": "address", "internalType": "address" }, { "name": "vault", "type": "address", "internalType": "address" }, { "name": "timestamp", "type": "uint48", "internalType": "uint48" } ], "outputs": [ { "name": "", "type": "bool", "internalType": "bool" } ], "stateMutability": "view" }, { "type": "function", "name": "isOperatorVaultRegisteredAt", "inputs": [ { "name": "vault", "type": "address", "internalType": "address" }, { "name": "timestamp", "type": "uint48", "internalType": "uint48" } ], "outputs": [ { "name": "", "type": "bool", "internalType": "bool" } ], "stateMutability": "view" }, { "type": "function", "name": "isSharedVaultRegistered", "inputs": [ { "name": "vault", "type": "address", "internalType": "address" } ], "outputs": [ { "name": "", "type": "bool", "internalType": "bool" } ], "stateMutability": "view" }, { "type": "function", "name": "isSharedVaultRegisteredAt", "inputs": [ { "name": "vault", "type": "address", "internalType": "address" }, { "name": "timestamp", "type": "uint48", "internalType": "uint48" } ], "outputs": [ { "name": "", "type": "bool", "internalType": "bool" } ], "stateMutability": "view" }, { "type": "function", "name": "isTokenRegistered", "inputs": [ { "name": "token", "type": "address", "internalType": "address" } ], "outputs": [ { "name": "", "type": "bool", "internalType": "bool" } ], "stateMutability": "view" }, { "type": "function", "name": "isTokenRegisteredAt", "inputs": [ { "name": "token", "type": "address", "internalType": "address" }, { "name": "timestamp", "type": "uint48", "internalType": "uint48" } ], "outputs": [ { "name": "", "type": "bool", "internalType": "bool" } ], "stateMutability": "view" }, { "type": "function", "name": "multicall", "inputs": [ { "name": "data", "type": "bytes[]", "internalType": "bytes[]" } ], "outputs": [ { "name": "results", "type": "bytes[]", "internalType": "bytes[]" } ], "stateMutability": "nonpayable" }, { "type": "function", "name": "nonces", "inputs": [ { "name": "owner", "type": "address", "internalType": "address" } ], "outputs": [ { "name": "", "type": "uint256", "internalType": "uint256" } ], "stateMutability": "view" }, { "type": "function", "name": "registerOperator", "inputs": [], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "registerOperatorWithSignature", "inputs": [ { "name": "operator", "type": "address", "internalType": "address" }, { "name": "signature", "type": "bytes", "internalType": "bytes" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "stakeToVotingPower", "inputs": [ { "name": "vault", "type": "address", "internalType": "address" }, { "name": "stake", "type": "uint256", "internalType": "uint256" }, { "name": "extraData", "type": "bytes", "internalType": "bytes" } ], "outputs": [ { "name": "power", "type": "uint256", "internalType": "uint256" } ], "stateMutability": "view" }, { "type": "function", "name": "stakeToVotingPowerAt", "inputs": [ { "name": "vault", "type": "address", "internalType": "address" }, { "name": "stake", "type": "uint256", "internalType": "uint256" }, { "name": "extraData", "type": "bytes", "internalType": "bytes" }, { "name": "timestamp", "type": "uint48", "internalType": "uint48" } ], "outputs": [ { "name": "power", "type": "uint256", "internalType": "uint256" } ], "stateMutability": "view" }, { "type": "function", "name": "staticDelegateCall", "inputs": [ { "name": "target", "type": "address", "internalType": "address" }, { "name": "data", "type": "bytes", "internalType": "bytes" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "unregisterOperator", "inputs": [], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "unregisterOperatorWithSignature", "inputs": [ { "name": "operator", "type": "address", "internalType": "address" }, { "name": "signature", "type": "bytes", "internalType": "bytes" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "event", "name": "EIP712DomainChanged", "inputs": [], "anonymous": false }, { "type": "event", "name": "InitEIP712", "inputs": [ { "name": "name", "type": "string", "indexed": false, "internalType": "string" }, { "name": "version", "type": "string", "indexed": false, "internalType": "string" } ], "anonymous": false }, { "type": "event", "name": "InitSubnetwork", "inputs": [ { "name": "network", "type": "address", "indexed": false, "internalType": "address" }, { "name": "subnetworkId", "type": "uint96", "indexed": false, "internalType": "uint96" } ], "anonymous": false }, { "type": "event", "name": "Initialized", "inputs": [ { "name": "version", "type": "uint64", "indexed": false, "internalType": "uint64" } ], "anonymous": false }, { "type": "event", "name": "RegisterOperator", "inputs": [ { "name": "operator", "type": "address", "indexed": true, "internalType": "address" } ], "anonymous": false }, { "type": "event", "name": "RegisterOperatorVault", "inputs": [ { "name": "operator", "type": "address", "indexed": true, "internalType": "address" }, { "name": "vault", "type": "address", "indexed": true, "internalType": "address" } ], "anonymous": false }, { "type": "event", "name": "RegisterSharedVault", "inputs": [ { "name": "vault", "type": "address", "indexed": true, "internalType": "address" } ], "anonymous": false }, { "type": "event", "name": "RegisterToken", "inputs": [ { "name": "token", "type": "address", "indexed": true, "internalType": "address" } ], "anonymous": false }, { "type": "event", "name": "SetSlashingData", "inputs": [ { "name": "requireSlasher", "type": "bool", "indexed": false, "internalType": "bool" }, { "name": "minVaultEpochDuration", "type": "uint48", "indexed": false, "internalType": "uint48" } ], "anonymous": false }, { "type": "event", "name": "UnregisterOperator", "inputs": [ { "name": "operator", "type": "address", "indexed": true, "internalType": "address" } ], "anonymous": false }, { "type": "event", "name": "UnregisterOperatorVault", "inputs": [ { "name": "operator", "type": "address", "indexed": true, "internalType": "address" }, { "name": "vault", "type": "address", "indexed": true, "internalType": "address" } ], "anonymous": false }, { "type": "event", "name": "UnregisterSharedVault", "inputs": [ { "name": "vault", "type": "address", "indexed": true, "internalType": "address" } ], "anonymous": false }, { "type": "event", "name": "UnregisterToken", "inputs": [ { "name": "token", "type": "address", "indexed": true, "internalType": "address" } ], "anonymous": false }, { "type": "error", "name": "AddressEmptyCode", "inputs": [ { "name": "target", "type": "address", "internalType": "address" } ] }, { "type": "error", "name": "FailedCall", "inputs": [] }, { "type": "error", "name": "InvalidAccountNonce", "inputs": [ { "name": "account", "type": "address", "internalType": "address" }, { "name": "currentNonce", "type": "uint256", "internalType": "uint256" } ] }, { "type": "error", "name": "InvalidInitialization", "inputs": [] }, { "type": "error", "name": "NetworkManager_InvalidNetwork", "inputs": [] }, { "type": "error", "name": "NotInitializing", "inputs": [] }, { "type": "error", "name": "VotingPowerProvider_InvalidOperator", "inputs": [] }, { "type": "error", "name": "VotingPowerProvider_InvalidOperatorVault", "inputs": [] }, { "type": "error", "name": "VotingPowerProvider_InvalidSharedVault", "inputs": [] }, { "type": "error", "name": "VotingPowerProvider_InvalidSignature", "inputs": [] }, { "type": "error", "name": "VotingPowerProvider_InvalidToken", "inputs": [] }, { "type": "error", "name": "VotingPowerProvider_InvalidVault", "inputs": [] }, { "type": "error", "name": "VotingPowerProvider_OperatorAlreadyRegistered", "inputs": [] }, { "type": "error", "name": "VotingPowerProvider_OperatorNotRegistered", "inputs": [] }, { "type": "error", "name": "VotingPowerProvider_OperatorVaultAlreadyIsRegistered", "inputs": [] }, { "type": "error", "name": "VotingPowerProvider_OperatorVaultNotRegistered", "inputs": [] }, { "type": "error", "name": "VotingPowerProvider_SharedVaultAlreadyIsRegistered", "inputs": [] }, { "type": "error", "name": "VotingPowerProvider_SharedVaultNotRegistered", "inputs": [] }, { "type": "error", "name": "VotingPowerProvider_TokenAlreadyIsRegistered", "inputs": [] }, { "type": "error", "name": "VotingPowerProvider_TokenNotRegistered", "inputs": [] } ] ```` ## File: symbiotic/client/evm/gen/keyRegistry.go ````go // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. ⋮---- package gen ⋮---- import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) ⋮---- "errors" "math/big" "strings" ⋮---- ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ⋮---- // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) ⋮---- // IKeyRegistryKey is an auto generated low-level Go binding around an user-defined struct. type IKeyRegistryKey struct { Tag uint8 Payload []byte } ⋮---- // IKeyRegistryOperatorWithKeys is an auto generated low-level Go binding around an user-defined struct. type IKeyRegistryOperatorWithKeys struct { Operator common.Address Keys []IKeyRegistryKey } ⋮---- // IKeyRegistryMetaData contains all meta data concerning the IKeyRegistry contract. var IKeyRegistryMetaData = &bind.MetaData{ ABI: "[{\"type\":\"function\",\"name\":\"getKey\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"tag\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getKeyAt\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"tag\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"timestamp\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getKeys\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"tuple[]\",\"internalType\":\"structIKeyRegistry.OperatorWithKeys[]\",\"components\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"keys\",\"type\":\"tuple[]\",\"internalType\":\"structIKeyRegistry.Key[]\",\"components\":[{\"name\":\"tag\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"payload\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getKeys\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple[]\",\"internalType\":\"structIKeyRegistry.Key[]\",\"components\":[{\"name\":\"tag\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"payload\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getKeysAt\",\"inputs\":[{\"name\":\"timestamp\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple[]\",\"internalType\":\"structIKeyRegistry.OperatorWithKeys[]\",\"components\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"keys\",\"type\":\"tuple[]\",\"internalType\":\"structIKeyRegistry.Key[]\",\"components\":[{\"name\":\"tag\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"payload\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getKeysAt\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"timestamp\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple[]\",\"internalType\":\"structIKeyRegistry.Key[]\",\"components\":[{\"name\":\"tag\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"payload\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getKeysOperators\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getKeysOperatorsAt\",\"inputs\":[{\"name\":\"timestamp\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getKeysOperatorsLength\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getOperator\",\"inputs\":[{\"name\":\"key\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"setKey\",\"inputs\":[{\"name\":\"tag\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"key\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"extraData\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"SetKey\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"tag\",\"type\":\"uint8\",\"indexed\":true,\"internalType\":\"uint8\"},{\"name\":\"key\",\"type\":\"bytes\",\"indexed\":true,\"internalType\":\"bytes\"},{\"name\":\"extraData\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"KeyRegistry_AlreadyUsed\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"KeyRegistry_InvalidKeySignature\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"KeyRegistry_InvalidKeyType\",\"inputs\":[]}]", } ⋮---- // IKeyRegistryABI is the input ABI used to generate the binding from. // Deprecated: Use IKeyRegistryMetaData.ABI instead. var IKeyRegistryABI = IKeyRegistryMetaData.ABI ⋮---- // IKeyRegistry is an auto generated Go binding around an Ethereum contract. type IKeyRegistry struct { IKeyRegistryCaller // Read-only binding to the contract IKeyRegistryTransactor // Write-only binding to the contract IKeyRegistryFilterer // Log filterer for contract events } ⋮---- IKeyRegistryCaller // Read-only binding to the contract IKeyRegistryTransactor // Write-only binding to the contract IKeyRegistryFilterer // Log filterer for contract events ⋮---- // IKeyRegistryCaller is an auto generated read-only Go binding around an Ethereum contract. type IKeyRegistryCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } ⋮---- contract *bind.BoundContract // Generic contract wrapper for the low level calls ⋮---- // IKeyRegistryTransactor is an auto generated write-only Go binding around an Ethereum contract. type IKeyRegistryTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } ⋮---- // IKeyRegistryFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type IKeyRegistryFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } ⋮---- // IKeyRegistrySession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type IKeyRegistrySession struct { Contract *IKeyRegistry // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } ⋮---- Contract *IKeyRegistry // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session ⋮---- // IKeyRegistryCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type IKeyRegistryCallerSession struct { Contract *IKeyRegistryCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } ⋮---- Contract *IKeyRegistryCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session ⋮---- // IKeyRegistryTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type IKeyRegistryTransactorSession struct { Contract *IKeyRegistryTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } ⋮---- Contract *IKeyRegistryTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session ⋮---- // IKeyRegistryRaw is an auto generated low-level Go binding around an Ethereum contract. type IKeyRegistryRaw struct { Contract *IKeyRegistry // Generic contract binding to access the raw methods on } ⋮---- Contract *IKeyRegistry // Generic contract binding to access the raw methods on ⋮---- // IKeyRegistryCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type IKeyRegistryCallerRaw struct { Contract *IKeyRegistryCaller // Generic read-only contract binding to access the raw methods on } ⋮---- Contract *IKeyRegistryCaller // Generic read-only contract binding to access the raw methods on ⋮---- // IKeyRegistryTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type IKeyRegistryTransactorRaw struct { Contract *IKeyRegistryTransactor // Generic write-only contract binding to access the raw methods on } ⋮---- Contract *IKeyRegistryTransactor // Generic write-only contract binding to access the raw methods on ⋮---- // NewIKeyRegistry creates a new instance of IKeyRegistry, bound to a specific deployed contract. func NewIKeyRegistry(address common.Address, backend bind.ContractBackend) (*IKeyRegistry, error) ⋮---- // NewIKeyRegistryCaller creates a new read-only instance of IKeyRegistry, bound to a specific deployed contract. func NewIKeyRegistryCaller(address common.Address, caller bind.ContractCaller) (*IKeyRegistryCaller, error) ⋮---- // NewIKeyRegistryTransactor creates a new write-only instance of IKeyRegistry, bound to a specific deployed contract. func NewIKeyRegistryTransactor(address common.Address, transactor bind.ContractTransactor) (*IKeyRegistryTransactor, error) ⋮---- // NewIKeyRegistryFilterer creates a new log filterer instance of IKeyRegistry, bound to a specific deployed contract. func NewIKeyRegistryFilterer(address common.Address, filterer bind.ContractFilterer) (*IKeyRegistryFilterer, error) ⋮---- // bindIKeyRegistry binds a generic wrapper to an already deployed contract. func bindIKeyRegistry(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) ⋮---- // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_IKeyRegistry *IKeyRegistryRaw) Call(opts *bind.CallOpts, result *[]interface ⋮---- // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_IKeyRegistry *IKeyRegistryRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) ⋮---- // Transact invokes the (paid) contract method with params as input values. func (_IKeyRegistry *IKeyRegistryRaw) Transact(opts *bind.TransactOpts, method string, params ...interface ⋮---- // GetKey is a free data retrieval call binding the contract method 0xb6e1a1e2. // // Solidity: function getKey(address operator, uint8 tag) view returns(bytes) func (_IKeyRegistry *IKeyRegistryCaller) GetKey(opts *bind.CallOpts, operator common.Address, tag uint8) ([]byte, error) ⋮---- var out []interface{} ⋮---- // GetKeyAt is a free data retrieval call binding the contract method 0xb1dab20f. ⋮---- // Solidity: function getKeyAt(address operator, uint8 tag, uint48 timestamp) view returns(bytes) func (_IKeyRegistry *IKeyRegistryCaller) GetKeyAt(opts *bind.CallOpts, operator common.Address, tag uint8, timestamp *big.Int) ([]byte, error) ⋮---- // GetKeys is a free data retrieval call binding the contract method 0x2150c518. ⋮---- // Solidity: function getKeys() view returns((address,(uint8,bytes)[])[]) func (_IKeyRegistry *IKeyRegistryCaller) GetKeys(opts *bind.CallOpts) ([]IKeyRegistryOperatorWithKeys, error) ⋮---- // GetKeys0 is a free data retrieval call binding the contract method 0x34e80c34. ⋮---- // Solidity: function getKeys(address operator) view returns((uint8,bytes)[]) func (_IKeyRegistry *IKeyRegistryCaller) GetKeys0(opts *bind.CallOpts, operator common.Address) ([]IKeyRegistryKey, error) ⋮---- // GetKeysAt is a free data retrieval call binding the contract method 0x256d1be5. ⋮---- // Solidity: function getKeysAt(uint48 timestamp) view returns((address,(uint8,bytes)[])[]) func (_IKeyRegistry *IKeyRegistryCaller) GetKeysAt(opts *bind.CallOpts, timestamp *big.Int) ([]IKeyRegistryOperatorWithKeys, error) ⋮---- // GetKeysAt0 is a free data retrieval call binding the contract method 0x26cb1f1c. ⋮---- // Solidity: function getKeysAt(address operator, uint48 timestamp) view returns((uint8,bytes)[]) func (_IKeyRegistry *IKeyRegistryCaller) GetKeysAt0(opts *bind.CallOpts, operator common.Address, timestamp *big.Int) ([]IKeyRegistryKey, error) ⋮---- // GetKeysOperators is a free data retrieval call binding the contract method 0x20d268de. ⋮---- // Solidity: function getKeysOperators() view returns(address[]) func (_IKeyRegistry *IKeyRegistryCaller) GetKeysOperators(opts *bind.CallOpts) ([]common.Address, error) ⋮---- // GetKeysOperatorsAt is a free data retrieval call binding the contract method 0xf493b5f3. ⋮---- // Solidity: function getKeysOperatorsAt(uint48 timestamp) view returns(address[]) func (_IKeyRegistry *IKeyRegistryCaller) GetKeysOperatorsAt(opts *bind.CallOpts, timestamp *big.Int) ([]common.Address, error) ⋮---- // GetKeysOperatorsLength is a free data retrieval call binding the contract method 0xd201ab93. ⋮---- // Solidity: function getKeysOperatorsLength() view returns(uint256) func (_IKeyRegistry *IKeyRegistryCaller) GetKeysOperatorsLength(opts *bind.CallOpts) (*big.Int, error) ⋮---- // GetOperator is a free data retrieval call binding the contract method 0x9eaffa96. ⋮---- // Solidity: function getOperator(bytes key) view returns(address) func (_IKeyRegistry *IKeyRegistryCaller) GetOperator(opts *bind.CallOpts, key []byte) (common.Address, error) ⋮---- // SetKey is a paid mutator transaction binding the contract method 0xc1ef9aca. ⋮---- // Solidity: function setKey(uint8 tag, bytes key, bytes signature, bytes extraData) returns() func (_IKeyRegistry *IKeyRegistryTransactor) SetKey(opts *bind.TransactOpts, tag uint8, key []byte, signature []byte, extraData []byte) (*types.Transaction, error) ⋮---- // IKeyRegistrySetKeyIterator is returned from FilterSetKey and is used to iterate over the raw logs and unpacked data for SetKey events raised by the IKeyRegistry contract. type IKeyRegistrySetKeyIterator struct { Event *IKeyRegistrySetKey // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } ⋮---- Event *IKeyRegistrySetKey // Event containing the contract specifics and raw log ⋮---- contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data ⋮---- logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration ⋮---- // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *IKeyRegistrySetKeyIterator) Next() bool ⋮---- // If the iterator failed, stop iterating ⋮---- // If the iterator completed, deliver directly whatever's available ⋮---- // Iterator still in progress, wait for either a data or an error event ⋮---- // Error returns any retrieval or parsing error occurred during filtering. func (it *IKeyRegistrySetKeyIterator) Error() error ⋮---- // Close terminates the iteration process, releasing any pending underlying // resources. func (it *IKeyRegistrySetKeyIterator) Close() error ⋮---- // IKeyRegistrySetKey represents a SetKey event raised by the IKeyRegistry contract. type IKeyRegistrySetKey struct { Operator common.Address Tag uint8 Key common.Hash ExtraData []byte Raw types.Log // Blockchain specific contextual infos } ⋮---- Raw types.Log // Blockchain specific contextual infos ⋮---- // FilterSetKey is a free log retrieval operation binding the contract event 0x980cfe4e76cbf6d3ba24c2161089e5e1b2f98e31821b6afdf5a4d596bee91fcd. ⋮---- // Solidity: event SetKey(address indexed operator, uint8 indexed tag, bytes indexed key, bytes extraData) func (_IKeyRegistry *IKeyRegistryFilterer) FilterSetKey(opts *bind.FilterOpts, operator []common.Address, tag []uint8, key [][]byte) (*IKeyRegistrySetKeyIterator, error) ⋮---- var operatorRule []interface{} ⋮---- var tagRule []interface{} ⋮---- var keyRule []interface{} ⋮---- // WatchSetKey is a free log subscription operation binding the contract event 0x980cfe4e76cbf6d3ba24c2161089e5e1b2f98e31821b6afdf5a4d596bee91fcd. ⋮---- func (_IKeyRegistry *IKeyRegistryFilterer) WatchSetKey(opts *bind.WatchOpts, sink chan<- *IKeyRegistrySetKey, operator []common.Address, tag []uint8, key [][]byte) (event.Subscription, error) ⋮---- // New log arrived, parse the event and forward to the user ⋮---- // ParseSetKey is a log parse operation binding the contract event 0x980cfe4e76cbf6d3ba24c2161089e5e1b2f98e31821b6afdf5a4d596bee91fcd. ⋮---- func (_IKeyRegistry *IKeyRegistryFilterer) ParseSetKey(log types.Log) (*IKeyRegistrySetKey, error) ```` ## File: symbiotic/client/evm/gen/multicall3.go ````go // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. ⋮---- package gen ⋮---- import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) ⋮---- "errors" "math/big" "strings" ⋮---- ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ⋮---- // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) ⋮---- // Multicall3Call is an auto generated low-level Go binding around an user-defined struct. type Multicall3Call struct { Target common.Address CallData []byte } ⋮---- // Multicall3Call3 is an auto generated low-level Go binding around an user-defined struct. type Multicall3Call3 struct { Target common.Address AllowFailure bool CallData []byte } ⋮---- // Multicall3Call3Value is an auto generated low-level Go binding around an user-defined struct. type Multicall3Call3Value struct { Target common.Address AllowFailure bool Value *big.Int CallData []byte } ⋮---- // Multicall3Result is an auto generated low-level Go binding around an user-defined struct. type Multicall3Result struct { Success bool ReturnData []byte } ⋮---- // Multicall3MetaData contains all meta data concerning the Multicall3 contract. var Multicall3MetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"}],\"internalType\":\"structMulticall3.Call[]\",\"name\":\"calls\",\"type\":\"tuple[]\"}],\"name\":\"aggregate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"},{\"internalType\":\"bytes[]\",\"name\":\"returnData\",\"type\":\"bytes[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"allowFailure\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"}],\"internalType\":\"structMulticall3.Call3[]\",\"name\":\"calls\",\"type\":\"tuple[]\"}],\"name\":\"aggregate3\",\"outputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"returnData\",\"type\":\"bytes\"}],\"internalType\":\"structMulticall3.Result[]\",\"name\":\"returnData\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"allowFailure\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"}],\"internalType\":\"structMulticall3.Call3Value[]\",\"name\":\"calls\",\"type\":\"tuple[]\"}],\"name\":\"aggregate3Value\",\"outputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"returnData\",\"type\":\"bytes\"}],\"internalType\":\"structMulticall3.Result[]\",\"name\":\"returnData\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"}],\"internalType\":\"structMulticall3.Call[]\",\"name\":\"calls\",\"type\":\"tuple[]\"}],\"name\":\"blockAndAggregate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"returnData\",\"type\":\"bytes\"}],\"internalType\":\"structMulticall3.Result[]\",\"name\":\"returnData\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBasefee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"basefee\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"}],\"name\":\"getBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBlockNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getChainId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"chainid\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCurrentBlockCoinbase\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCurrentBlockDifficulty\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"difficulty\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCurrentBlockGasLimit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"gaslimit\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCurrentBlockTimestamp\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"getEthBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLastBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"requireSuccess\",\"type\":\"bool\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"}],\"internalType\":\"structMulticall3.Call[]\",\"name\":\"calls\",\"type\":\"tuple[]\"}],\"name\":\"tryAggregate\",\"outputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"returnData\",\"type\":\"bytes\"}],\"internalType\":\"structMulticall3.Result[]\",\"name\":\"returnData\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"requireSuccess\",\"type\":\"bool\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"}],\"internalType\":\"structMulticall3.Call[]\",\"name\":\"calls\",\"type\":\"tuple[]\"}],\"name\":\"tryBlockAndAggregate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"returnData\",\"type\":\"bytes\"}],\"internalType\":\"structMulticall3.Result[]\",\"name\":\"returnData\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", } ⋮---- // Multicall3ABI is the input ABI used to generate the binding from. // Deprecated: Use Multicall3MetaData.ABI instead. var Multicall3ABI = Multicall3MetaData.ABI ⋮---- // Multicall3 is an auto generated Go binding around an Ethereum contract. type Multicall3 struct { Multicall3Caller // Read-only binding to the contract Multicall3Transactor // Write-only binding to the contract Multicall3Filterer // Log filterer for contract events } ⋮---- Multicall3Caller // Read-only binding to the contract Multicall3Transactor // Write-only binding to the contract Multicall3Filterer // Log filterer for contract events ⋮---- // Multicall3Caller is an auto generated read-only Go binding around an Ethereum contract. type Multicall3Caller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } ⋮---- contract *bind.BoundContract // Generic contract wrapper for the low level calls ⋮---- // Multicall3Transactor is an auto generated write-only Go binding around an Ethereum contract. type Multicall3Transactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } ⋮---- // Multicall3Filterer is an auto generated log filtering Go binding around an Ethereum contract events. type Multicall3Filterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } ⋮---- // Multicall3Session is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type Multicall3Session struct { Contract *Multicall3 // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } ⋮---- Contract *Multicall3 // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session ⋮---- // Multicall3CallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type Multicall3CallerSession struct { Contract *Multicall3Caller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } ⋮---- Contract *Multicall3Caller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session ⋮---- // Multicall3TransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type Multicall3TransactorSession struct { Contract *Multicall3Transactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } ⋮---- Contract *Multicall3Transactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session ⋮---- // Multicall3Raw is an auto generated low-level Go binding around an Ethereum contract. type Multicall3Raw struct { Contract *Multicall3 // Generic contract binding to access the raw methods on } ⋮---- Contract *Multicall3 // Generic contract binding to access the raw methods on ⋮---- // Multicall3CallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type Multicall3CallerRaw struct { Contract *Multicall3Caller // Generic read-only contract binding to access the raw methods on } ⋮---- Contract *Multicall3Caller // Generic read-only contract binding to access the raw methods on ⋮---- // Multicall3TransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type Multicall3TransactorRaw struct { Contract *Multicall3Transactor // Generic write-only contract binding to access the raw methods on } ⋮---- Contract *Multicall3Transactor // Generic write-only contract binding to access the raw methods on ⋮---- // NewMulticall3 creates a new instance of Multicall3, bound to a specific deployed contract. func NewMulticall3(address common.Address, backend bind.ContractBackend) (*Multicall3, error) ⋮---- // NewMulticall3Caller creates a new read-only instance of Multicall3, bound to a specific deployed contract. func NewMulticall3Caller(address common.Address, caller bind.ContractCaller) (*Multicall3Caller, error) ⋮---- // NewMulticall3Transactor creates a new write-only instance of Multicall3, bound to a specific deployed contract. func NewMulticall3Transactor(address common.Address, transactor bind.ContractTransactor) (*Multicall3Transactor, error) ⋮---- // NewMulticall3Filterer creates a new log filterer instance of Multicall3, bound to a specific deployed contract. func NewMulticall3Filterer(address common.Address, filterer bind.ContractFilterer) (*Multicall3Filterer, error) ⋮---- // bindMulticall3 binds a generic wrapper to an already deployed contract. func bindMulticall3(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) ⋮---- // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_Multicall3 *Multicall3Raw) Call(opts *bind.CallOpts, result *[]interface ⋮---- // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_Multicall3 *Multicall3Raw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) ⋮---- // Transact invokes the (paid) contract method with params as input values. func (_Multicall3 *Multicall3Raw) Transact(opts *bind.TransactOpts, method string, params ...interface ⋮---- // Aggregate is a free data retrieval call binding the contract method 0x252dba42. // // Solidity: function aggregate((address,bytes)[] calls) view returns(uint256 blockNumber, bytes[] returnData) func (_Multicall3 *Multicall3Caller) Aggregate(opts *bind.CallOpts, calls []Multicall3Call) (struct ⋮---- var out []interface{} ⋮---- // Aggregate3 is a free data retrieval call binding the contract method 0x82ad56cb. ⋮---- // Solidity: function aggregate3((address,bool,bytes)[] calls) view returns((bool,bytes)[] returnData) func (_Multicall3 *Multicall3Caller) Aggregate3(opts *bind.CallOpts, calls []Multicall3Call3) ([]Multicall3Result, error) ⋮---- // Aggregate3Value is a free data retrieval call binding the contract method 0x174dea71. ⋮---- // Solidity: function aggregate3Value((address,bool,uint256,bytes)[] calls) view returns((bool,bytes)[] returnData) func (_Multicall3 *Multicall3Caller) Aggregate3Value(opts *bind.CallOpts, calls []Multicall3Call3Value) ([]Multicall3Result, error) ⋮---- // BlockAndAggregate is a free data retrieval call binding the contract method 0xc3077fa9. ⋮---- // Solidity: function blockAndAggregate((address,bytes)[] calls) view returns(uint256 blockNumber, bytes32 blockHash, (bool,bytes)[] returnData) func (_Multicall3 *Multicall3Caller) BlockAndAggregate(opts *bind.CallOpts, calls []Multicall3Call) (struct ⋮---- // GetBasefee is a free data retrieval call binding the contract method 0x3e64a696. ⋮---- // Solidity: function getBasefee() view returns(uint256 basefee) func (_Multicall3 *Multicall3Caller) GetBasefee(opts *bind.CallOpts) (*big.Int, error) ⋮---- // GetBlockHash is a free data retrieval call binding the contract method 0xee82ac5e. ⋮---- // Solidity: function getBlockHash(uint256 blockNumber) view returns(bytes32 blockHash) func (_Multicall3 *Multicall3Caller) GetBlockHash(opts *bind.CallOpts, blockNumber *big.Int) ([32]byte, error) ⋮---- // GetBlockNumber is a free data retrieval call binding the contract method 0x42cbb15c. ⋮---- // Solidity: function getBlockNumber() view returns(uint256 blockNumber) func (_Multicall3 *Multicall3Caller) GetBlockNumber(opts *bind.CallOpts) (*big.Int, error) ⋮---- // GetChainId is a free data retrieval call binding the contract method 0x3408e470. ⋮---- // Solidity: function getChainId() view returns(uint256 chainid) func (_Multicall3 *Multicall3Caller) GetChainId(opts *bind.CallOpts) (*big.Int, error) ⋮---- // GetCurrentBlockCoinbase is a free data retrieval call binding the contract method 0xa8b0574e. ⋮---- // Solidity: function getCurrentBlockCoinbase() view returns(address coinbase) func (_Multicall3 *Multicall3Caller) GetCurrentBlockCoinbase(opts *bind.CallOpts) (common.Address, error) ⋮---- // GetCurrentBlockDifficulty is a free data retrieval call binding the contract method 0x72425d9d. ⋮---- // Solidity: function getCurrentBlockDifficulty() view returns(uint256 difficulty) func (_Multicall3 *Multicall3Caller) GetCurrentBlockDifficulty(opts *bind.CallOpts) (*big.Int, error) ⋮---- // GetCurrentBlockGasLimit is a free data retrieval call binding the contract method 0x86d516e8. ⋮---- // Solidity: function getCurrentBlockGasLimit() view returns(uint256 gaslimit) func (_Multicall3 *Multicall3Caller) GetCurrentBlockGasLimit(opts *bind.CallOpts) (*big.Int, error) ⋮---- // GetCurrentBlockTimestamp is a free data retrieval call binding the contract method 0x0f28c97d. ⋮---- // Solidity: function getCurrentBlockTimestamp() view returns(uint256 timestamp) func (_Multicall3 *Multicall3Caller) GetCurrentBlockTimestamp(opts *bind.CallOpts) (*big.Int, error) ⋮---- // GetEthBalance is a free data retrieval call binding the contract method 0x4d2301cc. ⋮---- // Solidity: function getEthBalance(address addr) view returns(uint256 balance) func (_Multicall3 *Multicall3Caller) GetEthBalance(opts *bind.CallOpts, addr common.Address) (*big.Int, error) ⋮---- // GetLastBlockHash is a free data retrieval call binding the contract method 0x27e86d6e. ⋮---- // Solidity: function getLastBlockHash() view returns(bytes32 blockHash) func (_Multicall3 *Multicall3Caller) GetLastBlockHash(opts *bind.CallOpts) ([32]byte, error) ⋮---- // TryAggregate is a free data retrieval call binding the contract method 0xbce38bd7. ⋮---- // Solidity: function tryAggregate(bool requireSuccess, (address,bytes)[] calls) view returns((bool,bytes)[] returnData) func (_Multicall3 *Multicall3Caller) TryAggregate(opts *bind.CallOpts, requireSuccess bool, calls []Multicall3Call) ([]Multicall3Result, error) ⋮---- // TryBlockAndAggregate is a free data retrieval call binding the contract method 0x399542e9. ⋮---- // Solidity: function tryBlockAndAggregate(bool requireSuccess, (address,bytes)[] calls) view returns(uint256 blockNumber, bytes32 blockHash, (bool,bytes)[] returnData) func (_Multicall3 *Multicall3Caller) TryBlockAndAggregate(opts *bind.CallOpts, requireSuccess bool, calls []Multicall3Call) (struct ```` ## File: symbiotic/client/evm/gen/operatorRegistry.go ````go // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. ⋮---- package gen ⋮---- import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) ⋮---- "errors" "math/big" "strings" ⋮---- ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ⋮---- // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) ⋮---- // OperatorRegistryMetaData contains all meta data concerning the OperatorRegistry contract. var OperatorRegistryMetaData = &bind.MetaData{ ABI: "[{\"type\":\"function\",\"name\":\"entity\",\"inputs\":[{\"name\":\"index\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isEntity\",\"inputs\":[{\"name\":\"entity_\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"registerOperator\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"totalEntities\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"AddEntity\",\"inputs\":[{\"name\":\"entity\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"EntityNotExist\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OperatorAlreadyRegistered\",\"inputs\":[]}]", } ⋮---- // OperatorRegistryABI is the input ABI used to generate the binding from. // Deprecated: Use OperatorRegistryMetaData.ABI instead. var OperatorRegistryABI = OperatorRegistryMetaData.ABI ⋮---- // OperatorRegistry is an auto generated Go binding around an Ethereum contract. type OperatorRegistry struct { OperatorRegistryCaller // Read-only binding to the contract OperatorRegistryTransactor // Write-only binding to the contract OperatorRegistryFilterer // Log filterer for contract events } ⋮---- OperatorRegistryCaller // Read-only binding to the contract OperatorRegistryTransactor // Write-only binding to the contract OperatorRegistryFilterer // Log filterer for contract events ⋮---- // OperatorRegistryCaller is an auto generated read-only Go binding around an Ethereum contract. type OperatorRegistryCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } ⋮---- contract *bind.BoundContract // Generic contract wrapper for the low level calls ⋮---- // OperatorRegistryTransactor is an auto generated write-only Go binding around an Ethereum contract. type OperatorRegistryTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } ⋮---- // OperatorRegistryFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type OperatorRegistryFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } ⋮---- // OperatorRegistrySession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type OperatorRegistrySession struct { Contract *OperatorRegistry // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } ⋮---- Contract *OperatorRegistry // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session ⋮---- // OperatorRegistryCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type OperatorRegistryCallerSession struct { Contract *OperatorRegistryCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } ⋮---- Contract *OperatorRegistryCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session ⋮---- // OperatorRegistryTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type OperatorRegistryTransactorSession struct { Contract *OperatorRegistryTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } ⋮---- Contract *OperatorRegistryTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session ⋮---- // OperatorRegistryRaw is an auto generated low-level Go binding around an Ethereum contract. type OperatorRegistryRaw struct { Contract *OperatorRegistry // Generic contract binding to access the raw methods on } ⋮---- Contract *OperatorRegistry // Generic contract binding to access the raw methods on ⋮---- // OperatorRegistryCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type OperatorRegistryCallerRaw struct { Contract *OperatorRegistryCaller // Generic read-only contract binding to access the raw methods on } ⋮---- Contract *OperatorRegistryCaller // Generic read-only contract binding to access the raw methods on ⋮---- // OperatorRegistryTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type OperatorRegistryTransactorRaw struct { Contract *OperatorRegistryTransactor // Generic write-only contract binding to access the raw methods on } ⋮---- Contract *OperatorRegistryTransactor // Generic write-only contract binding to access the raw methods on ⋮---- // NewOperatorRegistry creates a new instance of OperatorRegistry, bound to a specific deployed contract. func NewOperatorRegistry(address common.Address, backend bind.ContractBackend) (*OperatorRegistry, error) ⋮---- // NewOperatorRegistryCaller creates a new read-only instance of OperatorRegistry, bound to a specific deployed contract. func NewOperatorRegistryCaller(address common.Address, caller bind.ContractCaller) (*OperatorRegistryCaller, error) ⋮---- // NewOperatorRegistryTransactor creates a new write-only instance of OperatorRegistry, bound to a specific deployed contract. func NewOperatorRegistryTransactor(address common.Address, transactor bind.ContractTransactor) (*OperatorRegistryTransactor, error) ⋮---- // NewOperatorRegistryFilterer creates a new log filterer instance of OperatorRegistry, bound to a specific deployed contract. func NewOperatorRegistryFilterer(address common.Address, filterer bind.ContractFilterer) (*OperatorRegistryFilterer, error) ⋮---- // bindOperatorRegistry binds a generic wrapper to an already deployed contract. func bindOperatorRegistry(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) ⋮---- // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_OperatorRegistry *OperatorRegistryRaw) Call(opts *bind.CallOpts, result *[]interface ⋮---- // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_OperatorRegistry *OperatorRegistryRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) ⋮---- // Transact invokes the (paid) contract method with params as input values. func (_OperatorRegistry *OperatorRegistryRaw) Transact(opts *bind.TransactOpts, method string, params ...interface ⋮---- // Entity is a free data retrieval call binding the contract method 0xb42ba2a2. // // Solidity: function entity(uint256 index) view returns(address) func (_OperatorRegistry *OperatorRegistryCaller) Entity(opts *bind.CallOpts, index *big.Int) (common.Address, error) ⋮---- var out []interface{} ⋮---- // IsEntity is a free data retrieval call binding the contract method 0x14887c58. ⋮---- // Solidity: function isEntity(address entity_) view returns(bool) func (_OperatorRegistry *OperatorRegistryCaller) IsEntity(opts *bind.CallOpts, entity_ common.Address) (bool, error) ⋮---- // TotalEntities is a free data retrieval call binding the contract method 0x5cd8b15e. ⋮---- // Solidity: function totalEntities() view returns(uint256) func (_OperatorRegistry *OperatorRegistryCaller) TotalEntities(opts *bind.CallOpts) (*big.Int, error) ⋮---- // RegisterOperator is a paid mutator transaction binding the contract method 0x2acde098. ⋮---- // Solidity: function registerOperator() returns() func (_OperatorRegistry *OperatorRegistryTransactor) RegisterOperator(opts *bind.TransactOpts) (*types.Transaction, error) ⋮---- // OperatorRegistryAddEntityIterator is returned from FilterAddEntity and is used to iterate over the raw logs and unpacked data for AddEntity events raised by the OperatorRegistry contract. type OperatorRegistryAddEntityIterator struct { Event *OperatorRegistryAddEntity // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } ⋮---- Event *OperatorRegistryAddEntity // Event containing the contract specifics and raw log ⋮---- contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data ⋮---- logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration ⋮---- // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *OperatorRegistryAddEntityIterator) Next() bool ⋮---- // If the iterator failed, stop iterating ⋮---- // If the iterator completed, deliver directly whatever's available ⋮---- // Iterator still in progress, wait for either a data or an error event ⋮---- // Error returns any retrieval or parsing error occurred during filtering. func (it *OperatorRegistryAddEntityIterator) Error() error ⋮---- // Close terminates the iteration process, releasing any pending underlying // resources. func (it *OperatorRegistryAddEntityIterator) Close() error ⋮---- // OperatorRegistryAddEntity represents a AddEntity event raised by the OperatorRegistry contract. type OperatorRegistryAddEntity struct { Entity common.Address Raw types.Log // Blockchain specific contextual infos } ⋮---- Raw types.Log // Blockchain specific contextual infos ⋮---- // FilterAddEntity is a free log retrieval operation binding the contract event 0xb919910dcefbf753bfd926ab3b1d3f85d877190c3d01ba1bd585047b99b99f0b. ⋮---- // Solidity: event AddEntity(address indexed entity) func (_OperatorRegistry *OperatorRegistryFilterer) FilterAddEntity(opts *bind.FilterOpts, entity []common.Address) (*OperatorRegistryAddEntityIterator, error) ⋮---- var entityRule []interface{} ⋮---- // WatchAddEntity is a free log subscription operation binding the contract event 0xb919910dcefbf753bfd926ab3b1d3f85d877190c3d01ba1bd585047b99b99f0b. ⋮---- func (_OperatorRegistry *OperatorRegistryFilterer) WatchAddEntity(opts *bind.WatchOpts, sink chan<- *OperatorRegistryAddEntity, entity []common.Address) (event.Subscription, error) ⋮---- // New log arrived, parse the event and forward to the user ⋮---- // ParseAddEntity is a log parse operation binding the contract event 0xb919910dcefbf753bfd926ab3b1d3f85d877190c3d01ba1bd585047b99b99f0b. ⋮---- func (_OperatorRegistry *OperatorRegistryFilterer) ParseAddEntity(log types.Log) (*OperatorRegistryAddEntity, error) ```` ## File: symbiotic/client/evm/gen/settlement.go ````go // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. ⋮---- package gen ⋮---- import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) ⋮---- "errors" "math/big" "strings" ⋮---- ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ⋮---- // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) ⋮---- // ISettlementExtraData is an auto generated low-level Go binding around an user-defined struct. type ISettlementExtraData struct { Key [32]byte Value [32]byte } ⋮---- // ISettlementValSetHeader is an auto generated low-level Go binding around an user-defined struct. type ISettlementValSetHeader struct { Version uint8 RequiredKeyTag uint8 Epoch *big.Int CaptureTimestamp *big.Int QuorumThreshold *big.Int TotalVotingPower *big.Int ValidatorsSszMRoot [32]byte } ⋮---- // ISettlementMetaData contains all meta data concerning the ISettlement contract. var ISettlementMetaData = &bind.MetaData{ ABI: "[{\"type\":\"function\",\"name\":\"NETWORK\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"SUBNETWORK\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"SUBNETWORK_IDENTIFIER\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint96\",\"internalType\":\"uint96\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"VALIDATOR_SET_VERSION\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"commitValSetHeader\",\"inputs\":[{\"name\":\"header\",\"type\":\"tuple\",\"internalType\":\"structISettlement.ValSetHeader\",\"components\":[{\"name\":\"version\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"requiredKeyTag\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"epoch\",\"type\":\"uint48\",\"internalType\":\"uint48\"},{\"name\":\"captureTimestamp\",\"type\":\"uint48\",\"internalType\":\"uint48\"},{\"name\":\"quorumThreshold\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"totalVotingPower\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"validatorsSszMRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"name\":\"extraData\",\"type\":\"tuple[]\",\"internalType\":\"structISettlement.ExtraData[]\",\"components\":[{\"name\":\"key\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"value\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"name\":\"proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"eip712Domain\",\"inputs\":[],\"outputs\":[{\"name\":\"fields\",\"type\":\"bytes1\",\"internalType\":\"bytes1\"},{\"name\":\"name\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"version\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"chainId\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"verifyingContract\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"salt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"extensions\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getCaptureTimestampFromValSetHeader\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getCaptureTimestampFromValSetHeaderAt\",\"inputs\":[{\"name\":\"epoch\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getExtraData\",\"inputs\":[{\"name\":\"key\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getExtraDataAt\",\"inputs\":[{\"name\":\"epoch\",\"type\":\"uint48\",\"internalType\":\"uint48\"},{\"name\":\"key\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getLastCommittedHeaderEpoch\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getQuorumThresholdFromValSetHeader\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getQuorumThresholdFromValSetHeaderAt\",\"inputs\":[{\"name\":\"epoch\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getRequiredKeyTagFromValSetHeader\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getRequiredKeyTagFromValSetHeaderAt\",\"inputs\":[{\"name\":\"epoch\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getSigVerifier\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getSigVerifierAt\",\"inputs\":[{\"name\":\"epoch\",\"type\":\"uint48\",\"internalType\":\"uint48\"},{\"name\":\"hint\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getTotalVotingPowerFromValSetHeader\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getTotalVotingPowerFromValSetHeaderAt\",\"inputs\":[{\"name\":\"epoch\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getValSetHeader\",\"inputs\":[],\"outputs\":[{\"name\":\"header\",\"type\":\"tuple\",\"internalType\":\"structISettlement.ValSetHeader\",\"components\":[{\"name\":\"version\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"requiredKeyTag\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"epoch\",\"type\":\"uint48\",\"internalType\":\"uint48\"},{\"name\":\"captureTimestamp\",\"type\":\"uint48\",\"internalType\":\"uint48\"},{\"name\":\"quorumThreshold\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"totalVotingPower\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"validatorsSszMRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getValSetHeaderAt\",\"inputs\":[{\"name\":\"epoch\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structISettlement.ValSetHeader\",\"components\":[{\"name\":\"version\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"requiredKeyTag\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"epoch\",\"type\":\"uint48\",\"internalType\":\"uint48\"},{\"name\":\"captureTimestamp\",\"type\":\"uint48\",\"internalType\":\"uint48\"},{\"name\":\"quorumThreshold\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"totalVotingPower\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"validatorsSszMRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getValSetHeaderHash\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getValSetHeaderHashAt\",\"inputs\":[{\"name\":\"epoch\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getValidatorsSszMRootFromValSetHeader\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getValidatorsSszMRootFromValSetHeaderAt\",\"inputs\":[{\"name\":\"epoch\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getVersionFromValSetHeader\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getVersionFromValSetHeaderAt\",\"inputs\":[{\"name\":\"epoch\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"hashTypedDataV4\",\"inputs\":[{\"name\":\"structHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"hashTypedDataV4CrossChain\",\"inputs\":[{\"name\":\"structHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isValSetHeaderCommittedAt\",\"inputs\":[{\"name\":\"epoch\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"setGenesis\",\"inputs\":[{\"name\":\"valSetHeader\",\"type\":\"tuple\",\"internalType\":\"structISettlement.ValSetHeader\",\"components\":[{\"name\":\"version\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"requiredKeyTag\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"epoch\",\"type\":\"uint48\",\"internalType\":\"uint48\"},{\"name\":\"captureTimestamp\",\"type\":\"uint48\",\"internalType\":\"uint48\"},{\"name\":\"quorumThreshold\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"totalVotingPower\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"validatorsSszMRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"name\":\"extraData\",\"type\":\"tuple[]\",\"internalType\":\"structISettlement.ExtraData[]\",\"components\":[{\"name\":\"key\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"value\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setSigVerifier\",\"inputs\":[{\"name\":\"sigVerifier\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"staticDelegateCall\",\"inputs\":[{\"name\":\"target\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"verifyQuorumSig\",\"inputs\":[{\"name\":\"message\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"keyTag\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"quorumThreshold\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"verifyQuorumSigAt\",\"inputs\":[{\"name\":\"message\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"keyTag\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"quorumThreshold\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"epoch\",\"type\":\"uint48\",\"internalType\":\"uint48\"},{\"name\":\"hint\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"CommitValSetHeader\",\"inputs\":[{\"name\":\"valSetHeader\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structISettlement.ValSetHeader\",\"components\":[{\"name\":\"version\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"requiredKeyTag\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"epoch\",\"type\":\"uint48\",\"internalType\":\"uint48\"},{\"name\":\"captureTimestamp\",\"type\":\"uint48\",\"internalType\":\"uint48\"},{\"name\":\"quorumThreshold\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"totalVotingPower\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"validatorsSszMRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"name\":\"extraData\",\"type\":\"tuple[]\",\"indexed\":false,\"internalType\":\"structISettlement.ExtraData[]\",\"components\":[{\"name\":\"key\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"value\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"EIP712DomainChanged\",\"inputs\":[],\"anonymous\":false},{\"type\":\"event\",\"name\":\"InitEIP712\",\"inputs\":[{\"name\":\"name\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"},{\"name\":\"version\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"InitSigVerifier\",\"inputs\":[{\"name\":\"sigVerifier\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"InitSubnetwork\",\"inputs\":[{\"name\":\"network\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"subnetworkId\",\"type\":\"uint96\",\"indexed\":false,\"internalType\":\"uint96\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"SetGenesis\",\"inputs\":[{\"name\":\"valSetHeader\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structISettlement.ValSetHeader\",\"components\":[{\"name\":\"version\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"requiredKeyTag\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"epoch\",\"type\":\"uint48\",\"internalType\":\"uint48\"},{\"name\":\"captureTimestamp\",\"type\":\"uint48\",\"internalType\":\"uint48\"},{\"name\":\"quorumThreshold\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"totalVotingPower\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"validatorsSszMRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"name\":\"extraData\",\"type\":\"tuple[]\",\"indexed\":false,\"internalType\":\"structISettlement.ExtraData[]\",\"components\":[{\"name\":\"key\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"value\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"SetSigVerifier\",\"inputs\":[{\"name\":\"sigVerifier\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"CheckpointUnorderedInsertion\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidInitialization\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidKeyTag\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NetworkManager_InvalidNetwork\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotInitializing\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Settlement_DuplicateExtraDataKey\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Settlement_InvalidCaptureTimestamp\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Settlement_InvalidEpoch\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Settlement_InvalidSigVerifier\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Settlement_InvalidValidatorsSszMRoot\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Settlement_InvalidVersion\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Settlement_QuorumThresholdGtTotalVotingPower\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Settlement_ValSetHeaderAlreadyCommitted\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Settlement_VerificationFailed\",\"inputs\":[]}]", } ⋮---- // ISettlementABI is the input ABI used to generate the binding from. // Deprecated: Use ISettlementMetaData.ABI instead. var ISettlementABI = ISettlementMetaData.ABI ⋮---- // ISettlement is an auto generated Go binding around an Ethereum contract. type ISettlement struct { ISettlementCaller // Read-only binding to the contract ISettlementTransactor // Write-only binding to the contract ISettlementFilterer // Log filterer for contract events } ⋮---- ISettlementCaller // Read-only binding to the contract ISettlementTransactor // Write-only binding to the contract ISettlementFilterer // Log filterer for contract events ⋮---- // ISettlementCaller is an auto generated read-only Go binding around an Ethereum contract. type ISettlementCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } ⋮---- contract *bind.BoundContract // Generic contract wrapper for the low level calls ⋮---- // ISettlementTransactor is an auto generated write-only Go binding around an Ethereum contract. type ISettlementTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } ⋮---- // ISettlementFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type ISettlementFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } ⋮---- // ISettlementSession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type ISettlementSession struct { Contract *ISettlement // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } ⋮---- Contract *ISettlement // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session ⋮---- // ISettlementCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type ISettlementCallerSession struct { Contract *ISettlementCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } ⋮---- Contract *ISettlementCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session ⋮---- // ISettlementTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type ISettlementTransactorSession struct { Contract *ISettlementTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } ⋮---- Contract *ISettlementTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session ⋮---- // ISettlementRaw is an auto generated low-level Go binding around an Ethereum contract. type ISettlementRaw struct { Contract *ISettlement // Generic contract binding to access the raw methods on } ⋮---- Contract *ISettlement // Generic contract binding to access the raw methods on ⋮---- // ISettlementCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type ISettlementCallerRaw struct { Contract *ISettlementCaller // Generic read-only contract binding to access the raw methods on } ⋮---- Contract *ISettlementCaller // Generic read-only contract binding to access the raw methods on ⋮---- // ISettlementTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type ISettlementTransactorRaw struct { Contract *ISettlementTransactor // Generic write-only contract binding to access the raw methods on } ⋮---- Contract *ISettlementTransactor // Generic write-only contract binding to access the raw methods on ⋮---- // NewISettlement creates a new instance of ISettlement, bound to a specific deployed contract. func NewISettlement(address common.Address, backend bind.ContractBackend) (*ISettlement, error) ⋮---- // NewISettlementCaller creates a new read-only instance of ISettlement, bound to a specific deployed contract. func NewISettlementCaller(address common.Address, caller bind.ContractCaller) (*ISettlementCaller, error) ⋮---- // NewISettlementTransactor creates a new write-only instance of ISettlement, bound to a specific deployed contract. func NewISettlementTransactor(address common.Address, transactor bind.ContractTransactor) (*ISettlementTransactor, error) ⋮---- // NewISettlementFilterer creates a new log filterer instance of ISettlement, bound to a specific deployed contract. func NewISettlementFilterer(address common.Address, filterer bind.ContractFilterer) (*ISettlementFilterer, error) ⋮---- // bindISettlement binds a generic wrapper to an already deployed contract. func bindISettlement(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) ⋮---- // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_ISettlement *ISettlementRaw) Call(opts *bind.CallOpts, result *[]interface ⋮---- // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_ISettlement *ISettlementRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) ⋮---- // Transact invokes the (paid) contract method with params as input values. func (_ISettlement *ISettlementRaw) Transact(opts *bind.TransactOpts, method string, params ...interface ⋮---- // NETWORK is a free data retrieval call binding the contract method 0x8759e6d1. // // Solidity: function NETWORK() view returns(address) func (_ISettlement *ISettlementCaller) NETWORK(opts *bind.CallOpts) (common.Address, error) ⋮---- var out []interface{} ⋮---- // SUBNETWORK is a free data retrieval call binding the contract method 0x773e6b54. ⋮---- // Solidity: function SUBNETWORK() view returns(bytes32) func (_ISettlement *ISettlementCaller) SUBNETWORK(opts *bind.CallOpts) ([32]byte, error) ⋮---- // SUBNETWORKIDENTIFIER is a free data retrieval call binding the contract method 0xabacb807. ⋮---- // Solidity: function SUBNETWORK_IDENTIFIER() view returns(uint96) func (_ISettlement *ISettlementCaller) SUBNETWORKIDENTIFIER(opts *bind.CallOpts) (*big.Int, error) ⋮---- // VALIDATORSETVERSION is a free data retrieval call binding the contract method 0x321d7b8d. ⋮---- // Solidity: function VALIDATOR_SET_VERSION() view returns(uint8) func (_ISettlement *ISettlementCaller) VALIDATORSETVERSION(opts *bind.CallOpts) (uint8, error) ⋮---- // Eip712Domain is a free data retrieval call binding the contract method 0x84b0196e. ⋮---- // Solidity: function eip712Domain() view returns(bytes1 fields, string name, string version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] extensions) func (_ISettlement *ISettlementCaller) Eip712Domain(opts *bind.CallOpts) (struct ⋮---- // GetCaptureTimestampFromValSetHeader is a free data retrieval call binding the contract method 0xf4935d39. ⋮---- // Solidity: function getCaptureTimestampFromValSetHeader() view returns(uint48) func (_ISettlement *ISettlementCaller) GetCaptureTimestampFromValSetHeader(opts *bind.CallOpts) (*big.Int, error) ⋮---- // GetCaptureTimestampFromValSetHeaderAt is a free data retrieval call binding the contract method 0x5485b549. ⋮---- // Solidity: function getCaptureTimestampFromValSetHeaderAt(uint48 epoch) view returns(uint48) func (_ISettlement *ISettlementCaller) GetCaptureTimestampFromValSetHeaderAt(opts *bind.CallOpts, epoch *big.Int) (*big.Int, error) ⋮---- // GetExtraData is a free data retrieval call binding the contract method 0xecae6344. ⋮---- // Solidity: function getExtraData(bytes32 key) view returns(bytes32) func (_ISettlement *ISettlementCaller) GetExtraData(opts *bind.CallOpts, key [32]byte) ([32]byte, error) ⋮---- // GetExtraDataAt is a free data retrieval call binding the contract method 0x52bb038a. ⋮---- // Solidity: function getExtraDataAt(uint48 epoch, bytes32 key) view returns(bytes32) func (_ISettlement *ISettlementCaller) GetExtraDataAt(opts *bind.CallOpts, epoch *big.Int, key [32]byte) ([32]byte, error) ⋮---- // GetLastCommittedHeaderEpoch is a free data retrieval call binding the contract method 0x65b0849b. ⋮---- // Solidity: function getLastCommittedHeaderEpoch() view returns(uint48) func (_ISettlement *ISettlementCaller) GetLastCommittedHeaderEpoch(opts *bind.CallOpts) (*big.Int, error) ⋮---- // GetQuorumThresholdFromValSetHeader is a free data retrieval call binding the contract method 0xe586b38e. ⋮---- // Solidity: function getQuorumThresholdFromValSetHeader() view returns(uint256) func (_ISettlement *ISettlementCaller) GetQuorumThresholdFromValSetHeader(opts *bind.CallOpts) (*big.Int, error) ⋮---- // GetQuorumThresholdFromValSetHeaderAt is a free data retrieval call binding the contract method 0x1d86bd88. ⋮---- // Solidity: function getQuorumThresholdFromValSetHeaderAt(uint48 epoch) view returns(uint256) func (_ISettlement *ISettlementCaller) GetQuorumThresholdFromValSetHeaderAt(opts *bind.CallOpts, epoch *big.Int) (*big.Int, error) ⋮---- // GetRequiredKeyTagFromValSetHeader is a free data retrieval call binding the contract method 0xb91a434a. ⋮---- // Solidity: function getRequiredKeyTagFromValSetHeader() view returns(uint8) func (_ISettlement *ISettlementCaller) GetRequiredKeyTagFromValSetHeader(opts *bind.CallOpts) (uint8, error) ⋮---- // GetRequiredKeyTagFromValSetHeaderAt is a free data retrieval call binding the contract method 0xe4378ed2. ⋮---- // Solidity: function getRequiredKeyTagFromValSetHeaderAt(uint48 epoch) view returns(uint8) func (_ISettlement *ISettlementCaller) GetRequiredKeyTagFromValSetHeaderAt(opts *bind.CallOpts, epoch *big.Int) (uint8, error) ⋮---- // GetSigVerifier is a free data retrieval call binding the contract method 0x5b28556d. ⋮---- // Solidity: function getSigVerifier() view returns(address) func (_ISettlement *ISettlementCaller) GetSigVerifier(opts *bind.CallOpts) (common.Address, error) ⋮---- // GetSigVerifierAt is a free data retrieval call binding the contract method 0xa54ce263. ⋮---- // Solidity: function getSigVerifierAt(uint48 epoch, bytes hint) view returns(address) func (_ISettlement *ISettlementCaller) GetSigVerifierAt(opts *bind.CallOpts, epoch *big.Int, hint []byte) (common.Address, error) ⋮---- // GetTotalVotingPowerFromValSetHeader is a free data retrieval call binding the contract method 0xc38de37f. ⋮---- // Solidity: function getTotalVotingPowerFromValSetHeader() view returns(uint256) func (_ISettlement *ISettlementCaller) GetTotalVotingPowerFromValSetHeader(opts *bind.CallOpts) (*big.Int, error) ⋮---- // GetTotalVotingPowerFromValSetHeaderAt is a free data retrieval call binding the contract method 0xf7e5b491. ⋮---- // Solidity: function getTotalVotingPowerFromValSetHeaderAt(uint48 epoch) view returns(uint256) func (_ISettlement *ISettlementCaller) GetTotalVotingPowerFromValSetHeaderAt(opts *bind.CallOpts, epoch *big.Int) (*big.Int, error) ⋮---- // GetValSetHeader is a free data retrieval call binding the contract method 0xadc91fc8. ⋮---- // Solidity: function getValSetHeader() view returns((uint8,uint8,uint48,uint48,uint256,uint256,bytes32) header) func (_ISettlement *ISettlementCaller) GetValSetHeader(opts *bind.CallOpts) (ISettlementValSetHeader, error) ⋮---- // GetValSetHeaderAt is a free data retrieval call binding the contract method 0x4addaee7. ⋮---- // Solidity: function getValSetHeaderAt(uint48 epoch) view returns((uint8,uint8,uint48,uint48,uint256,uint256,bytes32)) func (_ISettlement *ISettlementCaller) GetValSetHeaderAt(opts *bind.CallOpts, epoch *big.Int) (ISettlementValSetHeader, error) ⋮---- // GetValSetHeaderHash is a free data retrieval call binding the contract method 0x32624bf3. ⋮---- // Solidity: function getValSetHeaderHash() view returns(bytes32) func (_ISettlement *ISettlementCaller) GetValSetHeaderHash(opts *bind.CallOpts) ([32]byte, error) ⋮---- // GetValSetHeaderHashAt is a free data retrieval call binding the contract method 0xf35d12a3. ⋮---- // Solidity: function getValSetHeaderHashAt(uint48 epoch) view returns(bytes32) func (_ISettlement *ISettlementCaller) GetValSetHeaderHashAt(opts *bind.CallOpts, epoch *big.Int) ([32]byte, error) ⋮---- // GetValidatorsSszMRootFromValSetHeader is a free data retrieval call binding the contract method 0x0167166e. ⋮---- // Solidity: function getValidatorsSszMRootFromValSetHeader() view returns(bytes32) func (_ISettlement *ISettlementCaller) GetValidatorsSszMRootFromValSetHeader(opts *bind.CallOpts) ([32]byte, error) ⋮---- // GetValidatorsSszMRootFromValSetHeaderAt is a free data retrieval call binding the contract method 0x230ae408. ⋮---- // Solidity: function getValidatorsSszMRootFromValSetHeaderAt(uint48 epoch) view returns(bytes32) func (_ISettlement *ISettlementCaller) GetValidatorsSszMRootFromValSetHeaderAt(opts *bind.CallOpts, epoch *big.Int) ([32]byte, error) ⋮---- // GetVersionFromValSetHeader is a free data retrieval call binding the contract method 0xd2df9fb6. ⋮---- // Solidity: function getVersionFromValSetHeader() view returns(uint8) func (_ISettlement *ISettlementCaller) GetVersionFromValSetHeader(opts *bind.CallOpts) (uint8, error) ⋮---- // GetVersionFromValSetHeaderAt is a free data retrieval call binding the contract method 0x548202ad. ⋮---- // Solidity: function getVersionFromValSetHeaderAt(uint48 epoch) view returns(uint8) func (_ISettlement *ISettlementCaller) GetVersionFromValSetHeaderAt(opts *bind.CallOpts, epoch *big.Int) (uint8, error) ⋮---- // HashTypedDataV4 is a free data retrieval call binding the contract method 0x4980f288. ⋮---- // Solidity: function hashTypedDataV4(bytes32 structHash) view returns(bytes32) func (_ISettlement *ISettlementCaller) HashTypedDataV4(opts *bind.CallOpts, structHash [32]byte) ([32]byte, error) ⋮---- // HashTypedDataV4CrossChain is a free data retrieval call binding the contract method 0x518dcf3b. ⋮---- // Solidity: function hashTypedDataV4CrossChain(bytes32 structHash) view returns(bytes32) func (_ISettlement *ISettlementCaller) HashTypedDataV4CrossChain(opts *bind.CallOpts, structHash [32]byte) ([32]byte, error) ⋮---- // IsValSetHeaderCommittedAt is a free data retrieval call binding the contract method 0x5fa4bbd2. ⋮---- // Solidity: function isValSetHeaderCommittedAt(uint48 epoch) view returns(bool) func (_ISettlement *ISettlementCaller) IsValSetHeaderCommittedAt(opts *bind.CallOpts, epoch *big.Int) (bool, error) ⋮---- // VerifyQuorumSig is a free data retrieval call binding the contract method 0x1dc1898b. ⋮---- // Solidity: function verifyQuorumSig(bytes message, uint8 keyTag, uint256 quorumThreshold, bytes proof) view returns(bool) func (_ISettlement *ISettlementCaller) VerifyQuorumSig(opts *bind.CallOpts, message []byte, keyTag uint8, quorumThreshold *big.Int, proof []byte) (bool, error) ⋮---- // VerifyQuorumSigAt is a free data retrieval call binding the contract method 0xacaa2269. ⋮---- // Solidity: function verifyQuorumSigAt(bytes message, uint8 keyTag, uint256 quorumThreshold, bytes proof, uint48 epoch, bytes hint) view returns(bool) func (_ISettlement *ISettlementCaller) VerifyQuorumSigAt(opts *bind.CallOpts, message []byte, keyTag uint8, quorumThreshold *big.Int, proof []byte, epoch *big.Int, hint []byte) (bool, error) ⋮---- // CommitValSetHeader is a paid mutator transaction binding the contract method 0x6f5f058e. ⋮---- // Solidity: function commitValSetHeader((uint8,uint8,uint48,uint48,uint256,uint256,bytes32) header, (bytes32,bytes32)[] extraData, bytes proof) returns() func (_ISettlement *ISettlementTransactor) CommitValSetHeader(opts *bind.TransactOpts, header ISettlementValSetHeader, extraData []ISettlementExtraData, proof []byte) (*types.Transaction, error) ⋮---- // SetGenesis is a paid mutator transaction binding the contract method 0xec3be7e4. ⋮---- // Solidity: function setGenesis((uint8,uint8,uint48,uint48,uint256,uint256,bytes32) valSetHeader, (bytes32,bytes32)[] extraData) returns() func (_ISettlement *ISettlementTransactor) SetGenesis(opts *bind.TransactOpts, valSetHeader ISettlementValSetHeader, extraData []ISettlementExtraData) (*types.Transaction, error) ⋮---- // SetSigVerifier is a paid mutator transaction binding the contract method 0xbd7e9980. ⋮---- // Solidity: function setSigVerifier(address sigVerifier) returns() func (_ISettlement *ISettlementTransactor) SetSigVerifier(opts *bind.TransactOpts, sigVerifier common.Address) (*types.Transaction, error) ⋮---- // StaticDelegateCall is a paid mutator transaction binding the contract method 0x9f86fd85. ⋮---- // Solidity: function staticDelegateCall(address target, bytes data) returns() func (_ISettlement *ISettlementTransactor) StaticDelegateCall(opts *bind.TransactOpts, target common.Address, data []byte) (*types.Transaction, error) ⋮---- // ISettlementCommitValSetHeaderIterator is returned from FilterCommitValSetHeader and is used to iterate over the raw logs and unpacked data for CommitValSetHeader events raised by the ISettlement contract. type ISettlementCommitValSetHeaderIterator struct { Event *ISettlementCommitValSetHeader // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } ⋮---- Event *ISettlementCommitValSetHeader // Event containing the contract specifics and raw log ⋮---- contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data ⋮---- logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration ⋮---- // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *ISettlementCommitValSetHeaderIterator) Next() bool ⋮---- // If the iterator failed, stop iterating ⋮---- // If the iterator completed, deliver directly whatever's available ⋮---- // Iterator still in progress, wait for either a data or an error event ⋮---- // Error returns any retrieval or parsing error occurred during filtering. func (it *ISettlementCommitValSetHeaderIterator) Error() error ⋮---- // Close terminates the iteration process, releasing any pending underlying // resources. func (it *ISettlementCommitValSetHeaderIterator) Close() error ⋮---- // ISettlementCommitValSetHeader represents a CommitValSetHeader event raised by the ISettlement contract. type ISettlementCommitValSetHeader struct { ValSetHeader ISettlementValSetHeader ExtraData []ISettlementExtraData Raw types.Log // Blockchain specific contextual infos } ⋮---- Raw types.Log // Blockchain specific contextual infos ⋮---- // FilterCommitValSetHeader is a free log retrieval operation binding the contract event 0x9ed1f51eddfff95a70fd993c30da7d26fc67bda21c9145aafc7d0a510a405558. ⋮---- // Solidity: event CommitValSetHeader((uint8,uint8,uint48,uint48,uint256,uint256,bytes32) valSetHeader, (bytes32,bytes32)[] extraData) func (_ISettlement *ISettlementFilterer) FilterCommitValSetHeader(opts *bind.FilterOpts) (*ISettlementCommitValSetHeaderIterator, error) ⋮---- // WatchCommitValSetHeader is a free log subscription operation binding the contract event 0x9ed1f51eddfff95a70fd993c30da7d26fc67bda21c9145aafc7d0a510a405558. ⋮---- func (_ISettlement *ISettlementFilterer) WatchCommitValSetHeader(opts *bind.WatchOpts, sink chan<- *ISettlementCommitValSetHeader) (event.Subscription, error) ⋮---- // New log arrived, parse the event and forward to the user ⋮---- // ParseCommitValSetHeader is a log parse operation binding the contract event 0x9ed1f51eddfff95a70fd993c30da7d26fc67bda21c9145aafc7d0a510a405558. ⋮---- func (_ISettlement *ISettlementFilterer) ParseCommitValSetHeader(log types.Log) (*ISettlementCommitValSetHeader, error) ⋮---- // ISettlementEIP712DomainChangedIterator is returned from FilterEIP712DomainChanged and is used to iterate over the raw logs and unpacked data for EIP712DomainChanged events raised by the ISettlement contract. type ISettlementEIP712DomainChangedIterator struct { Event *ISettlementEIP712DomainChanged // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } ⋮---- Event *ISettlementEIP712DomainChanged // Event containing the contract specifics and raw log ⋮---- // ISettlementEIP712DomainChanged represents a EIP712DomainChanged event raised by the ISettlement contract. type ISettlementEIP712DomainChanged struct { Raw types.Log // Blockchain specific contextual infos } ⋮---- Raw types.Log // Blockchain specific contextual infos ⋮---- // FilterEIP712DomainChanged is a free log retrieval operation binding the contract event 0x0a6387c9ea3628b88a633bb4f3b151770f70085117a15f9bf3787cda53f13d31. ⋮---- // Solidity: event EIP712DomainChanged() func (_ISettlement *ISettlementFilterer) FilterEIP712DomainChanged(opts *bind.FilterOpts) (*ISettlementEIP712DomainChangedIterator, error) ⋮---- // WatchEIP712DomainChanged is a free log subscription operation binding the contract event 0x0a6387c9ea3628b88a633bb4f3b151770f70085117a15f9bf3787cda53f13d31. ⋮---- func (_ISettlement *ISettlementFilterer) WatchEIP712DomainChanged(opts *bind.WatchOpts, sink chan<- *ISettlementEIP712DomainChanged) (event.Subscription, error) ⋮---- // ParseEIP712DomainChanged is a log parse operation binding the contract event 0x0a6387c9ea3628b88a633bb4f3b151770f70085117a15f9bf3787cda53f13d31. ⋮---- func (_ISettlement *ISettlementFilterer) ParseEIP712DomainChanged(log types.Log) (*ISettlementEIP712DomainChanged, error) ⋮---- // ISettlementInitEIP712Iterator is returned from FilterInitEIP712 and is used to iterate over the raw logs and unpacked data for InitEIP712 events raised by the ISettlement contract. type ISettlementInitEIP712Iterator struct { Event *ISettlementInitEIP712 // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } ⋮---- Event *ISettlementInitEIP712 // Event containing the contract specifics and raw log ⋮---- // ISettlementInitEIP712 represents a InitEIP712 event raised by the ISettlement contract. type ISettlementInitEIP712 struct { Name string Version string Raw types.Log // Blockchain specific contextual infos } ⋮---- Raw types.Log // Blockchain specific contextual infos ⋮---- // FilterInitEIP712 is a free log retrieval operation binding the contract event 0x98790bb3996c909e6f4279ffabdfe70fa6c0d49b8fa04656d6161decfc442e0a. ⋮---- // Solidity: event InitEIP712(string name, string version) func (_ISettlement *ISettlementFilterer) FilterInitEIP712(opts *bind.FilterOpts) (*ISettlementInitEIP712Iterator, error) ⋮---- // WatchInitEIP712 is a free log subscription operation binding the contract event 0x98790bb3996c909e6f4279ffabdfe70fa6c0d49b8fa04656d6161decfc442e0a. ⋮---- func (_ISettlement *ISettlementFilterer) WatchInitEIP712(opts *bind.WatchOpts, sink chan<- *ISettlementInitEIP712) (event.Subscription, error) ⋮---- // ParseInitEIP712 is a log parse operation binding the contract event 0x98790bb3996c909e6f4279ffabdfe70fa6c0d49b8fa04656d6161decfc442e0a. ⋮---- func (_ISettlement *ISettlementFilterer) ParseInitEIP712(log types.Log) (*ISettlementInitEIP712, error) ⋮---- // ISettlementInitSigVerifierIterator is returned from FilterInitSigVerifier and is used to iterate over the raw logs and unpacked data for InitSigVerifier events raised by the ISettlement contract. type ISettlementInitSigVerifierIterator struct { Event *ISettlementInitSigVerifier // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } ⋮---- Event *ISettlementInitSigVerifier // Event containing the contract specifics and raw log ⋮---- // ISettlementInitSigVerifier represents a InitSigVerifier event raised by the ISettlement contract. type ISettlementInitSigVerifier struct { SigVerifier common.Address Raw types.Log // Blockchain specific contextual infos } ⋮---- Raw types.Log // Blockchain specific contextual infos ⋮---- // FilterInitSigVerifier is a free log retrieval operation binding the contract event 0x8c698070f0c9ef92ff032a24e5c83ef7783fd360fde9c6af8ed5fca9fa5abbb7. ⋮---- // Solidity: event InitSigVerifier(address sigVerifier) func (_ISettlement *ISettlementFilterer) FilterInitSigVerifier(opts *bind.FilterOpts) (*ISettlementInitSigVerifierIterator, error) ⋮---- // WatchInitSigVerifier is a free log subscription operation binding the contract event 0x8c698070f0c9ef92ff032a24e5c83ef7783fd360fde9c6af8ed5fca9fa5abbb7. ⋮---- func (_ISettlement *ISettlementFilterer) WatchInitSigVerifier(opts *bind.WatchOpts, sink chan<- *ISettlementInitSigVerifier) (event.Subscription, error) ⋮---- // ParseInitSigVerifier is a log parse operation binding the contract event 0x8c698070f0c9ef92ff032a24e5c83ef7783fd360fde9c6af8ed5fca9fa5abbb7. ⋮---- func (_ISettlement *ISettlementFilterer) ParseInitSigVerifier(log types.Log) (*ISettlementInitSigVerifier, error) ⋮---- // ISettlementInitSubnetworkIterator is returned from FilterInitSubnetwork and is used to iterate over the raw logs and unpacked data for InitSubnetwork events raised by the ISettlement contract. type ISettlementInitSubnetworkIterator struct { Event *ISettlementInitSubnetwork // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } ⋮---- Event *ISettlementInitSubnetwork // Event containing the contract specifics and raw log ⋮---- // ISettlementInitSubnetwork represents a InitSubnetwork event raised by the ISettlement contract. type ISettlementInitSubnetwork struct { Network common.Address SubnetworkId *big.Int Raw types.Log // Blockchain specific contextual infos } ⋮---- // FilterInitSubnetwork is a free log retrieval operation binding the contract event 0x469c2e982e7d76d34cf5d1e72abee29749bb9971942c180e9023cea09f5f8e83. ⋮---- // Solidity: event InitSubnetwork(address network, uint96 subnetworkId) func (_ISettlement *ISettlementFilterer) FilterInitSubnetwork(opts *bind.FilterOpts) (*ISettlementInitSubnetworkIterator, error) ⋮---- // WatchInitSubnetwork is a free log subscription operation binding the contract event 0x469c2e982e7d76d34cf5d1e72abee29749bb9971942c180e9023cea09f5f8e83. ⋮---- func (_ISettlement *ISettlementFilterer) WatchInitSubnetwork(opts *bind.WatchOpts, sink chan<- *ISettlementInitSubnetwork) (event.Subscription, error) ⋮---- // ParseInitSubnetwork is a log parse operation binding the contract event 0x469c2e982e7d76d34cf5d1e72abee29749bb9971942c180e9023cea09f5f8e83. ⋮---- func (_ISettlement *ISettlementFilterer) ParseInitSubnetwork(log types.Log) (*ISettlementInitSubnetwork, error) ⋮---- // ISettlementInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the ISettlement contract. type ISettlementInitializedIterator struct { Event *ISettlementInitialized // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } ⋮---- Event *ISettlementInitialized // Event containing the contract specifics and raw log ⋮---- // ISettlementInitialized represents a Initialized event raised by the ISettlement contract. type ISettlementInitialized struct { Version uint64 Raw types.Log // Blockchain specific contextual infos } ⋮---- // FilterInitialized is a free log retrieval operation binding the contract event 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2. ⋮---- // Solidity: event Initialized(uint64 version) func (_ISettlement *ISettlementFilterer) FilterInitialized(opts *bind.FilterOpts) (*ISettlementInitializedIterator, error) ⋮---- // WatchInitialized is a free log subscription operation binding the contract event 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2. ⋮---- func (_ISettlement *ISettlementFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *ISettlementInitialized) (event.Subscription, error) ⋮---- // ParseInitialized is a log parse operation binding the contract event 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2. ⋮---- func (_ISettlement *ISettlementFilterer) ParseInitialized(log types.Log) (*ISettlementInitialized, error) ⋮---- // ISettlementSetGenesisIterator is returned from FilterSetGenesis and is used to iterate over the raw logs and unpacked data for SetGenesis events raised by the ISettlement contract. type ISettlementSetGenesisIterator struct { Event *ISettlementSetGenesis // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } ⋮---- Event *ISettlementSetGenesis // Event containing the contract specifics and raw log ⋮---- // ISettlementSetGenesis represents a SetGenesis event raised by the ISettlement contract. type ISettlementSetGenesis struct { ValSetHeader ISettlementValSetHeader ExtraData []ISettlementExtraData Raw types.Log // Blockchain specific contextual infos } ⋮---- // FilterSetGenesis is a free log retrieval operation binding the contract event 0xd4b7365d7a7dd369f40b249f48684bd7e51524b3ab56a9eb188ac339d574bbc0. ⋮---- // Solidity: event SetGenesis((uint8,uint8,uint48,uint48,uint256,uint256,bytes32) valSetHeader, (bytes32,bytes32)[] extraData) func (_ISettlement *ISettlementFilterer) FilterSetGenesis(opts *bind.FilterOpts) (*ISettlementSetGenesisIterator, error) ⋮---- // WatchSetGenesis is a free log subscription operation binding the contract event 0xd4b7365d7a7dd369f40b249f48684bd7e51524b3ab56a9eb188ac339d574bbc0. ⋮---- func (_ISettlement *ISettlementFilterer) WatchSetGenesis(opts *bind.WatchOpts, sink chan<- *ISettlementSetGenesis) (event.Subscription, error) ⋮---- // ParseSetGenesis is a log parse operation binding the contract event 0xd4b7365d7a7dd369f40b249f48684bd7e51524b3ab56a9eb188ac339d574bbc0. ⋮---- func (_ISettlement *ISettlementFilterer) ParseSetGenesis(log types.Log) (*ISettlementSetGenesis, error) ⋮---- // ISettlementSetSigVerifierIterator is returned from FilterSetSigVerifier and is used to iterate over the raw logs and unpacked data for SetSigVerifier events raised by the ISettlement contract. type ISettlementSetSigVerifierIterator struct { Event *ISettlementSetSigVerifier // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } ⋮---- Event *ISettlementSetSigVerifier // Event containing the contract specifics and raw log ⋮---- // ISettlementSetSigVerifier represents a SetSigVerifier event raised by the ISettlement contract. type ISettlementSetSigVerifier struct { SigVerifier common.Address Raw types.Log // Blockchain specific contextual infos } ⋮---- // FilterSetSigVerifier is a free log retrieval operation binding the contract event 0x3cb2fcfd41e182e933eb967bdeaac4f8ff69c80b6fd24fea9561dfbdec127942. ⋮---- // Solidity: event SetSigVerifier(address sigVerifier) func (_ISettlement *ISettlementFilterer) FilterSetSigVerifier(opts *bind.FilterOpts) (*ISettlementSetSigVerifierIterator, error) ⋮---- // WatchSetSigVerifier is a free log subscription operation binding the contract event 0x3cb2fcfd41e182e933eb967bdeaac4f8ff69c80b6fd24fea9561dfbdec127942. ⋮---- func (_ISettlement *ISettlementFilterer) WatchSetSigVerifier(opts *bind.WatchOpts, sink chan<- *ISettlementSetSigVerifier) (event.Subscription, error) ⋮---- // ParseSetSigVerifier is a log parse operation binding the contract event 0x3cb2fcfd41e182e933eb967bdeaac4f8ff69c80b6fd24fea9561dfbdec127942. ⋮---- func (_ISettlement *ISettlementFilterer) ParseSetSigVerifier(log types.Log) (*ISettlementSetSigVerifier, error) ```` ## File: symbiotic/client/evm/gen/valsetDriver.go ````go // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. ⋮---- package gen ⋮---- import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) ⋮---- "errors" "math/big" "strings" ⋮---- ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ⋮---- // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) ⋮---- // IValSetDriverConfig is an auto generated low-level Go binding around an user-defined struct. type IValSetDriverConfig struct { NumAggregators *big.Int NumCommitters *big.Int VotingPowerProviders []IValSetDriverCrossChainAddress KeysProvider IValSetDriverCrossChainAddress Settlements []IValSetDriverCrossChainAddress MaxVotingPower *big.Int MinInclusionVotingPower *big.Int MaxValidatorsCount *big.Int RequiredKeyTags []uint8 QuorumThresholds []IValSetDriverQuorumThreshold RequiredHeaderKeyTag uint8 VerificationType uint32 } ⋮---- // IValSetDriverCrossChainAddress is an auto generated low-level Go binding around an user-defined struct. type IValSetDriverCrossChainAddress struct { ChainId uint64 Addr common.Address } ⋮---- // IValSetDriverQuorumThreshold is an auto generated low-level Go binding around an user-defined struct. type IValSetDriverQuorumThreshold struct { KeyTag uint8 QuorumThreshold *big.Int } ⋮---- // IValSetDriverMetaData contains all meta data concerning the IValSetDriver contract. var IValSetDriverMetaData = &bind.MetaData{ ABI: "[{\"type\":\"function\",\"name\":\"MAX_QUORUM_THRESHOLD\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint248\",\"internalType\":\"uint248\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"NETWORK\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"SUBNETWORK\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"SUBNETWORK_IDENTIFIER\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint96\",\"internalType\":\"uint96\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"addQuorumThreshold\",\"inputs\":[{\"name\":\"quorumThreshold\",\"type\":\"tuple\",\"internalType\":\"structIValSetDriver.QuorumThreshold\",\"components\":[{\"name\":\"keyTag\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"quorumThreshold\",\"type\":\"uint248\",\"internalType\":\"uint248\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"addSettlement\",\"inputs\":[{\"name\":\"settlement\",\"type\":\"tuple\",\"internalType\":\"structIValSetDriver.CrossChainAddress\",\"components\":[{\"name\":\"chainId\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"addr\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"addVotingPowerProvider\",\"inputs\":[{\"name\":\"votingPowerProvider\",\"type\":\"tuple\",\"internalType\":\"structIValSetDriver.CrossChainAddress\",\"components\":[{\"name\":\"chainId\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"addr\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"getConfig\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIValSetDriver.Config\",\"components\":[{\"name\":\"numAggregators\",\"type\":\"uint208\",\"internalType\":\"uint208\"},{\"name\":\"numCommitters\",\"type\":\"uint208\",\"internalType\":\"uint208\"},{\"name\":\"votingPowerProviders\",\"type\":\"tuple[]\",\"internalType\":\"structIValSetDriver.CrossChainAddress[]\",\"components\":[{\"name\":\"chainId\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"addr\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"name\":\"keysProvider\",\"type\":\"tuple\",\"internalType\":\"structIValSetDriver.CrossChainAddress\",\"components\":[{\"name\":\"chainId\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"addr\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"name\":\"settlements\",\"type\":\"tuple[]\",\"internalType\":\"structIValSetDriver.CrossChainAddress[]\",\"components\":[{\"name\":\"chainId\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"addr\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"name\":\"maxVotingPower\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"minInclusionVotingPower\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"maxValidatorsCount\",\"type\":\"uint208\",\"internalType\":\"uint208\"},{\"name\":\"requiredKeyTags\",\"type\":\"uint8[]\",\"internalType\":\"uint8[]\"},{\"name\":\"quorumThresholds\",\"type\":\"tuple[]\",\"internalType\":\"structIValSetDriver.QuorumThreshold[]\",\"components\":[{\"name\":\"keyTag\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"quorumThreshold\",\"type\":\"uint248\",\"internalType\":\"uint248\"}]},{\"name\":\"requiredHeaderKeyTag\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"verificationType\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getConfigAt\",\"inputs\":[{\"name\":\"timestamp\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIValSetDriver.Config\",\"components\":[{\"name\":\"numAggregators\",\"type\":\"uint208\",\"internalType\":\"uint208\"},{\"name\":\"numCommitters\",\"type\":\"uint208\",\"internalType\":\"uint208\"},{\"name\":\"votingPowerProviders\",\"type\":\"tuple[]\",\"internalType\":\"structIValSetDriver.CrossChainAddress[]\",\"components\":[{\"name\":\"chainId\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"addr\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"name\":\"keysProvider\",\"type\":\"tuple\",\"internalType\":\"structIValSetDriver.CrossChainAddress\",\"components\":[{\"name\":\"chainId\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"addr\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"name\":\"settlements\",\"type\":\"tuple[]\",\"internalType\":\"structIValSetDriver.CrossChainAddress[]\",\"components\":[{\"name\":\"chainId\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"addr\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"name\":\"maxVotingPower\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"minInclusionVotingPower\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"maxValidatorsCount\",\"type\":\"uint208\",\"internalType\":\"uint208\"},{\"name\":\"requiredKeyTags\",\"type\":\"uint8[]\",\"internalType\":\"uint8[]\"},{\"name\":\"quorumThresholds\",\"type\":\"tuple[]\",\"internalType\":\"structIValSetDriver.QuorumThreshold[]\",\"components\":[{\"name\":\"keyTag\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"quorumThreshold\",\"type\":\"uint248\",\"internalType\":\"uint248\"}]},{\"name\":\"requiredHeaderKeyTag\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"verificationType\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getCurrentEpoch\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getCurrentEpochDuration\",\"inputs\":[],\"outputs\":[{\"name\":\"epochDuration\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getCurrentEpochStart\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getEpochDuration\",\"inputs\":[{\"name\":\"epoch\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"outputs\":[{\"name\":\"epochDuration\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getEpochIndex\",\"inputs\":[{\"name\":\"timestamp\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getEpochStart\",\"inputs\":[{\"name\":\"epoch\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getKeysProvider\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIValSetDriver.CrossChainAddress\",\"components\":[{\"name\":\"chainId\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"addr\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getKeysProviderAt\",\"inputs\":[{\"name\":\"timestamp\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIValSetDriver.CrossChainAddress\",\"components\":[{\"name\":\"chainId\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"addr\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getMaxValidatorsCount\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint208\",\"internalType\":\"uint208\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getMaxValidatorsCountAt\",\"inputs\":[{\"name\":\"timestamp\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint208\",\"internalType\":\"uint208\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getMaxVotingPower\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getMaxVotingPowerAt\",\"inputs\":[{\"name\":\"timestamp\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getMinInclusionVotingPower\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getMinInclusionVotingPowerAt\",\"inputs\":[{\"name\":\"timestamp\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getNextEpoch\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getNextEpochDuration\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getNextEpochStart\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getNumAggregators\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint208\",\"internalType\":\"uint208\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getNumAggregatorsAt\",\"inputs\":[{\"name\":\"timestamp\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint208\",\"internalType\":\"uint208\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getNumCommitters\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint208\",\"internalType\":\"uint208\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getNumCommittersAt\",\"inputs\":[{\"name\":\"timestamp\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint208\",\"internalType\":\"uint208\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getQuorumThresholds\",\"inputs\":[],\"outputs\":[{\"name\":\"quorumThresholds\",\"type\":\"tuple[]\",\"internalType\":\"structIValSetDriver.QuorumThreshold[]\",\"components\":[{\"name\":\"keyTag\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"quorumThreshold\",\"type\":\"uint248\",\"internalType\":\"uint248\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getQuorumThresholdsAt\",\"inputs\":[{\"name\":\"timestamp\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"outputs\":[{\"name\":\"quorumThresholds\",\"type\":\"tuple[]\",\"internalType\":\"structIValSetDriver.QuorumThreshold[]\",\"components\":[{\"name\":\"keyTag\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"quorumThreshold\",\"type\":\"uint248\",\"internalType\":\"uint248\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getRequiredHeaderKeyTag\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getRequiredHeaderKeyTagAt\",\"inputs\":[{\"name\":\"timestamp\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getRequiredKeyTags\",\"inputs\":[],\"outputs\":[{\"name\":\"requiredKeyTags\",\"type\":\"uint8[]\",\"internalType\":\"uint8[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getRequiredKeyTagsAt\",\"inputs\":[{\"name\":\"timestamp\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"outputs\":[{\"name\":\"requiredKeyTags\",\"type\":\"uint8[]\",\"internalType\":\"uint8[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getSettlements\",\"inputs\":[],\"outputs\":[{\"name\":\"settlements\",\"type\":\"tuple[]\",\"internalType\":\"structIValSetDriver.CrossChainAddress[]\",\"components\":[{\"name\":\"chainId\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"addr\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getSettlementsAt\",\"inputs\":[{\"name\":\"timestamp\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"outputs\":[{\"name\":\"settlements\",\"type\":\"tuple[]\",\"internalType\":\"structIValSetDriver.CrossChainAddress[]\",\"components\":[{\"name\":\"chainId\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"addr\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getVerificationType\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getVerificationTypeAt\",\"inputs\":[{\"name\":\"timestamp\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getVotingPowerProviders\",\"inputs\":[],\"outputs\":[{\"name\":\"votingPowerProviders\",\"type\":\"tuple[]\",\"internalType\":\"structIValSetDriver.CrossChainAddress[]\",\"components\":[{\"name\":\"chainId\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"addr\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getVotingPowerProvidersAt\",\"inputs\":[{\"name\":\"timestamp\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"outputs\":[{\"name\":\"votingPowerProviders\",\"type\":\"tuple[]\",\"internalType\":\"structIValSetDriver.CrossChainAddress[]\",\"components\":[{\"name\":\"chainId\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"addr\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isQuorumThresholdRegistered\",\"inputs\":[{\"name\":\"quorumThreshold\",\"type\":\"tuple\",\"internalType\":\"structIValSetDriver.QuorumThreshold\",\"components\":[{\"name\":\"keyTag\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"quorumThreshold\",\"type\":\"uint248\",\"internalType\":\"uint248\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isQuorumThresholdRegisteredAt\",\"inputs\":[{\"name\":\"quorumThreshold\",\"type\":\"tuple\",\"internalType\":\"structIValSetDriver.QuorumThreshold\",\"components\":[{\"name\":\"keyTag\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"quorumThreshold\",\"type\":\"uint248\",\"internalType\":\"uint248\"}]},{\"name\":\"timestamp\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isSettlementRegistered\",\"inputs\":[{\"name\":\"settlement\",\"type\":\"tuple\",\"internalType\":\"structIValSetDriver.CrossChainAddress\",\"components\":[{\"name\":\"chainId\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"addr\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isSettlementRegisteredAt\",\"inputs\":[{\"name\":\"settlement\",\"type\":\"tuple\",\"internalType\":\"structIValSetDriver.CrossChainAddress\",\"components\":[{\"name\":\"chainId\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"addr\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"name\":\"timestamp\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isVotingPowerProviderRegistered\",\"inputs\":[{\"name\":\"votingPowerProvider\",\"type\":\"tuple\",\"internalType\":\"structIValSetDriver.CrossChainAddress\",\"components\":[{\"name\":\"chainId\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"addr\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isVotingPowerProviderRegisteredAt\",\"inputs\":[{\"name\":\"votingPowerProvider\",\"type\":\"tuple\",\"internalType\":\"structIValSetDriver.CrossChainAddress\",\"components\":[{\"name\":\"chainId\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"addr\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"name\":\"timestamp\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"multicall\",\"inputs\":[{\"name\":\"data\",\"type\":\"bytes[]\",\"internalType\":\"bytes[]\"}],\"outputs\":[{\"name\":\"results\",\"type\":\"bytes[]\",\"internalType\":\"bytes[]\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"removeQuorumThreshold\",\"inputs\":[{\"name\":\"quorumThreshold\",\"type\":\"tuple\",\"internalType\":\"structIValSetDriver.QuorumThreshold\",\"components\":[{\"name\":\"keyTag\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"quorumThreshold\",\"type\":\"uint248\",\"internalType\":\"uint248\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"removeSettlement\",\"inputs\":[{\"name\":\"settlement\",\"type\":\"tuple\",\"internalType\":\"structIValSetDriver.CrossChainAddress\",\"components\":[{\"name\":\"chainId\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"addr\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"removeVotingPowerProvider\",\"inputs\":[{\"name\":\"votingPowerProvider\",\"type\":\"tuple\",\"internalType\":\"structIValSetDriver.CrossChainAddress\",\"components\":[{\"name\":\"chainId\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"addr\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setEpochDuration\",\"inputs\":[{\"name\":\"epochDuration\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setKeysProvider\",\"inputs\":[{\"name\":\"keysProvider\",\"type\":\"tuple\",\"internalType\":\"structIValSetDriver.CrossChainAddress\",\"components\":[{\"name\":\"chainId\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"addr\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setMaxValidatorsCount\",\"inputs\":[{\"name\":\"maxValidatorsCount\",\"type\":\"uint208\",\"internalType\":\"uint208\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setMaxVotingPower\",\"inputs\":[{\"name\":\"maxVotingPower\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setMinInclusionVotingPower\",\"inputs\":[{\"name\":\"minInclusionVotingPower\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setNumAggregators\",\"inputs\":[{\"name\":\"numAggregators\",\"type\":\"uint208\",\"internalType\":\"uint208\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setNumCommitters\",\"inputs\":[{\"name\":\"numCommitters\",\"type\":\"uint208\",\"internalType\":\"uint208\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setRequiredHeaderKeyTag\",\"inputs\":[{\"name\":\"requiredHeaderKeyTag\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setRequiredKeyTags\",\"inputs\":[{\"name\":\"requiredKeyTags\",\"type\":\"uint8[]\",\"internalType\":\"uint8[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setVerificationType\",\"inputs\":[{\"name\":\"verificationType\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"staticDelegateCall\",\"inputs\":[{\"name\":\"target\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"AddQuorumThreshold\",\"inputs\":[{\"name\":\"quorumThreshold\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIValSetDriver.QuorumThreshold\",\"components\":[{\"name\":\"keyTag\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"quorumThreshold\",\"type\":\"uint248\",\"internalType\":\"uint248\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"AddSettlement\",\"inputs\":[{\"name\":\"settlement\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIValSetDriver.CrossChainAddress\",\"components\":[{\"name\":\"chainId\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"addr\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"AddVotingPowerProvider\",\"inputs\":[{\"name\":\"votingPowerProvider\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIValSetDriver.CrossChainAddress\",\"components\":[{\"name\":\"chainId\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"addr\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"InitEpochDuration\",\"inputs\":[{\"name\":\"epochDuration\",\"type\":\"uint48\",\"indexed\":false,\"internalType\":\"uint48\"},{\"name\":\"epochDurationTimestamp\",\"type\":\"uint48\",\"indexed\":false,\"internalType\":\"uint48\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"InitSubnetwork\",\"inputs\":[{\"name\":\"network\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"subnetworkId\",\"type\":\"uint96\",\"indexed\":false,\"internalType\":\"uint96\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RemoveQuorumThreshold\",\"inputs\":[{\"name\":\"quorumThreshold\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIValSetDriver.QuorumThreshold\",\"components\":[{\"name\":\"keyTag\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"quorumThreshold\",\"type\":\"uint248\",\"internalType\":\"uint248\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RemoveSettlement\",\"inputs\":[{\"name\":\"settlement\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIValSetDriver.CrossChainAddress\",\"components\":[{\"name\":\"chainId\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"addr\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RemoveVotingPowerProvider\",\"inputs\":[{\"name\":\"votingPowerProvider\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIValSetDriver.CrossChainAddress\",\"components\":[{\"name\":\"chainId\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"addr\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"SetEpochDuration\",\"inputs\":[{\"name\":\"epochDuration\",\"type\":\"uint48\",\"indexed\":false,\"internalType\":\"uint48\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"SetKeysProvider\",\"inputs\":[{\"name\":\"keysProvider\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIValSetDriver.CrossChainAddress\",\"components\":[{\"name\":\"chainId\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"addr\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"SetMaxValidatorsCount\",\"inputs\":[{\"name\":\"maxValidatorsCount\",\"type\":\"uint208\",\"indexed\":false,\"internalType\":\"uint208\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"SetMaxVotingPower\",\"inputs\":[{\"name\":\"maxVotingPower\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"SetMinInclusionVotingPower\",\"inputs\":[{\"name\":\"minInclusionVotingPower\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"SetNumAggregators\",\"inputs\":[{\"name\":\"numAggregators\",\"type\":\"uint208\",\"indexed\":false,\"internalType\":\"uint208\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"SetNumCommitters\",\"inputs\":[{\"name\":\"numCommitters\",\"type\":\"uint208\",\"indexed\":false,\"internalType\":\"uint208\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"SetRequiredHeaderKeyTag\",\"inputs\":[{\"name\":\"requiredHeaderKeyTag\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"SetRequiredKeyTags\",\"inputs\":[{\"name\":\"requiredKeyTags\",\"type\":\"uint8[]\",\"indexed\":false,\"internalType\":\"uint8[]\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"SetVerificationType\",\"inputs\":[{\"name\":\"verificationType\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"AddressEmptyCode\",\"inputs\":[{\"name\":\"target\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"CheckpointUnorderedInsertion\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"DuplicateKeyTag\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"EpochManager_InvalidEpochDuration\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"EpochManager_InvalidEpochDurationTimestamp\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"EpochManager_TooOldTimestamp\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"FailedCall\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidInitialization\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidKey\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidKeyTag\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NetworkManager_InvalidNetwork\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotInitializing\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ValSetDriver_ChainAlreadyAdded\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ValSetDriver_InvalidCrossChainAddress\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ValSetDriver_InvalidMaxValidatorsCount\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ValSetDriver_InvalidQuorumThreshold\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ValSetDriver_KeyTagAlreadyAdded\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ValSetDriver_NotAdded\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ValSetDriver_ZeroNumAggregators\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ValSetDriver_ZeroNumCommitters\",\"inputs\":[]}]", } ⋮---- // IValSetDriverABI is the input ABI used to generate the binding from. // Deprecated: Use IValSetDriverMetaData.ABI instead. var IValSetDriverABI = IValSetDriverMetaData.ABI ⋮---- // IValSetDriver is an auto generated Go binding around an Ethereum contract. type IValSetDriver struct { IValSetDriverCaller // Read-only binding to the contract IValSetDriverTransactor // Write-only binding to the contract IValSetDriverFilterer // Log filterer for contract events } ⋮---- IValSetDriverCaller // Read-only binding to the contract IValSetDriverTransactor // Write-only binding to the contract IValSetDriverFilterer // Log filterer for contract events ⋮---- // IValSetDriverCaller is an auto generated read-only Go binding around an Ethereum contract. type IValSetDriverCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } ⋮---- contract *bind.BoundContract // Generic contract wrapper for the low level calls ⋮---- // IValSetDriverTransactor is an auto generated write-only Go binding around an Ethereum contract. type IValSetDriverTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } ⋮---- // IValSetDriverFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type IValSetDriverFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } ⋮---- // IValSetDriverSession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type IValSetDriverSession struct { Contract *IValSetDriver // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } ⋮---- Contract *IValSetDriver // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session ⋮---- // IValSetDriverCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type IValSetDriverCallerSession struct { Contract *IValSetDriverCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } ⋮---- Contract *IValSetDriverCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session ⋮---- // IValSetDriverTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type IValSetDriverTransactorSession struct { Contract *IValSetDriverTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } ⋮---- Contract *IValSetDriverTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session ⋮---- // IValSetDriverRaw is an auto generated low-level Go binding around an Ethereum contract. type IValSetDriverRaw struct { Contract *IValSetDriver // Generic contract binding to access the raw methods on } ⋮---- Contract *IValSetDriver // Generic contract binding to access the raw methods on ⋮---- // IValSetDriverCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type IValSetDriverCallerRaw struct { Contract *IValSetDriverCaller // Generic read-only contract binding to access the raw methods on } ⋮---- Contract *IValSetDriverCaller // Generic read-only contract binding to access the raw methods on ⋮---- // IValSetDriverTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type IValSetDriverTransactorRaw struct { Contract *IValSetDriverTransactor // Generic write-only contract binding to access the raw methods on } ⋮---- Contract *IValSetDriverTransactor // Generic write-only contract binding to access the raw methods on ⋮---- // NewIValSetDriver creates a new instance of IValSetDriver, bound to a specific deployed contract. func NewIValSetDriver(address common.Address, backend bind.ContractBackend) (*IValSetDriver, error) ⋮---- // NewIValSetDriverCaller creates a new read-only instance of IValSetDriver, bound to a specific deployed contract. func NewIValSetDriverCaller(address common.Address, caller bind.ContractCaller) (*IValSetDriverCaller, error) ⋮---- // NewIValSetDriverTransactor creates a new write-only instance of IValSetDriver, bound to a specific deployed contract. func NewIValSetDriverTransactor(address common.Address, transactor bind.ContractTransactor) (*IValSetDriverTransactor, error) ⋮---- // NewIValSetDriverFilterer creates a new log filterer instance of IValSetDriver, bound to a specific deployed contract. func NewIValSetDriverFilterer(address common.Address, filterer bind.ContractFilterer) (*IValSetDriverFilterer, error) ⋮---- // bindIValSetDriver binds a generic wrapper to an already deployed contract. func bindIValSetDriver(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) ⋮---- // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_IValSetDriver *IValSetDriverRaw) Call(opts *bind.CallOpts, result *[]interface ⋮---- // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_IValSetDriver *IValSetDriverRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) ⋮---- // Transact invokes the (paid) contract method with params as input values. func (_IValSetDriver *IValSetDriverRaw) Transact(opts *bind.TransactOpts, method string, params ...interface ⋮---- // MAXQUORUMTHRESHOLD is a free data retrieval call binding the contract method 0x127ec283. // // Solidity: function MAX_QUORUM_THRESHOLD() view returns(uint248) func (_IValSetDriver *IValSetDriverCaller) MAXQUORUMTHRESHOLD(opts *bind.CallOpts) (*big.Int, error) ⋮---- var out []interface{} ⋮---- // NETWORK is a free data retrieval call binding the contract method 0x8759e6d1. ⋮---- // Solidity: function NETWORK() view returns(address) func (_IValSetDriver *IValSetDriverCaller) NETWORK(opts *bind.CallOpts) (common.Address, error) ⋮---- // SUBNETWORK is a free data retrieval call binding the contract method 0x773e6b54. ⋮---- // Solidity: function SUBNETWORK() view returns(bytes32) func (_IValSetDriver *IValSetDriverCaller) SUBNETWORK(opts *bind.CallOpts) ([32]byte, error) ⋮---- // SUBNETWORKIDENTIFIER is a free data retrieval call binding the contract method 0xabacb807. ⋮---- // Solidity: function SUBNETWORK_IDENTIFIER() view returns(uint96) func (_IValSetDriver *IValSetDriverCaller) SUBNETWORKIDENTIFIER(opts *bind.CallOpts) (*big.Int, error) ⋮---- // GetConfig is a free data retrieval call binding the contract method 0xc3f909d4. ⋮---- // Solidity: function getConfig() view returns((uint208,uint208,(uint64,address)[],(uint64,address),(uint64,address)[],uint256,uint256,uint208,uint8[],(uint8,uint248)[],uint8,uint32)) func (_IValSetDriver *IValSetDriverCaller) GetConfig(opts *bind.CallOpts) (IValSetDriverConfig, error) ⋮---- // GetConfigAt is a free data retrieval call binding the contract method 0x13fb0877. ⋮---- // Solidity: function getConfigAt(uint48 timestamp) view returns((uint208,uint208,(uint64,address)[],(uint64,address),(uint64,address)[],uint256,uint256,uint208,uint8[],(uint8,uint248)[],uint8,uint32)) func (_IValSetDriver *IValSetDriverCaller) GetConfigAt(opts *bind.CallOpts, timestamp *big.Int) (IValSetDriverConfig, error) ⋮---- // GetCurrentEpoch is a free data retrieval call binding the contract method 0xb97dd9e2. ⋮---- // Solidity: function getCurrentEpoch() view returns(uint48) func (_IValSetDriver *IValSetDriverCaller) GetCurrentEpoch(opts *bind.CallOpts) (*big.Int, error) ⋮---- // GetCurrentEpochDuration is a free data retrieval call binding the contract method 0x558e2eb6. ⋮---- // Solidity: function getCurrentEpochDuration() view returns(uint48 epochDuration) func (_IValSetDriver *IValSetDriverCaller) GetCurrentEpochDuration(opts *bind.CallOpts) (*big.Int, error) ⋮---- // GetCurrentEpochStart is a free data retrieval call binding the contract method 0xa6e16c4d. ⋮---- // Solidity: function getCurrentEpochStart() view returns(uint48) func (_IValSetDriver *IValSetDriverCaller) GetCurrentEpochStart(opts *bind.CallOpts) (*big.Int, error) ⋮---- // GetEpochDuration is a free data retrieval call binding the contract method 0xf6fd6f14. ⋮---- // Solidity: function getEpochDuration(uint48 epoch) view returns(uint48 epochDuration) func (_IValSetDriver *IValSetDriverCaller) GetEpochDuration(opts *bind.CallOpts, epoch *big.Int) (*big.Int, error) ⋮---- // GetEpochIndex is a free data retrieval call binding the contract method 0xccafd209. ⋮---- // Solidity: function getEpochIndex(uint48 timestamp) view returns(uint48) func (_IValSetDriver *IValSetDriverCaller) GetEpochIndex(opts *bind.CallOpts, timestamp *big.Int) (*big.Int, error) ⋮---- // GetEpochStart is a free data retrieval call binding the contract method 0x246e158f. ⋮---- // Solidity: function getEpochStart(uint48 epoch) view returns(uint48) func (_IValSetDriver *IValSetDriverCaller) GetEpochStart(opts *bind.CallOpts, epoch *big.Int) (*big.Int, error) ⋮---- // GetKeysProvider is a free data retrieval call binding the contract method 0x297d29b8. ⋮---- // Solidity: function getKeysProvider() view returns((uint64,address)) func (_IValSetDriver *IValSetDriverCaller) GetKeysProvider(opts *bind.CallOpts) (IValSetDriverCrossChainAddress, error) ⋮---- // GetKeysProviderAt is a free data retrieval call binding the contract method 0x10a49295. ⋮---- // Solidity: function getKeysProviderAt(uint48 timestamp) view returns((uint64,address)) func (_IValSetDriver *IValSetDriverCaller) GetKeysProviderAt(opts *bind.CallOpts, timestamp *big.Int) (IValSetDriverCrossChainAddress, error) ⋮---- // GetMaxValidatorsCount is a free data retrieval call binding the contract method 0x06ce894d. ⋮---- // Solidity: function getMaxValidatorsCount() view returns(uint208) func (_IValSetDriver *IValSetDriverCaller) GetMaxValidatorsCount(opts *bind.CallOpts) (*big.Int, error) ⋮---- // GetMaxValidatorsCountAt is a free data retrieval call binding the contract method 0x4f938edc. ⋮---- // Solidity: function getMaxValidatorsCountAt(uint48 timestamp) view returns(uint208) func (_IValSetDriver *IValSetDriverCaller) GetMaxValidatorsCountAt(opts *bind.CallOpts, timestamp *big.Int) (*big.Int, error) ⋮---- // GetMaxVotingPower is a free data retrieval call binding the contract method 0x9f9c3080. ⋮---- // Solidity: function getMaxVotingPower() view returns(uint256) func (_IValSetDriver *IValSetDriverCaller) GetMaxVotingPower(opts *bind.CallOpts) (*big.Int, error) ⋮---- // GetMaxVotingPowerAt is a free data retrieval call binding the contract method 0x848b3040. ⋮---- // Solidity: function getMaxVotingPowerAt(uint48 timestamp) view returns(uint256) func (_IValSetDriver *IValSetDriverCaller) GetMaxVotingPowerAt(opts *bind.CallOpts, timestamp *big.Int) (*big.Int, error) ⋮---- // GetMinInclusionVotingPower is a free data retrieval call binding the contract method 0xb6a94695. ⋮---- // Solidity: function getMinInclusionVotingPower() view returns(uint256) func (_IValSetDriver *IValSetDriverCaller) GetMinInclusionVotingPower(opts *bind.CallOpts) (*big.Int, error) ⋮---- // GetMinInclusionVotingPowerAt is a free data retrieval call binding the contract method 0x456705a2. ⋮---- // Solidity: function getMinInclusionVotingPowerAt(uint48 timestamp) view returns(uint256) func (_IValSetDriver *IValSetDriverCaller) GetMinInclusionVotingPowerAt(opts *bind.CallOpts, timestamp *big.Int) (*big.Int, error) ⋮---- // GetNextEpoch is a free data retrieval call binding the contract method 0xefe97d05. ⋮---- // Solidity: function getNextEpoch() view returns(uint48) func (_IValSetDriver *IValSetDriverCaller) GetNextEpoch(opts *bind.CallOpts) (*big.Int, error) ⋮---- // GetNextEpochDuration is a free data retrieval call binding the contract method 0x038cf1c0. ⋮---- // Solidity: function getNextEpochDuration() view returns(uint48) func (_IValSetDriver *IValSetDriverCaller) GetNextEpochDuration(opts *bind.CallOpts) (*big.Int, error) ⋮---- // GetNextEpochStart is a free data retrieval call binding the contract method 0x65c5f94a. ⋮---- // Solidity: function getNextEpochStart() view returns(uint48) func (_IValSetDriver *IValSetDriverCaller) GetNextEpochStart(opts *bind.CallOpts) (*big.Int, error) ⋮---- // GetNumAggregators is a free data retrieval call binding the contract method 0x21fbfe0d. ⋮---- // Solidity: function getNumAggregators() view returns(uint208) func (_IValSetDriver *IValSetDriverCaller) GetNumAggregators(opts *bind.CallOpts) (*big.Int, error) ⋮---- // GetNumAggregatorsAt is a free data retrieval call binding the contract method 0x6bb7e08a. ⋮---- // Solidity: function getNumAggregatorsAt(uint48 timestamp) view returns(uint208) func (_IValSetDriver *IValSetDriverCaller) GetNumAggregatorsAt(opts *bind.CallOpts, timestamp *big.Int) (*big.Int, error) ⋮---- // GetNumCommitters is a free data retrieval call binding the contract method 0x7861db16. ⋮---- // Solidity: function getNumCommitters() view returns(uint208) func (_IValSetDriver *IValSetDriverCaller) GetNumCommitters(opts *bind.CallOpts) (*big.Int, error) ⋮---- // GetNumCommittersAt is a free data retrieval call binding the contract method 0xe0078c64. ⋮---- // Solidity: function getNumCommittersAt(uint48 timestamp) view returns(uint208) func (_IValSetDriver *IValSetDriverCaller) GetNumCommittersAt(opts *bind.CallOpts, timestamp *big.Int) (*big.Int, error) ⋮---- // GetQuorumThresholds is a free data retrieval call binding the contract method 0x5796148c. ⋮---- // Solidity: function getQuorumThresholds() view returns((uint8,uint248)[] quorumThresholds) func (_IValSetDriver *IValSetDriverCaller) GetQuorumThresholds(opts *bind.CallOpts) ([]IValSetDriverQuorumThreshold, error) ⋮---- // GetQuorumThresholdsAt is a free data retrieval call binding the contract method 0xf2f46b83. ⋮---- // Solidity: function getQuorumThresholdsAt(uint48 timestamp) view returns((uint8,uint248)[] quorumThresholds) func (_IValSetDriver *IValSetDriverCaller) GetQuorumThresholdsAt(opts *bind.CallOpts, timestamp *big.Int) ([]IValSetDriverQuorumThreshold, error) ⋮---- // GetRequiredHeaderKeyTag is a free data retrieval call binding the contract method 0x6582e9f7. ⋮---- // Solidity: function getRequiredHeaderKeyTag() view returns(uint8) func (_IValSetDriver *IValSetDriverCaller) GetRequiredHeaderKeyTag(opts *bind.CallOpts) (uint8, error) ⋮---- // GetRequiredHeaderKeyTagAt is a free data retrieval call binding the contract method 0xbc12e1fd. ⋮---- // Solidity: function getRequiredHeaderKeyTagAt(uint48 timestamp) view returns(uint8) func (_IValSetDriver *IValSetDriverCaller) GetRequiredHeaderKeyTagAt(opts *bind.CallOpts, timestamp *big.Int) (uint8, error) ⋮---- // GetRequiredKeyTags is a free data retrieval call binding the contract method 0xf9bfa78a. ⋮---- // Solidity: function getRequiredKeyTags() view returns(uint8[] requiredKeyTags) func (_IValSetDriver *IValSetDriverCaller) GetRequiredKeyTags(opts *bind.CallOpts) ([]uint8, error) ⋮---- // GetRequiredKeyTagsAt is a free data retrieval call binding the contract method 0x1161fc83. ⋮---- // Solidity: function getRequiredKeyTagsAt(uint48 timestamp) view returns(uint8[] requiredKeyTags) func (_IValSetDriver *IValSetDriverCaller) GetRequiredKeyTagsAt(opts *bind.CallOpts, timestamp *big.Int) ([]uint8, error) ⋮---- // GetSettlements is a free data retrieval call binding the contract method 0xa0c2bc25. ⋮---- // Solidity: function getSettlements() view returns((uint64,address)[] settlements) func (_IValSetDriver *IValSetDriverCaller) GetSettlements(opts *bind.CallOpts) ([]IValSetDriverCrossChainAddress, error) ⋮---- // GetSettlementsAt is a free data retrieval call binding the contract method 0x763d255a. ⋮---- // Solidity: function getSettlementsAt(uint48 timestamp) view returns((uint64,address)[] settlements) func (_IValSetDriver *IValSetDriverCaller) GetSettlementsAt(opts *bind.CallOpts, timestamp *big.Int) ([]IValSetDriverCrossChainAddress, error) ⋮---- // GetVerificationType is a free data retrieval call binding the contract method 0x24acc119. ⋮---- // Solidity: function getVerificationType() view returns(uint32) func (_IValSetDriver *IValSetDriverCaller) GetVerificationType(opts *bind.CallOpts) (uint32, error) ⋮---- // GetVerificationTypeAt is a free data retrieval call binding the contract method 0x3a0ad9ec. ⋮---- // Solidity: function getVerificationTypeAt(uint48 timestamp) view returns(uint32) func (_IValSetDriver *IValSetDriverCaller) GetVerificationTypeAt(opts *bind.CallOpts, timestamp *big.Int) (uint32, error) ⋮---- // GetVotingPowerProviders is a free data retrieval call binding the contract method 0x3e39b8db. ⋮---- // Solidity: function getVotingPowerProviders() view returns((uint64,address)[] votingPowerProviders) func (_IValSetDriver *IValSetDriverCaller) GetVotingPowerProviders(opts *bind.CallOpts) ([]IValSetDriverCrossChainAddress, error) ⋮---- // GetVotingPowerProvidersAt is a free data retrieval call binding the contract method 0x09bba5ca. ⋮---- // Solidity: function getVotingPowerProvidersAt(uint48 timestamp) view returns((uint64,address)[] votingPowerProviders) func (_IValSetDriver *IValSetDriverCaller) GetVotingPowerProvidersAt(opts *bind.CallOpts, timestamp *big.Int) ([]IValSetDriverCrossChainAddress, error) ⋮---- // IsQuorumThresholdRegistered is a free data retrieval call binding the contract method 0x79a4c359. ⋮---- // Solidity: function isQuorumThresholdRegistered((uint8,uint248) quorumThreshold) view returns(bool) func (_IValSetDriver *IValSetDriverCaller) IsQuorumThresholdRegistered(opts *bind.CallOpts, quorumThreshold IValSetDriverQuorumThreshold) (bool, error) ⋮---- // IsQuorumThresholdRegisteredAt is a free data retrieval call binding the contract method 0x80c2fc48. ⋮---- // Solidity: function isQuorumThresholdRegisteredAt((uint8,uint248) quorumThreshold, uint48 timestamp) view returns(bool) func (_IValSetDriver *IValSetDriverCaller) IsQuorumThresholdRegisteredAt(opts *bind.CallOpts, quorumThreshold IValSetDriverQuorumThreshold, timestamp *big.Int) (bool, error) ⋮---- // IsSettlementRegistered is a free data retrieval call binding the contract method 0x965c0768. ⋮---- // Solidity: function isSettlementRegistered((uint64,address) settlement) view returns(bool) func (_IValSetDriver *IValSetDriverCaller) IsSettlementRegistered(opts *bind.CallOpts, settlement IValSetDriverCrossChainAddress) (bool, error) ⋮---- // IsSettlementRegisteredAt is a free data retrieval call binding the contract method 0x01749b26. ⋮---- // Solidity: function isSettlementRegisteredAt((uint64,address) settlement, uint48 timestamp) view returns(bool) func (_IValSetDriver *IValSetDriverCaller) IsSettlementRegisteredAt(opts *bind.CallOpts, settlement IValSetDriverCrossChainAddress, timestamp *big.Int) (bool, error) ⋮---- // IsVotingPowerProviderRegistered is a free data retrieval call binding the contract method 0x1265b3be. ⋮---- // Solidity: function isVotingPowerProviderRegistered((uint64,address) votingPowerProvider) view returns(bool) func (_IValSetDriver *IValSetDriverCaller) IsVotingPowerProviderRegistered(opts *bind.CallOpts, votingPowerProvider IValSetDriverCrossChainAddress) (bool, error) ⋮---- // IsVotingPowerProviderRegisteredAt is a free data retrieval call binding the contract method 0xc16ccb73. ⋮---- // Solidity: function isVotingPowerProviderRegisteredAt((uint64,address) votingPowerProvider, uint48 timestamp) view returns(bool) func (_IValSetDriver *IValSetDriverCaller) IsVotingPowerProviderRegisteredAt(opts *bind.CallOpts, votingPowerProvider IValSetDriverCrossChainAddress, timestamp *big.Int) (bool, error) ⋮---- // AddQuorumThreshold is a paid mutator transaction binding the contract method 0x0fe5e0c2. ⋮---- // Solidity: function addQuorumThreshold((uint8,uint248) quorumThreshold) returns() func (_IValSetDriver *IValSetDriverTransactor) AddQuorumThreshold(opts *bind.TransactOpts, quorumThreshold IValSetDriverQuorumThreshold) (*types.Transaction, error) ⋮---- // AddSettlement is a paid mutator transaction binding the contract method 0x52ab8872. ⋮---- // Solidity: function addSettlement((uint64,address) settlement) returns() func (_IValSetDriver *IValSetDriverTransactor) AddSettlement(opts *bind.TransactOpts, settlement IValSetDriverCrossChainAddress) (*types.Transaction, error) ⋮---- // AddVotingPowerProvider is a paid mutator transaction binding the contract method 0x6940ed80. ⋮---- // Solidity: function addVotingPowerProvider((uint64,address) votingPowerProvider) returns() func (_IValSetDriver *IValSetDriverTransactor) AddVotingPowerProvider(opts *bind.TransactOpts, votingPowerProvider IValSetDriverCrossChainAddress) (*types.Transaction, error) ⋮---- // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. ⋮---- // Solidity: function multicall(bytes[] data) returns(bytes[] results) func (_IValSetDriver *IValSetDriverTransactor) Multicall(opts *bind.TransactOpts, data [][]byte) (*types.Transaction, error) ⋮---- // RemoveQuorumThreshold is a paid mutator transaction binding the contract method 0xf388db18. ⋮---- // Solidity: function removeQuorumThreshold((uint8,uint248) quorumThreshold) returns() func (_IValSetDriver *IValSetDriverTransactor) RemoveQuorumThreshold(opts *bind.TransactOpts, quorumThreshold IValSetDriverQuorumThreshold) (*types.Transaction, error) ⋮---- // RemoveSettlement is a paid mutator transaction binding the contract method 0x502bb1ad. ⋮---- // Solidity: function removeSettlement((uint64,address) settlement) returns() func (_IValSetDriver *IValSetDriverTransactor) RemoveSettlement(opts *bind.TransactOpts, settlement IValSetDriverCrossChainAddress) (*types.Transaction, error) ⋮---- // RemoveVotingPowerProvider is a paid mutator transaction binding the contract method 0x325234d5. ⋮---- // Solidity: function removeVotingPowerProvider((uint64,address) votingPowerProvider) returns() func (_IValSetDriver *IValSetDriverTransactor) RemoveVotingPowerProvider(opts *bind.TransactOpts, votingPowerProvider IValSetDriverCrossChainAddress) (*types.Transaction, error) ⋮---- // SetEpochDuration is a paid mutator transaction binding the contract method 0x2f53d5ff. ⋮---- // Solidity: function setEpochDuration(uint48 epochDuration) returns() func (_IValSetDriver *IValSetDriverTransactor) SetEpochDuration(opts *bind.TransactOpts, epochDuration *big.Int) (*types.Transaction, error) ⋮---- // SetKeysProvider is a paid mutator transaction binding the contract method 0xdd08bbff. ⋮---- // Solidity: function setKeysProvider((uint64,address) keysProvider) returns() func (_IValSetDriver *IValSetDriverTransactor) SetKeysProvider(opts *bind.TransactOpts, keysProvider IValSetDriverCrossChainAddress) (*types.Transaction, error) ⋮---- // SetMaxValidatorsCount is a paid mutator transaction binding the contract method 0xd2384cd3. ⋮---- // Solidity: function setMaxValidatorsCount(uint208 maxValidatorsCount) returns() func (_IValSetDriver *IValSetDriverTransactor) SetMaxValidatorsCount(opts *bind.TransactOpts, maxValidatorsCount *big.Int) (*types.Transaction, error) ⋮---- // SetMaxVotingPower is a paid mutator transaction binding the contract method 0xf6af258c. ⋮---- // Solidity: function setMaxVotingPower(uint256 maxVotingPower) returns() func (_IValSetDriver *IValSetDriverTransactor) SetMaxVotingPower(opts *bind.TransactOpts, maxVotingPower *big.Int) (*types.Transaction, error) ⋮---- // SetMinInclusionVotingPower is a paid mutator transaction binding the contract method 0xfaae42d7. ⋮---- // Solidity: function setMinInclusionVotingPower(uint256 minInclusionVotingPower) returns() func (_IValSetDriver *IValSetDriverTransactor) SetMinInclusionVotingPower(opts *bind.TransactOpts, minInclusionVotingPower *big.Int) (*types.Transaction, error) ⋮---- // SetNumAggregators is a paid mutator transaction binding the contract method 0x0dec288b. ⋮---- // Solidity: function setNumAggregators(uint208 numAggregators) returns() func (_IValSetDriver *IValSetDriverTransactor) SetNumAggregators(opts *bind.TransactOpts, numAggregators *big.Int) (*types.Transaction, error) ⋮---- // SetNumCommitters is a paid mutator transaction binding the contract method 0x15ddbbe8. ⋮---- // Solidity: function setNumCommitters(uint208 numCommitters) returns() func (_IValSetDriver *IValSetDriverTransactor) SetNumCommitters(opts *bind.TransactOpts, numCommitters *big.Int) (*types.Transaction, error) ⋮---- // SetRequiredHeaderKeyTag is a paid mutator transaction binding the contract method 0xd9736e12. ⋮---- // Solidity: function setRequiredHeaderKeyTag(uint8 requiredHeaderKeyTag) returns() func (_IValSetDriver *IValSetDriverTransactor) SetRequiredHeaderKeyTag(opts *bind.TransactOpts, requiredHeaderKeyTag uint8) (*types.Transaction, error) ⋮---- // SetRequiredKeyTags is a paid mutator transaction binding the contract method 0x4678a284. ⋮---- // Solidity: function setRequiredKeyTags(uint8[] requiredKeyTags) returns() func (_IValSetDriver *IValSetDriverTransactor) SetRequiredKeyTags(opts *bind.TransactOpts, requiredKeyTags []uint8) (*types.Transaction, error) ⋮---- // SetVerificationType is a paid mutator transaction binding the contract method 0x7b8ef42d. ⋮---- // Solidity: function setVerificationType(uint32 verificationType) returns() func (_IValSetDriver *IValSetDriverTransactor) SetVerificationType(opts *bind.TransactOpts, verificationType uint32) (*types.Transaction, error) ⋮---- // StaticDelegateCall is a paid mutator transaction binding the contract method 0x9f86fd85. ⋮---- // Solidity: function staticDelegateCall(address target, bytes data) returns() func (_IValSetDriver *IValSetDriverTransactor) StaticDelegateCall(opts *bind.TransactOpts, target common.Address, data []byte) (*types.Transaction, error) ⋮---- // IValSetDriverAddQuorumThresholdIterator is returned from FilterAddQuorumThreshold and is used to iterate over the raw logs and unpacked data for AddQuorumThreshold events raised by the IValSetDriver contract. type IValSetDriverAddQuorumThresholdIterator struct { Event *IValSetDriverAddQuorumThreshold // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } ⋮---- Event *IValSetDriverAddQuorumThreshold // Event containing the contract specifics and raw log ⋮---- contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data ⋮---- logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration ⋮---- // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *IValSetDriverAddQuorumThresholdIterator) Next() bool ⋮---- // If the iterator failed, stop iterating ⋮---- // If the iterator completed, deliver directly whatever's available ⋮---- // Iterator still in progress, wait for either a data or an error event ⋮---- // Error returns any retrieval or parsing error occurred during filtering. func (it *IValSetDriverAddQuorumThresholdIterator) Error() error ⋮---- // Close terminates the iteration process, releasing any pending underlying // resources. func (it *IValSetDriverAddQuorumThresholdIterator) Close() error ⋮---- // IValSetDriverAddQuorumThreshold represents a AddQuorumThreshold event raised by the IValSetDriver contract. type IValSetDriverAddQuorumThreshold struct { QuorumThreshold IValSetDriverQuorumThreshold Raw types.Log // Blockchain specific contextual infos } ⋮---- Raw types.Log // Blockchain specific contextual infos ⋮---- // FilterAddQuorumThreshold is a free log retrieval operation binding the contract event 0x88ee37bfc079201d8493557f757c8ff6b14222ae13a8393747fb3c74b8ddf06f. ⋮---- // Solidity: event AddQuorumThreshold((uint8,uint248) quorumThreshold) func (_IValSetDriver *IValSetDriverFilterer) FilterAddQuorumThreshold(opts *bind.FilterOpts) (*IValSetDriverAddQuorumThresholdIterator, error) ⋮---- // WatchAddQuorumThreshold is a free log subscription operation binding the contract event 0x88ee37bfc079201d8493557f757c8ff6b14222ae13a8393747fb3c74b8ddf06f. ⋮---- func (_IValSetDriver *IValSetDriverFilterer) WatchAddQuorumThreshold(opts *bind.WatchOpts, sink chan<- *IValSetDriverAddQuorumThreshold) (event.Subscription, error) ⋮---- // New log arrived, parse the event and forward to the user ⋮---- // ParseAddQuorumThreshold is a log parse operation binding the contract event 0x88ee37bfc079201d8493557f757c8ff6b14222ae13a8393747fb3c74b8ddf06f. ⋮---- func (_IValSetDriver *IValSetDriverFilterer) ParseAddQuorumThreshold(log types.Log) (*IValSetDriverAddQuorumThreshold, error) ⋮---- // IValSetDriverAddSettlementIterator is returned from FilterAddSettlement and is used to iterate over the raw logs and unpacked data for AddSettlement events raised by the IValSetDriver contract. type IValSetDriverAddSettlementIterator struct { Event *IValSetDriverAddSettlement // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } ⋮---- Event *IValSetDriverAddSettlement // Event containing the contract specifics and raw log ⋮---- // IValSetDriverAddSettlement represents a AddSettlement event raised by the IValSetDriver contract. type IValSetDriverAddSettlement struct { Settlement IValSetDriverCrossChainAddress Raw types.Log // Blockchain specific contextual infos } ⋮---- Raw types.Log // Blockchain specific contextual infos ⋮---- // FilterAddSettlement is a free log retrieval operation binding the contract event 0xd66c27144960b789ff7b5514538e3d85a3623c1669b8d6db4eb85658df2aad57. ⋮---- // Solidity: event AddSettlement((uint64,address) settlement) func (_IValSetDriver *IValSetDriverFilterer) FilterAddSettlement(opts *bind.FilterOpts) (*IValSetDriverAddSettlementIterator, error) ⋮---- // WatchAddSettlement is a free log subscription operation binding the contract event 0xd66c27144960b789ff7b5514538e3d85a3623c1669b8d6db4eb85658df2aad57. ⋮---- func (_IValSetDriver *IValSetDriverFilterer) WatchAddSettlement(opts *bind.WatchOpts, sink chan<- *IValSetDriverAddSettlement) (event.Subscription, error) ⋮---- // ParseAddSettlement is a log parse operation binding the contract event 0xd66c27144960b789ff7b5514538e3d85a3623c1669b8d6db4eb85658df2aad57. ⋮---- func (_IValSetDriver *IValSetDriverFilterer) ParseAddSettlement(log types.Log) (*IValSetDriverAddSettlement, error) ⋮---- // IValSetDriverAddVotingPowerProviderIterator is returned from FilterAddVotingPowerProvider and is used to iterate over the raw logs and unpacked data for AddVotingPowerProvider events raised by the IValSetDriver contract. type IValSetDriverAddVotingPowerProviderIterator struct { Event *IValSetDriverAddVotingPowerProvider // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } ⋮---- Event *IValSetDriverAddVotingPowerProvider // Event containing the contract specifics and raw log ⋮---- // IValSetDriverAddVotingPowerProvider represents a AddVotingPowerProvider event raised by the IValSetDriver contract. type IValSetDriverAddVotingPowerProvider struct { VotingPowerProvider IValSetDriverCrossChainAddress Raw types.Log // Blockchain specific contextual infos } ⋮---- Raw types.Log // Blockchain specific contextual infos ⋮---- // FilterAddVotingPowerProvider is a free log retrieval operation binding the contract event 0xa8ba28fa43d2ebdcd4f5c29ee4f5e5fb568e9986ae8be7c6ae54540176d6147f. ⋮---- // Solidity: event AddVotingPowerProvider((uint64,address) votingPowerProvider) func (_IValSetDriver *IValSetDriverFilterer) FilterAddVotingPowerProvider(opts *bind.FilterOpts) (*IValSetDriverAddVotingPowerProviderIterator, error) ⋮---- // WatchAddVotingPowerProvider is a free log subscription operation binding the contract event 0xa8ba28fa43d2ebdcd4f5c29ee4f5e5fb568e9986ae8be7c6ae54540176d6147f. ⋮---- func (_IValSetDriver *IValSetDriverFilterer) WatchAddVotingPowerProvider(opts *bind.WatchOpts, sink chan<- *IValSetDriverAddVotingPowerProvider) (event.Subscription, error) ⋮---- // ParseAddVotingPowerProvider is a log parse operation binding the contract event 0xa8ba28fa43d2ebdcd4f5c29ee4f5e5fb568e9986ae8be7c6ae54540176d6147f. ⋮---- func (_IValSetDriver *IValSetDriverFilterer) ParseAddVotingPowerProvider(log types.Log) (*IValSetDriverAddVotingPowerProvider, error) ⋮---- // IValSetDriverInitEpochDurationIterator is returned from FilterInitEpochDuration and is used to iterate over the raw logs and unpacked data for InitEpochDuration events raised by the IValSetDriver contract. type IValSetDriverInitEpochDurationIterator struct { Event *IValSetDriverInitEpochDuration // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } ⋮---- Event *IValSetDriverInitEpochDuration // Event containing the contract specifics and raw log ⋮---- // IValSetDriverInitEpochDuration represents a InitEpochDuration event raised by the IValSetDriver contract. type IValSetDriverInitEpochDuration struct { EpochDuration *big.Int EpochDurationTimestamp *big.Int Raw types.Log // Blockchain specific contextual infos } ⋮---- Raw types.Log // Blockchain specific contextual infos ⋮---- // FilterInitEpochDuration is a free log retrieval operation binding the contract event 0xf688b7b02a20c2dda7d7de03a41637b274af7706eb975ea4af45858648370f55. ⋮---- // Solidity: event InitEpochDuration(uint48 epochDuration, uint48 epochDurationTimestamp) func (_IValSetDriver *IValSetDriverFilterer) FilterInitEpochDuration(opts *bind.FilterOpts) (*IValSetDriverInitEpochDurationIterator, error) ⋮---- // WatchInitEpochDuration is a free log subscription operation binding the contract event 0xf688b7b02a20c2dda7d7de03a41637b274af7706eb975ea4af45858648370f55. ⋮---- func (_IValSetDriver *IValSetDriverFilterer) WatchInitEpochDuration(opts *bind.WatchOpts, sink chan<- *IValSetDriverInitEpochDuration) (event.Subscription, error) ⋮---- // ParseInitEpochDuration is a log parse operation binding the contract event 0xf688b7b02a20c2dda7d7de03a41637b274af7706eb975ea4af45858648370f55. ⋮---- func (_IValSetDriver *IValSetDriverFilterer) ParseInitEpochDuration(log types.Log) (*IValSetDriverInitEpochDuration, error) ⋮---- // IValSetDriverInitSubnetworkIterator is returned from FilterInitSubnetwork and is used to iterate over the raw logs and unpacked data for InitSubnetwork events raised by the IValSetDriver contract. type IValSetDriverInitSubnetworkIterator struct { Event *IValSetDriverInitSubnetwork // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } ⋮---- Event *IValSetDriverInitSubnetwork // Event containing the contract specifics and raw log ⋮---- // IValSetDriverInitSubnetwork represents a InitSubnetwork event raised by the IValSetDriver contract. type IValSetDriverInitSubnetwork struct { Network common.Address SubnetworkId *big.Int Raw types.Log // Blockchain specific contextual infos } ⋮---- Raw types.Log // Blockchain specific contextual infos ⋮---- // FilterInitSubnetwork is a free log retrieval operation binding the contract event 0x469c2e982e7d76d34cf5d1e72abee29749bb9971942c180e9023cea09f5f8e83. ⋮---- // Solidity: event InitSubnetwork(address network, uint96 subnetworkId) func (_IValSetDriver *IValSetDriverFilterer) FilterInitSubnetwork(opts *bind.FilterOpts) (*IValSetDriverInitSubnetworkIterator, error) ⋮---- // WatchInitSubnetwork is a free log subscription operation binding the contract event 0x469c2e982e7d76d34cf5d1e72abee29749bb9971942c180e9023cea09f5f8e83. ⋮---- func (_IValSetDriver *IValSetDriverFilterer) WatchInitSubnetwork(opts *bind.WatchOpts, sink chan<- *IValSetDriverInitSubnetwork) (event.Subscription, error) ⋮---- // ParseInitSubnetwork is a log parse operation binding the contract event 0x469c2e982e7d76d34cf5d1e72abee29749bb9971942c180e9023cea09f5f8e83. ⋮---- func (_IValSetDriver *IValSetDriverFilterer) ParseInitSubnetwork(log types.Log) (*IValSetDriverInitSubnetwork, error) ⋮---- // IValSetDriverInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the IValSetDriver contract. type IValSetDriverInitializedIterator struct { Event *IValSetDriverInitialized // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } ⋮---- Event *IValSetDriverInitialized // Event containing the contract specifics and raw log ⋮---- // IValSetDriverInitialized represents a Initialized event raised by the IValSetDriver contract. type IValSetDriverInitialized struct { Version uint64 Raw types.Log // Blockchain specific contextual infos } ⋮---- Raw types.Log // Blockchain specific contextual infos ⋮---- // FilterInitialized is a free log retrieval operation binding the contract event 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2. ⋮---- // Solidity: event Initialized(uint64 version) func (_IValSetDriver *IValSetDriverFilterer) FilterInitialized(opts *bind.FilterOpts) (*IValSetDriverInitializedIterator, error) ⋮---- // WatchInitialized is a free log subscription operation binding the contract event 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2. ⋮---- func (_IValSetDriver *IValSetDriverFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *IValSetDriverInitialized) (event.Subscription, error) ⋮---- // ParseInitialized is a log parse operation binding the contract event 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2. ⋮---- func (_IValSetDriver *IValSetDriverFilterer) ParseInitialized(log types.Log) (*IValSetDriverInitialized, error) ⋮---- // IValSetDriverRemoveQuorumThresholdIterator is returned from FilterRemoveQuorumThreshold and is used to iterate over the raw logs and unpacked data for RemoveQuorumThreshold events raised by the IValSetDriver contract. type IValSetDriverRemoveQuorumThresholdIterator struct { Event *IValSetDriverRemoveQuorumThreshold // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } ⋮---- Event *IValSetDriverRemoveQuorumThreshold // Event containing the contract specifics and raw log ⋮---- // IValSetDriverRemoveQuorumThreshold represents a RemoveQuorumThreshold event raised by the IValSetDriver contract. type IValSetDriverRemoveQuorumThreshold struct { QuorumThreshold IValSetDriverQuorumThreshold Raw types.Log // Blockchain specific contextual infos } ⋮---- // FilterRemoveQuorumThreshold is a free log retrieval operation binding the contract event 0xb321a5a0425badf1acf0a0b21b7984fa61e1e6405ae9011d4dcdb29b0e2f43ec. ⋮---- // Solidity: event RemoveQuorumThreshold((uint8,uint248) quorumThreshold) func (_IValSetDriver *IValSetDriverFilterer) FilterRemoveQuorumThreshold(opts *bind.FilterOpts) (*IValSetDriverRemoveQuorumThresholdIterator, error) ⋮---- // WatchRemoveQuorumThreshold is a free log subscription operation binding the contract event 0xb321a5a0425badf1acf0a0b21b7984fa61e1e6405ae9011d4dcdb29b0e2f43ec. ⋮---- func (_IValSetDriver *IValSetDriverFilterer) WatchRemoveQuorumThreshold(opts *bind.WatchOpts, sink chan<- *IValSetDriverRemoveQuorumThreshold) (event.Subscription, error) ⋮---- // ParseRemoveQuorumThreshold is a log parse operation binding the contract event 0xb321a5a0425badf1acf0a0b21b7984fa61e1e6405ae9011d4dcdb29b0e2f43ec. ⋮---- func (_IValSetDriver *IValSetDriverFilterer) ParseRemoveQuorumThreshold(log types.Log) (*IValSetDriverRemoveQuorumThreshold, error) ⋮---- // IValSetDriverRemoveSettlementIterator is returned from FilterRemoveSettlement and is used to iterate over the raw logs and unpacked data for RemoveSettlement events raised by the IValSetDriver contract. type IValSetDriverRemoveSettlementIterator struct { Event *IValSetDriverRemoveSettlement // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } ⋮---- Event *IValSetDriverRemoveSettlement // Event containing the contract specifics and raw log ⋮---- // IValSetDriverRemoveSettlement represents a RemoveSettlement event raised by the IValSetDriver contract. type IValSetDriverRemoveSettlement struct { Settlement IValSetDriverCrossChainAddress Raw types.Log // Blockchain specific contextual infos } ⋮---- // FilterRemoveSettlement is a free log retrieval operation binding the contract event 0x6307047e2a245d2a5867f7667a4a48687593b73e3b2f95d2204256cbff350cf3. ⋮---- // Solidity: event RemoveSettlement((uint64,address) settlement) func (_IValSetDriver *IValSetDriverFilterer) FilterRemoveSettlement(opts *bind.FilterOpts) (*IValSetDriverRemoveSettlementIterator, error) ⋮---- // WatchRemoveSettlement is a free log subscription operation binding the contract event 0x6307047e2a245d2a5867f7667a4a48687593b73e3b2f95d2204256cbff350cf3. ⋮---- func (_IValSetDriver *IValSetDriverFilterer) WatchRemoveSettlement(opts *bind.WatchOpts, sink chan<- *IValSetDriverRemoveSettlement) (event.Subscription, error) ⋮---- // ParseRemoveSettlement is a log parse operation binding the contract event 0x6307047e2a245d2a5867f7667a4a48687593b73e3b2f95d2204256cbff350cf3. ⋮---- func (_IValSetDriver *IValSetDriverFilterer) ParseRemoveSettlement(log types.Log) (*IValSetDriverRemoveSettlement, error) ⋮---- // IValSetDriverRemoveVotingPowerProviderIterator is returned from FilterRemoveVotingPowerProvider and is used to iterate over the raw logs and unpacked data for RemoveVotingPowerProvider events raised by the IValSetDriver contract. type IValSetDriverRemoveVotingPowerProviderIterator struct { Event *IValSetDriverRemoveVotingPowerProvider // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } ⋮---- Event *IValSetDriverRemoveVotingPowerProvider // Event containing the contract specifics and raw log ⋮---- // IValSetDriverRemoveVotingPowerProvider represents a RemoveVotingPowerProvider event raised by the IValSetDriver contract. type IValSetDriverRemoveVotingPowerProvider struct { VotingPowerProvider IValSetDriverCrossChainAddress Raw types.Log // Blockchain specific contextual infos } ⋮---- // FilterRemoveVotingPowerProvider is a free log retrieval operation binding the contract event 0x2a2103a52b9c3907936be3fea265a7bd34fdfc0c8c09cc3b8e3938b7deda761f. ⋮---- // Solidity: event RemoveVotingPowerProvider((uint64,address) votingPowerProvider) func (_IValSetDriver *IValSetDriverFilterer) FilterRemoveVotingPowerProvider(opts *bind.FilterOpts) (*IValSetDriverRemoveVotingPowerProviderIterator, error) ⋮---- // WatchRemoveVotingPowerProvider is a free log subscription operation binding the contract event 0x2a2103a52b9c3907936be3fea265a7bd34fdfc0c8c09cc3b8e3938b7deda761f. ⋮---- func (_IValSetDriver *IValSetDriverFilterer) WatchRemoveVotingPowerProvider(opts *bind.WatchOpts, sink chan<- *IValSetDriverRemoveVotingPowerProvider) (event.Subscription, error) ⋮---- // ParseRemoveVotingPowerProvider is a log parse operation binding the contract event 0x2a2103a52b9c3907936be3fea265a7bd34fdfc0c8c09cc3b8e3938b7deda761f. ⋮---- func (_IValSetDriver *IValSetDriverFilterer) ParseRemoveVotingPowerProvider(log types.Log) (*IValSetDriverRemoveVotingPowerProvider, error) ⋮---- // IValSetDriverSetEpochDurationIterator is returned from FilterSetEpochDuration and is used to iterate over the raw logs and unpacked data for SetEpochDuration events raised by the IValSetDriver contract. type IValSetDriverSetEpochDurationIterator struct { Event *IValSetDriverSetEpochDuration // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } ⋮---- Event *IValSetDriverSetEpochDuration // Event containing the contract specifics and raw log ⋮---- // IValSetDriverSetEpochDuration represents a SetEpochDuration event raised by the IValSetDriver contract. type IValSetDriverSetEpochDuration struct { EpochDuration *big.Int Raw types.Log // Blockchain specific contextual infos } ⋮---- Raw types.Log // Blockchain specific contextual infos ⋮---- // FilterSetEpochDuration is a free log retrieval operation binding the contract event 0xc950f06b73b224f8b32d39245a5905020aebfc426a15833a70ac2e4e2ebe098c. ⋮---- // Solidity: event SetEpochDuration(uint48 epochDuration) func (_IValSetDriver *IValSetDriverFilterer) FilterSetEpochDuration(opts *bind.FilterOpts) (*IValSetDriverSetEpochDurationIterator, error) ⋮---- // WatchSetEpochDuration is a free log subscription operation binding the contract event 0xc950f06b73b224f8b32d39245a5905020aebfc426a15833a70ac2e4e2ebe098c. ⋮---- func (_IValSetDriver *IValSetDriverFilterer) WatchSetEpochDuration(opts *bind.WatchOpts, sink chan<- *IValSetDriverSetEpochDuration) (event.Subscription, error) ⋮---- // ParseSetEpochDuration is a log parse operation binding the contract event 0xc950f06b73b224f8b32d39245a5905020aebfc426a15833a70ac2e4e2ebe098c. ⋮---- func (_IValSetDriver *IValSetDriverFilterer) ParseSetEpochDuration(log types.Log) (*IValSetDriverSetEpochDuration, error) ⋮---- // IValSetDriverSetKeysProviderIterator is returned from FilterSetKeysProvider and is used to iterate over the raw logs and unpacked data for SetKeysProvider events raised by the IValSetDriver contract. type IValSetDriverSetKeysProviderIterator struct { Event *IValSetDriverSetKeysProvider // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } ⋮---- Event *IValSetDriverSetKeysProvider // Event containing the contract specifics and raw log ⋮---- // IValSetDriverSetKeysProvider represents a SetKeysProvider event raised by the IValSetDriver contract. type IValSetDriverSetKeysProvider struct { KeysProvider IValSetDriverCrossChainAddress Raw types.Log // Blockchain specific contextual infos } ⋮---- // FilterSetKeysProvider is a free log retrieval operation binding the contract event 0x15ceb492f5dd0988720d5f2258f4de98a2ac5df85b25ed2f33eda91e90e07321. ⋮---- // Solidity: event SetKeysProvider((uint64,address) keysProvider) func (_IValSetDriver *IValSetDriverFilterer) FilterSetKeysProvider(opts *bind.FilterOpts) (*IValSetDriverSetKeysProviderIterator, error) ⋮---- // WatchSetKeysProvider is a free log subscription operation binding the contract event 0x15ceb492f5dd0988720d5f2258f4de98a2ac5df85b25ed2f33eda91e90e07321. ⋮---- func (_IValSetDriver *IValSetDriverFilterer) WatchSetKeysProvider(opts *bind.WatchOpts, sink chan<- *IValSetDriverSetKeysProvider) (event.Subscription, error) ⋮---- // ParseSetKeysProvider is a log parse operation binding the contract event 0x15ceb492f5dd0988720d5f2258f4de98a2ac5df85b25ed2f33eda91e90e07321. ⋮---- func (_IValSetDriver *IValSetDriverFilterer) ParseSetKeysProvider(log types.Log) (*IValSetDriverSetKeysProvider, error) ⋮---- // IValSetDriverSetMaxValidatorsCountIterator is returned from FilterSetMaxValidatorsCount and is used to iterate over the raw logs and unpacked data for SetMaxValidatorsCount events raised by the IValSetDriver contract. type IValSetDriverSetMaxValidatorsCountIterator struct { Event *IValSetDriverSetMaxValidatorsCount // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } ⋮---- Event *IValSetDriverSetMaxValidatorsCount // Event containing the contract specifics and raw log ⋮---- // IValSetDriverSetMaxValidatorsCount represents a SetMaxValidatorsCount event raised by the IValSetDriver contract. type IValSetDriverSetMaxValidatorsCount struct { MaxValidatorsCount *big.Int Raw types.Log // Blockchain specific contextual infos } ⋮---- Raw types.Log // Blockchain specific contextual infos ⋮---- // FilterSetMaxValidatorsCount is a free log retrieval operation binding the contract event 0x37ca3532b507cfa33b11765ae8b499cb6830421b982a7f8837ee71ca5a3119c8. ⋮---- // Solidity: event SetMaxValidatorsCount(uint208 maxValidatorsCount) func (_IValSetDriver *IValSetDriverFilterer) FilterSetMaxValidatorsCount(opts *bind.FilterOpts) (*IValSetDriverSetMaxValidatorsCountIterator, error) ⋮---- // WatchSetMaxValidatorsCount is a free log subscription operation binding the contract event 0x37ca3532b507cfa33b11765ae8b499cb6830421b982a7f8837ee71ca5a3119c8. ⋮---- func (_IValSetDriver *IValSetDriverFilterer) WatchSetMaxValidatorsCount(opts *bind.WatchOpts, sink chan<- *IValSetDriverSetMaxValidatorsCount) (event.Subscription, error) ⋮---- // ParseSetMaxValidatorsCount is a log parse operation binding the contract event 0x37ca3532b507cfa33b11765ae8b499cb6830421b982a7f8837ee71ca5a3119c8. ⋮---- func (_IValSetDriver *IValSetDriverFilterer) ParseSetMaxValidatorsCount(log types.Log) (*IValSetDriverSetMaxValidatorsCount, error) ⋮---- // IValSetDriverSetMaxVotingPowerIterator is returned from FilterSetMaxVotingPower and is used to iterate over the raw logs and unpacked data for SetMaxVotingPower events raised by the IValSetDriver contract. type IValSetDriverSetMaxVotingPowerIterator struct { Event *IValSetDriverSetMaxVotingPower // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } ⋮---- Event *IValSetDriverSetMaxVotingPower // Event containing the contract specifics and raw log ⋮---- // IValSetDriverSetMaxVotingPower represents a SetMaxVotingPower event raised by the IValSetDriver contract. type IValSetDriverSetMaxVotingPower struct { MaxVotingPower *big.Int Raw types.Log // Blockchain specific contextual infos } ⋮---- Raw types.Log // Blockchain specific contextual infos ⋮---- // FilterSetMaxVotingPower is a free log retrieval operation binding the contract event 0xe891886eac9e583940fb0844098689693a4d105206ec1f789d119b4314383b95. ⋮---- // Solidity: event SetMaxVotingPower(uint256 maxVotingPower) func (_IValSetDriver *IValSetDriverFilterer) FilterSetMaxVotingPower(opts *bind.FilterOpts) (*IValSetDriverSetMaxVotingPowerIterator, error) ⋮---- // WatchSetMaxVotingPower is a free log subscription operation binding the contract event 0xe891886eac9e583940fb0844098689693a4d105206ec1f789d119b4314383b95. ⋮---- func (_IValSetDriver *IValSetDriverFilterer) WatchSetMaxVotingPower(opts *bind.WatchOpts, sink chan<- *IValSetDriverSetMaxVotingPower) (event.Subscription, error) ⋮---- // ParseSetMaxVotingPower is a log parse operation binding the contract event 0xe891886eac9e583940fb0844098689693a4d105206ec1f789d119b4314383b95. ⋮---- func (_IValSetDriver *IValSetDriverFilterer) ParseSetMaxVotingPower(log types.Log) (*IValSetDriverSetMaxVotingPower, error) ⋮---- // IValSetDriverSetMinInclusionVotingPowerIterator is returned from FilterSetMinInclusionVotingPower and is used to iterate over the raw logs and unpacked data for SetMinInclusionVotingPower events raised by the IValSetDriver contract. type IValSetDriverSetMinInclusionVotingPowerIterator struct { Event *IValSetDriverSetMinInclusionVotingPower // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } ⋮---- Event *IValSetDriverSetMinInclusionVotingPower // Event containing the contract specifics and raw log ⋮---- // IValSetDriverSetMinInclusionVotingPower represents a SetMinInclusionVotingPower event raised by the IValSetDriver contract. type IValSetDriverSetMinInclusionVotingPower struct { MinInclusionVotingPower *big.Int Raw types.Log // Blockchain specific contextual infos } ⋮---- Raw types.Log // Blockchain specific contextual infos ⋮---- // FilterSetMinInclusionVotingPower is a free log retrieval operation binding the contract event 0x7ea1f11872caff0567f050bd06f29f128a1407e56e3272abbadef87f6cbb6188. ⋮---- // Solidity: event SetMinInclusionVotingPower(uint256 minInclusionVotingPower) func (_IValSetDriver *IValSetDriverFilterer) FilterSetMinInclusionVotingPower(opts *bind.FilterOpts) (*IValSetDriverSetMinInclusionVotingPowerIterator, error) ⋮---- // WatchSetMinInclusionVotingPower is a free log subscription operation binding the contract event 0x7ea1f11872caff0567f050bd06f29f128a1407e56e3272abbadef87f6cbb6188. ⋮---- func (_IValSetDriver *IValSetDriverFilterer) WatchSetMinInclusionVotingPower(opts *bind.WatchOpts, sink chan<- *IValSetDriverSetMinInclusionVotingPower) (event.Subscription, error) ⋮---- // ParseSetMinInclusionVotingPower is a log parse operation binding the contract event 0x7ea1f11872caff0567f050bd06f29f128a1407e56e3272abbadef87f6cbb6188. ⋮---- func (_IValSetDriver *IValSetDriverFilterer) ParseSetMinInclusionVotingPower(log types.Log) (*IValSetDriverSetMinInclusionVotingPower, error) ⋮---- // IValSetDriverSetNumAggregatorsIterator is returned from FilterSetNumAggregators and is used to iterate over the raw logs and unpacked data for SetNumAggregators events raised by the IValSetDriver contract. type IValSetDriverSetNumAggregatorsIterator struct { Event *IValSetDriverSetNumAggregators // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } ⋮---- Event *IValSetDriverSetNumAggregators // Event containing the contract specifics and raw log ⋮---- // IValSetDriverSetNumAggregators represents a SetNumAggregators event raised by the IValSetDriver contract. type IValSetDriverSetNumAggregators struct { NumAggregators *big.Int Raw types.Log // Blockchain specific contextual infos } ⋮---- // FilterSetNumAggregators is a free log retrieval operation binding the contract event 0xa47e6808a463c6134cf3bb23d54ee0ccb5c8056ab8c8b5fd5277fc83cc2f25f3. ⋮---- // Solidity: event SetNumAggregators(uint208 numAggregators) func (_IValSetDriver *IValSetDriverFilterer) FilterSetNumAggregators(opts *bind.FilterOpts) (*IValSetDriverSetNumAggregatorsIterator, error) ⋮---- // WatchSetNumAggregators is a free log subscription operation binding the contract event 0xa47e6808a463c6134cf3bb23d54ee0ccb5c8056ab8c8b5fd5277fc83cc2f25f3. ⋮---- func (_IValSetDriver *IValSetDriverFilterer) WatchSetNumAggregators(opts *bind.WatchOpts, sink chan<- *IValSetDriverSetNumAggregators) (event.Subscription, error) ⋮---- // ParseSetNumAggregators is a log parse operation binding the contract event 0xa47e6808a463c6134cf3bb23d54ee0ccb5c8056ab8c8b5fd5277fc83cc2f25f3. ⋮---- func (_IValSetDriver *IValSetDriverFilterer) ParseSetNumAggregators(log types.Log) (*IValSetDriverSetNumAggregators, error) ⋮---- // IValSetDriverSetNumCommittersIterator is returned from FilterSetNumCommitters and is used to iterate over the raw logs and unpacked data for SetNumCommitters events raised by the IValSetDriver contract. type IValSetDriverSetNumCommittersIterator struct { Event *IValSetDriverSetNumCommitters // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } ⋮---- Event *IValSetDriverSetNumCommitters // Event containing the contract specifics and raw log ⋮---- // IValSetDriverSetNumCommitters represents a SetNumCommitters event raised by the IValSetDriver contract. type IValSetDriverSetNumCommitters struct { NumCommitters *big.Int Raw types.Log // Blockchain specific contextual infos } ⋮---- // FilterSetNumCommitters is a free log retrieval operation binding the contract event 0x931a819f63102a134c17aeb8b67a254fc3e215c35487041ff43fd3225b272b5f. ⋮---- // Solidity: event SetNumCommitters(uint208 numCommitters) func (_IValSetDriver *IValSetDriverFilterer) FilterSetNumCommitters(opts *bind.FilterOpts) (*IValSetDriverSetNumCommittersIterator, error) ⋮---- // WatchSetNumCommitters is a free log subscription operation binding the contract event 0x931a819f63102a134c17aeb8b67a254fc3e215c35487041ff43fd3225b272b5f. ⋮---- func (_IValSetDriver *IValSetDriverFilterer) WatchSetNumCommitters(opts *bind.WatchOpts, sink chan<- *IValSetDriverSetNumCommitters) (event.Subscription, error) ⋮---- // ParseSetNumCommitters is a log parse operation binding the contract event 0x931a819f63102a134c17aeb8b67a254fc3e215c35487041ff43fd3225b272b5f. ⋮---- func (_IValSetDriver *IValSetDriverFilterer) ParseSetNumCommitters(log types.Log) (*IValSetDriverSetNumCommitters, error) ⋮---- // IValSetDriverSetRequiredHeaderKeyTagIterator is returned from FilterSetRequiredHeaderKeyTag and is used to iterate over the raw logs and unpacked data for SetRequiredHeaderKeyTag events raised by the IValSetDriver contract. type IValSetDriverSetRequiredHeaderKeyTagIterator struct { Event *IValSetDriverSetRequiredHeaderKeyTag // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } ⋮---- Event *IValSetDriverSetRequiredHeaderKeyTag // Event containing the contract specifics and raw log ⋮---- // IValSetDriverSetRequiredHeaderKeyTag represents a SetRequiredHeaderKeyTag event raised by the IValSetDriver contract. type IValSetDriverSetRequiredHeaderKeyTag struct { RequiredHeaderKeyTag uint8 Raw types.Log // Blockchain specific contextual infos } ⋮---- Raw types.Log // Blockchain specific contextual infos ⋮---- // FilterSetRequiredHeaderKeyTag is a free log retrieval operation binding the contract event 0xba7887224500eabdaa5bddd0e0210aec811345379939ffbbc4bc87bdfb673b70. ⋮---- // Solidity: event SetRequiredHeaderKeyTag(uint8 requiredHeaderKeyTag) func (_IValSetDriver *IValSetDriverFilterer) FilterSetRequiredHeaderKeyTag(opts *bind.FilterOpts) (*IValSetDriverSetRequiredHeaderKeyTagIterator, error) ⋮---- // WatchSetRequiredHeaderKeyTag is a free log subscription operation binding the contract event 0xba7887224500eabdaa5bddd0e0210aec811345379939ffbbc4bc87bdfb673b70. ⋮---- func (_IValSetDriver *IValSetDriverFilterer) WatchSetRequiredHeaderKeyTag(opts *bind.WatchOpts, sink chan<- *IValSetDriverSetRequiredHeaderKeyTag) (event.Subscription, error) ⋮---- // ParseSetRequiredHeaderKeyTag is a log parse operation binding the contract event 0xba7887224500eabdaa5bddd0e0210aec811345379939ffbbc4bc87bdfb673b70. ⋮---- func (_IValSetDriver *IValSetDriverFilterer) ParseSetRequiredHeaderKeyTag(log types.Log) (*IValSetDriverSetRequiredHeaderKeyTag, error) ⋮---- // IValSetDriverSetRequiredKeyTagsIterator is returned from FilterSetRequiredKeyTags and is used to iterate over the raw logs and unpacked data for SetRequiredKeyTags events raised by the IValSetDriver contract. type IValSetDriverSetRequiredKeyTagsIterator struct { Event *IValSetDriverSetRequiredKeyTags // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } ⋮---- Event *IValSetDriverSetRequiredKeyTags // Event containing the contract specifics and raw log ⋮---- // IValSetDriverSetRequiredKeyTags represents a SetRequiredKeyTags event raised by the IValSetDriver contract. type IValSetDriverSetRequiredKeyTags struct { RequiredKeyTags []uint8 Raw types.Log // Blockchain specific contextual infos } ⋮---- // FilterSetRequiredKeyTags is a free log retrieval operation binding the contract event 0x14f8998266f37e593027a05efebf63b8710681d1cdbd39e6d7a156ff7e1485cd. ⋮---- // Solidity: event SetRequiredKeyTags(uint8[] requiredKeyTags) func (_IValSetDriver *IValSetDriverFilterer) FilterSetRequiredKeyTags(opts *bind.FilterOpts) (*IValSetDriverSetRequiredKeyTagsIterator, error) ⋮---- // WatchSetRequiredKeyTags is a free log subscription operation binding the contract event 0x14f8998266f37e593027a05efebf63b8710681d1cdbd39e6d7a156ff7e1485cd. ⋮---- func (_IValSetDriver *IValSetDriverFilterer) WatchSetRequiredKeyTags(opts *bind.WatchOpts, sink chan<- *IValSetDriverSetRequiredKeyTags) (event.Subscription, error) ⋮---- // ParseSetRequiredKeyTags is a log parse operation binding the contract event 0x14f8998266f37e593027a05efebf63b8710681d1cdbd39e6d7a156ff7e1485cd. ⋮---- func (_IValSetDriver *IValSetDriverFilterer) ParseSetRequiredKeyTags(log types.Log) (*IValSetDriverSetRequiredKeyTags, error) ⋮---- // IValSetDriverSetVerificationTypeIterator is returned from FilterSetVerificationType and is used to iterate over the raw logs and unpacked data for SetVerificationType events raised by the IValSetDriver contract. type IValSetDriverSetVerificationTypeIterator struct { Event *IValSetDriverSetVerificationType // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } ⋮---- Event *IValSetDriverSetVerificationType // Event containing the contract specifics and raw log ⋮---- // IValSetDriverSetVerificationType represents a SetVerificationType event raised by the IValSetDriver contract. type IValSetDriverSetVerificationType struct { VerificationType uint32 Raw types.Log // Blockchain specific contextual infos } ⋮---- Raw types.Log // Blockchain specific contextual infos ⋮---- // FilterSetVerificationType is a free log retrieval operation binding the contract event 0x2acc7be3ff5df4b911488f72502071dcf3f4a8f778a8abc351af3220bcd15b7f. ⋮---- // Solidity: event SetVerificationType(uint32 verificationType) func (_IValSetDriver *IValSetDriverFilterer) FilterSetVerificationType(opts *bind.FilterOpts) (*IValSetDriverSetVerificationTypeIterator, error) ⋮---- // WatchSetVerificationType is a free log subscription operation binding the contract event 0x2acc7be3ff5df4b911488f72502071dcf3f4a8f778a8abc351af3220bcd15b7f. ⋮---- func (_IValSetDriver *IValSetDriverFilterer) WatchSetVerificationType(opts *bind.WatchOpts, sink chan<- *IValSetDriverSetVerificationType) (event.Subscription, error) ⋮---- // ParseSetVerificationType is a log parse operation binding the contract event 0x2acc7be3ff5df4b911488f72502071dcf3f4a8f778a8abc351af3220bcd15b7f. ⋮---- func (_IValSetDriver *IValSetDriverFilterer) ParseSetVerificationType(log types.Log) (*IValSetDriverSetVerificationType, error) ```` ## File: symbiotic/client/evm/gen/votingPowerProvider.go ````go // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. ⋮---- package gen ⋮---- import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) ⋮---- "errors" "math/big" "strings" ⋮---- ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ⋮---- // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) ⋮---- // IVotingPowerProviderOperatorVotingPower is an auto generated low-level Go binding around an user-defined struct. type IVotingPowerProviderOperatorVotingPower struct { Operator common.Address Vaults []IVotingPowerProviderVaultValue } ⋮---- // IVotingPowerProviderVaultValue is an auto generated low-level Go binding around an user-defined struct. type IVotingPowerProviderVaultValue struct { Vault common.Address Value *big.Int } ⋮---- // IVotingPowerProviderMetaData contains all meta data concerning the IVotingPowerProvider contract. var IVotingPowerProviderMetaData = &bind.MetaData{ ABI: "[{\"type\":\"function\",\"name\":\"NETWORK\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"OPERATOR_REGISTRY\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"SUBNETWORK\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"SUBNETWORK_IDENTIFIER\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint96\",\"internalType\":\"uint96\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"VAULT_FACTORY\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"eip712Domain\",\"inputs\":[],\"outputs\":[{\"name\":\"fields\",\"type\":\"bytes1\",\"internalType\":\"bytes1\"},{\"name\":\"name\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"version\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"chainId\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"verifyingContract\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"salt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"extensions\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getOperatorStakes\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple[]\",\"internalType\":\"structIVotingPowerProvider.VaultValue[]\",\"components\":[{\"name\":\"vault\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getOperatorStakesAt\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"timestamp\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple[]\",\"internalType\":\"structIVotingPowerProvider.VaultValue[]\",\"components\":[{\"name\":\"vault\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getOperatorVaults\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getOperatorVaultsAt\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"timestamp\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getOperatorVotingPowers\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"extraData\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple[]\",\"internalType\":\"structIVotingPowerProvider.VaultValue[]\",\"components\":[{\"name\":\"vault\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getOperatorVotingPowersAt\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"extraData\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"timestamp\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple[]\",\"internalType\":\"structIVotingPowerProvider.VaultValue[]\",\"components\":[{\"name\":\"vault\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getOperators\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getOperatorsAt\",\"inputs\":[{\"name\":\"timestamp\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getSharedVaults\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getSharedVaultsAt\",\"inputs\":[{\"name\":\"timestamp\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getSlashingData\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getSlashingDataAt\",\"inputs\":[{\"name\":\"timestamp\",\"type\":\"uint48\",\"internalType\":\"uint48\"},{\"name\":\"hint\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getTokens\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getTokensAt\",\"inputs\":[{\"name\":\"timestamp\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getVotingPowers\",\"inputs\":[{\"name\":\"extraData\",\"type\":\"bytes[]\",\"internalType\":\"bytes[]\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple[]\",\"internalType\":\"structIVotingPowerProvider.OperatorVotingPower[]\",\"components\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"vaults\",\"type\":\"tuple[]\",\"internalType\":\"structIVotingPowerProvider.VaultValue[]\",\"components\":[{\"name\":\"vault\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getVotingPowersAt\",\"inputs\":[{\"name\":\"extraData\",\"type\":\"bytes[]\",\"internalType\":\"bytes[]\"},{\"name\":\"timestamp\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple[]\",\"internalType\":\"structIVotingPowerProvider.OperatorVotingPower[]\",\"components\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"vaults\",\"type\":\"tuple[]\",\"internalType\":\"structIVotingPowerProvider.VaultValue[]\",\"components\":[{\"name\":\"vault\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"hashTypedDataV4\",\"inputs\":[{\"name\":\"structHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"hashTypedDataV4CrossChain\",\"inputs\":[{\"name\":\"structHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"invalidateOldSignatures\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"isOperatorRegistered\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isOperatorRegisteredAt\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"timestamp\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isOperatorVaultRegistered\",\"inputs\":[{\"name\":\"vault\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isOperatorVaultRegistered\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"vault\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isOperatorVaultRegisteredAt\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"vault\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"timestamp\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isOperatorVaultRegisteredAt\",\"inputs\":[{\"name\":\"vault\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"timestamp\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isSharedVaultRegistered\",\"inputs\":[{\"name\":\"vault\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isSharedVaultRegisteredAt\",\"inputs\":[{\"name\":\"vault\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"timestamp\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isTokenRegistered\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isTokenRegisteredAt\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"timestamp\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"multicall\",\"inputs\":[{\"name\":\"data\",\"type\":\"bytes[]\",\"internalType\":\"bytes[]\"}],\"outputs\":[{\"name\":\"results\",\"type\":\"bytes[]\",\"internalType\":\"bytes[]\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"nonces\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"registerOperator\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"registerOperatorWithSignature\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"stakeToVotingPower\",\"inputs\":[{\"name\":\"vault\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"stake\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"extraData\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"power\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"stakeToVotingPowerAt\",\"inputs\":[{\"name\":\"vault\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"stake\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"extraData\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"timestamp\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"outputs\":[{\"name\":\"power\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"staticDelegateCall\",\"inputs\":[{\"name\":\"target\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"unregisterOperator\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"unregisterOperatorWithSignature\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"EIP712DomainChanged\",\"inputs\":[],\"anonymous\":false},{\"type\":\"event\",\"name\":\"InitEIP712\",\"inputs\":[{\"name\":\"name\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"},{\"name\":\"version\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"InitSubnetwork\",\"inputs\":[{\"name\":\"network\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"subnetworkId\",\"type\":\"uint96\",\"indexed\":false,\"internalType\":\"uint96\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RegisterOperator\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RegisterOperatorVault\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"vault\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RegisterSharedVault\",\"inputs\":[{\"name\":\"vault\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RegisterToken\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"SetSlashingData\",\"inputs\":[{\"name\":\"requireSlasher\",\"type\":\"bool\",\"indexed\":false,\"internalType\":\"bool\"},{\"name\":\"minVaultEpochDuration\",\"type\":\"uint48\",\"indexed\":false,\"internalType\":\"uint48\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"UnregisterOperator\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"UnregisterOperatorVault\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"vault\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"UnregisterSharedVault\",\"inputs\":[{\"name\":\"vault\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"UnregisterToken\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"AddressEmptyCode\",\"inputs\":[{\"name\":\"target\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"FailedCall\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidAccountNonce\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"currentNonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"InvalidInitialization\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NetworkManager_InvalidNetwork\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotInitializing\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"VotingPowerProvider_InvalidOperator\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"VotingPowerProvider_InvalidOperatorVault\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"VotingPowerProvider_InvalidSharedVault\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"VotingPowerProvider_InvalidSignature\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"VotingPowerProvider_InvalidToken\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"VotingPowerProvider_InvalidVault\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"VotingPowerProvider_OperatorAlreadyRegistered\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"VotingPowerProvider_OperatorNotRegistered\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"VotingPowerProvider_OperatorVaultAlreadyIsRegistered\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"VotingPowerProvider_OperatorVaultNotRegistered\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"VotingPowerProvider_SharedVaultAlreadyIsRegistered\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"VotingPowerProvider_SharedVaultNotRegistered\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"VotingPowerProvider_TokenAlreadyIsRegistered\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"VotingPowerProvider_TokenNotRegistered\",\"inputs\":[]}]", } ⋮---- // IVotingPowerProviderABI is the input ABI used to generate the binding from. // Deprecated: Use IVotingPowerProviderMetaData.ABI instead. var IVotingPowerProviderABI = IVotingPowerProviderMetaData.ABI ⋮---- // IVotingPowerProvider is an auto generated Go binding around an Ethereum contract. type IVotingPowerProvider struct { IVotingPowerProviderCaller // Read-only binding to the contract IVotingPowerProviderTransactor // Write-only binding to the contract IVotingPowerProviderFilterer // Log filterer for contract events } ⋮---- IVotingPowerProviderCaller // Read-only binding to the contract IVotingPowerProviderTransactor // Write-only binding to the contract IVotingPowerProviderFilterer // Log filterer for contract events ⋮---- // IVotingPowerProviderCaller is an auto generated read-only Go binding around an Ethereum contract. type IVotingPowerProviderCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } ⋮---- contract *bind.BoundContract // Generic contract wrapper for the low level calls ⋮---- // IVotingPowerProviderTransactor is an auto generated write-only Go binding around an Ethereum contract. type IVotingPowerProviderTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } ⋮---- // IVotingPowerProviderFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type IVotingPowerProviderFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } ⋮---- // IVotingPowerProviderSession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type IVotingPowerProviderSession struct { Contract *IVotingPowerProvider // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } ⋮---- Contract *IVotingPowerProvider // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session ⋮---- // IVotingPowerProviderCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type IVotingPowerProviderCallerSession struct { Contract *IVotingPowerProviderCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } ⋮---- Contract *IVotingPowerProviderCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session ⋮---- // IVotingPowerProviderTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type IVotingPowerProviderTransactorSession struct { Contract *IVotingPowerProviderTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } ⋮---- Contract *IVotingPowerProviderTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session ⋮---- // IVotingPowerProviderRaw is an auto generated low-level Go binding around an Ethereum contract. type IVotingPowerProviderRaw struct { Contract *IVotingPowerProvider // Generic contract binding to access the raw methods on } ⋮---- Contract *IVotingPowerProvider // Generic contract binding to access the raw methods on ⋮---- // IVotingPowerProviderCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type IVotingPowerProviderCallerRaw struct { Contract *IVotingPowerProviderCaller // Generic read-only contract binding to access the raw methods on } ⋮---- Contract *IVotingPowerProviderCaller // Generic read-only contract binding to access the raw methods on ⋮---- // IVotingPowerProviderTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type IVotingPowerProviderTransactorRaw struct { Contract *IVotingPowerProviderTransactor // Generic write-only contract binding to access the raw methods on } ⋮---- Contract *IVotingPowerProviderTransactor // Generic write-only contract binding to access the raw methods on ⋮---- // NewIVotingPowerProvider creates a new instance of IVotingPowerProvider, bound to a specific deployed contract. func NewIVotingPowerProvider(address common.Address, backend bind.ContractBackend) (*IVotingPowerProvider, error) ⋮---- // NewIVotingPowerProviderCaller creates a new read-only instance of IVotingPowerProvider, bound to a specific deployed contract. func NewIVotingPowerProviderCaller(address common.Address, caller bind.ContractCaller) (*IVotingPowerProviderCaller, error) ⋮---- // NewIVotingPowerProviderTransactor creates a new write-only instance of IVotingPowerProvider, bound to a specific deployed contract. func NewIVotingPowerProviderTransactor(address common.Address, transactor bind.ContractTransactor) (*IVotingPowerProviderTransactor, error) ⋮---- // NewIVotingPowerProviderFilterer creates a new log filterer instance of IVotingPowerProvider, bound to a specific deployed contract. func NewIVotingPowerProviderFilterer(address common.Address, filterer bind.ContractFilterer) (*IVotingPowerProviderFilterer, error) ⋮---- // bindIVotingPowerProvider binds a generic wrapper to an already deployed contract. func bindIVotingPowerProvider(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) ⋮---- // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_IVotingPowerProvider *IVotingPowerProviderRaw) Call(opts *bind.CallOpts, result *[]interface ⋮---- // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_IVotingPowerProvider *IVotingPowerProviderRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) ⋮---- // Transact invokes the (paid) contract method with params as input values. func (_IVotingPowerProvider *IVotingPowerProviderRaw) Transact(opts *bind.TransactOpts, method string, params ...interface ⋮---- // NETWORK is a free data retrieval call binding the contract method 0x8759e6d1. // // Solidity: function NETWORK() view returns(address) func (_IVotingPowerProvider *IVotingPowerProviderCaller) NETWORK(opts *bind.CallOpts) (common.Address, error) ⋮---- var out []interface{} ⋮---- // OPERATORREGISTRY is a free data retrieval call binding the contract method 0x83ce0322. ⋮---- // Solidity: function OPERATOR_REGISTRY() view returns(address) func (_IVotingPowerProvider *IVotingPowerProviderCaller) OPERATORREGISTRY(opts *bind.CallOpts) (common.Address, error) ⋮---- // SUBNETWORK is a free data retrieval call binding the contract method 0x773e6b54. ⋮---- // Solidity: function SUBNETWORK() view returns(bytes32) func (_IVotingPowerProvider *IVotingPowerProviderCaller) SUBNETWORK(opts *bind.CallOpts) ([32]byte, error) ⋮---- // SUBNETWORKIDENTIFIER is a free data retrieval call binding the contract method 0xabacb807. ⋮---- // Solidity: function SUBNETWORK_IDENTIFIER() view returns(uint96) func (_IVotingPowerProvider *IVotingPowerProviderCaller) SUBNETWORKIDENTIFIER(opts *bind.CallOpts) (*big.Int, error) ⋮---- // VAULTFACTORY is a free data retrieval call binding the contract method 0x103f2907. ⋮---- // Solidity: function VAULT_FACTORY() view returns(address) func (_IVotingPowerProvider *IVotingPowerProviderCaller) VAULTFACTORY(opts *bind.CallOpts) (common.Address, error) ⋮---- // Eip712Domain is a free data retrieval call binding the contract method 0x84b0196e. ⋮---- // Solidity: function eip712Domain() view returns(bytes1 fields, string name, string version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] extensions) func (_IVotingPowerProvider *IVotingPowerProviderCaller) Eip712Domain(opts *bind.CallOpts) (struct ⋮---- // GetOperatorStakes is a free data retrieval call binding the contract method 0x93816a13. ⋮---- // Solidity: function getOperatorStakes(address operator) view returns((address,uint256)[]) func (_IVotingPowerProvider *IVotingPowerProviderCaller) GetOperatorStakes(opts *bind.CallOpts, operator common.Address) ([]IVotingPowerProviderVaultValue, error) ⋮---- // GetOperatorStakesAt is a free data retrieval call binding the contract method 0xa54e116e. ⋮---- // Solidity: function getOperatorStakesAt(address operator, uint48 timestamp) view returns((address,uint256)[]) func (_IVotingPowerProvider *IVotingPowerProviderCaller) GetOperatorStakesAt(opts *bind.CallOpts, operator common.Address, timestamp *big.Int) ([]IVotingPowerProviderVaultValue, error) ⋮---- // GetOperatorVaults is a free data retrieval call binding the contract method 0x14d7e25b. ⋮---- // Solidity: function getOperatorVaults(address operator) view returns(address[]) func (_IVotingPowerProvider *IVotingPowerProviderCaller) GetOperatorVaults(opts *bind.CallOpts, operator common.Address) ([]common.Address, error) ⋮---- // GetOperatorVaultsAt is a free data retrieval call binding the contract method 0x49f993ec. ⋮---- // Solidity: function getOperatorVaultsAt(address operator, uint48 timestamp) view returns(address[]) func (_IVotingPowerProvider *IVotingPowerProviderCaller) GetOperatorVaultsAt(opts *bind.CallOpts, operator common.Address, timestamp *big.Int) ([]common.Address, error) ⋮---- // GetOperatorVotingPowers is a free data retrieval call binding the contract method 0x63ff1140. ⋮---- // Solidity: function getOperatorVotingPowers(address operator, bytes extraData) view returns((address,uint256)[]) func (_IVotingPowerProvider *IVotingPowerProviderCaller) GetOperatorVotingPowers(opts *bind.CallOpts, operator common.Address, extraData []byte) ([]IVotingPowerProviderVaultValue, error) ⋮---- // GetOperatorVotingPowersAt is a free data retrieval call binding the contract method 0x380f9945. ⋮---- // Solidity: function getOperatorVotingPowersAt(address operator, bytes extraData, uint48 timestamp) view returns((address,uint256)[]) func (_IVotingPowerProvider *IVotingPowerProviderCaller) GetOperatorVotingPowersAt(opts *bind.CallOpts, operator common.Address, extraData []byte, timestamp *big.Int) ([]IVotingPowerProviderVaultValue, error) ⋮---- // GetOperators is a free data retrieval call binding the contract method 0x27a099d8. ⋮---- // Solidity: function getOperators() view returns(address[]) func (_IVotingPowerProvider *IVotingPowerProviderCaller) GetOperators(opts *bind.CallOpts) ([]common.Address, error) ⋮---- // GetOperatorsAt is a free data retrieval call binding the contract method 0xa2e33009. ⋮---- // Solidity: function getOperatorsAt(uint48 timestamp) view returns(address[]) func (_IVotingPowerProvider *IVotingPowerProviderCaller) GetOperatorsAt(opts *bind.CallOpts, timestamp *big.Int) ([]common.Address, error) ⋮---- // GetSharedVaults is a free data retrieval call binding the contract method 0xc28474cd. ⋮---- // Solidity: function getSharedVaults() view returns(address[]) func (_IVotingPowerProvider *IVotingPowerProviderCaller) GetSharedVaults(opts *bind.CallOpts) ([]common.Address, error) ⋮---- // GetSharedVaultsAt is a free data retrieval call binding the contract method 0x4a0c7c17. ⋮---- // Solidity: function getSharedVaultsAt(uint48 timestamp) view returns(address[]) func (_IVotingPowerProvider *IVotingPowerProviderCaller) GetSharedVaultsAt(opts *bind.CallOpts, timestamp *big.Int) ([]common.Address, error) ⋮---- // GetSlashingData is a free data retrieval call binding the contract method 0xf7dfb974. ⋮---- // Solidity: function getSlashingData() view returns(bool, uint48) func (_IVotingPowerProvider *IVotingPowerProviderCaller) GetSlashingData(opts *bind.CallOpts) (bool, *big.Int, error) ⋮---- // GetSlashingDataAt is a free data retrieval call binding the contract method 0x7a74c7fd. ⋮---- // Solidity: function getSlashingDataAt(uint48 timestamp, bytes hint) view returns(bool, uint48) func (_IVotingPowerProvider *IVotingPowerProviderCaller) GetSlashingDataAt(opts *bind.CallOpts, timestamp *big.Int, hint []byte) (bool, *big.Int, error) ⋮---- // GetTokens is a free data retrieval call binding the contract method 0xaa6ca808. ⋮---- // Solidity: function getTokens() view returns(address[]) func (_IVotingPowerProvider *IVotingPowerProviderCaller) GetTokens(opts *bind.CallOpts) ([]common.Address, error) ⋮---- // GetTokensAt is a free data retrieval call binding the contract method 0x1796df1b. ⋮---- // Solidity: function getTokensAt(uint48 timestamp) view returns(address[]) func (_IVotingPowerProvider *IVotingPowerProviderCaller) GetTokensAt(opts *bind.CallOpts, timestamp *big.Int) ([]common.Address, error) ⋮---- // GetVotingPowers is a free data retrieval call binding the contract method 0xff7cd71c. ⋮---- // Solidity: function getVotingPowers(bytes[] extraData) view returns((address,(address,uint256)[])[]) func (_IVotingPowerProvider *IVotingPowerProviderCaller) GetVotingPowers(opts *bind.CallOpts, extraData [][]byte) ([]IVotingPowerProviderOperatorVotingPower, error) ⋮---- // GetVotingPowersAt is a free data retrieval call binding the contract method 0x77adea5f. ⋮---- // Solidity: function getVotingPowersAt(bytes[] extraData, uint48 timestamp) view returns((address,(address,uint256)[])[]) func (_IVotingPowerProvider *IVotingPowerProviderCaller) GetVotingPowersAt(opts *bind.CallOpts, extraData [][]byte, timestamp *big.Int) ([]IVotingPowerProviderOperatorVotingPower, error) ⋮---- // HashTypedDataV4 is a free data retrieval call binding the contract method 0x4980f288. ⋮---- // Solidity: function hashTypedDataV4(bytes32 structHash) view returns(bytes32) func (_IVotingPowerProvider *IVotingPowerProviderCaller) HashTypedDataV4(opts *bind.CallOpts, structHash [32]byte) ([32]byte, error) ⋮---- // HashTypedDataV4CrossChain is a free data retrieval call binding the contract method 0x518dcf3b. ⋮---- // Solidity: function hashTypedDataV4CrossChain(bytes32 structHash) view returns(bytes32) func (_IVotingPowerProvider *IVotingPowerProviderCaller) HashTypedDataV4CrossChain(opts *bind.CallOpts, structHash [32]byte) ([32]byte, error) ⋮---- // IsOperatorRegistered is a free data retrieval call binding the contract method 0x6b1906f8. ⋮---- // Solidity: function isOperatorRegistered(address operator) view returns(bool) func (_IVotingPowerProvider *IVotingPowerProviderCaller) IsOperatorRegistered(opts *bind.CallOpts, operator common.Address) (bool, error) ⋮---- // IsOperatorRegisteredAt is a free data retrieval call binding the contract method 0x8a5aef51. ⋮---- // Solidity: function isOperatorRegisteredAt(address operator, uint48 timestamp) view returns(bool) func (_IVotingPowerProvider *IVotingPowerProviderCaller) IsOperatorRegisteredAt(opts *bind.CallOpts, operator common.Address, timestamp *big.Int) (bool, error) ⋮---- // IsOperatorVaultRegistered is a free data retrieval call binding the contract method 0x0f6e0743. ⋮---- // Solidity: function isOperatorVaultRegistered(address vault) view returns(bool) func (_IVotingPowerProvider *IVotingPowerProviderCaller) IsOperatorVaultRegistered(opts *bind.CallOpts, vault common.Address) (bool, error) ⋮---- // IsOperatorVaultRegistered0 is a free data retrieval call binding the contract method 0x669fa8c7. ⋮---- // Solidity: function isOperatorVaultRegistered(address operator, address vault) view returns(bool) func (_IVotingPowerProvider *IVotingPowerProviderCaller) IsOperatorVaultRegistered0(opts *bind.CallOpts, operator common.Address, vault common.Address) (bool, error) ⋮---- // IsOperatorVaultRegisteredAt is a free data retrieval call binding the contract method 0xdae8f803. ⋮---- // Solidity: function isOperatorVaultRegisteredAt(address operator, address vault, uint48 timestamp) view returns(bool) func (_IVotingPowerProvider *IVotingPowerProviderCaller) IsOperatorVaultRegisteredAt(opts *bind.CallOpts, operator common.Address, vault common.Address, timestamp *big.Int) (bool, error) ⋮---- // IsOperatorVaultRegisteredAt0 is a free data retrieval call binding the contract method 0xf6c011de. ⋮---- // Solidity: function isOperatorVaultRegisteredAt(address vault, uint48 timestamp) view returns(bool) func (_IVotingPowerProvider *IVotingPowerProviderCaller) IsOperatorVaultRegisteredAt0(opts *bind.CallOpts, vault common.Address, timestamp *big.Int) (bool, error) ⋮---- // IsSharedVaultRegistered is a free data retrieval call binding the contract method 0x9a1ebee9. ⋮---- // Solidity: function isSharedVaultRegistered(address vault) view returns(bool) func (_IVotingPowerProvider *IVotingPowerProviderCaller) IsSharedVaultRegistered(opts *bind.CallOpts, vault common.Address) (bool, error) ⋮---- // IsSharedVaultRegisteredAt is a free data retrieval call binding the contract method 0xe66e1ed2. ⋮---- // Solidity: function isSharedVaultRegisteredAt(address vault, uint48 timestamp) view returns(bool) func (_IVotingPowerProvider *IVotingPowerProviderCaller) IsSharedVaultRegisteredAt(opts *bind.CallOpts, vault common.Address, timestamp *big.Int) (bool, error) ⋮---- // IsTokenRegistered is a free data retrieval call binding the contract method 0x26aa101f. ⋮---- // Solidity: function isTokenRegistered(address token) view returns(bool) func (_IVotingPowerProvider *IVotingPowerProviderCaller) IsTokenRegistered(opts *bind.CallOpts, token common.Address) (bool, error) ⋮---- // IsTokenRegisteredAt is a free data retrieval call binding the contract method 0x6a496108. ⋮---- // Solidity: function isTokenRegisteredAt(address token, uint48 timestamp) view returns(bool) func (_IVotingPowerProvider *IVotingPowerProviderCaller) IsTokenRegisteredAt(opts *bind.CallOpts, token common.Address, timestamp *big.Int) (bool, error) ⋮---- // Nonces is a free data retrieval call binding the contract method 0x7ecebe00. ⋮---- // Solidity: function nonces(address owner) view returns(uint256) func (_IVotingPowerProvider *IVotingPowerProviderCaller) Nonces(opts *bind.CallOpts, owner common.Address) (*big.Int, error) ⋮---- // StakeToVotingPower is a free data retrieval call binding the contract method 0x039b8dd0. ⋮---- // Solidity: function stakeToVotingPower(address vault, uint256 stake, bytes extraData) view returns(uint256 power) func (_IVotingPowerProvider *IVotingPowerProviderCaller) StakeToVotingPower(opts *bind.CallOpts, vault common.Address, stake *big.Int, extraData []byte) (*big.Int, error) ⋮---- // StakeToVotingPowerAt is a free data retrieval call binding the contract method 0x52936362. ⋮---- // Solidity: function stakeToVotingPowerAt(address vault, uint256 stake, bytes extraData, uint48 timestamp) view returns(uint256 power) func (_IVotingPowerProvider *IVotingPowerProviderCaller) StakeToVotingPowerAt(opts *bind.CallOpts, vault common.Address, stake *big.Int, extraData []byte, timestamp *big.Int) (*big.Int, error) ⋮---- // InvalidateOldSignatures is a paid mutator transaction binding the contract method 0x622e4dba. ⋮---- // Solidity: function invalidateOldSignatures() returns() func (_IVotingPowerProvider *IVotingPowerProviderTransactor) InvalidateOldSignatures(opts *bind.TransactOpts) (*types.Transaction, error) ⋮---- // Multicall is a paid mutator transaction binding the contract method 0xac9650d8. ⋮---- // Solidity: function multicall(bytes[] data) returns(bytes[] results) func (_IVotingPowerProvider *IVotingPowerProviderTransactor) Multicall(opts *bind.TransactOpts, data [][]byte) (*types.Transaction, error) ⋮---- // RegisterOperator is a paid mutator transaction binding the contract method 0x2acde098. ⋮---- // Solidity: function registerOperator() returns() func (_IVotingPowerProvider *IVotingPowerProviderTransactor) RegisterOperator(opts *bind.TransactOpts) (*types.Transaction, error) ⋮---- // RegisterOperatorWithSignature is a paid mutator transaction binding the contract method 0xeb5e940d. ⋮---- // Solidity: function registerOperatorWithSignature(address operator, bytes signature) returns() func (_IVotingPowerProvider *IVotingPowerProviderTransactor) RegisterOperatorWithSignature(opts *bind.TransactOpts, operator common.Address, signature []byte) (*types.Transaction, error) ⋮---- // StaticDelegateCall is a paid mutator transaction binding the contract method 0x9f86fd85. ⋮---- // Solidity: function staticDelegateCall(address target, bytes data) returns() func (_IVotingPowerProvider *IVotingPowerProviderTransactor) StaticDelegateCall(opts *bind.TransactOpts, target common.Address, data []byte) (*types.Transaction, error) ⋮---- // UnregisterOperator is a paid mutator transaction binding the contract method 0xa876b89a. ⋮---- // Solidity: function unregisterOperator() returns() func (_IVotingPowerProvider *IVotingPowerProviderTransactor) UnregisterOperator(opts *bind.TransactOpts) (*types.Transaction, error) ⋮---- // UnregisterOperatorWithSignature is a paid mutator transaction binding the contract method 0xf96d1946. ⋮---- // Solidity: function unregisterOperatorWithSignature(address operator, bytes signature) returns() func (_IVotingPowerProvider *IVotingPowerProviderTransactor) UnregisterOperatorWithSignature(opts *bind.TransactOpts, operator common.Address, signature []byte) (*types.Transaction, error) ⋮---- // IVotingPowerProviderEIP712DomainChangedIterator is returned from FilterEIP712DomainChanged and is used to iterate over the raw logs and unpacked data for EIP712DomainChanged events raised by the IVotingPowerProvider contract. type IVotingPowerProviderEIP712DomainChangedIterator struct { Event *IVotingPowerProviderEIP712DomainChanged // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } ⋮---- Event *IVotingPowerProviderEIP712DomainChanged // Event containing the contract specifics and raw log ⋮---- contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data ⋮---- logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration ⋮---- // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *IVotingPowerProviderEIP712DomainChangedIterator) Next() bool ⋮---- // If the iterator failed, stop iterating ⋮---- // If the iterator completed, deliver directly whatever's available ⋮---- // Iterator still in progress, wait for either a data or an error event ⋮---- // Error returns any retrieval or parsing error occurred during filtering. func (it *IVotingPowerProviderEIP712DomainChangedIterator) Error() error ⋮---- // Close terminates the iteration process, releasing any pending underlying // resources. func (it *IVotingPowerProviderEIP712DomainChangedIterator) Close() error ⋮---- // IVotingPowerProviderEIP712DomainChanged represents a EIP712DomainChanged event raised by the IVotingPowerProvider contract. type IVotingPowerProviderEIP712DomainChanged struct { Raw types.Log // Blockchain specific contextual infos } ⋮---- Raw types.Log // Blockchain specific contextual infos ⋮---- // FilterEIP712DomainChanged is a free log retrieval operation binding the contract event 0x0a6387c9ea3628b88a633bb4f3b151770f70085117a15f9bf3787cda53f13d31. ⋮---- // Solidity: event EIP712DomainChanged() func (_IVotingPowerProvider *IVotingPowerProviderFilterer) FilterEIP712DomainChanged(opts *bind.FilterOpts) (*IVotingPowerProviderEIP712DomainChangedIterator, error) ⋮---- // WatchEIP712DomainChanged is a free log subscription operation binding the contract event 0x0a6387c9ea3628b88a633bb4f3b151770f70085117a15f9bf3787cda53f13d31. ⋮---- func (_IVotingPowerProvider *IVotingPowerProviderFilterer) WatchEIP712DomainChanged(opts *bind.WatchOpts, sink chan<- *IVotingPowerProviderEIP712DomainChanged) (event.Subscription, error) ⋮---- // New log arrived, parse the event and forward to the user ⋮---- // ParseEIP712DomainChanged is a log parse operation binding the contract event 0x0a6387c9ea3628b88a633bb4f3b151770f70085117a15f9bf3787cda53f13d31. ⋮---- func (_IVotingPowerProvider *IVotingPowerProviderFilterer) ParseEIP712DomainChanged(log types.Log) (*IVotingPowerProviderEIP712DomainChanged, error) ⋮---- // IVotingPowerProviderInitEIP712Iterator is returned from FilterInitEIP712 and is used to iterate over the raw logs and unpacked data for InitEIP712 events raised by the IVotingPowerProvider contract. type IVotingPowerProviderInitEIP712Iterator struct { Event *IVotingPowerProviderInitEIP712 // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } ⋮---- Event *IVotingPowerProviderInitEIP712 // Event containing the contract specifics and raw log ⋮---- // IVotingPowerProviderInitEIP712 represents a InitEIP712 event raised by the IVotingPowerProvider contract. type IVotingPowerProviderInitEIP712 struct { Name string Version string Raw types.Log // Blockchain specific contextual infos } ⋮---- Raw types.Log // Blockchain specific contextual infos ⋮---- // FilterInitEIP712 is a free log retrieval operation binding the contract event 0x98790bb3996c909e6f4279ffabdfe70fa6c0d49b8fa04656d6161decfc442e0a. ⋮---- // Solidity: event InitEIP712(string name, string version) func (_IVotingPowerProvider *IVotingPowerProviderFilterer) FilterInitEIP712(opts *bind.FilterOpts) (*IVotingPowerProviderInitEIP712Iterator, error) ⋮---- // WatchInitEIP712 is a free log subscription operation binding the contract event 0x98790bb3996c909e6f4279ffabdfe70fa6c0d49b8fa04656d6161decfc442e0a. ⋮---- func (_IVotingPowerProvider *IVotingPowerProviderFilterer) WatchInitEIP712(opts *bind.WatchOpts, sink chan<- *IVotingPowerProviderInitEIP712) (event.Subscription, error) ⋮---- // ParseInitEIP712 is a log parse operation binding the contract event 0x98790bb3996c909e6f4279ffabdfe70fa6c0d49b8fa04656d6161decfc442e0a. ⋮---- func (_IVotingPowerProvider *IVotingPowerProviderFilterer) ParseInitEIP712(log types.Log) (*IVotingPowerProviderInitEIP712, error) ⋮---- // IVotingPowerProviderInitSubnetworkIterator is returned from FilterInitSubnetwork and is used to iterate over the raw logs and unpacked data for InitSubnetwork events raised by the IVotingPowerProvider contract. type IVotingPowerProviderInitSubnetworkIterator struct { Event *IVotingPowerProviderInitSubnetwork // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } ⋮---- Event *IVotingPowerProviderInitSubnetwork // Event containing the contract specifics and raw log ⋮---- // IVotingPowerProviderInitSubnetwork represents a InitSubnetwork event raised by the IVotingPowerProvider contract. type IVotingPowerProviderInitSubnetwork struct { Network common.Address SubnetworkId *big.Int Raw types.Log // Blockchain specific contextual infos } ⋮---- Raw types.Log // Blockchain specific contextual infos ⋮---- // FilterInitSubnetwork is a free log retrieval operation binding the contract event 0x469c2e982e7d76d34cf5d1e72abee29749bb9971942c180e9023cea09f5f8e83. ⋮---- // Solidity: event InitSubnetwork(address network, uint96 subnetworkId) func (_IVotingPowerProvider *IVotingPowerProviderFilterer) FilterInitSubnetwork(opts *bind.FilterOpts) (*IVotingPowerProviderInitSubnetworkIterator, error) ⋮---- // WatchInitSubnetwork is a free log subscription operation binding the contract event 0x469c2e982e7d76d34cf5d1e72abee29749bb9971942c180e9023cea09f5f8e83. ⋮---- func (_IVotingPowerProvider *IVotingPowerProviderFilterer) WatchInitSubnetwork(opts *bind.WatchOpts, sink chan<- *IVotingPowerProviderInitSubnetwork) (event.Subscription, error) ⋮---- // ParseInitSubnetwork is a log parse operation binding the contract event 0x469c2e982e7d76d34cf5d1e72abee29749bb9971942c180e9023cea09f5f8e83. ⋮---- func (_IVotingPowerProvider *IVotingPowerProviderFilterer) ParseInitSubnetwork(log types.Log) (*IVotingPowerProviderInitSubnetwork, error) ⋮---- // IVotingPowerProviderInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the IVotingPowerProvider contract. type IVotingPowerProviderInitializedIterator struct { Event *IVotingPowerProviderInitialized // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } ⋮---- Event *IVotingPowerProviderInitialized // Event containing the contract specifics and raw log ⋮---- // IVotingPowerProviderInitialized represents a Initialized event raised by the IVotingPowerProvider contract. type IVotingPowerProviderInitialized struct { Version uint64 Raw types.Log // Blockchain specific contextual infos } ⋮---- // FilterInitialized is a free log retrieval operation binding the contract event 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2. ⋮---- // Solidity: event Initialized(uint64 version) func (_IVotingPowerProvider *IVotingPowerProviderFilterer) FilterInitialized(opts *bind.FilterOpts) (*IVotingPowerProviderInitializedIterator, error) ⋮---- // WatchInitialized is a free log subscription operation binding the contract event 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2. ⋮---- func (_IVotingPowerProvider *IVotingPowerProviderFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *IVotingPowerProviderInitialized) (event.Subscription, error) ⋮---- // ParseInitialized is a log parse operation binding the contract event 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2. ⋮---- func (_IVotingPowerProvider *IVotingPowerProviderFilterer) ParseInitialized(log types.Log) (*IVotingPowerProviderInitialized, error) ⋮---- // IVotingPowerProviderRegisterOperatorIterator is returned from FilterRegisterOperator and is used to iterate over the raw logs and unpacked data for RegisterOperator events raised by the IVotingPowerProvider contract. type IVotingPowerProviderRegisterOperatorIterator struct { Event *IVotingPowerProviderRegisterOperator // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } ⋮---- Event *IVotingPowerProviderRegisterOperator // Event containing the contract specifics and raw log ⋮---- // IVotingPowerProviderRegisterOperator represents a RegisterOperator event raised by the IVotingPowerProvider contract. type IVotingPowerProviderRegisterOperator struct { Operator common.Address Raw types.Log // Blockchain specific contextual infos } ⋮---- Raw types.Log // Blockchain specific contextual infos ⋮---- // FilterRegisterOperator is a free log retrieval operation binding the contract event 0xdfd9e0392912bee97777ec588d2ff7ae010ea24202d153a0bff1b30aed643daa. ⋮---- // Solidity: event RegisterOperator(address indexed operator) func (_IVotingPowerProvider *IVotingPowerProviderFilterer) FilterRegisterOperator(opts *bind.FilterOpts, operator []common.Address) (*IVotingPowerProviderRegisterOperatorIterator, error) ⋮---- var operatorRule []interface{} ⋮---- // WatchRegisterOperator is a free log subscription operation binding the contract event 0xdfd9e0392912bee97777ec588d2ff7ae010ea24202d153a0bff1b30aed643daa. ⋮---- func (_IVotingPowerProvider *IVotingPowerProviderFilterer) WatchRegisterOperator(opts *bind.WatchOpts, sink chan<- *IVotingPowerProviderRegisterOperator, operator []common.Address) (event.Subscription, error) ⋮---- // ParseRegisterOperator is a log parse operation binding the contract event 0xdfd9e0392912bee97777ec588d2ff7ae010ea24202d153a0bff1b30aed643daa. ⋮---- func (_IVotingPowerProvider *IVotingPowerProviderFilterer) ParseRegisterOperator(log types.Log) (*IVotingPowerProviderRegisterOperator, error) ⋮---- // IVotingPowerProviderRegisterOperatorVaultIterator is returned from FilterRegisterOperatorVault and is used to iterate over the raw logs and unpacked data for RegisterOperatorVault events raised by the IVotingPowerProvider contract. type IVotingPowerProviderRegisterOperatorVaultIterator struct { Event *IVotingPowerProviderRegisterOperatorVault // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } ⋮---- Event *IVotingPowerProviderRegisterOperatorVault // Event containing the contract specifics and raw log ⋮---- // IVotingPowerProviderRegisterOperatorVault represents a RegisterOperatorVault event raised by the IVotingPowerProvider contract. type IVotingPowerProviderRegisterOperatorVault struct { Operator common.Address Vault common.Address Raw types.Log // Blockchain specific contextual infos } ⋮---- // FilterRegisterOperatorVault is a free log retrieval operation binding the contract event 0x6db8d1ad7903329250db9b7a653d3aa009807c85daa2281a75e063808bceefdc. ⋮---- // Solidity: event RegisterOperatorVault(address indexed operator, address indexed vault) func (_IVotingPowerProvider *IVotingPowerProviderFilterer) FilterRegisterOperatorVault(opts *bind.FilterOpts, operator []common.Address, vault []common.Address) (*IVotingPowerProviderRegisterOperatorVaultIterator, error) ⋮---- var vaultRule []interface{} ⋮---- // WatchRegisterOperatorVault is a free log subscription operation binding the contract event 0x6db8d1ad7903329250db9b7a653d3aa009807c85daa2281a75e063808bceefdc. ⋮---- func (_IVotingPowerProvider *IVotingPowerProviderFilterer) WatchRegisterOperatorVault(opts *bind.WatchOpts, sink chan<- *IVotingPowerProviderRegisterOperatorVault, operator []common.Address, vault []common.Address) (event.Subscription, error) ⋮---- // ParseRegisterOperatorVault is a log parse operation binding the contract event 0x6db8d1ad7903329250db9b7a653d3aa009807c85daa2281a75e063808bceefdc. ⋮---- func (_IVotingPowerProvider *IVotingPowerProviderFilterer) ParseRegisterOperatorVault(log types.Log) (*IVotingPowerProviderRegisterOperatorVault, error) ⋮---- // IVotingPowerProviderRegisterSharedVaultIterator is returned from FilterRegisterSharedVault and is used to iterate over the raw logs and unpacked data for RegisterSharedVault events raised by the IVotingPowerProvider contract. type IVotingPowerProviderRegisterSharedVaultIterator struct { Event *IVotingPowerProviderRegisterSharedVault // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } ⋮---- Event *IVotingPowerProviderRegisterSharedVault // Event containing the contract specifics and raw log ⋮---- // IVotingPowerProviderRegisterSharedVault represents a RegisterSharedVault event raised by the IVotingPowerProvider contract. type IVotingPowerProviderRegisterSharedVault struct { Vault common.Address Raw types.Log // Blockchain specific contextual infos } ⋮---- Raw types.Log // Blockchain specific contextual infos ⋮---- // FilterRegisterSharedVault is a free log retrieval operation binding the contract event 0x99528065e654d6d4b95447d6787148a84b7e98a95e752784e99da056b403b25c. ⋮---- // Solidity: event RegisterSharedVault(address indexed vault) func (_IVotingPowerProvider *IVotingPowerProviderFilterer) FilterRegisterSharedVault(opts *bind.FilterOpts, vault []common.Address) (*IVotingPowerProviderRegisterSharedVaultIterator, error) ⋮---- // WatchRegisterSharedVault is a free log subscription operation binding the contract event 0x99528065e654d6d4b95447d6787148a84b7e98a95e752784e99da056b403b25c. ⋮---- func (_IVotingPowerProvider *IVotingPowerProviderFilterer) WatchRegisterSharedVault(opts *bind.WatchOpts, sink chan<- *IVotingPowerProviderRegisterSharedVault, vault []common.Address) (event.Subscription, error) ⋮---- // ParseRegisterSharedVault is a log parse operation binding the contract event 0x99528065e654d6d4b95447d6787148a84b7e98a95e752784e99da056b403b25c. ⋮---- func (_IVotingPowerProvider *IVotingPowerProviderFilterer) ParseRegisterSharedVault(log types.Log) (*IVotingPowerProviderRegisterSharedVault, error) ⋮---- // IVotingPowerProviderRegisterTokenIterator is returned from FilterRegisterToken and is used to iterate over the raw logs and unpacked data for RegisterToken events raised by the IVotingPowerProvider contract. type IVotingPowerProviderRegisterTokenIterator struct { Event *IVotingPowerProviderRegisterToken // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } ⋮---- Event *IVotingPowerProviderRegisterToken // Event containing the contract specifics and raw log ⋮---- // IVotingPowerProviderRegisterToken represents a RegisterToken event raised by the IVotingPowerProvider contract. type IVotingPowerProviderRegisterToken struct { Token common.Address Raw types.Log // Blockchain specific contextual infos } ⋮---- // FilterRegisterToken is a free log retrieval operation binding the contract event 0xf7fe8023cb2e36bde1d59a88ac5763a8c11be6d25e6819f71bb7e23e5bf0dc16. ⋮---- // Solidity: event RegisterToken(address indexed token) func (_IVotingPowerProvider *IVotingPowerProviderFilterer) FilterRegisterToken(opts *bind.FilterOpts, token []common.Address) (*IVotingPowerProviderRegisterTokenIterator, error) ⋮---- var tokenRule []interface{} ⋮---- // WatchRegisterToken is a free log subscription operation binding the contract event 0xf7fe8023cb2e36bde1d59a88ac5763a8c11be6d25e6819f71bb7e23e5bf0dc16. ⋮---- func (_IVotingPowerProvider *IVotingPowerProviderFilterer) WatchRegisterToken(opts *bind.WatchOpts, sink chan<- *IVotingPowerProviderRegisterToken, token []common.Address) (event.Subscription, error) ⋮---- // ParseRegisterToken is a log parse operation binding the contract event 0xf7fe8023cb2e36bde1d59a88ac5763a8c11be6d25e6819f71bb7e23e5bf0dc16. ⋮---- func (_IVotingPowerProvider *IVotingPowerProviderFilterer) ParseRegisterToken(log types.Log) (*IVotingPowerProviderRegisterToken, error) ⋮---- // IVotingPowerProviderSetSlashingDataIterator is returned from FilterSetSlashingData and is used to iterate over the raw logs and unpacked data for SetSlashingData events raised by the IVotingPowerProvider contract. type IVotingPowerProviderSetSlashingDataIterator struct { Event *IVotingPowerProviderSetSlashingData // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } ⋮---- Event *IVotingPowerProviderSetSlashingData // Event containing the contract specifics and raw log ⋮---- // IVotingPowerProviderSetSlashingData represents a SetSlashingData event raised by the IVotingPowerProvider contract. type IVotingPowerProviderSetSlashingData struct { RequireSlasher bool MinVaultEpochDuration *big.Int Raw types.Log // Blockchain specific contextual infos } ⋮---- Raw types.Log // Blockchain specific contextual infos ⋮---- // FilterSetSlashingData is a free log retrieval operation binding the contract event 0xfa31c1b97ed96532301949e5fd34d2e059500b0de599195245ddf8fbfbb36db0. ⋮---- // Solidity: event SetSlashingData(bool requireSlasher, uint48 minVaultEpochDuration) func (_IVotingPowerProvider *IVotingPowerProviderFilterer) FilterSetSlashingData(opts *bind.FilterOpts) (*IVotingPowerProviderSetSlashingDataIterator, error) ⋮---- // WatchSetSlashingData is a free log subscription operation binding the contract event 0xfa31c1b97ed96532301949e5fd34d2e059500b0de599195245ddf8fbfbb36db0. ⋮---- func (_IVotingPowerProvider *IVotingPowerProviderFilterer) WatchSetSlashingData(opts *bind.WatchOpts, sink chan<- *IVotingPowerProviderSetSlashingData) (event.Subscription, error) ⋮---- // ParseSetSlashingData is a log parse operation binding the contract event 0xfa31c1b97ed96532301949e5fd34d2e059500b0de599195245ddf8fbfbb36db0. ⋮---- func (_IVotingPowerProvider *IVotingPowerProviderFilterer) ParseSetSlashingData(log types.Log) (*IVotingPowerProviderSetSlashingData, error) ⋮---- // IVotingPowerProviderUnregisterOperatorIterator is returned from FilterUnregisterOperator and is used to iterate over the raw logs and unpacked data for UnregisterOperator events raised by the IVotingPowerProvider contract. type IVotingPowerProviderUnregisterOperatorIterator struct { Event *IVotingPowerProviderUnregisterOperator // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } ⋮---- Event *IVotingPowerProviderUnregisterOperator // Event containing the contract specifics and raw log ⋮---- // IVotingPowerProviderUnregisterOperator represents a UnregisterOperator event raised by the IVotingPowerProvider contract. type IVotingPowerProviderUnregisterOperator struct { Operator common.Address Raw types.Log // Blockchain specific contextual infos } ⋮---- // FilterUnregisterOperator is a free log retrieval operation binding the contract event 0xd1b48d1e49885298af5dc8adc7777836ef804b38af88eabf4e079c04ee1538a7. ⋮---- // Solidity: event UnregisterOperator(address indexed operator) func (_IVotingPowerProvider *IVotingPowerProviderFilterer) FilterUnregisterOperator(opts *bind.FilterOpts, operator []common.Address) (*IVotingPowerProviderUnregisterOperatorIterator, error) ⋮---- // WatchUnregisterOperator is a free log subscription operation binding the contract event 0xd1b48d1e49885298af5dc8adc7777836ef804b38af88eabf4e079c04ee1538a7. ⋮---- func (_IVotingPowerProvider *IVotingPowerProviderFilterer) WatchUnregisterOperator(opts *bind.WatchOpts, sink chan<- *IVotingPowerProviderUnregisterOperator, operator []common.Address) (event.Subscription, error) ⋮---- // ParseUnregisterOperator is a log parse operation binding the contract event 0xd1b48d1e49885298af5dc8adc7777836ef804b38af88eabf4e079c04ee1538a7. ⋮---- func (_IVotingPowerProvider *IVotingPowerProviderFilterer) ParseUnregisterOperator(log types.Log) (*IVotingPowerProviderUnregisterOperator, error) ⋮---- // IVotingPowerProviderUnregisterOperatorVaultIterator is returned from FilterUnregisterOperatorVault and is used to iterate over the raw logs and unpacked data for UnregisterOperatorVault events raised by the IVotingPowerProvider contract. type IVotingPowerProviderUnregisterOperatorVaultIterator struct { Event *IVotingPowerProviderUnregisterOperatorVault // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } ⋮---- Event *IVotingPowerProviderUnregisterOperatorVault // Event containing the contract specifics and raw log ⋮---- // IVotingPowerProviderUnregisterOperatorVault represents a UnregisterOperatorVault event raised by the IVotingPowerProvider contract. type IVotingPowerProviderUnregisterOperatorVault struct { Operator common.Address Vault common.Address Raw types.Log // Blockchain specific contextual infos } ⋮---- // FilterUnregisterOperatorVault is a free log retrieval operation binding the contract event 0x3455b6128675eff843703027879cc9b52d6ce684ddc6077cbe0d191ad98b255e. ⋮---- // Solidity: event UnregisterOperatorVault(address indexed operator, address indexed vault) func (_IVotingPowerProvider *IVotingPowerProviderFilterer) FilterUnregisterOperatorVault(opts *bind.FilterOpts, operator []common.Address, vault []common.Address) (*IVotingPowerProviderUnregisterOperatorVaultIterator, error) ⋮---- // WatchUnregisterOperatorVault is a free log subscription operation binding the contract event 0x3455b6128675eff843703027879cc9b52d6ce684ddc6077cbe0d191ad98b255e. ⋮---- func (_IVotingPowerProvider *IVotingPowerProviderFilterer) WatchUnregisterOperatorVault(opts *bind.WatchOpts, sink chan<- *IVotingPowerProviderUnregisterOperatorVault, operator []common.Address, vault []common.Address) (event.Subscription, error) ⋮---- // ParseUnregisterOperatorVault is a log parse operation binding the contract event 0x3455b6128675eff843703027879cc9b52d6ce684ddc6077cbe0d191ad98b255e. ⋮---- func (_IVotingPowerProvider *IVotingPowerProviderFilterer) ParseUnregisterOperatorVault(log types.Log) (*IVotingPowerProviderUnregisterOperatorVault, error) ⋮---- // IVotingPowerProviderUnregisterSharedVaultIterator is returned from FilterUnregisterSharedVault and is used to iterate over the raw logs and unpacked data for UnregisterSharedVault events raised by the IVotingPowerProvider contract. type IVotingPowerProviderUnregisterSharedVaultIterator struct { Event *IVotingPowerProviderUnregisterSharedVault // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } ⋮---- Event *IVotingPowerProviderUnregisterSharedVault // Event containing the contract specifics and raw log ⋮---- // IVotingPowerProviderUnregisterSharedVault represents a UnregisterSharedVault event raised by the IVotingPowerProvider contract. type IVotingPowerProviderUnregisterSharedVault struct { Vault common.Address Raw types.Log // Blockchain specific contextual infos } ⋮---- // FilterUnregisterSharedVault is a free log retrieval operation binding the contract event 0xead83f8482d0fa5de2b5c28fb39ee288392076d150db7020e10a92954aea82ee. ⋮---- // Solidity: event UnregisterSharedVault(address indexed vault) func (_IVotingPowerProvider *IVotingPowerProviderFilterer) FilterUnregisterSharedVault(opts *bind.FilterOpts, vault []common.Address) (*IVotingPowerProviderUnregisterSharedVaultIterator, error) ⋮---- // WatchUnregisterSharedVault is a free log subscription operation binding the contract event 0xead83f8482d0fa5de2b5c28fb39ee288392076d150db7020e10a92954aea82ee. ⋮---- func (_IVotingPowerProvider *IVotingPowerProviderFilterer) WatchUnregisterSharedVault(opts *bind.WatchOpts, sink chan<- *IVotingPowerProviderUnregisterSharedVault, vault []common.Address) (event.Subscription, error) ⋮---- // ParseUnregisterSharedVault is a log parse operation binding the contract event 0xead83f8482d0fa5de2b5c28fb39ee288392076d150db7020e10a92954aea82ee. ⋮---- func (_IVotingPowerProvider *IVotingPowerProviderFilterer) ParseUnregisterSharedVault(log types.Log) (*IVotingPowerProviderUnregisterSharedVault, error) ⋮---- // IVotingPowerProviderUnregisterTokenIterator is returned from FilterUnregisterToken and is used to iterate over the raw logs and unpacked data for UnregisterToken events raised by the IVotingPowerProvider contract. type IVotingPowerProviderUnregisterTokenIterator struct { Event *IVotingPowerProviderUnregisterToken // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } ⋮---- Event *IVotingPowerProviderUnregisterToken // Event containing the contract specifics and raw log ⋮---- // IVotingPowerProviderUnregisterToken represents a UnregisterToken event raised by the IVotingPowerProvider contract. type IVotingPowerProviderUnregisterToken struct { Token common.Address Raw types.Log // Blockchain specific contextual infos } ⋮---- // FilterUnregisterToken is a free log retrieval operation binding the contract event 0xca2a890939276223a9122217752c67608466faee388aff53f077d00a186a389b. ⋮---- // Solidity: event UnregisterToken(address indexed token) func (_IVotingPowerProvider *IVotingPowerProviderFilterer) FilterUnregisterToken(opts *bind.FilterOpts, token []common.Address) (*IVotingPowerProviderUnregisterTokenIterator, error) ⋮---- // WatchUnregisterToken is a free log subscription operation binding the contract event 0xca2a890939276223a9122217752c67608466faee388aff53f077d00a186a389b. ⋮---- func (_IVotingPowerProvider *IVotingPowerProviderFilterer) WatchUnregisterToken(opts *bind.WatchOpts, sink chan<- *IVotingPowerProviderUnregisterToken, token []common.Address) (event.Subscription, error) ⋮---- // ParseUnregisterToken is a log parse operation binding the contract event 0xca2a890939276223a9122217752c67608466faee388aff53f077d00a186a389b. ⋮---- func (_IVotingPowerProvider *IVotingPowerProviderFilterer) ParseUnregisterToken(log types.Log) (*IVotingPowerProviderUnregisterToken, error) ```` ## File: symbiotic/client/evm/mocks/eth.go ````go // Code generated by MockGen. DO NOT EDIT. // Source: github.com/symbioticfi/relay/symbiotic/client/evm (interfaces: IEvmClient,conn,metrics,keyProvider,driverContract) // // Generated by this command: ⋮---- // mockgen -destination=mocks/eth.go -package=mocks github.com/symbioticfi/relay/symbiotic/client/evm IEvmClient,conn,metrics,keyProvider,driverContract ⋮---- // Package mocks is a generated GoMock package. package mocks ⋮---- import ( context "context" big "math/big" reflect "reflect" time "time" ethereum "github.com/ethereum/go-ethereum" bind "github.com/ethereum/go-ethereum/accounts/abi/bind" common "github.com/ethereum/go-ethereum/common" types "github.com/ethereum/go-ethereum/core/types" gen "github.com/symbioticfi/relay/symbiotic/client/evm/gen" entity "github.com/symbioticfi/relay/symbiotic/entity" crypto "github.com/symbioticfi/relay/symbiotic/usecase/crypto" gomock "go.uber.org/mock/gomock" ) ⋮---- context "context" big "math/big" reflect "reflect" time "time" ⋮---- ethereum "github.com/ethereum/go-ethereum" bind "github.com/ethereum/go-ethereum/accounts/abi/bind" common "github.com/ethereum/go-ethereum/common" types "github.com/ethereum/go-ethereum/core/types" gen "github.com/symbioticfi/relay/symbiotic/client/evm/gen" entity "github.com/symbioticfi/relay/symbiotic/entity" crypto "github.com/symbioticfi/relay/symbiotic/usecase/crypto" gomock "go.uber.org/mock/gomock" ⋮---- // MockIEvmClient is a mock of IEvmClient interface. type MockIEvmClient struct { ctrl *gomock.Controller recorder *MockIEvmClientMockRecorder isgomock struct{} ⋮---- // MockIEvmClientMockRecorder is the mock recorder for MockIEvmClient. type MockIEvmClientMockRecorder struct { mock *MockIEvmClient } ⋮---- // NewMockIEvmClient creates a new mock instance. func NewMockIEvmClient(ctrl *gomock.Controller) *MockIEvmClient ⋮---- // EXPECT returns an object that allows the caller to indicate expected use. func (m *MockIEvmClient) EXPECT() *MockIEvmClientMockRecorder ⋮---- // CommitValsetHeader mocks base method. func (m *MockIEvmClient) CommitValsetHeader(ctx context.Context, addr entity.CrossChainAddress, header entity.ValidatorSetHeader, extraData []entity.ExtraData, proof []byte) (entity.TxResult, error) ⋮---- // CommitValsetHeader indicates an expected call of CommitValsetHeader. ⋮---- // GetCaptureTimestampFromValsetHeaderAt mocks base method. func (m *MockIEvmClient) GetCaptureTimestampFromValsetHeaderAt(ctx context.Context, addr entity.CrossChainAddress, epoch entity.Epoch) (uint64, error) ⋮---- // GetCaptureTimestampFromValsetHeaderAt indicates an expected call of GetCaptureTimestampFromValsetHeaderAt. ⋮---- // GetChains mocks base method. func (m *MockIEvmClient) GetChains() []uint64 ⋮---- // GetChains indicates an expected call of GetChains. ⋮---- // GetConfig mocks base method. func (m *MockIEvmClient) GetConfig(ctx context.Context, timestamp entity.Timestamp, epoch entity.Epoch) (entity.NetworkConfig, error) ⋮---- // GetConfig indicates an expected call of GetConfig. ⋮---- // GetCurrentEpoch mocks base method. func (m *MockIEvmClient) GetCurrentEpoch(ctx context.Context) (entity.Epoch, error) ⋮---- // GetCurrentEpoch indicates an expected call of GetCurrentEpoch. ⋮---- // GetCurrentEpochDuration mocks base method. func (m *MockIEvmClient) GetCurrentEpochDuration(ctx context.Context) (uint64, error) ⋮---- // GetCurrentEpochDuration indicates an expected call of GetCurrentEpochDuration. ⋮---- // GetEip712Domain mocks base method. func (m *MockIEvmClient) GetEip712Domain(ctx context.Context, addr entity.CrossChainAddress) (entity.Eip712Domain, error) ⋮---- // GetEip712Domain indicates an expected call of GetEip712Domain. ⋮---- // GetEpochDuration mocks base method. func (m *MockIEvmClient) GetEpochDuration(ctx context.Context, epoch entity.Epoch) (uint64, error) ⋮---- // GetEpochDuration indicates an expected call of GetEpochDuration. ⋮---- // GetEpochStart mocks base method. func (m *MockIEvmClient) GetEpochStart(ctx context.Context, epoch entity.Epoch) (entity.Timestamp, error) ⋮---- // GetEpochStart indicates an expected call of GetEpochStart. ⋮---- // GetHeaderHash mocks base method. func (m *MockIEvmClient) GetHeaderHash(ctx context.Context, addr entity.CrossChainAddress) (common.Hash, error) ⋮---- // GetHeaderHash indicates an expected call of GetHeaderHash. ⋮---- // GetHeaderHashAt mocks base method. func (m *MockIEvmClient) GetHeaderHashAt(ctx context.Context, addr entity.CrossChainAddress, epoch entity.Epoch) (common.Hash, error) ⋮---- // GetHeaderHashAt indicates an expected call of GetHeaderHashAt. ⋮---- // GetKeys mocks base method. func (m *MockIEvmClient) GetKeys(ctx context.Context, address entity.CrossChainAddress, timestamp entity.Timestamp) ([]entity.OperatorWithKeys, error) ⋮---- // GetKeys indicates an expected call of GetKeys. ⋮---- // GetLastCommittedHeaderEpoch mocks base method. func (m *MockIEvmClient) GetLastCommittedHeaderEpoch(ctx context.Context, addr entity.CrossChainAddress, evmOptions ...entity.EVMOption) (entity.Epoch, error) ⋮---- // GetLastCommittedHeaderEpoch indicates an expected call of GetLastCommittedHeaderEpoch. ⋮---- // GetNetworkAddress mocks base method. func (m *MockIEvmClient) GetNetworkAddress(ctx context.Context) (common.Address, error) ⋮---- // GetNetworkAddress indicates an expected call of GetNetworkAddress. ⋮---- // GetOperatorNonce mocks base method. func (m *MockIEvmClient) GetOperatorNonce(ctx context.Context, votingPowerProvider entity.CrossChainAddress, operator common.Address) (*big.Int, error) ⋮---- // GetOperatorNonce indicates an expected call of GetOperatorNonce. ⋮---- // GetSubnetwork mocks base method. func (m *MockIEvmClient) GetSubnetwork(ctx context.Context) (common.Hash, error) ⋮---- // GetSubnetwork indicates an expected call of GetSubnetwork. ⋮---- // GetValSetHeader mocks base method. func (m *MockIEvmClient) GetValSetHeader(ctx context.Context, addr entity.CrossChainAddress) (entity.ValidatorSetHeader, error) ⋮---- // GetValSetHeader indicates an expected call of GetValSetHeader. ⋮---- // GetValSetHeaderAt mocks base method. func (m *MockIEvmClient) GetValSetHeaderAt(ctx context.Context, addr entity.CrossChainAddress, epoch entity.Epoch) (entity.ValidatorSetHeader, error) ⋮---- // GetValSetHeaderAt indicates an expected call of GetValSetHeaderAt. ⋮---- // GetVotingPowerProviderEip712Domain mocks base method. func (m *MockIEvmClient) GetVotingPowerProviderEip712Domain(ctx context.Context, addr entity.CrossChainAddress) (entity.Eip712Domain, error) ⋮---- // GetVotingPowerProviderEip712Domain indicates an expected call of GetVotingPowerProviderEip712Domain. ⋮---- // GetVotingPowers mocks base method. func (m *MockIEvmClient) GetVotingPowers(ctx context.Context, address entity.CrossChainAddress, timestamp entity.Timestamp) ([]entity.OperatorVotingPower, error) ⋮---- // GetVotingPowers indicates an expected call of GetVotingPowers. ⋮---- // InvalidateOldSignatures mocks base method. func (m *MockIEvmClient) InvalidateOldSignatures(ctx context.Context, addr entity.CrossChainAddress) (entity.TxResult, error) ⋮---- // InvalidateOldSignatures indicates an expected call of InvalidateOldSignatures. ⋮---- // IsValsetHeaderCommittedAt mocks base method. func (m *MockIEvmClient) IsValsetHeaderCommittedAt(ctx context.Context, addr entity.CrossChainAddress, epoch entity.Epoch, opts ...entity.EVMOption) (bool, error) ⋮---- // IsValsetHeaderCommittedAt indicates an expected call of IsValsetHeaderCommittedAt. ⋮---- // IsValsetHeaderCommittedAtEpochs mocks base method. func (m *MockIEvmClient) IsValsetHeaderCommittedAtEpochs(ctx context.Context, addr entity.CrossChainAddress, epochs []entity.Epoch) ([]bool, error) ⋮---- // IsValsetHeaderCommittedAtEpochs indicates an expected call of IsValsetHeaderCommittedAtEpochs. ⋮---- // RegisterKey mocks base method. func (m *MockIEvmClient) RegisterKey(ctx context.Context, addr entity.CrossChainAddress, keyTag entity.KeyTag, key entity.CompactPublicKey, signature entity.RawSignature, extraData []byte) (entity.TxResult, error) ⋮---- // RegisterKey indicates an expected call of RegisterKey. ⋮---- // RegisterOperator mocks base method. func (m *MockIEvmClient) RegisterOperator(ctx context.Context, addr entity.CrossChainAddress) (entity.TxResult, error) ⋮---- // RegisterOperator indicates an expected call of RegisterOperator. ⋮---- // RegisterOperatorVotingPowerProvider mocks base method. func (m *MockIEvmClient) RegisterOperatorVotingPowerProvider(ctx context.Context, addr entity.CrossChainAddress) (entity.TxResult, error) ⋮---- // RegisterOperatorVotingPowerProvider indicates an expected call of RegisterOperatorVotingPowerProvider. ⋮---- // SetGenesis mocks base method. func (m *MockIEvmClient) SetGenesis(ctx context.Context, addr entity.CrossChainAddress, header entity.ValidatorSetHeader, extraData []entity.ExtraData) (entity.TxResult, error) ⋮---- // SetGenesis indicates an expected call of SetGenesis. ⋮---- // UnregisterOperatorVotingPowerProvider mocks base method. func (m *MockIEvmClient) UnregisterOperatorVotingPowerProvider(ctx context.Context, addr entity.CrossChainAddress) (entity.TxResult, error) ⋮---- // UnregisterOperatorVotingPowerProvider indicates an expected call of UnregisterOperatorVotingPowerProvider. ⋮---- // VerifyQuorumSig mocks base method. func (m *MockIEvmClient) VerifyQuorumSig(ctx context.Context, addr entity.CrossChainAddress, epoch entity.Epoch, message []byte, keyTag entity.KeyTag, threshold *big.Int, proof []byte) (bool, error) ⋮---- // VerifyQuorumSig indicates an expected call of VerifyQuorumSig. ⋮---- // Mockconn is a mock of conn interface. type Mockconn struct { ctrl *gomock.Controller recorder *MockconnMockRecorder isgomock struct{} ⋮---- // MockconnMockRecorder is the mock recorder for Mockconn. type MockconnMockRecorder struct { mock *Mockconn } ⋮---- // NewMockconn creates a new mock instance. func NewMockconn(ctrl *gomock.Controller) *Mockconn ⋮---- // CallContract mocks base method. func (m *Mockconn) CallContract(ctx context.Context, call ethereum.CallMsg, blockNumber *big.Int) ([]byte, error) ⋮---- // CallContract indicates an expected call of CallContract. ⋮---- // CodeAt mocks base method. func (m *Mockconn) CodeAt(ctx context.Context, contract common.Address, blockNumber *big.Int) ([]byte, error) ⋮---- // CodeAt indicates an expected call of CodeAt. ⋮---- // EstimateGas mocks base method. func (m *Mockconn) EstimateGas(ctx context.Context, call ethereum.CallMsg) (uint64, error) ⋮---- // EstimateGas indicates an expected call of EstimateGas. ⋮---- // FilterLogs mocks base method. func (m *Mockconn) FilterLogs(ctx context.Context, q ethereum.FilterQuery) ([]types.Log, error) ⋮---- // FilterLogs indicates an expected call of FilterLogs. ⋮---- // HeaderByNumber mocks base method. func (m *Mockconn) HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error) ⋮---- // HeaderByNumber indicates an expected call of HeaderByNumber. ⋮---- // PendingCodeAt mocks base method. func (m *Mockconn) PendingCodeAt(ctx context.Context, account common.Address) ([]byte, error) ⋮---- // PendingCodeAt indicates an expected call of PendingCodeAt. ⋮---- // PendingNonceAt mocks base method. func (m *Mockconn) PendingNonceAt(ctx context.Context, account common.Address) (uint64, error) ⋮---- // PendingNonceAt indicates an expected call of PendingNonceAt. ⋮---- // SendTransaction mocks base method. func (m *Mockconn) SendTransaction(ctx context.Context, tx *types.Transaction) error ⋮---- // SendTransaction indicates an expected call of SendTransaction. ⋮---- // SubscribeFilterLogs mocks base method. func (m *Mockconn) SubscribeFilterLogs(ctx context.Context, q ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error) ⋮---- // SubscribeFilterLogs indicates an expected call of SubscribeFilterLogs. ⋮---- // SuggestGasPrice mocks base method. func (m *Mockconn) SuggestGasPrice(ctx context.Context) (*big.Int, error) ⋮---- // SuggestGasPrice indicates an expected call of SuggestGasPrice. ⋮---- // SuggestGasTipCap mocks base method. func (m *Mockconn) SuggestGasTipCap(ctx context.Context) (*big.Int, error) ⋮---- // SuggestGasTipCap indicates an expected call of SuggestGasTipCap. ⋮---- // TransactionReceipt mocks base method. func (m *Mockconn) TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error) ⋮---- // TransactionReceipt indicates an expected call of TransactionReceipt. ⋮---- // Mockmetrics is a mock of metrics interface. type Mockmetrics struct { ctrl *gomock.Controller recorder *MockmetricsMockRecorder isgomock struct{} ⋮---- // MockmetricsMockRecorder is the mock recorder for Mockmetrics. type MockmetricsMockRecorder struct { mock *Mockmetrics } ⋮---- // NewMockmetrics creates a new mock instance. func NewMockmetrics(ctrl *gomock.Controller) *Mockmetrics ⋮---- // ObserveCommitValsetHeaderParams mocks base method. func (m *Mockmetrics) ObserveCommitValsetHeaderParams(chainID, gasUsed uint64, effectiveGasPrice *big.Int) ⋮---- // ObserveCommitValsetHeaderParams indicates an expected call of ObserveCommitValsetHeaderParams. ⋮---- // ObserveEVMMethodCall mocks base method. func (m *Mockmetrics) ObserveEVMMethodCall(method string, chainID uint64, status string, d time.Duration) ⋮---- // ObserveEVMMethodCall indicates an expected call of ObserveEVMMethodCall. ⋮---- // MockkeyProvider is a mock of keyProvider interface. type MockkeyProvider struct { ctrl *gomock.Controller recorder *MockkeyProviderMockRecorder isgomock struct{} ⋮---- // MockkeyProviderMockRecorder is the mock recorder for MockkeyProvider. type MockkeyProviderMockRecorder struct { mock *MockkeyProvider } ⋮---- // NewMockkeyProvider creates a new mock instance. func NewMockkeyProvider(ctrl *gomock.Controller) *MockkeyProvider ⋮---- // GetPrivateKeyByNamespaceTypeId mocks base method. func (m *MockkeyProvider) GetPrivateKeyByNamespaceTypeId(namespace string, keyType entity.KeyType, id int) (crypto.PrivateKey, error) ⋮---- // GetPrivateKeyByNamespaceTypeId indicates an expected call of GetPrivateKeyByNamespaceTypeId. ⋮---- // MockdriverContract is a mock of driverContract interface. type MockdriverContract struct { ctrl *gomock.Controller recorder *MockdriverContractMockRecorder isgomock struct{} ⋮---- // MockdriverContractMockRecorder is the mock recorder for MockdriverContract. type MockdriverContractMockRecorder struct { mock *MockdriverContract } ⋮---- // NewMockdriverContract creates a new mock instance. func NewMockdriverContract(ctrl *gomock.Controller) *MockdriverContract ⋮---- // GetConfigAt mocks base method. func (m *MockdriverContract) GetConfigAt(opts *bind.CallOpts, timestamp *big.Int) (gen.IValSetDriverConfig, error) ⋮---- // GetConfigAt indicates an expected call of GetConfigAt. ⋮---- // NETWORK mocks base method. func (m *MockdriverContract) NETWORK(opts *bind.CallOpts) (common.Address, error) ⋮---- // NETWORK indicates an expected call of NETWORK. ⋮---- // SUBNETWORK mocks base method. func (m *MockdriverContract) SUBNETWORK(opts *bind.CallOpts) ([32]byte, error) ⋮---- // SUBNETWORK indicates an expected call of SUBNETWORK. ```` ## File: symbiotic/client/evm/eth_commit_valset_test.go ````go package evm ⋮---- import ( "context" "crypto/ecdsa" "math/big" "testing" "time" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/go-errors/errors" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" "github.com/symbioticfi/relay/symbiotic/client/evm/mocks" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" "crypto/ecdsa" "math/big" "testing" "time" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/go-errors/errors" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" ⋮---- "github.com/symbioticfi/relay/symbiotic/client/evm/mocks" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- type mockPrivateKey struct { key *ecdsa.PrivateKey } ⋮---- func (m *mockPrivateKey) Bytes() []byte ⋮---- func (m *mockPrivateKey) Sign(msg []byte) (symbiotic.RawSignature, symbiotic.MessageHash, error) ⋮---- func (m *mockPrivateKey) PublicKey() symbiotic.PublicKey ⋮---- func TestCommitValsetHeader_NoSettlementContract_ReturnsError(t *testing.T) ⋮---- func TestCommitValsetHeader_KeyProviderFails_ReturnsError(t *testing.T) ⋮---- func TestCommitValsetHeader_InvalidECDSAKey_ReturnsError(t *testing.T) ⋮---- func TestCommitValsetHeader_ContextTimeout_ReturnsError(t *testing.T) ⋮---- func TestCommitValsetHeader_InvalidChainID_ReturnsError(t *testing.T) ⋮---- func TestCommitValsetHeader_EmptyProof_HandlesCorrectly(t *testing.T) ⋮---- func TestCommitValsetHeader_EmptyExtraData_HandlesCorrectly(t *testing.T) ⋮---- func TestCommitValsetHeader_PartialHappyPath_ValidatesDataPreparation(t *testing.T) ```` ## File: symbiotic/client/evm/eth_commit_valset.go ````go package evm ⋮---- import ( "context" "log/slog" "math/big" "time" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" "github.com/go-errors/errors" keyprovider "github.com/symbioticfi/relay/internal/usecase/key-provider" "github.com/symbioticfi/relay/symbiotic/client/evm/gen" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" "log/slog" "math/big" "time" ⋮---- "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" "github.com/go-errors/errors" ⋮---- keyprovider "github.com/symbioticfi/relay/internal/usecase/key-provider" "github.com/symbioticfi/relay/symbiotic/client/evm/gen" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- func (e *Client) CommitValsetHeader( ctx context.Context, addr symbiotic.CrossChainAddress, header symbiotic.ValidatorSetHeader, extraData []symbiotic.ExtraData, proof []byte, ) (_ symbiotic.TxResult, err error) ```` ## File: symbiotic/client/evm/eth_operator_test.go ````go package evm ⋮---- import ( "context" "testing" "time" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/go-errors/errors" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" "github.com/symbioticfi/relay/symbiotic/client/evm/mocks" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" "testing" "time" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/go-errors/errors" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" ⋮---- "github.com/symbioticfi/relay/symbiotic/client/evm/mocks" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- func TestRegisterOperator_KeyProviderFails_ReturnsError(t *testing.T) ⋮---- func TestRegisterOperator_InvalidECDSAKey_ReturnsError(t *testing.T) ⋮---- func TestRegisterOperator_ContextTimeout_ReturnsError(t *testing.T) ⋮---- func TestRegisterOperator_NoOperatorRegistry_ReturnsError(t *testing.T) ⋮---- func TestRegisterKey_KeyProviderFails_ReturnsError(t *testing.T) ⋮---- func TestRegisterKey_InvalidECDSAKey_ReturnsError(t *testing.T) ⋮---- func TestRegisterKey_NoKeyRegistry_ReturnsError(t *testing.T) ⋮---- func TestRegisterKey_EmptyExtraData_HandlesCorrectly(t *testing.T) ⋮---- func TestRegisterOperatorVotingPowerProvider_KeyProviderFails_ReturnsError(t *testing.T) ⋮---- func TestRegisterOperatorVotingPowerProvider_InvalidECDSAKey_ReturnsError(t *testing.T) ⋮---- func TestRegisterOperatorVotingPowerProvider_NoVotingPowerProvider_ReturnsError(t *testing.T) ⋮---- func TestUnregisterOperatorVotingPowerProvider_KeyProviderFails_ReturnsError(t *testing.T) ⋮---- func TestUnregisterOperatorVotingPowerProvider_InvalidECDSAKey_ReturnsError(t *testing.T) ⋮---- func TestUnregisterOperatorVotingPowerProvider_NoVotingPowerProvider_ReturnsError(t *testing.T) ⋮---- func TestRegisterOperator_PartialHappyPath_ValidatesDataPreparation(t *testing.T) ⋮---- func TestInvalidateOldSignatures_KeyProviderFails_ReturnsError(t *testing.T) ⋮---- func TestInvalidateOldSignatures_InvalidECDSAKey_ReturnsError(t *testing.T) ⋮---- func TestInvalidateOldSignatures_NoVotingPowerProvider_ReturnsError(t *testing.T) ```` ## File: symbiotic/client/evm/eth_operator.go ````go package evm ⋮---- import ( "context" "math/big" "time" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" "github.com/go-errors/errors" keyprovider "github.com/symbioticfi/relay/internal/usecase/key-provider" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" "math/big" "time" ⋮---- "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" "github.com/go-errors/errors" ⋮---- keyprovider "github.com/symbioticfi/relay/internal/usecase/key-provider" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- func (e *Client) RegisterOperator( ctx context.Context, addr symbiotic.CrossChainAddress, ) (_ symbiotic.TxResult, err error) ⋮---- func (e *Client) RegisterKey( ctx context.Context, addr symbiotic.CrossChainAddress, keyTag symbiotic.KeyTag, key symbiotic.CompactPublicKey, signature symbiotic.RawSignature, extraData []byte, ) (_ symbiotic.TxResult, err error) ⋮---- func (e *Client) InvalidateOldSignatures( ctx context.Context, addr symbiotic.CrossChainAddress, ) (_ symbiotic.TxResult, err error) ⋮---- func (e *Client) RegisterOperatorVotingPowerProvider( ctx context.Context, addr symbiotic.CrossChainAddress, ) (_ symbiotic.TxResult, err error) ⋮---- func (e *Client) UnregisterOperatorVotingPowerProvider( ctx context.Context, addr symbiotic.CrossChainAddress, ) (_ symbiotic.TxResult, err error) ```` ## File: symbiotic/client/evm/eth_set_genesis_test.go ````go package evm ⋮---- import ( "context" "math/big" "testing" "time" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/go-errors/errors" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" "github.com/symbioticfi/relay/symbiotic/client/evm/mocks" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" "math/big" "testing" "time" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/go-errors/errors" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" ⋮---- "github.com/symbioticfi/relay/symbiotic/client/evm/mocks" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- func TestSetGenesis_NoSettlementContract_ReturnsError(t *testing.T) ⋮---- func TestSetGenesis_KeyProviderFails_ReturnsError(t *testing.T) ⋮---- func TestSetGenesis_InvalidECDSAKey_ReturnsError(t *testing.T) ⋮---- func TestSetGenesis_ContextTimeout_ReturnsError(t *testing.T) ⋮---- func TestSetGenesis_InvalidChainID_ReturnsError(t *testing.T) ⋮---- func TestSetGenesis_EmptyExtraData_HandlesCorrectly(t *testing.T) ⋮---- func TestSetGenesis_NilExtraData_HandlesCorrectly(t *testing.T) ⋮---- func TestSetGenesis_PartialHappyPath_ValidatesDataPreparation(t *testing.T) ```` ## File: symbiotic/client/evm/eth_set_genesis.go ````go package evm ⋮---- import ( "context" "math/big" "time" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" "github.com/go-errors/errors" keyprovider "github.com/symbioticfi/relay/internal/usecase/key-provider" "github.com/symbioticfi/relay/symbiotic/client/evm/gen" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" "math/big" "time" ⋮---- "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" "github.com/go-errors/errors" ⋮---- keyprovider "github.com/symbioticfi/relay/internal/usecase/key-provider" "github.com/symbioticfi/relay/symbiotic/client/evm/gen" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- func (e *Client) SetGenesis( ctx context.Context, addr symbiotic.CrossChainAddress, header symbiotic.ValidatorSetHeader, extraData []symbiotic.ExtraData, ) (_ symbiotic.TxResult, err error) ```` ## File: symbiotic/client/evm/eth_test.go ````go package evm ⋮---- import ( "context" "errors" "math/big" "testing" "time" "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" "github.com/symbioticfi/relay/symbiotic/client/evm/gen" "github.com/symbioticfi/relay/symbiotic/client/evm/mocks" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" "errors" "math/big" "testing" "time" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" ⋮---- "github.com/symbioticfi/relay/symbiotic/client/evm/gen" "github.com/symbioticfi/relay/symbiotic/client/evm/mocks" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- func TestGetChains_WithMultipleChains_ReturnsAllChainIDs(t *testing.T) ⋮---- func TestGetChains_WithNoChains_ReturnsEmptySlice(t *testing.T) ⋮---- func TestGetChains_WithSingleChain_ReturnsSingleChainID(t *testing.T) ⋮---- func TestObserveMetrics_WithMetricsEnabled_CallsObserveEVMMethodCall(t *testing.T) ⋮---- func TestObserveMetrics_WithError_CallsWithErrorStatus(t *testing.T) ⋮---- func TestObserveMetrics_WithNilMetrics_DoesNotPanic(t *testing.T) ⋮---- func TestIsValsetHeaderCommittedAt_NoConnection_ReturnsError(t *testing.T) ⋮---- func TestGetHeaderHash_NoConnection_ReturnsError(t *testing.T) ⋮---- func TestGetHeaderHashAt_NoConnection_ReturnsError(t *testing.T) ⋮---- func TestGetLastCommittedHeaderEpoch_NoConnection_ReturnsError(t *testing.T) ⋮---- func TestGetCaptureTimestampFromValsetHeaderAt_NoConnection_ReturnsError(t *testing.T) ⋮---- func TestGetValSetHeaderAt_NoConnection_ReturnsError(t *testing.T) ⋮---- func TestGetValSetHeader_NoConnection_ReturnsError(t *testing.T) ⋮---- func TestGetEip712Domain_NoConnection_ReturnsError(t *testing.T) ⋮---- func TestGetVotingPowerProviderEip712Domain_NoConnection_ReturnsError(t *testing.T) ⋮---- func TestGetOperatorNonce_NoConnection_ReturnsError(t *testing.T) ⋮---- func TestGetVotingPowers_MulticallCheckFails_ReturnsError(t *testing.T) ⋮---- func TestGetOperators_NoConnection_ReturnsError(t *testing.T) ⋮---- func TestGetKeysOperators_NoConnection_ReturnsError(t *testing.T) ⋮---- func TestGetKeys_MulticallCheckFails_ReturnsError(t *testing.T) ⋮---- func TestIsValsetHeaderCommittedAtEpochs_MulticallCheckFails_ReturnsError(t *testing.T) ⋮---- func TestGetSubnetwork_Success_ReturnsSubnetworkHash(t *testing.T) ⋮---- func TestGetSubnetwork_DriverError_ReturnsError(t *testing.T) ⋮---- func TestGetNetworkAddress_Success_ReturnsNetworkAddress(t *testing.T) ⋮---- func TestGetNetworkAddress_DriverError_ReturnsError(t *testing.T) ⋮---- func TestFormatEVMContractError_WithNonJSONError_ReturnsOriginalError(t *testing.T) ⋮---- func TestGetVotingPowers_WithNoMulticall_ReturnsError(t *testing.T) ⋮---- func TestGetKeys_WithNoMulticall_ReturnsError(t *testing.T) ⋮---- func TestGetSettlementContract_NoConnection_ReturnsError(t *testing.T) ⋮---- func TestGetSettlementContract_WithConnection_ReturnsContract(t *testing.T) ⋮---- func TestGetVotingPowerProviderContract_NoConnection_ReturnsError(t *testing.T) ⋮---- func TestGetVotingPowerProviderContract_WithConnection_ReturnsContract(t *testing.T) ⋮---- func TestGetVotingPowerProviderContractTransactor_NoConnection_ReturnsError(t *testing.T) ⋮---- func TestGetVotingPowerProviderContractTransactor_WithConnection_ReturnsContract(t *testing.T) ⋮---- func TestGetKeyRegistryContract_NoConnection_ReturnsError(t *testing.T) ⋮---- func TestGetKeyRegistryContract_WithConnection_ReturnsContract(t *testing.T) ⋮---- func TestGetOperatorRegistryContract_NoConnection_ReturnsError(t *testing.T) ⋮---- func TestGetOperatorRegistryContract_WithConnection_ReturnsContract(t *testing.T) ⋮---- func TestGetCurrentEpoch_Success_ReturnsEpoch(t *testing.T) ⋮---- func TestGetCurrentEpoch_DriverError_ReturnsError(t *testing.T) ⋮---- func TestGetCurrentEpochDuration_Success_ReturnsDuration(t *testing.T) ⋮---- func TestGetCurrentEpochDuration_DriverError_ReturnsError(t *testing.T) ⋮---- func TestGetEpochDuration_Success_ReturnsDuration(t *testing.T) ⋮---- func TestGetEpochDuration_DriverError_ReturnsError(t *testing.T) ⋮---- func TestGetEpochStart_Success_ReturnsTimestamp(t *testing.T) ⋮---- func TestGetEpochStart_DriverError_ReturnsError(t *testing.T) ⋮---- func TestGetConfig_Success_ReturnsConfig(t *testing.T) ⋮---- func TestGetConfig_GetConfigAtError_ReturnsError(t *testing.T) ⋮---- func TestGetConfig_GetEpochDurationError_ReturnsError(t *testing.T) ```` ## File: symbiotic/client/evm/eth_verify_quorum_sig_test.go ````go package evm ⋮---- import ( "context" "math/big" "testing" "time" "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" "github.com/symbioticfi/relay/symbiotic/client/evm/mocks" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" "math/big" "testing" "time" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" ⋮---- "github.com/symbioticfi/relay/symbiotic/client/evm/mocks" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- func TestVerifyQuorumSig_NoSettlementContract_ReturnsError(t *testing.T) ⋮---- func TestVerifyQuorumSig_ContextTimeout_ReturnsError(t *testing.T) ⋮---- func TestVerifyQuorumSig_InvalidChainID_ReturnsError(t *testing.T) ⋮---- func TestVerifyQuorumSig_EmptyProof_HandlesCorrectly(t *testing.T) ⋮---- func TestVerifyQuorumSig_EmptyMessage_HandlesCorrectly(t *testing.T) ⋮---- func TestVerifyQuorumSig_NilThreshold_HandlesCorrectly(t *testing.T) ⋮---- func TestVerifyQuorumSig_ZeroEpoch_HandlesCorrectly(t *testing.T) ```` ## File: symbiotic/client/evm/eth_verify_quorum_sig.go ````go package evm ⋮---- import ( "context" "math/big" "time" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/rpc" "github.com/go-errors/errors" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" "math/big" "time" ⋮---- "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/rpc" "github.com/go-errors/errors" ⋮---- symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- func (e *Client) VerifyQuorumSig(ctx context.Context, addr symbiotic.CrossChainAddress, epoch symbiotic.Epoch, message []byte, keyTag symbiotic.KeyTag, threshold *big.Int, proof []byte) (_ bool, err error) ```` ## File: symbiotic/client/evm/eth.go ````go package evm ⋮---- import ( "context" _ "embed" "encoding/hex" "log/slog" "math/big" "regexp" "time" "github.com/ethereum/go-ethereum/rpc" "github.com/samber/lo" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/ethclient" "github.com/go-errors/errors" "github.com/go-playground/validator/v10" "github.com/symbioticfi/relay/internal/entity" "github.com/symbioticfi/relay/symbiotic/client/evm/gen" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" cryptoSym "github.com/symbioticfi/relay/symbiotic/usecase/crypto" ) ⋮---- "context" _ "embed" "encoding/hex" "log/slog" "math/big" "regexp" "time" ⋮---- "github.com/ethereum/go-ethereum/rpc" "github.com/samber/lo" ⋮---- "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/ethclient" "github.com/go-errors/errors" "github.com/go-playground/validator/v10" ⋮---- "github.com/symbioticfi/relay/internal/entity" "github.com/symbioticfi/relay/symbiotic/client/evm/gen" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" cryptoSym "github.com/symbioticfi/relay/symbiotic/usecase/crypto" ⋮---- //go:generate mockgen -destination=mocks/eth.go -package=mocks github.com/symbioticfi/relay/symbiotic/client/evm IEvmClient,conn,metrics,keyProvider,driverContract ⋮---- type metrics interface { ObserveEVMMethodCall(method string, chainID uint64, status string, d time.Duration) ObserveCommitValsetHeaderParams(chainID uint64, gasUsed uint64, effectiveGasPrice *big.Int) } ⋮---- // IEvmClient defines the interface for EVM client operations type IEvmClient interface { GetChains() []uint64 GetSubnetwork(ctx context.Context) (common.Hash, error) GetNetworkAddress(ctx context.Context) (common.Address, error) GetConfig(ctx context.Context, timestamp symbiotic.Timestamp, epoch symbiotic.Epoch) (symbiotic.NetworkConfig, error) GetEip712Domain(ctx context.Context, addr symbiotic.CrossChainAddress) (symbiotic.Eip712Domain, error) GetVotingPowerProviderEip712Domain(ctx context.Context, addr symbiotic.CrossChainAddress) (symbiotic.Eip712Domain, error) GetOperatorNonce(ctx context.Context, votingPowerProvider symbiotic.CrossChainAddress, operator common.Address) (*big.Int, error) GetCurrentEpoch(ctx context.Context) (symbiotic.Epoch, error) GetCurrentEpochDuration(ctx context.Context) (uint64, error) GetEpochDuration(ctx context.Context, epoch symbiotic.Epoch) (uint64, error) GetEpochStart(ctx context.Context, epoch symbiotic.Epoch) (symbiotic.Timestamp, error) IsValsetHeaderCommittedAt(ctx context.Context, addr symbiotic.CrossChainAddress, epoch symbiotic.Epoch, opts ...symbiotic.EVMOption) (bool, error) GetHeaderHash(ctx context.Context, addr symbiotic.CrossChainAddress) (common.Hash, error) GetHeaderHashAt(ctx context.Context, addr symbiotic.CrossChainAddress, epoch symbiotic.Epoch) (common.Hash, error) GetLastCommittedHeaderEpoch(ctx context.Context, addr symbiotic.CrossChainAddress, evmOptions ...symbiotic.EVMOption) (symbiotic.Epoch, error) GetCaptureTimestampFromValsetHeaderAt(ctx context.Context, addr symbiotic.CrossChainAddress, epoch symbiotic.Epoch) (uint64, error) GetValSetHeaderAt(ctx context.Context, addr symbiotic.CrossChainAddress, epoch symbiotic.Epoch) (symbiotic.ValidatorSetHeader, error) GetValSetHeader(ctx context.Context, addr symbiotic.CrossChainAddress) (symbiotic.ValidatorSetHeader, error) GetVotingPowers(ctx context.Context, address symbiotic.CrossChainAddress, timestamp symbiotic.Timestamp) ([]symbiotic.OperatorVotingPower, error) GetKeys(ctx context.Context, address symbiotic.CrossChainAddress, timestamp symbiotic.Timestamp) ([]symbiotic.OperatorWithKeys, error) CommitValsetHeader(ctx context.Context, addr symbiotic.CrossChainAddress, header symbiotic.ValidatorSetHeader, extraData []symbiotic.ExtraData, proof []byte) (symbiotic.TxResult, error) RegisterOperator(ctx context.Context, addr symbiotic.CrossChainAddress) (symbiotic.TxResult, error) RegisterKey(ctx context.Context, addr symbiotic.CrossChainAddress, keyTag symbiotic.KeyTag, key symbiotic.CompactPublicKey, signature symbiotic.RawSignature, extraData []byte) (symbiotic.TxResult, error) InvalidateOldSignatures(ctx context.Context, addr symbiotic.CrossChainAddress) (symbiotic.TxResult, error) RegisterOperatorVotingPowerProvider(ctx context.Context, addr symbiotic.CrossChainAddress) (symbiotic.TxResult, error) UnregisterOperatorVotingPowerProvider(ctx context.Context, addr symbiotic.CrossChainAddress) (symbiotic.TxResult, error) SetGenesis(ctx context.Context, addr symbiotic.CrossChainAddress, header symbiotic.ValidatorSetHeader, extraData []symbiotic.ExtraData) (symbiotic.TxResult, error) VerifyQuorumSig(ctx context.Context, addr symbiotic.CrossChainAddress, epoch symbiotic.Epoch, message []byte, keyTag symbiotic.KeyTag, threshold *big.Int, proof []byte) (bool, error) IsValsetHeaderCommittedAtEpochs(ctx context.Context, addr symbiotic.CrossChainAddress, epochs []symbiotic.Epoch) ([]bool, error) } ⋮---- type keyProvider interface { GetPrivateKeyByNamespaceTypeId(namespace string, keyType symbiotic.KeyType, id int) (cryptoSym.PrivateKey, error) } ⋮---- // conn defines the interface for Ethereum client operations // ethclient.Client implements this interface type conn interface { bind.ContractBackend bind.DeployBackend } ⋮---- var _ driverContract = (*gen.IValSetDriverCaller)(nil) ⋮---- // driverContract defines the interface for driver contract operations // gen.IValSetDriverCaller implements this interface type driverContract interface { GetConfigAt(opts *bind.CallOpts, timestamp *big.Int) (gen.IValSetDriverConfig, error) GetCurrentEpoch(opts *bind.CallOpts) (*big.Int, error) GetCurrentEpochDuration(opts *bind.CallOpts) (*big.Int, error) GetEpochDuration(opts *bind.CallOpts, epoch *big.Int) (*big.Int, error) GetEpochStart(opts *bind.CallOpts, epoch *big.Int) (*big.Int, error) SUBNETWORK(opts *bind.CallOpts) ([32]byte, error) NETWORK(opts *bind.CallOpts) (common.Address, error) } ⋮---- type Config struct { ChainURLs []string `validate:"required"` DriverAddress symbiotic.CrossChainAddress `validate:"required"` RequestTimeout time.Duration `validate:"required,gt=0"` KeyProvider keyProvider Metrics metrics MaxCalls int } ⋮---- func (c Config) Validate() error ⋮---- type Client struct { cfg Config conns map[uint64]conn driver driverContract driverChainID uint64 metrics metrics } ⋮---- func NewEvmClient(ctx context.Context, cfg Config) (*Client, error) ⋮---- func (e *Client) GetChains() []uint64 ⋮---- func (e *Client) GetConfig(ctx context.Context, timestamp symbiotic.Timestamp, epoch symbiotic.Epoch) (_ symbiotic.NetworkConfig, err error) ⋮---- // TODO: get from contract ⋮---- func (e *Client) GetCurrentEpoch(ctx context.Context) (_ symbiotic.Epoch, err error) ⋮---- func (e *Client) GetCurrentEpochDuration(ctx context.Context) (_ uint64, err error) ⋮---- func (e *Client) GetEpochDuration(ctx context.Context, epoch symbiotic.Epoch) (_ uint64, err error) ⋮---- func (e *Client) GetEpochStart(ctx context.Context, epoch symbiotic.Epoch) (_ symbiotic.Timestamp, err error) ⋮---- func (e *Client) GetSubnetwork(ctx context.Context) (_ common.Hash, err error) ⋮---- func (e *Client) GetNetworkAddress(ctx context.Context) (_ common.Address, err error) ⋮---- func (e *Client) IsValsetHeaderCommittedAt(ctx context.Context, addr symbiotic.CrossChainAddress, epoch symbiotic.Epoch, opts ...symbiotic.EVMOption) (_ bool, err error) ⋮---- func (e *Client) GetHeaderHash(ctx context.Context, addr symbiotic.CrossChainAddress) (_ common.Hash, err error) ⋮---- func (e *Client) GetHeaderHashAt(ctx context.Context, addr symbiotic.CrossChainAddress, epoch symbiotic.Epoch) (_ common.Hash, err error) ⋮---- func (e *Client) GetLastCommittedHeaderEpoch(ctx context.Context, addr symbiotic.CrossChainAddress, opts ...symbiotic.EVMOption) (_ symbiotic.Epoch, err error) ⋮---- // todo if zero epoch need to check if it's committed or not ⋮---- func getRPCBlockNumber(number symbiotic.BlockNumber) *big.Int ⋮---- func (e *Client) GetCaptureTimestampFromValsetHeaderAt(ctx context.Context, addr symbiotic.CrossChainAddress, epoch symbiotic.Epoch) (_ uint64, err error) ⋮---- func (e *Client) GetValSetHeaderAt(ctx context.Context, addr symbiotic.CrossChainAddress, epoch symbiotic.Epoch) (_ symbiotic.ValidatorSetHeader, err error) ⋮---- func (e *Client) GetValSetHeader(ctx context.Context, addr symbiotic.CrossChainAddress) (_ symbiotic.ValidatorSetHeader, err error) ⋮---- func (e *Client) GetEip712Domain(ctx context.Context, addr symbiotic.CrossChainAddress) (_ symbiotic.Eip712Domain, err error) ⋮---- func (e *Client) GetVotingPowerProviderEip712Domain(ctx context.Context, addr symbiotic.CrossChainAddress) (_ symbiotic.Eip712Domain, err error) ⋮---- func (e *Client) GetOperatorNonce(ctx context.Context, votingPowerProvider symbiotic.CrossChainAddress, operator common.Address) (_ *big.Int, err error) ⋮---- func (e *Client) GetVotingPowers(ctx context.Context, address symbiotic.CrossChainAddress, timestamp symbiotic.Timestamp) (_ []symbiotic.OperatorVotingPower, err error) ⋮---- func (e *Client) GetOperators(ctx context.Context, address symbiotic.CrossChainAddress, timestamp symbiotic.Timestamp) (_ []common.Address, err error) ⋮---- func (e *Client) GetKeysOperators(ctx context.Context, address symbiotic.CrossChainAddress, timestamp symbiotic.Timestamp) (_ []common.Address, err error) ⋮---- func (e *Client) GetKeys(ctx context.Context, address symbiotic.CrossChainAddress, timestamp symbiotic.Timestamp) (_ []symbiotic.OperatorWithKeys, err error) ⋮---- func (e *Client) IsValsetHeaderCommittedAtEpochs(ctx context.Context, addr symbiotic.CrossChainAddress, epochs []symbiotic.Epoch) (_ []bool, err error) ⋮---- var res bool ⋮---- var customErrRegExp = regexp.MustCompile(`0x[0-9a-fA-F]{8}`) ⋮---- type metadata interface { GetAbi() (*abi.ABI, error) } ⋮---- func (e *Client) formatEVMContractError(meta metadata, originalErr error) error ⋮---- type jsonError interface { Error() string ErrorData() interface{} var errData jsonError ⋮---- func (e *Client) formatEVMError(err error) error ⋮---- func (e *Client) getSettlementContract(addr symbiotic.CrossChainAddress) (*gen.ISettlement, error) ⋮---- func (e *Client) getVotingPowerProviderContract(addr symbiotic.CrossChainAddress) (*gen.IVotingPowerProviderCaller, error) ⋮---- func (e *Client) getVotingPowerProviderContractTransactor(addr symbiotic.CrossChainAddress) (*gen.IVotingPowerProvider, error) ⋮---- func (e *Client) getKeyRegistryContract(addr symbiotic.CrossChainAddress) (*gen.IKeyRegistry, error) ⋮---- func (e *Client) getOperatorRegistryContract(addr symbiotic.CrossChainAddress) (*gen.OperatorRegistry, error) ⋮---- func findErrorBySelector(errSelector string) (abi.Error, bool) ⋮---- func (e *Client) observeMetrics(method string, chainID uint64, err error, start time.Time) ```` ## File: symbiotic/client/evm/multicall_test.go ````go package evm ⋮---- import ( "context" "testing" "time" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" "github.com/symbioticfi/relay/symbiotic/client/evm/mocks" ) ⋮---- "context" "testing" "time" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" ⋮---- "github.com/symbioticfi/relay/symbiotic/client/evm/mocks" ⋮---- func TestMulticallExists_NoConnection_ReturnsError(t *testing.T) ⋮---- func TestMulticallExists_CodeAtFails_ReturnsError(t *testing.T) ⋮---- func TestMulticallExists_CodeExists_ReturnsTrue(t *testing.T) ⋮---- func TestMulticallExists_NoCode_ReturnsFalse(t *testing.T) ⋮---- func TestMulticall_NoConnection_ReturnsError(t *testing.T) ```` ## File: symbiotic/client/evm/multicall.go ````go package evm ⋮---- import ( "context" "math/big" "time" "github.com/ethereum/go-ethereum/accounts/abi/bind/v2" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/rpc" "github.com/go-errors/errors" "github.com/samber/lo" "github.com/symbioticfi/relay/internal/entity" "github.com/symbioticfi/relay/symbiotic/client/evm/gen" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "context" "math/big" "time" ⋮---- "github.com/ethereum/go-ethereum/accounts/abi/bind/v2" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/rpc" "github.com/go-errors/errors" "github.com/samber/lo" ⋮---- "github.com/symbioticfi/relay/internal/entity" "github.com/symbioticfi/relay/symbiotic/client/evm/gen" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- const Multicall3 = "0xcA11bde05977b3631167028862bE2a173976CA11" ⋮---- func (e *Client) multicallExists(ctx context.Context, chainId uint64) (bool, error) ⋮---- func (e *Client) multicall(ctx context.Context, chainId uint64, calls []Call) (_ []Result, err error) ⋮---- func (e *Client) getVotingPowersMulticall(ctx context.Context, address symbiotic.CrossChainAddress, timestamp symbiotic.Timestamp) ([]symbiotic.OperatorVotingPower, error) ⋮---- var res []gen.IVotingPowerProviderVaultValue ⋮---- func (e *Client) getKeysMulticall(ctx context.Context, address symbiotic.CrossChainAddress, timestamp symbiotic.Timestamp) (_ []symbiotic.OperatorWithKeys, err error) ⋮---- var res []gen.IKeyRegistryKey ```` ## File: symbiotic/entity/entity_test.go ````go package entity ⋮---- import ( "context" "math/big" "testing" "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/require" ) ⋮---- "context" "math/big" "testing" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/require" ⋮---- func TestValidatorSet_FindValidatorsBySignatures(t *testing.T) ⋮---- // Test data setup ⋮---- // Create validators ⋮---- {Tag: KeyTag(2), Payload: publicKey3}, // Different key tag ⋮---- // Check that we found the right validators ⋮---- // Validator3 has publicKey3 but for different tag ⋮---- func TestValidatorSet_IsActiveCommitter(t *testing.T) ⋮---- // Create test validators with keys ⋮---- { // Index 0 - committer ⋮---- { // Index 1 - committer ⋮---- { // Index 2 - committer ⋮---- { // Index 3 - not a committer ⋮---- CommitterIndices: []uint32{0, 1, 2}, // Only first three are committers ⋮---- // Test with non-committer key ⋮---- // Test with unknown key ⋮---- // When duration is 0, any committer should always be active ⋮---- CommitterIndices: []uint32{1}, // Only one committer ⋮---- // Single committer should always be active after capture time (no time slot rotation needed) ⋮---- // but capture time is in the future, so before that it should be false ⋮---- // But non-committer key should still return false ⋮---- // No committer should be active before capture timestamp ⋮---- CommitterIndices: []uint32{0, 1, 2}, // Three committers ⋮---- // Test first slot (1000-1099): committer 0 should be active ⋮---- // Test second slot (1100-1199): committer 1 should be active ⋮---- // Test third slot (1200-1299): committer 2 should be active ⋮---- // Test fourth slot (1300-1399): wraps back to committer 0 ⋮---- // Test fifth slot (1400-1499): committer 1 again ⋮---- // Test sixth slot (1500-1599): committer 2 again ⋮---- // Test grace period at end of slot 0 (time 1095, grace brings us to 1105 which is slot 1) ⋮---- // Test grace period at end of slot 1 (time 1195, grace brings us to 1205 which is slot 2) ⋮---- // Test grace period at end of slot 2 (time 1295, grace brings us to 1305 which is slot 3, wraps to committer 0) ⋮---- // Test grace period that doesn't cross slot boundary ⋮---- CommitterIndices: []uint32{2, 0, 1}, // Different order to test proper indexing ⋮---- // First slot should go to validator at index 2 (first in CommitterIndices) ⋮---- // Second slot should go to validator at index 0 (second in CommitterIndices) ⋮---- // Third slot should go to validator at index 1 (third in CommitterIndices) ⋮---- // Fourth slot wraps back to validator at index 2 ⋮---- CaptureTimestamp: 1000000000, // 1 billion ⋮---- slotDuration := uint64(1000000) // 1 million seconds per slot ⋮---- // Test first slot ⋮---- // Test second slot ⋮---- // Test wrap-around with large values ⋮---- // Test exact boundary between slot 0 and slot 1 ⋮---- // Test exact boundary between slot 1 and slot 2 ⋮---- CommitterIndices: []uint32{}, // No committers ⋮---- // No one should be active if there are no committers ⋮---- func TestPaddedUint64(t *testing.T) ⋮---- input: 65535, // 0xFFFF ⋮---- input: 4294967295, // 0xFFFFFFFF ⋮---- input: 18446744073709551615, // 0xFFFFFFFFFFFFFFFF ⋮---- input: 1640995200, // Typical epoch timestamp ```` ## File: symbiotic/entity/entity.go ````go package entity ⋮---- import ( "bytes" "context" "encoding/binary" "fmt" "log/slog" "math/big" "slices" "github.com/symbioticfi/relay/symbiotic/usecase/ssz" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/crypto" "github.com/go-errors/errors" "github.com/samber/lo" ) ⋮---- "bytes" "context" "encoding/binary" "fmt" "log/slog" "math/big" "slices" ⋮---- "github.com/symbioticfi/relay/symbiotic/usecase/ssz" ⋮---- "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/crypto" "github.com/go-errors/errors" "github.com/samber/lo" ⋮---- type VerificationType uint32 type AggregationPolicyType uint32 ⋮---- const ( VerificationTypeBlsBn254ZK VerificationType = 0 VerificationTypeBlsBn254Simple VerificationType = 1 AggregationPolicyLowLatency AggregationPolicyType = 0 AggregationPolicyLowCost AggregationPolicyType = 1 ) ⋮---- var ( ExtraDataKeyTagPrefixHash = crypto.Keccak256Hash([]byte("keyTag.")) ⋮---- var ( ZkVerificationTotalActiveValidatorsHash = crypto.Keccak256Hash([]byte("totalActiveValidators")) ⋮---- var ( SimpleVerificationValidatorSetHashKeccak256Hash = crypto.Keccak256Hash([]byte("validatorSetHashKeccak256")) ⋮---- type ValidatorSetStatus uint8 ⋮---- const ( HeaderDerived ValidatorSetStatus = iota HeaderAggregated HeaderCommitted HeaderMissed ) ⋮---- const ValsetHeaderKeyTag = KeyTag(15) ⋮---- type RawSignature []byte type RawMessageHash []byte type RawPublicKey []byte type CompactPublicKey []byte type RawMessage []byte type RawProof []byte type VotingPower struct { *big.Int } type QuorumThresholdPct struct { *big.Int } ⋮---- func ToVotingPower(val *big.Int) VotingPower ⋮---- func ToQuorumThresholdPct(val *big.Int) QuorumThresholdPct ⋮---- type Epoch uint64 type Timestamp uint64 ⋮---- // Bytes returns the epoch as a BigEndian encoded byte slice for use in database keys. // BigEndian encoding ensures that lexicographic byte ordering matches numeric ordering, // which is crucial for proper sorting in key-value stores like Badger. // Example: Epoch(51).Bytes() < Epoch(501).Bytes() when comparing bytes lexicographically. func (e Epoch) Bytes() []byte ⋮---- func (raw RawSignature) MarshalText() ([]byte, error) ⋮---- func (vp VotingPower) MarshalJSON() ([]byte, error) ⋮---- // dirty hack to force using string instead of float in json ⋮---- // SignatureRequest signature request message type SignatureRequest struct { KeyTag KeyTag RequiredEpoch Epoch Message RawMessage } ⋮---- type SignatureRequestWithID struct { SignatureRequest RequestID common.Hash } ⋮---- // Signature signer.sign() -> Signature type Signature struct { MessageHash RawMessageHash // scheme depends on KeyTag KeyTag KeyTag // Key tag for validation Epoch Epoch // Epoch for validation PublicKey PublicKey // parse based on KeyTag (for bls will contain g1+g2) Signature RawSignature // parse based on KeyTag } ⋮---- MessageHash RawMessageHash // scheme depends on KeyTag KeyTag KeyTag // Key tag for validation Epoch Epoch // Epoch for validation PublicKey PublicKey // parse based on KeyTag (for bls will contain g1+g2) Signature RawSignature // parse based on KeyTag ⋮---- // RequestID calculates the request id based on Hash(MessageHash, KeyTag, Epoch) func (s Signature) RequestID() common.Hash ⋮---- func requestID(keyTag KeyTag, epoch Epoch, messageHash RawMessageHash) common.Hash ⋮---- func paddedUint64(value uint64) []byte ⋮---- // AggregationProof aggregator.proof(signatures []Signature) -> AggregationProof type AggregationProof struct { MessageHash RawMessageHash // scheme depends on KeyTag KeyTag KeyTag // Key tag for validation Epoch Epoch // Epoch for validation Proof RawProof // parse based on KeyTag } ⋮---- Proof RawProof // parse based on KeyTag ⋮---- // ProofCommitKey represents a proof commit key with its parsed epoch and hash for sorting type ProofCommitKey struct { Epoch Epoch RequestID common.Hash } ⋮---- func (vt VerificationType) String() string ⋮---- type CrossChainAddress struct { ChainId uint64 Address common.Address } ⋮---- type QuorumThreshold struct { KeyTag KeyTag QuorumThreshold QuorumThresholdPct } ⋮---- type NetworkConfig struct { VotingPowerProviders []CrossChainAddress KeysProvider CrossChainAddress Settlements []CrossChainAddress VerificationType VerificationType MaxVotingPower VotingPower MinInclusionVotingPower VotingPower MaxValidatorsCount VotingPower RequiredKeyTags []KeyTag RequiredHeaderKeyTag KeyTag QuorumThresholds []QuorumThreshold EpochDuration uint64 // in seconds // scheduler config NumAggregators uint64 NumCommitters uint64 CommitterSlotDuration uint64 // in seconds } ⋮---- EpochDuration uint64 // in seconds // scheduler config ⋮---- CommitterSlotDuration uint64 // in seconds ⋮---- func maxThreshold() *big.Int ⋮---- // 10^18 is the maximum threshold value ⋮---- func (nc NetworkConfig) CalcQuorumThreshold(totalVP VotingPower) (VotingPower, error) ⋮---- // add 1 to apply up rounding ⋮---- type NetworkData struct { Address common.Address Subnetwork common.Hash Eip712Data Eip712Domain } ⋮---- type VaultVotingPower struct { Vault common.Address VotingPower VotingPower } ⋮---- type OperatorVotingPower struct { Operator common.Address Vaults []VaultVotingPower } ⋮---- type OperatorWithKeys struct { Operator common.Address Keys []ValidatorKey } ⋮---- type Eip712Domain struct { Fields [1]byte Name string Version string ChainId *big.Int VerifyingContract common.Address Salt *big.Int Extensions []*big.Int } ⋮---- type ValidatorKey struct { Tag KeyTag Payload CompactPublicKey } ⋮---- type ValidatorVault struct { ChainID uint64 `json:"chainId"` Vault common.Address `json:"vault"` VotingPower VotingPower `json:"votingPower"` } ⋮---- type Validators []Validator ⋮---- func (va Validators) SortByVotingPowerDescAndOperatorAddressAsc() ⋮---- func (va Validators) SortByOperatorAddressAsc() ⋮---- func (va Validators) CheckIsSortedByOperatorAddressAsc() error ⋮---- type Vaults []ValidatorVault ⋮---- func (v Vaults) SortByAddressAsc() ⋮---- func (v Vaults) SortVaultsByVotingPowerDescAndAddressAsc() ⋮---- func (va Validators) GetTotalActiveVotingPower() VotingPower ⋮---- func (va Validators) GetActiveValidators() Validators ⋮---- var activeValidators Validators ⋮---- type Validator struct { Operator common.Address `json:"operator"` VotingPower VotingPower `json:"votingPower"` IsActive bool `json:"isActive"` Keys []ValidatorKey `json:"keys"` Vaults Vaults `json:"vaults"` } ⋮---- func (v Validator) FindKeyByKeyTag(keyTag KeyTag) ([]byte, bool) ⋮---- type ValidatorSet struct { Version uint8 RequiredKeyTag KeyTag // key tag required to commit next valset Epoch Epoch // valset epoch CaptureTimestamp Timestamp // epoch capture timestamp QuorumThreshold VotingPower // absolute number now, not a percent Validators Validators Status ValidatorSetStatus // Scheduler info for current validator set, completely offchain not included in header AggregatorIndices []uint32 CommitterIndices []uint32 } ⋮---- RequiredKeyTag KeyTag // key tag required to commit next valset Epoch Epoch // valset epoch CaptureTimestamp Timestamp // epoch capture timestamp QuorumThreshold VotingPower // absolute number now, not a percent ⋮---- // Scheduler info for current validator set, completely offchain not included in header ⋮---- func (v ValidatorSet) IsAggregator(requiredKey []byte) bool ⋮---- func (v ValidatorSet) IsCommitter(requiredKey []byte) bool ⋮---- func (v ValidatorSet) IsSigner(requiredKey CompactPublicKey) bool ⋮---- func (v ValidatorSet) findMembership(indexArray []uint32, requiredKey []byte) (uint32, bool) ⋮---- // IsActiveCommitter determines if the current time falls within the time slot // of the current node based on the network configuration and validator set. // Each committer has a dedicated time slot of CommitterSlotDuration seconds, // starting from the CaptureTimestamp. If the node's slot is about to start // i.e. if currentTime + graceSeconds moves us to the next slot, it will also return true. func (v ValidatorSet) IsActiveCommitter( ctx context.Context, committerSlotDuration uint64, currentTime Timestamp, graceSeconds uint64, requiredKey []byte, ) bool ⋮---- // If current time is before capture timestamp, we're not in any slot yet ⋮---- // single committer no need to check time slots ⋮---- // Calculate elapsed time since capture ⋮---- // Calculate which slot we're currently in ⋮---- // Calculate which committer should be active for current slot (round-robin) ⋮---- // Check if the required key matches the current slot's committer ⋮---- // Check if adding grace period moves us to the next slot ⋮---- // If grace period moves us to a different slot, check that slot's committer too ⋮---- func (v ValidatorSet) FindValidatorByKey(keyTag KeyTag, publicKey []byte) (Validator, bool) { // DON'T USE INSIDE LOOPS ⋮---- type ValidatorSetHash struct { KeyTag KeyTag Hash common.Hash } ⋮---- // ValidatorSetHeader represents the input for validator set header type ValidatorSetHeader struct { Version uint8 RequiredKeyTag KeyTag Epoch Epoch CaptureTimestamp Timestamp QuorumThreshold VotingPower TotalVotingPower VotingPower ValidatorsSszMRoot common.Hash } ⋮---- type ValidatorSetMetadata struct { RequestID common.Hash ExtraData []ExtraData Epoch Epoch CommitmentData []byte } ⋮---- type ExtraData struct { Key common.Hash Value common.Hash } ⋮---- type ExtraDataList []ExtraData ⋮---- func (e ExtraDataList) Hash() ([]byte, error) ⋮---- func (e ExtraDataList) AbiEncode() ([]byte, error) ⋮---- func (v ValidatorSet) GetTotalActiveValidators() int64 ⋮---- func (v ValidatorSet) GetHeader() (ValidatorSetHeader, error) ⋮---- func (v ValidatorSet) FindValidatorsByKeys(keyTag KeyTag, publicKeys []CompactPublicKey) (Validators, error) ⋮---- // Build lookup map: publicKey -> validator ⋮---- // Find validators for each public key ⋮---- func sszTreeRoot(v *ValidatorSet) (common.Hash, error) ⋮---- func keyPayloadHash(k ValidatorKey) common.Hash ⋮---- func validatorSetToSszValidators(v *ValidatorSet) ssz.SszValidatorSet ⋮---- type TxResult struct { TxHash common.Hash } ⋮---- type ChainURL struct { ChainID uint64 RPCURL string } ⋮---- type AggregationStatus struct { VotingPower VotingPower Validators []Validator } ```` ## File: symbiotic/entity/evm_entity.go ````go package entity ⋮---- type BlockNumber string ⋮---- const ( BlockNumberFinalized BlockNumber = "finalized" BlockNumberLatest BlockNumber = "latest" ) ⋮---- type EVMOptions struct { BlockNumber BlockNumber } ⋮---- func AppliedEVMOptions(opts ...EVMOption) *EVMOptions ⋮---- type EVMOption func(options *EVMOptions) ⋮---- func WithEVMBlockNumber(blockNumber BlockNumber) EVMOption ```` ## File: symbiotic/entity/key_tag_entity_test.go ````go package entity ⋮---- import ( "strings" "testing" ) ⋮---- "strings" "testing" ⋮---- func TestKeyTag_Type(t *testing.T) ⋮---- func TestKeyTag_MarshalText(t *testing.T) ⋮---- func TestKeyTag_String(t *testing.T) ⋮---- func TestKeyType_String(t *testing.T) ⋮---- func TestKeyTypeFromString(t *testing.T) ```` ## File: symbiotic/entity/key_tag_entity.go ````go package entity ⋮---- import ( "fmt" "github.com/go-errors/errors" ) ⋮---- "fmt" ⋮---- "github.com/go-errors/errors" ⋮---- type KeyType uint8 ⋮---- const ( KeyTypeBlsBn254 KeyType = 0 KeyTypeEcdsaSecp256k1 KeyType = 1 KeyTypeBls12381Bn254 KeyType = 2 KeyTypeInvalid KeyType = 255 BLS_BN254_TYPE = "bls_bn254" ECDSA_SECP256K1_TYPE = "ecdsa_secp256k1" BLS_12381_BN254_TYPE = "bls12381_bn254" INVALID_TYPE = "invalid" ) ⋮---- type KeyTag uint8 ⋮---- func (kt KeyTag) Type() KeyType ⋮---- return KeyTypeInvalid // Invalid key type ⋮---- func (kt KeyTag) MarshalText() (text []byte, err error) ⋮---- func (kt KeyTag) String() string ⋮---- // SignerKey returns true if the key type can be used for signing func (kt KeyType) SignerKey() bool ⋮---- // AggregationKey returns true if the key type can be used for aggregation func (kt KeyType) AggregationKey() bool ⋮---- func KeyTypeFromString(typeStr string) (KeyType, error) ⋮---- func KeyTagFromTypeAndId(keyType KeyType, keyId uint8) (KeyTag, error) ```` ## File: symbiotic/entity/key.go ````go package entity ⋮---- type PublicKey interface { Verify(msg Message, sig RawSignature) error VerifyWithHash(msgHash MessageHash, sig RawSignature) error OnChain() CompactPublicKey Raw() RawPublicKey MarshalText() (text []byte, err error) } ⋮---- type PrivateKey interface { Bytes() []byte Sign(msg []byte) (RawSignature, MessageHash, error) PublicKey() PublicKey } ```` ## File: symbiotic/usecase/aggregator/aggregator-types/aggregator.go ````go package aggregator_types ⋮---- import ( "github.com/symbioticfi/relay/pkg/proof" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/ethereum/go-ethereum/common" ) ⋮---- "github.com/symbioticfi/relay/pkg/proof" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- "github.com/ethereum/go-ethereum/common" ⋮---- type Aggregator interface { Aggregate(valset symbiotic.ValidatorSet, keyTag symbiotic.KeyTag, messageHash []byte, signatures []symbiotic.Signature) (symbiotic.AggregationProof, error) Verify(valset symbiotic.ValidatorSet, keyTag symbiotic.KeyTag, aggregationProof symbiotic.AggregationProof) (bool, error) GenerateExtraData(valset symbiotic.ValidatorSet, keyTags []symbiotic.KeyTag) ([]symbiotic.ExtraData, error) } ⋮---- type Prover interface { Prove(proveInput proof.ProveInput) (proof.ProofData, error) Verify(valsetLen int, publicInputHash common.Hash, proofBytes []byte) (bool, error) } ```` ## File: symbiotic/usecase/aggregator/blsBn254Simple/aggregator_test.go ````go package blsBn254Simple ⋮---- import ( "math/big" "testing" "github.com/consensys/gnark-crypto/ecc/bn254" "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "math/big" "testing" ⋮---- "github.com/consensys/gnark-crypto/ecc/bn254" "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ⋮---- symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- func TestNewAggregator_Success(t *testing.T) ⋮---- func TestCompress_WithValidG1Point_ReturnsCompressedHash(t *testing.T) ⋮---- func TestCompress_WithZeroPoint_ReturnsHash(t *testing.T) ⋮---- func TestCompress_WithDifferentPoints_ReturnsDifferentHashes(t *testing.T) ⋮---- func TestDecompress_WithValidCompressedPoint_ReturnsG1Point(t *testing.T) ⋮---- func TestCompress_Decompress_RoundTrip_PreservesPoint(t *testing.T) ⋮---- func TestFindYFromX_WithValidX_ReturnsY(t *testing.T) ⋮---- assert.Greater(t, y.Cmp(big.NewInt(0)), 0) //nolint:testifylint // assert.Positive doesn't work with *big.Int ⋮---- func TestFindYFromX_WithZeroX_ReturnsY(t *testing.T) ⋮---- func TestFindYFromX_WithLargeX_ReturnsY(t *testing.T) ⋮---- func TestProcessValidators_WithNoValidators_ReturnsEmpty(t *testing.T) ⋮---- func TestProcessValidators_WithInactiveValidators_ReturnsEmpty(t *testing.T) ⋮---- func TestProcessValidators_WithActiveValidators_ReturnsValidatorData(t *testing.T) ⋮---- func TestProcessValidators_WithMultipleValidators_ReturnsSortedData(t *testing.T) ⋮---- func TestProcessValidators_WithMissingKeyTag_ReturnsError(t *testing.T) ⋮---- func TestCalcAlpha_WithValidInputs_ReturnsAlpha(t *testing.T) ⋮---- assert.Greater(t, alpha.Cmp(big.NewInt(0)), 0) //nolint:testifylint // assert.Positive doesn't work with *big.Int ⋮---- func TestCalcAlpha_WithDifferentInputs_ReturnsDifferentAlphas(t *testing.T) ⋮---- func TestCalcAlpha_WithSameInputs_ReturnsSameAlpha(t *testing.T) ⋮---- func TestAggregator_Aggregate_WithEmptySignatures_Succeeds(t *testing.T) ⋮---- func TestAggregator_Aggregate_WithMismatchedMessageHashes_ReturnsError(t *testing.T) ⋮---- func TestAggregator_Verify_WithInvalidMessageHashLength_ReturnsError(t *testing.T) ⋮---- func TestAggregator_Verify_WithShortProof_ReturnsError(t *testing.T) ⋮---- func TestAggregator_PackValidatorsData_WithValidData_ReturnsBytes(t *testing.T) ⋮---- func TestAggregator_PackValidatorsData_WithEmptyData_ReturnsBytes(t *testing.T) ⋮---- func TestAggregator_CalculateValidatorsKeccak_WithValidData_ReturnsHash(t *testing.T) ⋮---- func TestAggregator_CalculateValidatorsKeccak_WithSameData_ReturnsSameHash(t *testing.T) ⋮---- func TestAggregator_CalculateValidatorsKeccak_WithDifferentData_ReturnsDifferentHashes(t *testing.T) ⋮---- func TestAggregator_GenerateExtraData_WithValidValidatorSet_ReturnsExtraData(t *testing.T) ⋮---- func TestAggregator_GenerateExtraData_WithMultipleKeyTags_ReturnsMultipleExtraData(t *testing.T) ⋮---- func TestAggregator_GenerateExtraData_ReturnsSortedData(t *testing.T) ```` ## File: symbiotic/usecase/aggregator/blsBn254Simple/aggregator.go ````go package blsBn254Simple ⋮---- import ( "bytes" "encoding/binary" "math/big" "sort" "github.com/consensys/gnark-crypto/ecc/bn254" "github.com/consensys/gnark-crypto/ecc/bn254/fp" "github.com/consensys/gnark-crypto/ecc/bn254/fr" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/go-errors/errors" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/aggregator/helpers" "github.com/symbioticfi/relay/symbiotic/usecase/crypto/blsBn254" ) ⋮---- "bytes" "encoding/binary" "math/big" "sort" ⋮---- "github.com/consensys/gnark-crypto/ecc/bn254" "github.com/consensys/gnark-crypto/ecc/bn254/fp" "github.com/consensys/gnark-crypto/ecc/bn254/fr" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/go-errors/errors" ⋮---- symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/aggregator/helpers" "github.com/symbioticfi/relay/symbiotic/usecase/crypto/blsBn254" ⋮---- const maxValidators = 65_536 ⋮---- type abiTypes struct { g1Type abi.Type g2Type abi.Type validatorsDataType abi.Type g1Args abi.Arguments g2Args abi.Arguments validatorsArgs abi.Arguments } ⋮---- type Aggregator struct { abiTypes abiTypes } ⋮---- type ValidatorData struct { KeySerialized common.Hash VotingPower *big.Int } ⋮---- func NewAggregator() (*Aggregator, error) ⋮---- // createABITypes creates and returns all ABI types func createABITypes() (abiTypes, error) ⋮---- func (a Aggregator) Aggregate( valset symbiotic.ValidatorSet, keyTag symbiotic.KeyTag, messageHash []byte, signatures []symbiotic.Signature, ) (symbiotic.AggregationProof, error) ⋮---- aggG2Key.X.A1.BigInt(new(big.Int)), // index 0 aggG2Key.X.A0.BigInt(new(big.Int)), // index 1 ⋮---- aggG2Key.Y.A1.BigInt(new(big.Int)), // index 0 aggG2Key.Y.A0.BigInt(new(big.Int)), // index 1 ⋮---- // Pack validators data with anonymous structs ⋮---- // Encode non-signers indices ⋮---- // Assemble proof ⋮---- func (a Aggregator) Verify( valset symbiotic.ValidatorSet, keyTag symbiotic.KeyTag, aggregationProof symbiotic.AggregationProof, ) (bool, error) ⋮---- // Check key tag type ⋮---- // Parse proof components ⋮---- // Parse validators data length ⋮---- // Calculate non-signers offset ⋮---- // Verify validators data hash matches ⋮---- // Parse non-signers with proper validation ⋮---- // Validate proof length matches expected non-signers data ⋮---- // Parse and validate non-signers with ordering check ⋮---- var nonSignersVotingPower big.Int var nonSignersPublicKeyG1 *bn254.G1Affine nonSignersPublicKeyG1 = new(bn254.G1Affine) // Initialize to zero point ⋮---- var prevNonSignerIndex uint16 ⋮---- // Validate non-signer index ⋮---- // Check ordering (must be ascending) ⋮---- // Add non-signer's voting power ⋮---- // Add non-signer's public key ⋮---- // Verify validators match expected ⋮---- // Verify validator data matches ⋮---- // Check quorum using the same logic as Solidity ⋮---- // Get aggregated public key from valset (equivalent to extra data in Solidity) ⋮---- // Calculate effective public key: aggPubKeyG1 - nonSignersPublicKeyG1 // This matches the Solidity logic: aggPubKeyG1.plus(nonSignersPublicKeyG1.negate()) ⋮---- // Verify signature using BLS verification ⋮---- // Prepare bytes for alpha calculation ⋮---- func calcAlpha(aggPubKeyG1 *bn254.G1Affine, aggPubKeyG2 *bn254.G2Affine, aggSig *bn254.G1Affine, messageHash []byte) *big.Int ⋮---- // G1 public key bytes ⋮---- // G2 public key bytes ⋮---- // Signature bytes ⋮---- func (a Aggregator) GenerateExtraData(valset symbiotic.ValidatorSet, keyTags []symbiotic.KeyTag) ([]symbiotic.ExtraData, error) ⋮---- // Pack aggregated keys ⋮---- // sort extra data by key to ensure deterministic order ⋮---- func (a Aggregator) packValidatorsData(validatorsData []ValidatorData) ([]byte, error) ⋮---- func processValidators(validators []symbiotic.Validator, keyTag symbiotic.KeyTag) ([]ValidatorData, error) ⋮---- func (a Aggregator) calculateValidatorsKeccak(validatorsData []ValidatorData) (common.Hash, error) ⋮---- func compress(g1 *bn254.G1Affine) (common.Hash, error) ⋮---- func decompress(compressed [32]byte) (*bn254.G1Affine, error) ⋮---- func findYFromX(x *big.Int) (y *big.Int, err error) ⋮---- // Calculate beta = x^3 + 3 mod p beta := new(big.Int).Exp(x, big.NewInt(3), fpModulus) // x^3 beta.Add(beta, big.NewInt(3)) // x^3 + 3 beta.Mod(beta, fpModulus) // (x^3 + 3) mod p ⋮---- // Calculate y = beta^((p+1)/4) mod p ```` ## File: symbiotic/usecase/aggregator/blsBn254ZK/aggregator_test.go ````go package blsBn254ZK ⋮---- import ( "math/big" "testing" "github.com/consensys/gnark-crypto/ecc/bn254" "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/symbioticfi/relay/pkg/proof" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "math/big" "testing" ⋮---- "github.com/consensys/gnark-crypto/ecc/bn254" "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ⋮---- "github.com/symbioticfi/relay/pkg/proof" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- type mockProver struct{} ⋮---- func (m *mockProver) Prove(proveInput proof.ProveInput) (proof.ProofData, error) ⋮---- func (m *mockProver) Verify(valsetLen int, publicInputHash common.Hash, proofBytes []byte) (bool, error) ⋮---- func TestNewAggregator_WithProver_Success(t *testing.T) ⋮---- func TestNewAggregator_WithNilProver_Success(t *testing.T) ⋮---- func TestAggregator_Aggregate_WithMismatchedMessageHashes_ReturnsError(t *testing.T) ⋮---- func TestValidatorSetMimcAccumulator_WithNoValidators_ReturnsZeroHash(t *testing.T) ⋮---- func TestValidatorSetMimcAccumulator_WithActiveValidators_ReturnsHash(t *testing.T) ⋮---- func TestValidatorSetMimcAccumulator_WithSameValidators_ReturnsSameHash(t *testing.T) ⋮---- func TestValidatorSetMimcAccumulator_WithDifferentValidators_ReturnsDifferentHashes(t *testing.T) ⋮---- func TestToValidatorsData_WithNoValidators_ReturnsNormalizedData(t *testing.T) ⋮---- func TestToValidatorsData_WithInactiveValidators_ReturnsNormalizedData(t *testing.T) ⋮---- func TestToValidatorsData_WithActiveValidators_ReturnsData(t *testing.T) ⋮---- func TestToValidatorsData_WithSigners_MarksSignersCorrectly(t *testing.T) ⋮---- func TestToValidatorsData_WithMixedSignersAndNonSigners_MarksCorrectly(t *testing.T) ⋮---- func TestAggregator_GenerateExtraData_WithValidValidators_ReturnsExtraData(t *testing.T) ⋮---- func TestAggregator_GenerateExtraData_WithMultipleKeyTags_ReturnsMultipleExtraData(t *testing.T) ⋮---- func TestAggregator_GenerateExtraData_ReturnsSortedData(t *testing.T) ⋮---- func TestAggregator_Verify_WithInvalidMessageHash_ReturnsError(t *testing.T) ⋮---- func TestAggregator_Verify_WithInsufficientVotingPower_ReturnsError(t *testing.T) ```` ## File: symbiotic/usecase/aggregator/blsBn254ZK/aggregator.go ````go package blsBn254ZK ⋮---- import ( "bytes" "math/big" "sort" "github.com/symbioticfi/relay/pkg/proof" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" types "github.com/symbioticfi/relay/symbiotic/usecase/aggregator/aggregator-types" "github.com/symbioticfi/relay/symbiotic/usecase/aggregator/helpers" "github.com/symbioticfi/relay/symbiotic/usecase/crypto/blsBn254" "github.com/consensys/gnark-crypto/ecc/bn254" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/go-errors/errors" ) ⋮---- "bytes" "math/big" "sort" ⋮---- "github.com/symbioticfi/relay/pkg/proof" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" types "github.com/symbioticfi/relay/symbiotic/usecase/aggregator/aggregator-types" "github.com/symbioticfi/relay/symbiotic/usecase/aggregator/helpers" "github.com/symbioticfi/relay/symbiotic/usecase/crypto/blsBn254" ⋮---- "github.com/consensys/gnark-crypto/ecc/bn254" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/go-errors/errors" ⋮---- type Aggregator struct { prover types.Prover } ⋮---- func NewAggregator(prover types.Prover) (*Aggregator, error) ⋮---- func (a Aggregator) Aggregate( valset symbiotic.ValidatorSet, keyTag symbiotic.KeyTag, messageHash []byte, signatures []symbiotic.Signature, ) (symbiotic.AggregationProof, error) ⋮---- var validatorsData []proof.ValidatorData ⋮---- func (a Aggregator) Verify( valset symbiotic.ValidatorSet, keyTag symbiotic.KeyTag, aggregationProof symbiotic.AggregationProof, ) (bool, error) ⋮---- // last 32 bytes is aggVotingPowerBytes ⋮---- messageG1Bytes := messageG1.RawBytes() // non compressed ⋮---- func (a Aggregator) GenerateExtraData(valset symbiotic.ValidatorSet, keyTags []symbiotic.KeyTag) ([]symbiotic.ExtraData, error) ⋮---- // sort extra data by key to ensure deterministic order ⋮---- func validatorSetMimcAccumulator(valset []symbiotic.Validator, requiredKeyTag symbiotic.KeyTag) (common.Hash, error) ⋮---- func toValidatorsData(signerValidators []symbiotic.Validator, allValidators symbiotic.Validators, requiredKeyTag symbiotic.KeyTag) ([]proof.ValidatorData, error) ```` ## File: symbiotic/usecase/aggregator/helpers/helpers_test.go ````go package helpers ⋮---- import ( "math/big" "testing" "github.com/consensys/gnark-crypto/ecc/bn254" "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "math/big" "testing" ⋮---- "github.com/consensys/gnark-crypto/ecc/bn254" "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ⋮---- symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- func TestCompareMessageHasher_WithMatchingHashes_ReturnsTrue(t *testing.T) ⋮---- func TestCompareMessageHasher_WithDifferentHash_ReturnsFalse(t *testing.T) ⋮---- func TestCompareMessageHasher_WithEmptySignatures_ReturnsTrue(t *testing.T) ⋮---- func TestCompareMessageHasher_WithSingleSignature_ReturnsCorrectResult(t *testing.T) ⋮---- func TestGetExtraDataKey_WithValidInputs_ReturnsHash(t *testing.T) ⋮---- func TestGetExtraDataKey_WithDifferentVerificationTypes_ReturnsDifferentHashes(t *testing.T) ⋮---- func TestGetExtraDataKey_WithDifferentNameHashes_ReturnsDifferentHashes(t *testing.T) ⋮---- func TestGetExtraDataKey_WithSameInputs_ReturnsSameHash(t *testing.T) ⋮---- func TestGetExtraDataKeyTagged_WithValidInputs_ReturnsHash(t *testing.T) ⋮---- func TestGetExtraDataKeyTagged_WithDifferentKeyTags_ReturnsDifferentHashes(t *testing.T) ⋮---- func TestGetExtraDataKeyTagged_WithDifferentVerificationTypes_ReturnsDifferentHashes(t *testing.T) ⋮---- func TestGetExtraDataKeyTagged_WithSameInputs_ReturnsSameHash(t *testing.T) ⋮---- func TestGetAggregatedPubKeys_WithNoValidators_ReturnsZeroPoint(t *testing.T) ⋮---- func TestGetAggregatedPubKeys_WithInactiveValidators_ReturnsZeroPoint(t *testing.T) ⋮---- func TestGetAggregatedPubKeys_WithSingleActiveValidator_ReturnsAggregatedKey(t *testing.T) ⋮---- func TestGetAggregatedPubKeys_WithMultipleActiveValidators_ReturnsAggregatedKey(t *testing.T) ⋮---- func TestGetAggregatedPubKeys_WithMixedActiveInactive_ReturnsOnlyActiveAggregation(t *testing.T) ⋮---- func TestGetAggregatedPubKeys_WithMultipleKeyTags_ReturnsMultipleAggregations(t *testing.T) ⋮---- func TestGetExtraDataKeyIndexed_WithValidInputs_ReturnsHash(t *testing.T) ⋮---- func TestGetExtraDataKeyIndexed_WithZeroIndex_EqualsBaseHash(t *testing.T) ⋮---- func TestGetExtraDataKeyIndexed_WithDifferentIndexes_ReturnsDifferentHashes(t *testing.T) ⋮---- func TestGetExtraDataKeyIndexed_WithLargeIndex_ReturnsHash(t *testing.T) ⋮---- func TestGetValidatorsIndexesMapByKey_WithNoValidators_ReturnsEmptyMap(t *testing.T) ⋮---- func TestGetValidatorsIndexesMapByKey_WithInactiveValidators_ReturnsEmptyMap(t *testing.T) ⋮---- func TestGetValidatorsIndexesMapByKey_WithSingleActiveValidator_ReturnsMapWithOneEntry(t *testing.T) ⋮---- func TestGetValidatorsIndexesMapByKey_WithMultipleActiveValidators_ReturnsMapWithAllEntries(t *testing.T) ⋮---- func TestGetValidatorsIndexesMapByKey_WithMixedActiveInactive_ReturnsOnlyActiveValidators(t *testing.T) ⋮---- func TestGetValidatorsIndexesMapByKey_WithNonMatchingKeyTag_ReturnsEmptyMap(t *testing.T) ⋮---- func TestGetValidatorsIndexesMapByKey_WithValidatorHavingMultipleKeys_OnlyMapsMatchingKeyTag(t *testing.T) ```` ## File: symbiotic/usecase/aggregator/helpers/helpers.go ````go package helpers ⋮---- import ( "bytes" "math/big" "github.com/consensys/gnark-crypto/ecc/bn254" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "bytes" "math/big" ⋮---- "github.com/consensys/gnark-crypto/ecc/bn254" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" ⋮---- symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- func CompareMessageHasher(signatures []symbiotic.Signature, msgHash []byte) bool ⋮---- func GetExtraDataKey(verificationType symbiotic.VerificationType, nameHash common.Hash) (common.Hash, error) ⋮---- func GetExtraDataKeyTagged(verificationType symbiotic.VerificationType, keyTag symbiotic.KeyTag, nameHash common.Hash) (common.Hash, error) ⋮---- func GetAggregatedPubKeys( valset symbiotic.ValidatorSet, keyTags []symbiotic.KeyTag, ) []symbiotic.ValidatorKey ⋮---- // only bn254 bls for now ⋮---- // aggregate and save in map ⋮---- var aggregatedPubKeys []symbiotic.ValidatorKey ⋮---- // pack g1 point to bytes and add to list ⋮---- // will be used later func GetExtraDataKeyIndexed( verificationType symbiotic.VerificationType, keyTag symbiotic.KeyTag, nameHash common.Hash, index *big.Int, ) (common.Hash, error) ⋮---- var out common.Hash ⋮---- func GetValidatorsIndexesMapByKey(valset symbiotic.ValidatorSet, keyTag symbiotic.KeyTag) map[string]int ```` ## File: symbiotic/usecase/aggregator/aggregators_test.go ````go package aggregator ⋮---- import ( "encoding/hex" "math/big" "testing" "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/symbioticfi/relay/pkg/proof" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/aggregator/blsBn254Simple" "github.com/symbioticfi/relay/symbiotic/usecase/aggregator/blsBn254ZK" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" crypto2 "github.com/ethereum/go-ethereum/crypto" "github.com/go-errors/errors" ) ⋮---- "encoding/hex" "math/big" "testing" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ⋮---- "github.com/symbioticfi/relay/pkg/proof" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/aggregator/blsBn254Simple" "github.com/symbioticfi/relay/symbiotic/usecase/aggregator/blsBn254ZK" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" ⋮---- crypto2 "github.com/ethereum/go-ethereum/crypto" "github.com/go-errors/errors" ⋮---- type mockProver struct{} ⋮---- func (m *mockProver) Prove(proveInput proof.ProveInput) (proof.ProofData, error) ⋮---- func (m *mockProver) Verify(valsetLen int, publicInputHash common.Hash, proofBytes []byte) (bool, error) ⋮---- func TestSimpleAggregator(t *testing.T) ⋮---- func TestInvalidSimpleAggregator(t *testing.T) ⋮---- func TestSimpleAggregatorExtraData(t *testing.T) ⋮---- func TestAggregatorZKExtraData(t *testing.T) ⋮---- func TestZkAggregator(t *testing.T) ⋮---- func genExtraDataTest(t *testing.T) (symbiotic.ValidatorSet, symbiotic.KeyTag) ⋮---- var err error ⋮---- func genCorrectTest(numValidators int, nonSigners []int) (symbiotic.ValidatorSet, []symbiotic.Signature, symbiotic.KeyTag) ⋮---- func TestNewAggregator_WithBlsBn254Simple_ReturnsAggregator(t *testing.T) ⋮---- func TestNewAggregator_WithBlsBn254ZK_ReturnsAggregator(t *testing.T) ⋮---- func TestNewAggregator_WithUnsupportedType_ReturnsError(t *testing.T) ⋮---- func TestNewAggregator_WithDifferentTypes_ReturnsDifferentImplementations(t *testing.T) ```` ## File: symbiotic/usecase/aggregator/aggregators.go ````go package aggregator ⋮---- import ( symbiotic "github.com/symbioticfi/relay/symbiotic/entity" types "github.com/symbioticfi/relay/symbiotic/usecase/aggregator/aggregator-types" "github.com/symbioticfi/relay/symbiotic/usecase/aggregator/blsBn254Simple" "github.com/symbioticfi/relay/symbiotic/usecase/aggregator/blsBn254ZK" "github.com/go-errors/errors" ) ⋮---- symbiotic "github.com/symbioticfi/relay/symbiotic/entity" types "github.com/symbioticfi/relay/symbiotic/usecase/aggregator/aggregator-types" "github.com/symbioticfi/relay/symbiotic/usecase/aggregator/blsBn254Simple" "github.com/symbioticfi/relay/symbiotic/usecase/aggregator/blsBn254ZK" ⋮---- "github.com/go-errors/errors" ⋮---- func NewAggregator(verificationType symbiotic.VerificationType, prover Prover) (Aggregator, error) ```` ## File: symbiotic/usecase/crypto/bls12381Bn254/key_test.go ````go package bls12381Bn254 ⋮---- import ( "crypto/rand" "math/big" "testing" "github.com/stretchr/testify/require" ) ⋮---- "crypto/rand" "math/big" "testing" ⋮---- "github.com/stretchr/testify/require" ⋮---- func TestBLS12381Keys(t *testing.T) ⋮---- func TestCheckPrivateKeyBytes(t *testing.T) ⋮---- func TestMarshalText(t *testing.T) ⋮---- func TestInvalidVerification(t *testing.T) ⋮---- func TestFromRaw(t *testing.T) ⋮---- func randData(t *testing.T) []byte ```` ## File: symbiotic/usecase/crypto/bls12381Bn254/key.go ````go package bls12381Bn254 ⋮---- import ( "fmt" "math/big" bls12381 "github.com/consensys/gnark-crypto/ecc/bls12-381" "github.com/consensys/gnark-crypto/ecc/bls12-381/fr" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/crypto" "github.com/go-errors/errors" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "fmt" "math/big" ⋮---- bls12381 "github.com/consensys/gnark-crypto/ecc/bls12-381" "github.com/consensys/gnark-crypto/ecc/bls12-381/fr" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/crypto" "github.com/go-errors/errors" ⋮---- symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- const ( RawKeyLength int = bls12381.SizeOfG1AffineCompressed + bls12381.SizeOfG2AffineCompressed MessageHashLength int = 32 hashToG1Domain = "BLS_SIG_BLS12381G1_XMD:SHA-256_SSWU_RO_NUL_" ) ⋮---- type PublicKey struct { g1PubKey bls12381.G1Affine g2PubKey bls12381.G2Affine } ⋮---- type PrivateKey struct { privateKey *big.Int } ⋮---- func NewPrivateKey(b []byte) (*PrivateKey, error) ⋮---- func HashMessage(msg []byte) MessageHash ⋮---- func GenerateKey() (*PrivateKey, error) ⋮---- var err error ⋮---- func (k *PrivateKey) Bytes() []byte ⋮---- func (k *PrivateKey) Sign(msg []byte) (Signature, MessageHash, error) ⋮---- // symbiotic using keccak256 for hashing in bls12381-bn254 ⋮---- var g1Sig bls12381.G1Affine ⋮---- func HashToG1(data []byte) (*bls12381.G1Affine, error) ⋮---- func (k *PrivateKey) PublicKey() symbiotic.PublicKey ⋮---- func NewPublicKey(g1PubKey bls12381.G1Affine, g2PubKey bls12381.G2Affine) *PublicKey ⋮---- func (k *PublicKey) Verify(msg Message, sig Signature) error ⋮---- func (k *PublicKey) VerifyWithHash(msgHash MessageHash, sig Signature) error ⋮---- var negSig bls12381.G1Affine ⋮---- // OnChain might be one way operation, meaning that it's impossible to reconstruct PublicKey from compact func (k *PublicKey) OnChain() CompactPublicKey ⋮---- func (k *PublicKey) Raw() RawPublicKey ⋮---- // combined g1 and g2 [compressed] ⋮---- func (k *PublicKey) G2() *bls12381.G2Affine ⋮---- func (k *PublicKey) MarshalText() ([]byte, error) ⋮---- func FromRaw(rawKey RawPublicKey) (*PublicKey, error) ⋮---- var g1 bls12381.G1Affine var g2 bls12381.G2Affine ⋮---- func FromPrivateKey(privateKey *PrivateKey) symbiotic.PublicKey ```` ## File: symbiotic/usecase/crypto/blsBn254/key_test.go ````go package blsBn254 ⋮---- import ( "crypto/rand" "math/big" "testing" "github.com/stretchr/testify/require" ) ⋮---- "crypto/rand" "math/big" "testing" ⋮---- "github.com/stretchr/testify/require" ⋮---- func TestBLSKeys(t *testing.T) ⋮---- func TestCheckPrivateKeyBytes(t *testing.T) ⋮---- func TestMarshallText(t *testing.T) ⋮---- func TestInvalidVerification(t *testing.T) ⋮---- func TestFromRaw(t *testing.T) ⋮---- func randData(t *testing.T) []byte ```` ## File: symbiotic/usecase/crypto/blsBn254/key.go ````go package blsBn254 ⋮---- import ( "fmt" "math/big" "github.com/consensys/gnark-crypto/ecc/bn254" "github.com/consensys/gnark-crypto/ecc/bn254/fp" "github.com/consensys/gnark-crypto/ecc/bn254/fr" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/crypto" "github.com/go-errors/errors" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "fmt" "math/big" ⋮---- "github.com/consensys/gnark-crypto/ecc/bn254" "github.com/consensys/gnark-crypto/ecc/bn254/fp" "github.com/consensys/gnark-crypto/ecc/bn254/fr" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/crypto" "github.com/go-errors/errors" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- const ( RawKeyLength int = 96 MessageHashLength int = 32 ) ⋮---- type PublicKey struct { g1PubKey bn254.G1Affine g2PubKey bn254.G2Affine } ⋮---- type PrivateKey struct { privateKey *big.Int } ⋮---- func NewPrivateKey(b []byte) (*PrivateKey, error) ⋮---- func HashMessage(msg []byte) MessageHash ⋮---- func GenerateKey() (*PrivateKey, error) ⋮---- var err error ⋮---- func (k *PrivateKey) Bytes() []byte ⋮---- func (k *PrivateKey) Sign(msg []byte) (Signature, MessageHash, error) ⋮---- // symbiotic using keccak256 for hashing in bls-bn254 ⋮---- // returns non compressed G1 point ⋮---- func HashToG1(data []byte) (*bn254.G1Affine, error) ⋮---- // Convert data to a big integer ⋮---- // Ensure x is within the field ⋮---- // Find y coordinate for the current x ⋮---- // Check if y^2 == beta ⋮---- // Create a G1 point with the found coordinates var point bn254.G1Affine ⋮---- // Increment x and try again ⋮---- // FindYFromX calculates the y coordinate for a given x on the BN254 curve // Returns (beta, y) where beta = x^3 + 3 (mod p) and y = sqrt(beta) if it exists func findYFromX(x *big.Int) (beta *big.Int, y *big.Int, err error) ⋮---- // Calculate beta = x^3 + 3 mod p beta = new(big.Int).Exp(x, big.NewInt(3), fpModulus) // x^3 beta.Add(beta, big.NewInt(3)) // x^3 + 3 beta.Mod(beta, fpModulus) // (x^3 + 3) mod p ⋮---- // Calculate y = beta^((p+1)/4) mod p // The exponent (p+1)/4 for BN254 is 0xc19139cb84c680a6e14116da060561765e05aa45a1c72a34f082305b61f3f52 ⋮---- func (k *PrivateKey) PublicKey() symbiotic.PublicKey ⋮---- // Get the generators for G1 and G2 ⋮---- // Compute public keys by scalar multiplication with generators ⋮---- func NewPublicKey(g1PubKey bn254.G1Affine, g2PubKey bn254.G2Affine) *PublicKey ⋮---- func (k *PublicKey) Verify(msg Message, sig Signature) error ⋮---- // Hash the message to a point on G1 ⋮---- // Get the G2 generator ⋮---- var negSig bn254.G1Affine ⋮---- func (k *PublicKey) VerifyWithHash(msgHash MessageHash, sig Signature) error ⋮---- // OnChain might be one way operation, meaning that it's impossible to reconstruct PublicKey from compact func (k *PublicKey) OnChain() CompactPublicKey ⋮---- func (k *PublicKey) Raw() RawPublicKey ⋮---- // combined g1 and g2 [compressed] ⋮---- func (k *PublicKey) G2() *bn254.G2Affine ⋮---- func (k *PublicKey) MarshalText() (text []byte, err error) ⋮---- func FromRaw(rawKey RawPublicKey) (*PublicKey, error) ⋮---- func FromPrivateKey(privateKey *PrivateKey) symbiotic.PublicKey ```` ## File: symbiotic/usecase/crypto/ecdsaSecp256k1/key_test.go ````go package ecdsaSecp256k1 ⋮---- import ( "crypto/rand" "math/big" "testing" "github.com/ethereum/go-ethereum/crypto" "github.com/stretchr/testify/require" ) ⋮---- "crypto/rand" "math/big" "testing" ⋮---- "github.com/ethereum/go-ethereum/crypto" "github.com/stretchr/testify/require" ⋮---- func TestECDSAKeys(t *testing.T) ⋮---- func TestCheckPrivateKeyBytes(t *testing.T) ⋮---- func TestMakePrivateFromNumber(t *testing.T) ⋮---- func TestMarshallText(t *testing.T) ⋮---- func TestInvalidVerification(t *testing.T) ⋮---- func TestFromRaw(t *testing.T) ⋮---- func randData(t *testing.T) []byte ```` ## File: symbiotic/usecase/crypto/ecdsaSecp256k1/key.go ````go package ecdsaSecp256k1 ⋮---- import ( "crypto/ecdsa" "math/big" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/crypto" "github.com/go-errors/errors" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ) ⋮---- "crypto/ecdsa" "math/big" ⋮---- "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/crypto" "github.com/go-errors/errors" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" ⋮---- const ( RawKeyLength int = 33 MessageHashLength int = 32 ) ⋮---- type PublicKey struct { pubKey ecdsa.PublicKey } ⋮---- type PrivateKey struct { privateKey ecdsa.PrivateKey } ⋮---- func NewPrivateKey(b []byte) (*PrivateKey, error) ⋮---- if kInt.BitLen() > 32*8 { // 32 bytes = 256 bits ⋮---- func HashMessage(msg []byte) MessageHash ⋮---- func GenerateKey() (*PrivateKey, error) ⋮---- func (k *PrivateKey) Bytes() []byte ⋮---- func (k *PrivateKey) Sign(msg []byte) (Signature, MessageHash, error) ⋮---- // symbiotic using keccak256 for hashing in ecdsaSecp256k1 ⋮---- func (k *PrivateKey) PublicKey() symbiotic.PublicKey ⋮---- func NewPublicKey(x *big.Int, y *big.Int) *PublicKey ⋮---- func (k *PublicKey) Verify(msg Message, sig Signature) error ⋮---- func (k *PublicKey) VerifyWithHash(msgHash MessageHash, sig Signature) error ⋮---- // Remove recovery ID from signature for verification ⋮---- // OnChain might be one way operation, meaning that it's impossible to reconstruct PublicKey from compact func (k *PublicKey) OnChain() CompactPublicKey ⋮---- // returns eth address in this case, left-padded to 32 bytes to match logic in contracts // see https://github.com/symbioticfi/relay-contracts/blob/abcf4d7bb151780094d3a67cce7431300ecd5e31/src/contracts/libraries/keys/KeyEcdsaSecp256k1.sol#L41 ⋮---- func (k *PublicKey) Raw() RawPublicKey ⋮---- // returns 33 bytes compressed pubKey ⋮---- func (k *PublicKey) MarshalText() (text []byte, err error) ⋮---- func FromRaw(rawKey RawPublicKey) (*PublicKey, error) ⋮---- func FromPrivateKey(privateKey *PrivateKey) symbiotic.PublicKey ```` ## File: symbiotic/usecase/crypto/keys.go ````go package crypto ⋮---- import ( "sync" "github.com/go-errors/errors" "github.com/symbioticfi/relay/internal/client/repository/cache" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/crypto/bls12381Bn254" "github.com/symbioticfi/relay/symbiotic/usecase/crypto/blsBn254" "github.com/symbioticfi/relay/symbiotic/usecase/crypto/ecdsaSecp256k1" ) ⋮---- "sync" ⋮---- "github.com/go-errors/errors" "github.com/symbioticfi/relay/internal/client/repository/cache" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/crypto/bls12381Bn254" "github.com/symbioticfi/relay/symbiotic/usecase/crypto/blsBn254" "github.com/symbioticfi/relay/symbiotic/usecase/crypto/ecdsaSecp256k1" ⋮---- var ( pubKeyCache cache.Cache[pubKeyCacheKey, symbiotic.PublicKey] initCacheOnce sync.Once ) ⋮---- // InitializePubkeyCache initializes the public key cache with the given size. // Dev: Should be called only once during application startup. func InitializePubkeyCache(cacheSize int) (err error) ⋮---- // FNV-1a 32-bit hash const ( offset32 = uint32(2166136261) ⋮---- // Process each byte of the key string ⋮---- type pubKeyCacheKey struct { keyTag symbiotic.KeyType key string } ⋮---- func NewPublicKey(keyType symbiotic.KeyType, keyBytes symbiotic.RawPublicKey) (PublicKey, error) ⋮---- // Try cache first ⋮---- var ( pubkey PublicKey err error ) ⋮---- func NewPrivateKey(keyType symbiotic.KeyType, keyBytes []byte) (PrivateKey, error) ⋮---- func HashMessage(keyType symbiotic.KeyType, msg []byte) (symbiotic.RawMessageHash, error) ⋮---- func GeneratePrivateKey(keyType symbiotic.KeyType) (PrivateKey, error) ```` ## File: symbiotic/usecase/ssz/ssz.go ````go // Hash: 8c67e0de1079a95336f540c6c73e42f4633fd2cb9841d83ab84b052439e4f3c7 // Version: 0.1.3 package ssz ⋮---- import ( "sort" ssz "github.com/ferranbt/fastssz" "github.com/go-errors/errors" "github.com/ethereum/go-ethereum/common" ) ⋮---- "sort" ⋮---- ssz "github.com/ferranbt/fastssz" "github.com/go-errors/errors" ⋮---- "github.com/ethereum/go-ethereum/common" ⋮---- const ( ValidatorsListLocalPosition = 0 OperatorLocalPosition = 0 ValidatorVotingPowerLocalPosition = 1 IsActiveLocalPosition = 2 KeysListLocalPosition = 3 VaultsListLocalPosition = 4 TagLocalPosition = 0 PayloadHashLocalPosition = 1 ChainIdLocalPosition = 0 VaultLocalPosition = 1 VaultVotingPowerLocalPosition = 2 ) ⋮---- const ( ValidatorSetElements = 1 ValidatorSetTreeHeight = 0 // ceil(log2(ValidatorSetElements)) ⋮---- ValidatorSetTreeHeight = 0 // ceil(log2(ValidatorSetElements)) ⋮---- ValidatorTreeHeight = 3 // ceil(log2(ValidatorElements)) ⋮---- VaultTreeHeight = 2 // ceil(log2(VaultElements)) ⋮---- KeyTreeHeight = 1 // ceil(log2(KeyElements)) ⋮---- ValidatorsListTreeHeight = 20 // ceil(log2(ValidatorsListMaxElements)) ⋮---- KeysListTreeHeight = 7 // ceil(log2(KeysListMaxElements)) ⋮---- VaultsListTreeHeight = 10 // ceil(log2(VaultsListMaxElements)) ⋮---- // MarshalSSZ ssz marshals the Key object func (k *SszKey) MarshalSSZ() ([]byte, error) ⋮---- // MarshalSSZTo ssz marshals the Key object to a target array func (k *SszKey) MarshalSSZTo(buf []byte) ([]byte, error) ⋮---- // Field (0) 'Tag' ⋮---- // Field (1) 'PayloadHash' ⋮---- // UnmarshalSSZ ssz unmarshals the Key object func (k *SszKey) UnmarshalSSZ(buf []byte) error ⋮---- var err error ⋮---- // SizeSSZ returns the ssz encoded size in bytes for the Key object func (k *SszKey) SizeSSZ() int ⋮---- // HashTreeRoot ssz hashes the Key object func (k *SszKey) HashTreeRoot() ([32]byte, error) ⋮---- // HashTreeRootWith ssz hashes the Key object with a hasher func (k *SszKey) HashTreeRootWith(hh ssz.HashWalker) error ⋮---- // GetTree ssz hashes the Key object func (k *SszKey) GetTree() (*ssz.Node, error) ⋮---- // MarshalSSZ ssz marshals the Vault object ⋮---- // MarshalSSZTo ssz marshals the Vault object to a target array ⋮---- // Field (0) 'ChainId' ⋮---- // Field (1) 'OperatorVault' ⋮---- // Field (2) 'VotingPower' ⋮---- // UnmarshalSSZ ssz unmarshals the Vault object ⋮---- // SizeSSZ returns the ssz encoded size in bytes for the Vault object ⋮---- // HashTreeRoot ssz hashes the Vault object ⋮---- // HashTreeRootWith ssz hashes the Vault object with a hasher ⋮---- // GetTree ssz hashes the Vault object ⋮---- // MarshalSSZ ssz marshals the Validator object ⋮---- // MarshalSSZTo ssz marshals the Validator object to a target array ⋮---- // Field (0) 'Operator' ⋮---- // Field (1) 'VotingPower' ⋮---- // Field (2) 'IsActive' ⋮---- // Offset (3) 'Keys' ⋮---- // Offset (4) 'Vaults' ⋮---- // Field (3) 'Keys' ⋮---- var err error ⋮---- // Field (4) 'Vaults' ⋮---- // UnmarshalSSZ ssz unmarshals the Validator object ⋮---- var o3, o4 uint64 ⋮---- // SizeSSZ returns the ssz encoded size in bytes for the Validator object ⋮---- // HashTreeRoot ssz hashes the Validator object ⋮---- // HashTreeRootWith ssz hashes the Validator object with a hasher ⋮---- // GetTree ssz hashes the Validator object ⋮---- // MarshalSSZ ssz marshals the SszValidatorSet object ⋮---- // MarshalSSZTo ssz marshals the SszValidatorSet object to a target array ⋮---- // Offset (0) 'Validators' ⋮---- // Field (0) 'Validators' ⋮---- // UnmarshalSSZ ssz unmarshalls the SszValidatorSet object ⋮---- var o0 uint64 ⋮---- // SizeSSZ returns the ssz encoded size in bytes for the SszValidatorSet object ⋮---- // HashTreeRoot ssz hashes the SszValidatorSet object ⋮---- // HashTreeRootWith ssz hashes the SszValidatorSet object with a hasher ⋮---- // GetTree ssz hashes the SszValidatorSet object ⋮---- //nolint:revive // function-result-limit: This function needs to return multiple complex types for cryptographic operations func (v *SszValidatorSet) ProveValidatorRoot(operator common.Address) (*SszValidator, int, *ssz.Proof, error) ⋮---- // go to SszValidatorSet.Validators ⋮---- // consider List's length mix-in ⋮---- // go to SszValidatorSet.Validators[validatorIndex] ⋮---- func (v *SszValidator) ProveValidatorOperator() (*ssz.Proof, error) ⋮---- // go to Validator.Operator ⋮---- func (v *SszValidator) ProveValidatorVotingPower() (*ssz.Proof, error) ⋮---- // go to Validator.VotingPower ⋮---- func (v *SszValidator) ProveValidatorIsActive() (*ssz.Proof, error) ⋮---- // go to Validator.IsActive ⋮---- func (v *SszValidator) ProveKeyRoot(keyTag uint8) (*SszKey, int, *ssz.Proof, error) ⋮---- // go to Validator.Keys ⋮---- // go to Validator.Keys[keyIndex] ⋮---- func (k *SszKey) ProveKeyTag() (*ssz.Proof, error) ⋮---- // go to Key.Tag ⋮---- func (k *SszKey) ProveKeyPayloadHash() (*ssz.Proof, error) ⋮---- // go to Key.PayloadHash ⋮---- func (v *SszValidator) ProveVaultRoot(vault common.Address) (*SszVault, int, *ssz.Proof, error) ⋮---- // go to Validator.Vaults ⋮---- // go to Validator.Vaults[vaultIndex] ⋮---- func (v *SszVault) ProveVaultChainId() (*ssz.Proof, error) ⋮---- // go to Vault.ChainId ⋮---- func (v *SszVault) ProveVaultVault() (*ssz.Proof, error) ⋮---- // go to Vault.Vault ⋮---- func (v *SszVault) ProveVaultVotingPower() (*ssz.Proof, error) ⋮---- // go to Vault.VotingPower ```` ## File: symbiotic/usecase/ssz/types.go ````go package ssz ⋮---- import ( "math/big" "github.com/ethereum/go-ethereum/common" ) ⋮---- "math/big" ⋮---- "github.com/ethereum/go-ethereum/common" ⋮---- type SszKey struct { Tag uint8 `ssz-size:"1"` Payload []byte PayloadHash [32]byte `ssz-size:"32"` } ⋮---- type SszVault struct { ChainId uint64 `ssz-size:"8"` Vault common.Address `ssz-size:"20"` VotingPower *big.Int `ssz-size:"32"` } ⋮---- type SszValidator struct { Operator common.Address `ssz-size:"20"` VotingPower *big.Int `ssz-size:"32"` IsActive bool `ssz-size:"1"` Keys []*SszKey `ssz-max:"128"` Vaults []*SszVault `ssz-max:"1024"` } ⋮---- type SszValidatorSet struct { Version uint8 Validators []*SszValidator `ssz-max:"1048576"` } ```` ## File: symbiotic/usecase/valset-deriver/mocks/deriver.go ````go // Code generated by MockGen. DO NOT EDIT. // Source: valset_deriver.go // // Generated by this command: ⋮---- // mockgen -source=valset_deriver.go -destination=mocks/deriver.go -package=mocks -mock_names=evmClient=MockEvmClient ⋮---- // Package mocks is a generated GoMock package. package mocks ⋮---- import ( context "context" reflect "reflect" common "github.com/ethereum/go-ethereum/common" entity "github.com/symbioticfi/relay/symbiotic/entity" gomock "go.uber.org/mock/gomock" ) ⋮---- context "context" reflect "reflect" ⋮---- common "github.com/ethereum/go-ethereum/common" entity "github.com/symbioticfi/relay/symbiotic/entity" gomock "go.uber.org/mock/gomock" ⋮---- // MockEvmClient is a mock of evmClient interface. type MockEvmClient struct { ctrl *gomock.Controller recorder *MockEvmClientMockRecorder isgomock struct{} ⋮---- // MockEvmClientMockRecorder is the mock recorder for MockEvmClient. type MockEvmClientMockRecorder struct { mock *MockEvmClient } ⋮---- // NewMockEvmClient creates a new mock instance. func NewMockEvmClient(ctrl *gomock.Controller) *MockEvmClient ⋮---- // EXPECT returns an object that allows the caller to indicate expected use. func (m *MockEvmClient) EXPECT() *MockEvmClientMockRecorder ⋮---- // GetConfig mocks base method. func (m *MockEvmClient) GetConfig(ctx context.Context, timestamp entity.Timestamp, epoch entity.Epoch) (entity.NetworkConfig, error) ⋮---- // GetConfig indicates an expected call of GetConfig. ⋮---- // GetCurrentEpoch mocks base method. func (m *MockEvmClient) GetCurrentEpoch(ctx context.Context) (entity.Epoch, error) ⋮---- // GetCurrentEpoch indicates an expected call of GetCurrentEpoch. ⋮---- // GetEip712Domain mocks base method. func (m *MockEvmClient) GetEip712Domain(ctx context.Context, addr entity.CrossChainAddress) (entity.Eip712Domain, error) ⋮---- // GetEip712Domain indicates an expected call of GetEip712Domain. ⋮---- // GetEpochStart mocks base method. func (m *MockEvmClient) GetEpochStart(ctx context.Context, epoch entity.Epoch) (entity.Timestamp, error) ⋮---- // GetEpochStart indicates an expected call of GetEpochStart. ⋮---- // GetHeaderHash mocks base method. func (m *MockEvmClient) GetHeaderHash(ctx context.Context, addr entity.CrossChainAddress) (common.Hash, error) ⋮---- // GetHeaderHash indicates an expected call of GetHeaderHash. ⋮---- // GetHeaderHashAt mocks base method. func (m *MockEvmClient) GetHeaderHashAt(ctx context.Context, addr entity.CrossChainAddress, epoch entity.Epoch) (common.Hash, error) ⋮---- // GetHeaderHashAt indicates an expected call of GetHeaderHashAt. ⋮---- // GetKeys mocks base method. func (m *MockEvmClient) GetKeys(ctx context.Context, address entity.CrossChainAddress, timestamp entity.Timestamp) ([]entity.OperatorWithKeys, error) ⋮---- // GetKeys indicates an expected call of GetKeys. ⋮---- // GetLastCommittedHeaderEpoch mocks base method. func (m *MockEvmClient) GetLastCommittedHeaderEpoch(ctx context.Context, addr entity.CrossChainAddress, opts ...entity.EVMOption) (entity.Epoch, error) ⋮---- // GetLastCommittedHeaderEpoch indicates an expected call of GetLastCommittedHeaderEpoch. ⋮---- // GetNetworkAddress mocks base method. func (m *MockEvmClient) GetNetworkAddress(ctx context.Context) (common.Address, error) ⋮---- // GetNetworkAddress indicates an expected call of GetNetworkAddress. ⋮---- // GetOperators mocks base method. func (m *MockEvmClient) GetOperators(ctx context.Context, address entity.CrossChainAddress, timestamp entity.Timestamp) ([]common.Address, error) ⋮---- // GetOperators indicates an expected call of GetOperators. ⋮---- // GetSubnetwork mocks base method. func (m *MockEvmClient) GetSubnetwork(ctx context.Context) (common.Hash, error) ⋮---- // GetSubnetwork indicates an expected call of GetSubnetwork. ⋮---- // GetVotingPowers mocks base method. func (m *MockEvmClient) GetVotingPowers(ctx context.Context, address entity.CrossChainAddress, timestamp entity.Timestamp) ([]entity.OperatorVotingPower, error) ⋮---- // GetVotingPowers indicates an expected call of GetVotingPowers. ⋮---- // IsValsetHeaderCommittedAt mocks base method. func (m *MockEvmClient) IsValsetHeaderCommittedAt(ctx context.Context, addr entity.CrossChainAddress, epoch entity.Epoch, opts ...entity.EVMOption) (bool, error) ⋮---- // IsValsetHeaderCommittedAt indicates an expected call of IsValsetHeaderCommittedAt. ```` ## File: symbiotic/usecase/valset-deriver/valset_deriver_test.go ````go package valsetDeriver ⋮---- import ( "context" "fmt" "math/big" "slices" "testing" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/ssz" "github.com/symbioticfi/relay/symbiotic/usecase/valset-deriver/mocks" ) ⋮---- "context" "fmt" "math/big" "slices" "testing" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" ⋮---- symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/ssz" "github.com/symbioticfi/relay/symbiotic/usecase/valset-deriver/mocks" ⋮---- func TestDeriver_calcQuorumThreshold(t *testing.T) ⋮---- QuorumThreshold: symbiotic.ToQuorumThresholdPct(big.NewInt(670000000000000000)), // 67% ⋮---- expectedQuorum: big.NewInt(1000*.67 + 1), // (1000 * 67% + 1) ⋮---- QuorumThreshold: symbiotic.ToQuorumThresholdPct(big.NewInt(750000000000000000)), // 75% ⋮---- expectedQuorum: big.NewInt(2000*.75 + 1), // (2000 * 75% + 1) ⋮---- func TestDeriver_fillValidators(t *testing.T) ⋮---- func TestDeriver_fillValidatorsActive(t *testing.T) ⋮---- expectedActiveValidators []common.Address // operator addresses that should be active expectedInactiveValidators []common.Address // operator addresses that should be inactive expectedVotingPowers map[string]*big.Int // operator -> expected voting power after capping ⋮---- MaxVotingPower: symbiotic.ToVotingPower(big.NewInt(0)), // no max limit MaxValidatorsCount: symbiotic.ToVotingPower(big.NewInt(0)), // no max count ⋮---- expectedTotalVotingPower: big.NewInt(700), // 500 + 200 ⋮---- expectedInactiveValidators: []common.Address{common.HexToAddress("0x789")}, // below minimum ⋮---- "0x789": big.NewInt(50), // unchanged but inactive ⋮---- Keys: []symbiotic.ValidatorKey{}, // no keys ⋮---- expectedInactiveValidators: []common.Address{common.HexToAddress("0x456")}, // no keys ⋮---- expectedTotalVotingPower: big.NewInt(600), // 400 (capped) + 200 ⋮---- "0x123": big.NewInt(400), // capped from 600 ⋮---- expectedTotalVotingPower: big.NewInt(900), // 500 + 400 (only first 2 validators) ⋮---- expectedInactiveValidators: []common.Address{common.HexToAddress("0x789")}, // exceeds max count ⋮---- expectedTotalVotingPower: big.NewInt(550), // 350 (capped from 500) + 200 ⋮---- expectedInactiveValidators: []common.Address{common.HexToAddress("0x789"), common.HexToAddress("0xabc")}, // 0x789 exceeds max count, 0xabc below min power ⋮---- "0x123": big.NewInt(350), // capped from 500 ⋮---- // Make a copy of validators to avoid modifying the test data ⋮---- // Check total voting power ⋮---- // Check active validators var activeValidators []common.Address var inactiveValidators []common.Address ⋮---- // Check voting power (capping) ⋮---- func TestDeriver_GetNetworkData(t *testing.T) ⋮---- func TestDeriver_fillValidators_VaultLimitExceeded(t *testing.T) ⋮---- // This test verifies vault truncation when exceeding ssz.VaultsListMaxElements (1024) // Expected behavior: // 1. Sort vaults by voting power DESC, then vault address ASC // 2. Truncate to keep only top 1024 vaults // 3. Re-sort remaining vaults by vault address ASC only ⋮---- const ( highPowerVaults = 5 mediumPowerVaults = 5 extraVaults = 10 // Create more than the 1024 limit highPower = 2000 mediumPower = 1500 lowPower = 1000 ) ⋮---- extraVaults = 10 // Create more than the 1024 limit ⋮---- // Create test vaults with different voting powers ⋮---- var power int64 ⋮---- // Setup test data ⋮---- // Execute ⋮---- // Verify results ⋮---- // All high and medium power vaults should be kept ⋮---- // Remaining slots filled with low power vaults ⋮---- func TestDeriver_GetSchedulerInfo(t *testing.T) ⋮---- // These expected values are deterministic based on the hash calculation expectedAggIndices: []uint32{2, 0}, // Calculated deterministically from hash expectedCommIndices: []uint32{1}, // Calculated deterministically from hash ⋮---- func TestDeriver_GetSchedulerInfo_Deterministic(t *testing.T) ⋮---- // Test that GetSchedulerInfo returns consistent results for the same inputs ⋮---- // Run the same calculation multiple times const iterations = 10 var firstAggIndices, firstCommIndices []uint32 ⋮---- func TestDeriver_GetSchedulerInfo_VerifyRandomness(t *testing.T) ⋮---- // Test that different inputs produce different results ⋮---- // Get results for original valset ⋮---- // Test with different epoch ⋮---- // Note: Different epochs might produce the same results due to hash collisions, // but we can verify they run without error ⋮---- // Test with different timestamp ⋮---- // Results should be different for different timestamps (high probability) ⋮---- func TestDeriver_findNextAvailableIndex(t *testing.T) ⋮---- // Verify the result is not in usedIndices ⋮---- // Verify the result is within bounds ⋮---- func TestDeriver_findNextAvailableIndex_Panic(t *testing.T) ⋮---- // Test that the function panics when no indices are available ⋮---- // Create a scenario where all indices are taken ```` ## File: symbiotic/usecase/valset-deriver/valset_deriver.go ````go package valsetDeriver ⋮---- import ( "context" "log/slog" "maps" "math/big" "slices" "strconv" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/go-errors/errors" "github.com/samber/lo" symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/ssz" ) ⋮---- "context" "log/slog" "maps" "math/big" "slices" "strconv" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/go-errors/errors" "github.com/samber/lo" ⋮---- symbiotic "github.com/symbioticfi/relay/symbiotic/entity" "github.com/symbioticfi/relay/symbiotic/usecase/ssz" ⋮---- const ( valsetVersion = 1 aggregatorRoleType = "AGGREGATOR" committerRoleType = "COMMITTER" ) ⋮---- //go:generate mockgen -source=valset_deriver.go -destination=mocks/deriver.go -package=mocks -mock_names=evmClient=MockEvmClient type evmClient interface { GetConfig(ctx context.Context, timestamp symbiotic.Timestamp, epoch symbiotic.Epoch) (symbiotic.NetworkConfig, error) GetEpochStart(ctx context.Context, epoch symbiotic.Epoch) (symbiotic.Timestamp, error) GetVotingPowers(ctx context.Context, address symbiotic.CrossChainAddress, timestamp symbiotic.Timestamp) ([]symbiotic.OperatorVotingPower, error) GetKeys(ctx context.Context, address symbiotic.CrossChainAddress, timestamp symbiotic.Timestamp) ([]symbiotic.OperatorWithKeys, error) GetEip712Domain(ctx context.Context, addr symbiotic.CrossChainAddress) (symbiotic.Eip712Domain, error) GetCurrentEpoch(ctx context.Context) (symbiotic.Epoch, error) GetSubnetwork(ctx context.Context) (common.Hash, error) GetNetworkAddress(ctx context.Context) (common.Address, error) GetHeaderHash(ctx context.Context, addr symbiotic.CrossChainAddress) (common.Hash, error) IsValsetHeaderCommittedAt(ctx context.Context, addr symbiotic.CrossChainAddress, epoch symbiotic.Epoch, opts ...symbiotic.EVMOption) (bool, error) GetHeaderHashAt(ctx context.Context, addr symbiotic.CrossChainAddress, epoch symbiotic.Epoch) (common.Hash, error) GetLastCommittedHeaderEpoch(ctx context.Context, addr symbiotic.CrossChainAddress, opts ...symbiotic.EVMOption) (symbiotic.Epoch, error) GetOperators(ctx context.Context, address symbiotic.CrossChainAddress, timestamp symbiotic.Timestamp) ([]common.Address, error) } ⋮---- // Deriver coordinates the ETH services type Deriver struct { evmClient evmClient } ⋮---- // NewDeriver creates a new valset deriver func NewDeriver(evmClient evmClient) (*Deriver, error) ⋮---- func (v *Deriver) GetNetworkData(ctx context.Context, addr symbiotic.CrossChainAddress) (symbiotic.NetworkData, error) ⋮---- type dtoOperatorVotingPower struct { chainId uint64 votingPowers []symbiotic.OperatorVotingPower } ⋮---- func (v *Deriver) GetValidatorSet(ctx context.Context, epoch symbiotic.Epoch, config symbiotic.NetworkConfig) (symbiotic.ValidatorSet, error) ⋮---- // Get voting powers from all voting power providers ⋮---- // Get keys from the keys provider ⋮---- // form validators list from voting powers and keys using config ⋮---- // calc new quorum threshold ⋮---- AggregatorIndices: nil, // will be initialized later CommitterIndices: nil, // will be initialized later ⋮---- func GetSchedulerInfo(_ context.Context, valset symbiotic.ValidatorSet, config symbiotic.NetworkConfig) (aggIndices []uint32, commIndices []uint32, err error) ⋮---- // ensure validators sorted already, function expects sorted list ⋮---- // Helper function for wrap-around search func findNextAvailableIndex(startIndex uint32, validatorCount int, usedIndices map[uint32]struct ⋮---- // This should never happen if we don't request more roles than available validators ⋮---- func (v *Deriver) formValidators( config symbiotic.NetworkConfig, votingPowers []dtoOperatorVotingPower, keys []symbiotic.OperatorWithKeys, ) symbiotic.Validators ⋮---- func markValidatorsActive(config symbiotic.NetworkConfig, validators symbiotic.Validators) ⋮---- // Check minimum voting power if configured ⋮---- // Check if validator has at least one key ⋮---- func fillValidators(votingPowers []dtoOperatorVotingPower, keys []symbiotic.OperatorWithKeys) symbiotic.Validators ⋮---- // Create validators map to consolidate voting powers and keys ⋮---- // Process voting powers ⋮---- IsActive: false, // Default to active, will filter later ⋮---- // Add vaults and their voting powers ⋮---- // Add vault to validator's vaults ⋮---- // filter by ssz max-vaults limit ⋮---- // Process required keys for _, rk := range keys { // TODO: get required key tags from validator set config and fill with nils if needed ⋮---- // Add all keys for this operator ⋮---- // filter by ssz max-validators limit ```` ## File: symbiotic/symbiotic.go ````go package symbiotic ⋮---- import ( "github.com/symbioticfi/relay/symbiotic/client/evm" "github.com/symbioticfi/relay/symbiotic/usecase/aggregator" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" valsetDeriver "github.com/symbioticfi/relay/symbiotic/usecase/valset-deriver" ) ⋮---- "github.com/symbioticfi/relay/symbiotic/client/evm" "github.com/symbioticfi/relay/symbiotic/usecase/aggregator" "github.com/symbioticfi/relay/symbiotic/usecase/crypto" valsetDeriver "github.com/symbioticfi/relay/symbiotic/usecase/valset-deriver" ```` ## File: .dockerignore ```` # Ignore build outputs dist out # Ignore environment files .env .env.* # Ignore Docker-related files Dockerfile docker-compose.yml # Ignore version control files .git .gitignore # Ignore editor and OS-specific files *.swp *.DS_Store Thumbs.db e2e/ # Ignore IDE-specific files .idea/ .vscode/ .claude/ ```` ## File: .env.example ```` PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 ETH_RPC_URL_MASTER=http://127.0.0.1:8545 EPOCH_DURATION=60 DEPLOYMENT_BUFFER=600 SLASHING_WINDOW=1200 BLOCK_TIME=1 OPERATORS=4 VERIFICATION_TYPE=1 ```` ## File: .gitignore ```` .idea/ .claude/ .local/ CLAUDE.md go.sum .env .DS_Store .data* coverage.txt pkg/proof/circuits e2e/contracts e2e/temp-network ```` ## File: .gitmodules ```` [submodule "relay-bn254-example-circuit-keys"] path = circuits url = git@github.com:symbioticfi/relay-bn254-example-circuit-keys.git ```` ## File: .golangci.yml ````yaml version: "2" run: go: "1.25" build-tags: - integration tests: true linters: default: none enable: - asasalint - asciicheck - bidichk - bodyclose - contextcheck - copyloopvar - decorder # - dogsled - durationcheck - embeddedstructfieldcheck - errchkjson - errname - errorlint - exhaustive - exhaustruct - exptostd - fatcontext - forbidigo - funcorder - gocheckcompilerdirectives - gochecknoinits - gochecksumtype - goconst - gocritic # - godox - gomoddirectives - gomodguard - goprintffuncname - gosec - govet - grouper - importas - inamedparam - ineffassign - iotamixing - loggercheck - makezero - mirror - misspell - musttag - nakedret - nilerr - nilnesserr - noctx - nolintlint - nosprintfhostport - perfsprint - prealloc - predeclared - protogetter - reassign - revive - rowserrcheck - sloglint - spancheck - sqlclosecheck - staticcheck - testableexamples - testifylint - thelper - tparallel - unconvert - unparam - unused - usestdlibvars - usetesting - wastedassign - whitespace # - wrapcheck settings: gomoddirectives: replace-allow-list: - github.com/consensys/gnark - github.com/consensys/gnark-crypto importas: alias: - pkg: github.com/symbioticfi/relay/internal/gen/api/v1 alias: apiv1 cyclop: max-complexity: 30 package-average: 10 errcheck: check-type-assertions: true exhaustive: check: - switch - map exhaustruct: allow-empty-returns: true allow-empty: true include: - ^github.com/symbioticfi/relay/internal/client/repository/.*$ - ^github.com/symbioticfi/relay/internal/client/p2p/proto/.*$ - ^github.com/symbioticfi/relay/internal/gen/.*$ - ^github.com/symbioticfi/relay/internal/entity/.*$ - ^github.com/symbioticfi/relay/core/entity/.*$ - ^github.com/symbioticfi/relay/core/entity/.*$ exclude: - ^github.com/symbioticfi/relay/internal/client/repository/badger.Repository$ - ^github.com/ethereum/go-ethereum.CallMsg$ funlen: lines: 100 statements: 50 ignore-comments: true gocognit: min-complexity: 20 gocritic: disabled-checks: - commentFormatting - ifElseChain - appendAssign settings: captLocal: paramsOnly: false underef: skipRecvDeref: false gomodguard: blocked: modules: - github.com/golang/protobuf: recommendations: - google.golang.org/protobuf reason: see https://developers.google.com/protocol-buffers/docs/reference/go/faq#modules - github.com/satori/go.uuid: recommendations: - github.com/google/uuid reason: satori's package is not maintained - github.com/gofrs/uuid: recommendations: - github.com/gofrs/uuid/v5 reason: gofrs' package was not go module before v5 govet: disable: - fieldalignment enable-all: true settings: shadow: strict: true inamedparam: skip-single-param: true mnd: ignored-functions: - args.Error - flag.Arg - flag.Duration.* - flag.Float.* - flag.Int.* - flag.Uint.* - os.Chmod - os.Mkdir.* - os.OpenFile - os.WriteFile - prometheus.ExponentialBuckets.* - prometheus.LinearBuckets nolintlint: require-explanation: true require-specific: true allow-no-explanation: - funlen - gocognit - lll perfsprint: strconcat: false revive: severity: warning rules: - name: atomic - name: banned-characters - name: bare-return - name: bool-literal-in-expr - name: call-to-gc - name: comments-density - name: confusing-results - name: constant-logical-expr - name: context-as-argument - name: context-keys-type - name: datarace - name: deep-exit - name: defer - name: dot-imports - name: duplicated-imports - name: early-return - name: empty-block - name: empty-lines - name: enforce-map-style - name: enforce-repeated-arg-type-style - name: enforce-slice-style - name: error-naming - name: error-return - name: error-strings - name: errorf - name: file-header # - name: flag-parameter - name: function-result-limit - name: identical-branches - name: imports-blocklist - name: increment-decrement - name: indent-error-flow - name: modifies-parameter - name: modifies-value-receiver - name: nested-structs - name: optimize-operands-order - name: range-val-address - name: range-val-in-closure - name: range - name: receiver-naming - name: redefines-builtin-id - name: redundant-import-alias - name: string-format - name: string-of-int - name: struct-tag - name: superfluous-else - name: time-equal - name: time-naming - name: unconditional-recursion - name: unexported-naming - name: unexported-return - name: unnecessary-stmt - name: unreachable-code - name: useless-break - name: var-declaration - name: waitgroup-by-value rowserrcheck: packages: - github.com/jmoiron/sqlx sloglint: no-global: "" context: scope wrapcheck: ignore-package-globs: - github.com/symbioticfi/relay/internal/* - golang.org/x/sync/errgroup funcorder: constructor: true struct-method: false forbidigo: forbid: - pattern: ^fmt\.Errorf$ msg: "use errors.Errorf instead of fmt.Errorf" exclusions: generated: lax presets: - comments - common-false-positives - legacy - std-error-handling rules: - linters: - goconst - exhaustruct - wrapcheck path: _test\.go - path: _test\.go text: 'subtests should call t.Parallel' - path: (.+)\.go$ text: ST1003 - path: (.+)\.go$ text: 'shadow: declaration of "err" shadows declaration at line' - path: (.+)\.go$ text: G115 - path: cmd/utils/ text: "use of `fmt.Printf` forbidden" paths: - third_party$ - builtin$ - examples$ - hack/ issues: max-issues-per-linter: 500 max-same-issues: 500 formatters: enable: - gofmt - goimports exclusions: generated: lax paths: - third_party$ - builtin$ - examples$ ```` ## File: buf.badger.gen.yaml ````yaml version: v2 inputs: - directory: internal/client/repository/badger/proto managed: enabled: true plugins: - local: protoc-gen-go out: internal/client/repository/badger/proto opt: - paths=source_relative ```` ## File: buf.gen.yaml ````yaml version: v2 inputs: - directory: api/proto managed: enabled: true plugins: - local: protoc-gen-doc out: docs/api/v1 opt: - "html,index.html" - local: protoc-gen-doc out: docs/api/v1 opt: - "markdown,doc.md" - local: protoc-gen-go out: internal/gen/api opt: - paths=source_relative - local: protoc-gen-go-grpc out: internal/gen/api opt: - paths=source_relative - local: protoc-gen-grpc-gateway out: internal/gen/api opt: - paths=source_relative - generate_unbound_methods=true - local: protoc-gen-openapiv2 out: docs/api opt: - openapi_naming_strategy=simple ```` ## File: buf.lock ```` # Generated by buf. DO NOT EDIT. version: v2 deps: - name: buf.build/googleapis/googleapis commit: 72c8614f3bd0466ea67931ef2c43d608 digest: b5:13efeea24e633fd45327390bdee941207a8727e96cf01affb84c1e4100fd8f48a42bbd508df11930cd2884629bafad685df1ac3111bc78cdaefcd38c9371c6b1 ```` ## File: buf.p2p.gen.yaml ````yaml version: v2 inputs: - directory: internal/client/p2p/proto managed: enabled: true plugins: - local: protoc-gen-go out: internal/client/p2p/proto opt: - paths=source_relative - local: protoc-gen-go-grpc out: internal/client/p2p/proto opt: - paths=source_relative ```` ## File: buf.yaml ````yaml version: v2 modules: - path: api/proto deps: - buf.build/googleapis/googleapis lint: use: - STANDARD except: - PACKAGE_DIRECTORY_MATCH ```` ## File: CONTRIBUTING.md ````markdown # Contributing Guidelines We welcome contributions from the community! Please read the following guidelines carefully to ensure a smooth development workflow and consistent project quality. For detailed development setup, testing, and API change management, see the [Development Guide](DEVELOPMENT.md). --- ## Branching Strategy We follow a simplified Git Flow model with the following primary branches: - **`main`**: Contains stable, production-ready code. Releases are tagged from this branch. - **`dev`**: The main development branch. All new features and fixes should be merged here first. ### Branch Naming Conventions Please name your branches according to the purpose of the work: - `feature/your-short-description` — for new features - `fix/your-bug-description` — for bug fixes - `hotfix/urgent-fix` — for critical fixes (only in special cases, coordinated with maintainers) - `chore/your-task` — for maintenance or tooling updates - `docs/your-doc-change` — for documentation-only changes --- ## Pull Request Process - 🔀 **Always create pull requests targeting the `dev` branch**, never `main`. - ✅ Make sure your branch is up to date with `dev` before opening a PR. - ✅ Ensure your code builds and passes all tests. - ✅ Follow Go best practices and run a linter by running `make lint`. - 📝 Use clear and descriptive PR titles. - 📌 Link related issues in the PR description (`Fixes #123`, `Closes #456`, etc.). ### PR Checklist Before submitting, make sure your PR meets the following: - [ ] Target branch is `dev` - [ ] All tests pass - [ ] Lint checks pass - [ ] Code is covered with tests where applicable - [ ] Documentation is updated if needed --- ## Releases Releases are created by maintainers by tagging the `main` branch using semantic versioning: - `v1.2.3` — stable releases - `nightly-YYYYMMDD` — automated nightly builds on the `dev` branch > 🚫 Do not tag releases manually unless you are a core maintainer. --- ## Commit Style We encourage using [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) for commit messages, e.g.: ```` ## File: DEVELOPMENT.md ````markdown # Symbiotic Relay - Development Guide ## Table of Contents 1. [Introduction](#introduction) 2. [Architecture Overview](#architecture-overview) 3. [Development Setup](#development-setup) 4. [Running Tests](#running-tests) 5. [Local Environment](#local-environment) 6. [Managing API/Configuration Changes](#managing-api-changes) 7. [Code Generation](#code-generation) 8. [Linting](#linting) 9. [Logging Conventions](#logging-conventions) 10. [Building Docker Images](#building-docker-images) 11. [Contributing](#contributing) 12. [Additional Resources](#additional-resources) --- ## Introduction The Symbiotic Relay is a distributed middleware layer that facilitates cross-chain coordination, validator set management, and signature aggregation. This guide provides comprehensive information for developers working on the relay codebase, including setup, testing, and managing changes across the ecosystem. ## Architecture Overview ### Core Components The Symbiotic Relay consists of several key components working together: #### 1. **P2P Layer** (`internal/client/p2p/`) The peer-to-peer networking layer handles decentralized communication between relay nodes: - **GossipSub Protocol**: Uses libp2p's GossipSub for message broadcasting - **Topic-based Communication**: - `/relay/v1/signature/ready` - Signature ready notifications - `/relay/v1/proof/ready` - Aggregation proof ready notifications - **gRPC over P2P**: Direct node-to-node sync requests using gRPC over libp2p streams - **Discovery**: - mDNS for local network discovery - Kademlia DHT for distributed peer discovery - Static peer support for known bootstrap nodes #### 2. **Node Logic & Applications** The relay operates in multiple modes, configurable per node: - **Signer Nodes** (`internal/usecase/signer-app/`): - Listen for signature requests - Sign messages using BLS/Ecdsa keys - Broadcast signatures to the P2P network - **Aggregator Nodes** (`internal/usecase/aggregator-app/`): - Collect signatures from multiple signers - Apply aggregation policies - Generate BLS aggregated signatures or ZK proofs - Broadcast aggregation proofs - **Committer Nodes** (`internal/usecase/valset-listener/`): - Monitor validator set state on-chain - Submit aggregated proofs to settlement chains - Track epoch transitions #### 3. **API Layer** (`internal/usecase/api-server/`) Exposes gRPC API for external clients to create signature requests, query proofs/signatures and get validator/epoch info. Defined in `api/proto/v1/api.proto` #### 4. **Storage Layer** (`internal/client/repository/badger/`) - BadgerDB for persistent state storage - Caches for high-performance reads - Stores signatures, aggregation proofs, validator sets, and epochs #### 5. **Symbiotic Integration** (`symbiotic/`) - EVM client for on-chain interactions - Validator set derivation logic - Cryptographic primitives (BLS signatures, ZK proofs) --- ## Development Setup ### Prerequisites - **Go 1.25.3 or later** - **Node.js** (for contract compilation in E2E tests) - **Foundry/Forge** (for Solidity contracts) - **Docker & Docker Compose** (for E2E testing) - **Buf CLI** (installed via `make install-tools`) ### Initial Setup 1. **Clone the repository**: ```bash git clone https://github.com/symbioticfi/relay.git cd relay ``` 2. **Install development tools**: ```bash make install-tools ``` This installs: - `buf` - Protocol buffer compiler - `protoc-gen-go` and `protoc-gen-go-grpc` - Go protobuf generators - `mockgen` - Mock generation for testing - `protoc-gen-doc` - API documentation generator 3. **Generate code**: ```bash make generate ``` This generates: - API types from proto files - P2P message types - BadgerDB repository types - Client types - Mock implementations - Contract ABI bindings 4. **Build the relay sidecar binary**: ```bash make build-relay-sidecar OS=linux ARCH=amd64 ``` or for macOS ARM: ```bash make build-relay-sidecar OS=darwin ARCH=arm64 ``` 5. **Build the relay utils CLI binary**: ```bash make build-relay-utils OS=linux ARCH=amd64 ``` --- ## Running Tests ### Unit Tests Run all unit tests with coverage: ```bash make unit-test ``` To run tests for a specific package: ```bash go test -v ./internal/usecase/signer-app/ ``` ### End-to-End (E2E) Tests E2E tests spin up a complete relay network with blockchain nodes. #### Quick E2E Test Run ```bash # Setup the E2E environment (only needed once or after cleanup) cd e2e ./setup.sh # Start the network cd temp-network docker compose up -d cd ../.. # Run the tests make e2e-test ``` #### Custom E2E Configuration You can customize the E2E network topology using environment variables, see the setup.sh script for more envs: ```bash # Configure network before setup export OPERATORS=6 # Number of relay operator nodes (default: 4) export COMMITERS=2 # Number of committer nodes (default: 1) export AGGREGATORS=1 # Number of aggregator nodes (default: 1) export VERIFICATION_TYPE=1 # 0=ZK proofs, 1=BLS simple (default: 1) export EPOCH_TIME=30 # Epoch duration in seconds (default: 30) export BLOCK_TIME=2 # Block time in seconds (default: 1) export FINALITY_BLOCKS=2 # Blocks until finality (default: 2) # Run setup with custom config cd e2e ./setup.sh ``` #### Cleanup E2E Environment ```bash # Stop and remove containers cd e2e/temp-network docker compose down ``` --- ## Local Environment ### Setting Up Local Development Network For local development and testing: ```bash make local-setup ``` This command takes the same envs as the e2e setup for configuration. This command: 1. Generates relay sidecar configurations 2. Sets up a local blockchain network (Anvil) 3. Deploys contracts 4. Starts relay nodes in Docker --- ## Managing API/Configuration Changes ### Overview When you make changes to the API proto file (`api/proto/v1/api.proto`), those changes must be propagated across multiple repositories and examples to maintain consistency across the ecosystem. ### Step 1: Update Proto Definition 1. Make your changes to `api/proto/v1/api.proto` 2. Regenerate Go code and Docs: ```bash make generate ``` ### Step 2: Update Local Examples and E2E Tests **Update Go Client Examples:** ```bash cd api/client/examples # Update main.go to reflect API changes vim main.go # Test the example, follow the readme and test go run main.go ``` **Update E2E Tests and Configuration:** If API changes affect the relay sidecar configuration or client usage: **E2E Test Files** (`e2e/tests/`): - Update client instantiation in test setup files - Update test cases that use the changed RPC methods - Update `sidecar.yaml` if new configuration fields are required **E2E Scripts** (`e2e/scripts/`): - Update sidecar startup scripts if config template needs new fields - Update genesis generation script if relay utils CLI commands changed - Update network generation script if new environment variables are needed **Common changes:** - **New RPC methods** → Add corresponding test cases - **Config field changes** → Update sidecar configuration files and startup templates - **CLI command changes** → Update scripts that invoke relay utils commands - **Client interface changes** → Update test setup and client instantiation code ### Step 3: Update External Client Repositories #### TypeScript Client ([relay-client-ts](https://github.com/symbioticfi/relay-client-ts)) The TypeScript client has an automated workflow that regenerates the gRPC client when the proto file changes. However, you still need to: 1. **Wait for/Trigger the workflow** that updates the generated client code 2. **Update examples manually**: ```bash cd examples/ # Update example files to use new API vim basic-usage.ts npm run build npm run basic-usage ``` #### Rust Client ([relay-client-rs](https://github.com/symbioticfi/relay-client-rs)) Similar to TypeScript, the Rust client auto-generates the gRPC implementation: 1. **Wait for/Trigger the workflow** that updates the generated client code 2. **Update examples manually**: ```bash cd examples/ # Update example files to use new API vim basic_usage.rs cargo build cargo run --example basic_usage ``` ### Step 4: Update Symbiotic Super Sum Example The [symbiotic-super-sum](https://github.com/symbioticfi/symbiotic-super-sum) repository provides a comprehensive task-based example. **What to update:** 1. **Go Client Package Version**: ```bash cd off-chain # Update go.mod to use latest relay client go get github.com/symbioticfi/relay@ go mod tidy ``` 2. **Network Configuration**: - Check if any configuration changes are needed in network setup - The `generate_network.sh` script in symbiotic-super-sum is similar to the E2E setup - Update environment variables or config files if the relay now requires new settings 3. **Example Application Code**: - Update any client usage in the off-chain application - Test the example end-to-end 4. **Documentation**: - Update README if API usage patterns have changed ### Step 5: Update Cosmos Relay SDK The [cosmos-relay-sdk](https://github.com/symbioticfi/cosmos-relay-sdk) integrates the relay with Cosmos SDK chains. **What to update:** 1. **Go Client Package**: ```bash # Update the client package version go get github.com/symbioticfi/relay/api/client/v1@latest go mod tidy ``` 2. **Mock Relay Client** (`x/symstaking/types/mock_relay.go`): The mock relay client must match the updated client interface: Example of what needs updating: - If you added a new RPC method, add it to the mock - If you changed method signatures, update them in the mock - If you changed request/response types, update the mock accordingly 3. **Documentation**: - Update SDK docs to reflect new API capabilities --- ## Code Generation The project uses code generation extensively. Here's what each target generates: ### Generate All ```bash make generate ``` This runs all generation targets that need codegen, including mocks, proto messages, etc. --- ## Linting ### Run All Linters ```bash make lint ``` This runs: - `buf lint` for proto files - `golangci-lint` for Go code ### Auto-fix Linting Issues ```bash make go-lint-fix ``` --- ## Logging Conventions ### Overview The Symbiotic Relay uses Go's standard `log/slog` (structured logging) with a custom wrapper located in `pkg/log/`. This provides: - **Structured logging** with type-safe fields - **Context propagation** for automatic field inheritance - **Component-based tagging** for filtering and debugging - **Multiple output modes**: pretty (colored), text, and JSON **Configuration:** Set log level and mode in `sidecar.yaml`: ```yaml log: level: debug # debug, info, warn, error mode: pretty # pretty, text, json ``` ### Log Levels - When to Use | Level | When to Use | Examples | |-------------------------|-----------------------------------------------------------------------|----------------------------------------------------------------------------------------------| | **Debug** | Flow tracing, detailed decisions, skipped operations, variable values | "Skipped signing (not in validator set)", "Checked for missing epochs" | | **Info** (prod default) | Key state changes, service lifecycle events, completed operations | "Signature aggregation completed", "Started P2P listener", "Submitted proof to chain" | | **Warn** | Recoverable issues, unusual but handled situations, security concerns | "Message signing disabled", "Retrying after temporary failure", "Invalid signature received" | | **Error** | Unrecoverable failures, critical problems requiring attention | "Failed to load validator set", "Database connection lost", "Contract call failed" | **Important:** Log errors only at high-level error handlers (API handlers, main event loops, service entry points), not at every location where an error occurs. Internal functions should return errors without logging them, allowing the top-level handler to log once with full context. ### Context Propagation Pattern **Always use context-aware logging variants** (`slog.InfoContext`, `slog.DebugContext`, etc.) when context is available. ```go func (s *Service) HandleRequest(ctx context.Context, req *Request) error { // 1. Add component tag (required) ctx = log.WithComponent(ctx, "aggregator") // 2. Add request-specific context (if applicable) ctx = log.WithAttrs(ctx, slog.Uint64("epoch", uint64(req.Epoch)), slog.String("requestId", req.RequestID.Hex()), ) // 3. All subsequent logs automatically include these fields slog.InfoContext(ctx, "Started processing request") // ... rest of implementation return nil } ``` ### Standard Field Names All field names **must** use `camelCase` notation. Use these standard field names consistently: #### Request Context - `requestId` - Unique request identifier (use for cross-service correlation) - `epoch` - Epoch number (uint64) #### Identifiers - `keyTag` - Key tag identifier - `operator` - Operator address/ID - `publicKey` - Public key (formatted as hex) - `address` - Ethereum address - `validatorIndex` - Validator index in the set #### Operation Tracking - `error` - Error message/object (always use "error", not "err") - `duration` - Operation duration (use `time.Since()`) - `attempt` - Current retry attempt number - `maxRetries` - Maximum retry attempts #### Network/P2P - `topic` - P2P topic name - `sender` - Message sender identifier - `peer` - Peer identifier - `peerId` - Libp2p peer ID #### Component/Method - `component` - Component name (auto-added via `log.WithComponent()`) - `method` - gRPC method name or function identifier #### Blockchain - `chainId` - Chain identifier - `blockNumber` - Block number - `txHash` - Transaction hash - `contractAddress` - Smart contract address #### Custom Fields When adding custom fields not in this list: - Use descriptive `camelCase` names - Prefer specific names over generic ones (`validatorCount` not `count`) - Document new commonly-used fields by updating this list ### Error Logging Standards **1. Error Wrapping (Internal Functions):** Always wrap errors using `github.com/go-errors/errors` to capture stacktrace in the place of error: ```go import "github.com/go-errors/errors" func (s *Service) loadData(id string) error { data, err := s.repo.Get(id) if err != nil { // Wrap with context, preserve stack trace return errors.Errorf("failed to load data for id=%s: %w", id, err) } return nil } ``` **2. Error Logging (Boundaries Only):** Log errors at **boundaries** (API handlers, main loops, service entry points): **3. Always use `"error"` as the field name** (not "err"): ```go // ❌ Incorrect: Using "err" as field name slog.ErrorContext(ctx, "Failed to process request", "err", err) slog.WarnContext(ctx, "Retry attempt failed", "err", retryErr) // ✅ Correct: Always use "error" for consistency slog.ErrorContext(ctx, "Failed to process request", "error", err) slog.WarnContext(ctx, "Retry attempt failed", "error", retryErr) ``` ### Duration Tracking Always track and log operation durations for performance monitoring: ```go func (s *Service) ProcessSignature(ctx context.Context, sig *Signature) error { start := time.Now() // ... perform operation ... slog.InfoContext(ctx, "Signature processed successfully", "duration", time.Since(start), "requestId", sig.RequestID, ) return nil } ``` ### Log Message Format Log messages **must** follow these conventions: **1. Start with past tense verb:** ```go // ✅ Correct: Past tense verbs indicating completed actions slog.InfoContext(ctx, "Signature received") slog.InfoContext(ctx, "Validator set loaded") slog.InfoContext(ctx, "Proof submitted to chain") slog.DebugContext(ctx, "Checked for missing epochs") // ❌ Incorrect slog.InfoContext(ctx, "Receiving signature") // present continuous slog.InfoContext(ctx, "Load validator set") // imperative slog.InfoContext(ctx, "Signature receive") // noun only ``` **Note:** Present continuous tense ("Processing...", "Aggregating signatures...") may be valid for long-running operations where you want to communicate progress and show that the process is active, not stuck. However, always pair these with a past tense completion log: ```go // ✅ Acceptable for long-running operations slog.DebugContext(ctx, "Aggregating signatures from validators", "count", validatorCount) // ... long operation ... slog.InfoContext(ctx, "Aggregation completed", "duration", time.Since(start)) ``` **2. Use consistent terminology:** - "Started" / "Completed" for long operations - "Received" / "Sent" for messages - "Loaded" / "Stored" for data operations - "Failed" for errors (not "Error:", the log level indicates it's an error) ### Component Naming Conventions Use these standard component names with `log.WithComponent()`: | Component | Usage | |-------------------|----------------------------| | `"grpc"` | gRPC handlers | | `"signer"` | Signer application | | `"aggregator"` | Aggregator application | | `"sign_listener"` | Signature listener service | | `"listener"` | Validator set listener | | `"p2p"` | P2P network layer | | `"evm"` | EVM client interactions | Keep component names: - Lowercase - Short and recognizable - Consistent across the codebase ### *Prefer context-aware logging variants whenever possible ```go // ✅ Preferred (context-aware) slog.InfoContext(ctx, "Message processed", "count", count) slog.ErrorContext(ctx, "Failed to process", "error", err) // ⚠️ Avoid when context is available (legacy pattern) slog.Info("Message processed", "count", count) slog.Error("Failed to process", "error", err) ``` --- ## Building Docker Images Build the relay sidecar Docker image: ```bash make image ``` To build and push multi-architecture images: ```bash PUSH_IMAGE=true PUSH_LATEST=true make image ``` --- ## Contributing Please read [CONTRIBUTING.md](./CONTRIBUTING.md) for our branching strategy, PR process, and commit conventions. ### Key Points: - **Target branch**: Always create PRs against `dev`, never `main` - **Tests**: Ensure all tests pass before submitting PR - **Linting**: Run `make lint` and fix all issues - **Documentation**: Update docs when changing APIs or behavior --- ## Additional Resources - **API Documentation**: [docs/api/v1/doc.md](docs/api/v1/doc.md) - **Main README**: [README.md](README.md) - **Contributing Guide**: [CONTRIBUTING.md](CONTRIBUTING.md) - **Official Docs**: https://docs.symbiotic.fi/category/relay-sdk - **Example Client Usage**: [api/client/examples/README.md](api/client/examples/README.md) ```` ## File: Dockerfile ````dockerfile FROM golang:1.25 AS builder WORKDIR /app # Cache go mod dependencies COPY go.mod go.sum ./ RUN --mount=type=cache,target=/go/pkg/mod \ go mod download COPY . ./ ARG APP_VERSION ARG BUILD_TIME ARG TARGETOS ENV GOOS=$TARGETOS ARG TARGETARCH ENV GOARCH=$TARGETARCH # Cache build artifacts RUN --mount=type=cache,target=/go/pkg/mod \ --mount=type=cache,target=/root/.cache/go-build \ CGO_ENABLED=0 go build -ldflags "-extldflags '-static' -X 'github.com/symbioticfi/relay/cmd/utils/root.Version=${APP_VERSION}' -X 'github.com/symbioticfi/relay/cmd/utils/root.BuildTime=${BUILD_TIME}'" -o relay_utils ./cmd/utils && \ chmod a+x relay_utils RUN --mount=type=cache,target=/go/pkg/mod \ --mount=type=cache,target=/root/.cache/go-build \ CGO_ENABLED=0 go build -ldflags "-extldflags '-static' -X 'github.com/symbioticfi/relay/cmd/relay/root.Version=${APP_VERSION}' -X 'github.com/symbioticfi/relay/cmd/relay/root.BuildTime=${BUILD_TIME}'" -o relay_sidecar ./cmd/relay && \ chmod a+x relay_sidecar FROM alpine:latest WORKDIR /app COPY --from=builder /app/relay_utils . COPY --from=builder /app/relay_sidecar . COPY --from=builder /app/docs ./docs ```` ## File: example.config.yaml ````yaml # Relay Sidecar Configuration Example # Logging log: level: "debug" mode: "pretty" # Storage storage-dir: ".data" # circuits-dir: "" # Optional: Path to ZK circuits directory # API Server Configuration api: listen: ":8080" verbose-logging: false http-gateway: false # Enable HTTP/JSON REST API gateway (default: false) # Metrics Configuration (optional) metrics: listen: ":9090" pprof: false # Driver Contract driver: chain-id: 31337 address: "0x4826533B4897376654Bb4d4AD88B7faFD0C98528" # Secret Keys secret-keys: - namespace: "symb" key-type: 0 key-id: 15 secret: "0xde0b6b3a7640000" - namespace: "evm" key-type: 1 key-id: 31337 secret: "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" # Signal Configuration signal: worker-count: 10 buffer-size: 20 # Cache Configuration cache: network-config-size: 10 validator-set-size: 10 # Sync Configuration sync: enabled: true period: 5s timeout: 1m epochs: 5 # Key Cache key-cache: size: 100 enabled: true # P2P Configuration p2p: listen: "/ip4/0.0.0.0/tcp/8880" bootnodes: [] dht-mode: "disabled" mdns: true # EVM Configuration evm: chains: - "http://127.0.0.1:8545" max-calls: 30 # Aggregation Policy aggregation-policy-max-unsigners: 50 # Data Retention Configuration (optional) # Controls how much historical data to keep on this node retention: # Maximum number of historical validator set epochs to sync on fresh node startup # - 0 (default): Unlimited - sync from genesis epoch # - N > 0: Sync only the most recent N epochs # Note: Only applies to fresh nodes. Existing nodes continue from last synced epoch. # Should match your pruning retention period to avoid re-syncing pruned data. valset-epochs: 0 ```` ## File: go.mod ```` module github.com/symbioticfi/relay go 1.25.3 require ( github.com/RoaringBitmap/roaring/v2 v2.13.0 github.com/consensys/gnark v0.0.0-00010101000000-000000000000 // pinned with replace github.com/consensys/gnark-crypto v0.19.2 // pinned with replace github.com/dgraph-io/badger/v4 v4.8.0 github.com/docker/docker v28.5.1+incompatible github.com/elastic/go-freelru v0.16.0 github.com/ethereum/go-ethereum v1.16.5 github.com/ferranbt/fastssz v1.0.0 github.com/go-chi/chi/v5 v5.2.3 github.com/go-errors/errors v1.5.1 github.com/go-playground/validator/v10 v10.28.0 github.com/google/uuid v1.6.0 github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 github.com/kelseyhightower/envconfig v1.4.0 github.com/libp2p/go-libp2p v0.44.0 github.com/libp2p/go-libp2p-gostream v0.6.0 github.com/libp2p/go-libp2p-kad-dht v0.34.0 github.com/libp2p/go-libp2p-pubsub v0.15.0 github.com/multiformats/go-multiaddr v0.16.1 github.com/pavlo-v-chernykh/keystore-go/v4 v4.5.0 github.com/prometheus/client_golang v1.23.2 github.com/pterm/pterm v0.12.82 github.com/samber/lo v1.52.0 github.com/samber/slog-multi v1.5.0 github.com/spf13/cobra v1.10.1 github.com/spf13/pflag v1.0.10 github.com/spf13/viper v1.21.0 github.com/stretchr/testify v1.11.1 github.com/testcontainers/testcontainers-go v0.39.0 go.uber.org/mock v0.6.0 golang.org/x/net v0.46.0 golang.org/x/sync v0.17.0 golang.org/x/term v0.36.0 google.golang.org/genproto/googleapis/api v0.0.0-20251029180050-ab9386a59fda google.golang.org/grpc v1.76.0 google.golang.org/protobuf v1.36.10 gopkg.in/yaml.v2 v2.4.0 k8s.io/client-go v0.34.1 ) require ( atomicgo.dev/cursor v0.2.0 // indirect atomicgo.dev/keyboard v0.2.9 // indirect atomicgo.dev/schedule v0.1.0 // indirect dario.cat/mergo v1.0.2 // indirect github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/StackExchange/wmi v1.2.1 // indirect github.com/benbjohnson/clock v1.3.5 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bits-and-blooms/bitset v1.24.3 // indirect github.com/blang/semver/v4 v4.0.0 // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/clipperhouse/stringish v0.1.1 // indirect github.com/clipperhouse/uax29/v2 v2.3.0 // indirect github.com/containerd/console v1.0.5 // indirect github.com/containerd/errdefs v1.0.0 // indirect github.com/containerd/errdefs/pkg v0.3.0 // indirect github.com/containerd/log v0.1.0 // indirect github.com/containerd/platforms v0.2.1 // indirect github.com/cpuguy83/dockercfg v0.3.2 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.6 // indirect github.com/crate-crypto/go-eth-kzg v1.4.0 // indirect github.com/crate-crypto/go-ipa v0.0.0-20240724233137-53bbb0ceb27a // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c // indirect github.com/deckarep/golang-set/v2 v2.6.0 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect github.com/dgraph-io/ristretto/v2 v2.2.0 // indirect github.com/distribution/reference v0.6.0 // indirect github.com/docker/go-connections v0.6.0 // indirect github.com/docker/go-units v0.5.0 // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/ebitengine/purego v0.9.0 // indirect github.com/emicklei/dot v1.9.0 // indirect github.com/ethereum/c-kzg-4844/v2 v2.1.5 // indirect github.com/ethereum/go-verkle v0.2.2 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/filecoin-project/go-clock v0.1.0 // indirect github.com/flynn/noise v1.1.0 // indirect github.com/francoispqt/gojay v1.2.13 // indirect github.com/fsnotify/fsnotify v1.9.0 // indirect github.com/fxamacker/cbor/v2 v2.9.0 // indirect github.com/gabriel-vasile/mimetype v1.4.11 // indirect github.com/go-logr/logr v1.4.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect github.com/go-viper/mapstructure/v2 v2.4.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/google/flatbuffers v25.2.10+incompatible // indirect github.com/google/gopacket v1.1.19 // indirect github.com/google/pprof v0.0.0-20250820193118-f64d9cf942d6 // indirect github.com/gookit/color v1.6.0 // indirect github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect github.com/hashicorp/golang-lru v1.0.2 // indirect github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/holiman/uint256 v1.3.2 // indirect github.com/huin/goupnp v1.3.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/ingonyama-zk/icicle-gnark/v3 v3.2.2 // indirect github.com/ipfs/boxo v0.34.0 // indirect github.com/ipfs/go-cid v0.6.0 // indirect github.com/ipfs/go-datastore v0.8.3 // indirect github.com/ipfs/go-log/v2 v2.8.1 // indirect github.com/ipld/go-ipld-prime v0.21.0 // indirect github.com/jackpal/go-nat-pmp v1.0.2 // indirect github.com/jbenet/go-temp-err-catcher v0.1.0 // indirect github.com/klauspost/compress v1.18.1 // indirect github.com/klauspost/cpuid/v2 v2.3.0 // indirect github.com/koron/go-ssdp v0.1.0 // indirect github.com/leodido/go-urn v1.4.0 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect github.com/libp2p/go-cidranger v1.1.0 // indirect github.com/libp2p/go-flow-metrics v0.3.0 // indirect github.com/libp2p/go-libp2p-asn-util v0.4.1 // indirect github.com/libp2p/go-libp2p-kbucket v0.8.0 // indirect github.com/libp2p/go-libp2p-record v0.3.1 // indirect github.com/libp2p/go-libp2p-routing-helpers v0.7.5 // indirect github.com/libp2p/go-msgio v0.3.0 // indirect github.com/libp2p/go-netroute v0.4.0 // indirect github.com/libp2p/go-reuseport v0.4.0 // indirect github.com/libp2p/go-yamux/v5 v5.1.0 // indirect github.com/libp2p/zeroconf/v2 v2.2.0 // indirect github.com/lithammer/fuzzysearch v1.1.8 // indirect github.com/lufia/plan9stats v0.0.0-20250827001030-24949be3fa54 // indirect github.com/magiconair/properties v1.8.10 // indirect github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd // indirect github.com/mattn/go-colorable v0.1.14 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.19 // indirect github.com/miekg/dns v1.1.68 // indirect github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b // indirect github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc // indirect github.com/minio/sha256-simd v1.0.1 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/moby/docker-image-spec v1.3.1 // indirect github.com/moby/go-archive v0.1.0 // indirect github.com/moby/patternmatcher v0.6.0 // indirect github.com/moby/sys/sequential v0.6.0 // indirect github.com/moby/sys/user v0.4.0 // indirect github.com/moby/sys/userns v0.1.0 // indirect github.com/moby/term v0.5.2 // indirect github.com/morikuni/aec v1.0.0 // indirect github.com/mr-tron/base58 v1.2.0 // indirect github.com/mschoch/smat v0.2.0 // indirect github.com/multiformats/go-base32 v0.1.0 // indirect github.com/multiformats/go-base36 v0.2.0 // indirect github.com/multiformats/go-multiaddr-dns v0.4.1 // indirect github.com/multiformats/go-multiaddr-fmt v0.1.0 // indirect github.com/multiformats/go-multibase v0.2.0 // indirect github.com/multiformats/go-multicodec v0.10.0 // indirect github.com/multiformats/go-multihash v0.2.3 // indirect github.com/multiformats/go-multistream v0.6.1 // indirect github.com/multiformats/go-varint v0.1.0 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.1 // indirect github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect github.com/pelletier/go-toml/v2 v2.2.4 // indirect github.com/pion/datachannel v1.5.10 // indirect github.com/pion/dtls/v2 v2.2.12 // indirect github.com/pion/dtls/v3 v3.0.7 // indirect github.com/pion/ice/v4 v4.0.10 // indirect github.com/pion/interceptor v0.1.41 // indirect github.com/pion/logging v0.2.4 // indirect github.com/pion/mdns/v2 v2.0.7 // indirect github.com/pion/randutil v0.1.0 // indirect github.com/pion/rtcp v1.2.16 // indirect github.com/pion/rtp v1.8.25 // indirect github.com/pion/sctp v1.8.40 // indirect github.com/pion/sdp/v3 v3.0.16 // indirect github.com/pion/srtp/v3 v3.0.8 // indirect github.com/pion/stun v0.6.1 // indirect github.com/pion/stun/v3 v3.0.1 // indirect github.com/pion/transport/v2 v2.2.10 // indirect github.com/pion/transport/v3 v3.0.8 // indirect github.com/pion/turn/v4 v4.1.2 // indirect github.com/pion/webrtc/v4 v4.1.6 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/polydawn/refmt v0.89.0 // indirect github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect github.com/prometheus/client_model v0.6.2 // indirect github.com/prometheus/common v0.67.2 // indirect github.com/prometheus/procfs v0.19.2 // indirect github.com/quic-go/qpack v0.5.1 // indirect github.com/quic-go/quic-go v0.55.0 // indirect github.com/quic-go/webtransport-go v0.9.0 // indirect github.com/ronanh/intcomp v1.1.1 // indirect github.com/rs/zerolog v1.34.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/sagikazarmark/locafero v0.11.0 // indirect github.com/samber/slog-common v0.19.0 // indirect github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect github.com/shirou/gopsutil/v4 v4.25.8 // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect github.com/spf13/afero v1.15.0 // indirect github.com/spf13/cast v1.10.0 // indirect github.com/subosito/gotenv v1.6.0 // indirect github.com/supranational/blst v0.3.16 // indirect github.com/tklauser/go-sysconf v0.3.15 // indirect github.com/tklauser/numcpus v0.10.0 // indirect github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1 // indirect github.com/wlynxg/anet v0.0.5 // indirect github.com/x448/float16 v0.8.4 // indirect github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect go.opentelemetry.io/auto/sdk v1.2.1 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 // indirect go.opentelemetry.io/otel v1.38.0 // indirect go.opentelemetry.io/otel/metric v1.38.0 // indirect go.opentelemetry.io/otel/trace v1.38.0 // indirect go.uber.org/dig v1.19.0 // indirect go.uber.org/fx v1.24.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect go.yaml.in/yaml/v2 v2.4.3 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect golang.org/x/crypto v0.43.0 // indirect golang.org/x/exp v0.0.0-20251023183803-a4bb9ffd2546 // indirect golang.org/x/mod v0.29.0 // indirect golang.org/x/sys v0.37.0 // indirect golang.org/x/telemetry v0.0.0-20251028164327-d7a2859f34e8 // indirect golang.org/x/text v0.30.0 // indirect golang.org/x/time v0.14.0 // indirect golang.org/x/tools v0.38.0 // indirect gonum.org/v1/gonum v0.16.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20251029180050-ab9386a59fda // indirect gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/apimachinery v0.34.1 // indirect k8s.io/klog/v2 v2.130.1 // indirect k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 // indirect lukechampine.com/blake3 v1.4.1 // indirect ) // pinned versions replace ( github.com/consensys/gnark => github.com/consensys/gnark v0.14.0 github.com/consensys/gnark-crypto => github.com/consensys/gnark-crypto v0.19.0 ) ```` ## File: Makefile ```` PACKAGE=github.com/symbioticfi/relay IMAGE_REPO ?= relay_sidecar BUILD_TIME ?= $(shell date -u +%Y-%m-%dT%H:%M:%SZ) TAG ?= ifeq ($(strip $(TAG)),) CURRENT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD) PSEUDO_VERSION := $(shell go list -f {{.Version}} -m ${PACKAGE}@${CURRENT_BRANCH} 2>/dev/null || echo "unspecified-$(CURRENT_BRANCH)") # Trim the `v` prefix from golang pseudo version as the TAG if not set FINAL_TAG := $(shell echo $(PSEUDO_VERSION) | sed 's/^v//' | sed 's/-0\./-/') else # If TAG was explicitly passed, strip the v prefix TAG_ORIGINAL := $(TAG) FINAL_TAG := $(shell echo '$(TAG_ORIGINAL)' | sed 's/^v//') endif # add v prefix for APP_VERSION APP_VERSION := v$(FINAL_TAG) # create image tags without v prefix IMAGE_TAGS := -t ${IMAGE_REPO}:${FINAL_TAG} ifeq ($(PUSH_LATEST), true) IMAGE_TAGS := ${IMAGE_TAGS} -t ${IMAGE_REPO}:latest endif .PHONY: local-setup local-setup: cd e2e && \ GENERATE_SIDECARS=true bash setup.sh && \ cd temp-network && \ docker compose up -d .PHONY: clean-local-setup clean-local-setup: if [ -d "e2e/temp-network" ]; then \ docker compose --project-directory e2e/temp-network down; \ fi .PHONY: lint lint: install-tools buf-lint go-lint .PHONY: buf-lint buf-lint: buf lint .PHONY: go-lint go-lint: go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.6.2 -v run ./... .PHONY: go-lint-fix go-lint-fix: go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.6.2 -v run ./... --fix .PHONY: generate generate: install-tools generate-mocks generate-api-types generate-client-types generate-p2p-types generate-badger-types gen-abi generate-cli-docs .PHONY: install-tools install-tools: go install github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc@v1.5.1 go install go.uber.org/mock/mockgen@v0.6.0 go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.5.1 go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.36.6 go install github.com/bufbuild/buf/cmd/buf@v1.59.0 go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@latest go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@latest .PHONY: generate-mocks generate-mocks: go generate ./... .PHONY: generate-api-types generate-api-types: buf generate .PHONY: generate-p2p-types generate-p2p-types: buf generate --template=buf.p2p.gen.yaml .PHONY: generate-badger-types generate-badger-types: buf generate --template=buf.badger.gen.yaml .PHONY: generate-client-types generate-client-types: go run hack/codegen/generate-client-types.go .PHONY: generate-cli-docs generate-cli-docs: @echo "Generating CLI documentation..." go run hack/docgen/generate-cli-docs.go @echo "CLI documentation generated in docs/cli/" .PHONY: unit-test unit-test: go test $(shell go list ./... | grep -v '/e2e/') -v -covermode atomic -race -coverprofile=cover.out.tmp -coverpkg=$(shell go list ./... | grep -v '/e2e/' | tr '\n' ',') cat cover.out.tmp | grep -v "gen" | grep -v "mocks" > coverage.tmp.txt # strip out generated files go tool cover -func coverage.tmp.txt > coverage.txt rm cover.out.tmp coverage.tmp.txt .PHONY: e2e-test e2e-test: cd e2e/tests && go test -v -timeout 30m .PHONY: gen-abi gen-abi: go run github.com/ethereum/go-ethereum/cmd/abigen@latest \ --abi symbiotic/client/evm/abi/IValSetDriver.abi.json \ --type IValSetDriver \ --pkg gen \ --out symbiotic/client/evm/gen/valsetDriver.go go run github.com/ethereum/go-ethereum/cmd/abigen@latest \ --abi symbiotic/client/evm/abi/ISettlement.abi.json \ --type ISettlement \ --pkg gen \ --out symbiotic/client/evm/gen/settlement.go go run github.com/ethereum/go-ethereum/cmd/abigen@latest \ --abi symbiotic/client/evm/abi/IKeyRegistry.abi.json \ --type IKeyRegistry \ --pkg gen \ --out symbiotic/client/evm/gen/keyRegistry.go go run github.com/ethereum/go-ethereum/cmd/abigen@latest \ --abi symbiotic/client/evm/abi/IVotingPowerProvider.abi.json \ --type IVotingPowerProvider \ --pkg gen \ --out symbiotic/client/evm/gen/votingPowerProvider.go # Generic build target that takes OS and architecture as parameters # Usage: make build-relay-utils OS=linux ARCH=amd64 # Usage: make build-relay-sidecar OS=darwin ARCH=arm64 .PHONY: build-relay-utils build-relay-utils: @if [ -z "$(OS)" ] || [ -z "$(ARCH)" ]; then \ echo "Error: OS and ARCH parameters are required"; \ echo "Usage: make build-relay-utils OS= ARCH="; \ exit 1; \ fi GOOS=$(OS) GOARCH=$(ARCH) CGO_ENABLED=0 go build -ldflags "-extldflags '-static' -X 'github.com/symbioticfi/relay/cmd/utils/root.Version=$(APP_VERSION)' -X 'github.com/symbioticfi/relay/cmd/utils/root.BuildTime=$(BUILD_TIME)'" -o relay_utils_$(OS)_$(ARCH) ./cmd/utils && \ chmod a+x relay_utils_$(OS)_$(ARCH) .PHONY: build-relay-sidecar build-relay-sidecar: @if [ -z "$(OS)" ] || [ -z "$(ARCH)" ]; then \ echo "Error: OS and ARCH parameters are required"; \ echo "Usage: make build-relay-sidecar OS= ARCH="; \ exit 1; \ fi GOOS=$(OS) GOARCH=$(ARCH) CGO_ENABLED=0 go build -ldflags "-extldflags '-static' -X 'github.com/symbioticfi/relay/cmd/relay/root.Version=$(APP_VERSION)' -X 'github.com/symbioticfi/relay/cmd/relay/root.BuildTime=$(BUILD_TIME)'" -o relay_sidecar_$(OS)_$(ARCH) ./cmd/relay && \ chmod a+x relay_sidecar_$(OS)_$(ARCH) # Legacy targets for backward compatibility .PHONY: build-relay-utils-linux build-relay-utils-linux: $(MAKE) build-relay-utils OS=linux ARCH=amd64 .PHONY: build-relay-utils-darwin build-relay-utils-darwin: $(MAKE) build-relay-utils OS=darwin ARCH=arm64 .PHONY: build-relay-sidecar-linux build-relay-sidecar-linux: $(MAKE) build-relay-sidecar OS=linux ARCH=amd64 .PHONY: build-relay-sidecar-darwin build-relay-sidecar-darwin: $(MAKE) build-relay-sidecar OS=darwin ARCH=arm64 .PHONY: image image: ifeq ($(PUSH_IMAGE), true) @docker buildx build --push --platform=linux/amd64,linux/arm64 . ${IMAGE_TAGS} --build-arg APP_VERSION=$(APP_VERSION) --build-arg BUILD_TIME=$(BUILD_TIME) # https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-output-parameter echo "image=${IMAGE_REPO}:${FINAL_TAG}" >> $$GITHUB_OUTPUT else @DOCKER_BUILDKIT=1 docker build . ${IMAGE_TAGS} --build-arg APP_VERSION=$(APP_VERSION) --build-arg BUILD_TIME=$(BUILD_TIME) endif .PHONY: fix-goimports fix-goimports: go run golang.org/x/tools/cmd/goimports@latest -w . ```` ## File: README.md ````markdown # Symbiotic Relay [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/symbioticfi/relay) > [!WARNING] > The code is a work in progress and not production ready yet. > Breaking changes may occur in the code updates as well as backward compatibility is not guaranteed. > Use with caution. ## Overview The Symbiotic Relay operates as a distributed middleware layer that facilitates: - **Validator Set Management**: Derives and maintains validator sets across different epochs based on on-chain state - **Signature Aggregation**: Collects individual validator signatures and aggregates them using BLS signatures or zero-knowledge proofs - **Cross-Chain Coordination**: Manages validator sets across multiple EVM-compatible blockchains ## Architecture The relay consists of several key components: - **P2P Layer**: Uses libp2p with GossipSub for decentralized communication - **Signer Nodes**: Sign messages using BLS/ECDSA keys - **Aggregator Nodes**: Collect and aggregate signatures with configurable policies - **Committer Nodes**: Submit aggregated proofs to settlement chains - **API Server**: Exposes gRPC API for external clients For detailed architecture information, see [DEVELOPMENT.md](DEVELOPMENT.md). ## Documentation - **[Development Guide](DEVELOPMENT.md)** - Comprehensive guide for developers including testing, API changes, and code generation - **[Relay Docs](https://docs.symbiotic.fi/category/relay-sdk)** - Official documentation - **[CLI Documentation](docs/cli/)** - Command-line interface reference for relay_sidecar and relay_utils - **[Contributing](CONTRIBUTING.md)** - Contribution guidelines and workflow ## Running Examples For a complete end-to-end example application using the relay, see: **[Symbiotic Super Sum](https://github.com/symbioticfi/symbiotic-super-sum)** - A task-based network example demonstrating relay integration ## API The relay exposes both gRPC and HTTP/JSON REST APIs for interacting with the network: ### gRPC API - **API Documentation**: [docs/api/v1/doc.md](docs/api/v1/doc.md) - **Proto Definitions**: [api/proto/v1/api.proto](api/proto/v1/api.proto) - **Go Client**: [api/client/v1/](api/client/v1/) - **Client Examples**: [api/client/examples/](api/client/examples/) ### HTTP/JSON REST API Gateway The relay includes an optional HTTP/JSON REST API gateway that translates HTTP requests to gRPC: - **Swagger File**: [docs/v1/api.swagger.json](docs/api/v1/api.swagger.json) - **OpenAPI/Swagger Spec**: Available at `/docs/api.swagger.json` when enabled - **Endpoints**: All gRPC methods accessible via RESTful HTTP at `/api/v1/*` Enable via configuration: ```yaml api: http-gateway: true ``` Or via command-line flag: ```bash ./relay_sidecar --api.http-gateway=true ``` ### Client Libraries - **Go**: Included in this repository at `github.com/symbioticfi/relay/api/client/v1` - **TypeScript**: [relay-client-ts](https://github.com/symbioticfi/relay-client-ts) - **Rust**: [relay-client-rs](https://github.com/symbioticfi/relay-client-rs) - **HTTP/cURL**: Use the HTTP gateway for language-agnostic access ## Quick Start ### Use Pre-built Releases Instead of building from source, you can download pre-built binaries from GitHub releases: ```bash # Download the latest release for your platform # Linux AMD64 wget https://github.com/symbioticfi/relay/releases/latest/download/relay_sidecar_linux_amd64 wget https://github.com/symbioticfi/relay/releases/latest/download/relay_utils_linux_amd64 chmod +x relay_sidecar_linux_amd64 relay_utils_linux_amd64 # macOS ARM64 wget https://github.com/symbioticfi/relay/releases/latest/download/relay_sidecar_darwin_arm64 wget https://github.com/symbioticfi/relay/releases/latest/download/relay_utils_darwin_arm64 chmod +x relay_sidecar_darwin_arm64 relay_utils_darwin_arm64 # Run the binaries ./relay_sidecar_linux_amd64 --config config.yaml ``` Browse all releases at: https://github.com/symbioticfi/relay/releases ### Use Docker Images Pre-built Docker images are available from Docker Hub: ```bash # Pull the latest image docker pull symbioticfi/relay:latest # Or pull a specific version docker pull symbioticfi/relay: # Run the relay sidecar docker run -v $(pwd)/config.yaml:/config.yaml \ symbioticfi/relay:latest \ --config /config.yaml ``` Docker Hub: https://hub.docker.com/r/symbioticfi/relay ## Build localy ### Dependencies - **Go 1.24.3+** - **Docker & Docker Compose** (for local setup and E2E tests) - **Node.js & Foundry** (for contract compilation in E2E) ### Build Binaries Build the relay sidecar and utils binaries: ```bash # For Linux make build-relay-sidecar OS=linux ARCH=amd64 make build-relay-utils OS=linux ARCH=amd64 # For macOS ARM make build-relay-sidecar OS=darwin ARCH=arm64 make build-relay-utils OS=darwin ARCH=arm64 ``` ### Build Docker Image ```bash make image TAG=dev ``` ## Local Setup ### Automated Local Network Set up a complete local relay network with blockchain nodes and multiple relay sidecars: ```bash make local-setup ``` This command: 1. Builds the relay Docker image 2. Sets up local blockchain nodes (Anvil) 3. Deploys contracts 4. Generates sidecar configurations 5. Starts relay nodes in Docker **Customize the network** using environment variables (see [DEVELOPMENT.md](DEVELOPMENT.md) for details): ```bash OPERATORS=6 COMMITERS=2 AGGREGATORS=1 make local-setup ``` ## Configuration File Structure > **Note**: For a complete reference of all configuration options and command-line flags, see the [relay_sidecar CLI documentation](docs/cli/relay/relay_sidecar.md). Create a `config.yaml` file with the following structure: ```yaml # Logging log: level: "debug" # Options: debug, info, warn, error mode: "pretty" # Options: json, text, pretty # Storage storage-dir: ".data" # Directory for persistent data circuits-dir: "" # Path to ZK circuits (optional, empty disables ZK proofs) # API Server api: listen: ":8080" # API server address verbose-logging: false # Enable verbose API logging # Metrics (optional) metrics: listen: ":9090" # Metrics endpoint address pprof: false # Enable pprof debug endpoints # Driver Contract driver: chain-id: 31337 # Chain ID where driver contract is deployed address: "0x..." # Driver contract address # Secret Keys secret-keys: - namespace: "symb" # Namespace for the key key-type: 0 # 0=BLS-BN254, 1=ECDSA key-id: 15 # Key identifier secret: "0x..." # Private key hex - namespace: "evm" key-type: 1 key-id: 31337 secret: "0x..." - namespace: "p2p" key-type: 1 key-id: 1 secret: "0x..." # Alternatively, use keystore # keystore: # path: "/path/to/keystore.json" # password: "your-password" # Signal Configuration, used for internal messages and event queues signal: worker-count: 10 # Number of signal workers buffer-size: 20 # Signal buffer size # Cache Configuration, used for in memorylookups for db queries cache: network-config-size: 10 # Network config cache size validator-set-size: 10 # Validator set cache size # Sync Configuration, sync signatures and proofs over p2p to recover missing information sync: enabled: true # Enable P2P sync period: 5s # Sync period timeout: 1m # Sync timeout epochs: 5 # Number of epochs to sync # Key Cache, used for fast public key lookups key-cache: size: 100 # Key cache size enabled: true # Enable key caching # P2P Configuration p2p: listen: "/ip4/0.0.0.0/tcp/8880" # P2P listen address bootnodes: # List of bootstrap nodes (optional) - /dns4/node1/tcp/8880/p2p/... dht-mode: "server" # Options: auto, server, client, disabled, default: server (ideally should not change) mdns: true # Enable mDNS local discovery (useful for local networks) # EVM Configuration evm: chains: # List of settlement chain RPC endpoints - "http://localhost:8545" - "http://localhost:8546" max-calls: 30 # Max calls in multicall batches # Aggregation Policy aggregation-policy-max-unsigners: 50 # Max unsigners for low-cost policy # Data Retention (optional) # Controls how much historical data to keep on this node retention: valset-epochs: 0 # Number of historical epochs to retain on fresh node startup # 0 = unlimited (sync from genesis) # N > 0 = sync only last N epochs (for fresh nodes only) ``` #### Data Retention Control historical data sync for new nodes: ```bash --retention.valset-epochs=20 # Keep only last 20 validator set epochs on fresh node startup ``` **Important Notes**: - Only affects fresh nodes (no existing epoch data) - Set to match your planned pruning retention period - Must be >= `--sync.epochs` if both are set - Does not backfill gaps if increased on existing node #### Configuration via Command-Line Flags You can override config file values with command-line flags: ```bash ./relay_sidecar \ --config config.yaml \ --log.level debug \ --storage-dir /var/lib/relay \ --api.listen ":8080" \ --p2p.listen "/ip4/0.0.0.0/tcp/8880" \ --driver.chain-id 1 \ --driver.address "0x..." \ --secret-keys "symb/0/15/0x...,evm/1/31337/0x..." \ --evm.chains "http://localhost:8545" ``` #### Configuration via Environment Variables Environment variables use the `SYMB_` prefix with underscores instead of dashes and dots: ```bash export SYMB_LOG_LEVEL=debug export SYMB_LOG_MODE=pretty export SYMB_STORAGE_DIR=/var/lib/relay export SYMB_API_LISTEN=":8080" export SYMB_P2P_LISTEN="/ip4/0.0.0.0/tcp/8880" export SYMB_DRIVER_CHAIN_ID=1 export SYMB_DRIVER_ADDRESS="0x..." ./relay_sidecar --config config.yaml ``` #### Configuration Priority Configuration is loaded in the following order (highest priority first): 1. Command-line flags 2. Environment variables (with `SYMB_` prefix) 3. Configuration file (specified by `--config`) #### Example Configuration Generation For reference, see how configurations are generated in the E2E setup: ```bash # See the template in e2e/scripts/sidecar-start.sh (lines 11-27) cat e2e/scripts/sidecar-start.sh ``` To customize the local setup configuration, modify the template in `e2e/scripts/sidecar-start.sh` and run: ```bash make local-setup ``` ### Running the Relay Sidecar Once you have your configuration file ready: ```bash ./relay_sidecar --config config.yaml ``` Or with Docker: ```bash docker run -v $(pwd)/config.yaml:/config.yaml symbioticfi/relay:latest --config /config.yaml ``` ## Contributing We welcome contributions! Please read [CONTRIBUTING.md](CONTRIBUTING.md) for: - Branching strategy and PR process - Code style and linting requirements - Testing requirements For development workflows, API changes, and testing procedures, see [DEVELOPMENT.md](DEVELOPMENT.md). ```` --- ## Relay TypeScript client This file is a merged representation of the entire codebase, combined into a single document by Repomix. The content has been processed where content has been compressed (code blocks are separated by ⋮---- delimiter). # File Summary ## Purpose This file contains a packed representation of the entire repository's contents. It is designed to be easily consumable by AI systems for analysis, code review, or other automated processes. ## File Format The content is organized as follows: 1. This summary section 2. Repository information 3. Directory structure 4. Repository files (if enabled) 5. Multiple file entries, each consisting of: a. A header with the file path (## File: path/to/file) b. The full contents of the file in a code block ## Usage Guidelines - This file should be treated as read-only. Any changes should be made to the original repository files, not this packed version. - When processing this file, use the file path to distinguish between different files in the repository. - Be aware that this file may contain sensitive information. Handle it with the same level of security as you would the original repository. ## Notes - Some files may have been excluded based on .gitignore rules and Repomix's configuration - Binary files are not included in this packed representation. Please refer to the Repository Structure section for a complete list of file paths, including binary files - Files matching patterns in .gitignore are excluded - Files matching default ignore patterns are excluded - Content has been compressed - code blocks are separated by ⋮---- delimiter - Files are sorted by Git change count (files with more changes are at the bottom) # Directory Structure ``` .github/ workflows/ ci.yml generate.yml release.yml examples/ basic-usage.ts package.json README.md tsconfig.json scripts/ update-proto.sh src/ gen/ api/ proto/ v1/ api_pb.ts google/ api/ expr/ v1alpha1/ checked_pb.ts eval_pb.ts explain_pb.ts syntax_pb.ts value_pb.ts v1beta1/ decl_pb.ts eval_pb.ts expr_pb.ts source_pb.ts value_pb.ts annotations_pb.ts client_pb.ts field_behavior_pb.ts field_info_pb.ts http_pb.ts httpbody_pb.ts launch_stage_pb.ts resource_pb.ts visibility_pb.ts bytestream/ bytestream_pb.ts geo/ type/ viewport_pb.ts longrunning/ operations_pb.ts protobuf/ compiler/ plugin_pb.ts any_pb.ts api_pb.ts cpp_features_pb.ts descriptor_pb.ts duration_pb.ts empty_pb.ts field_mask_pb.ts go_features_pb.ts java_features_pb.ts source_context_pb.ts struct_pb.ts timestamp_pb.ts type_pb.ts wrappers_pb.ts rpc/ context/ attribute_context_pb.ts code_pb.ts error_details_pb.ts status_pb.ts type/ calendar_period_pb.ts color_pb.ts date_pb.ts datetime_pb.ts dayofweek_pb.ts decimal_pb.ts expr_pb.ts fraction_pb.ts interval_pb.ts latlng_pb.ts localized_text_pb.ts money_pb.ts month_pb.ts phone_number_pb.ts postal_address_pb.ts quaternion_pb.ts timeofday_pb.ts index.ts .gitignore .npmignore .npmrc buf.gen.yaml buf.lock buf.yaml eslint.config.js LICENSE package.json README.md tsconfig.json ``` # Files ## File: .github/workflows/ci.yml ````yaml name: CI on: pull_request: branches: - main push: branches: - main jobs: ci: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: '20' cache: 'npm' - name: Install buf uses: bufbuild/buf-setup-action@v1 - name: Install dependencies run: npm ci - name: Run lint run: npm run lint - name: Run build run: npm run build - name: Check generated files are up to date run: | # Generate protobuf files chmod +x ./scripts/update-proto.sh ./scripts/update-proto.sh # Check if any files changed if [ -n "$(git status --porcelain)" ]; then echo "❌ Generated files are out of date. Please run 'npm run update:proto' and commit the changes." echo "Changed files:" git status --porcelain git diff exit 1 else echo "✅ Generated files are up to date" fi ```` ## File: .github/workflows/generate.yml ````yaml name: Generate TS Client on: schedule: - cron: "0 3 * * *" # daily at 03:00 UTC workflow_dispatch: {} jobs: generate: runs-on: ubuntu-latest outputs: changed: ${{ steps.verify-changed-files.outputs.changed }} steps: - name: Checkout uses: actions/checkout@v4 - name: Setup Node uses: actions/setup-node@v4 with: node-version: 20 - name: Install buf uses: bufbuild/buf-setup-action@v1 - name: Install deps run: | npm ci - name: Generate run: | chmod +x ./scripts/update-proto.sh ./scripts/update-proto.sh - name: Build run: npm run build - name: Check for changes id: verify-changed-files run: | if [ -n "$(git status --porcelain)" ]; then echo "changed=true" >> $GITHUB_OUTPUT echo "Files have changed:" git status --porcelain else echo "changed=false" >> $GITHUB_OUTPUT echo "No changes detected" fi - name: Commit changes if: steps.verify-changed-files.outputs.changed == 'true' uses: stefanzweifel/git-auto-commit-action@v5 with: commit_message: "chore: update client from upstream proto" trigger-nightly-release: needs: generate if: needs.generate.outputs.changed == 'true' uses: ./.github/workflows/release.yml secrets: inherit ```` ## File: .github/workflows/release.yml ````yaml name: Release on: # Trigger for official releases push: tags: - 'v*.*.*' # Manual trigger with release type selection workflow_dispatch: inputs: release_type: description: 'Release type' required: true default: 'nightly' type: choice options: - nightly - official version: description: 'Version (only for official releases, e.g., 1.2.3)' required: false type: string # Allow this workflow to be called by other workflows workflow_call: jobs: release: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 with: fetch-depth: 0 # Needed for version bumping ref: ${{ github.event_name == 'workflow_call' && 'main' || github.ref }} - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: '20' registry-url: 'https://registry.npmjs.org' - name: Install dependencies run: npm ci - name: Build project run: npm run build - name: Determine release type id: release_info run: | if [[ "${{ github.event_name }}" == "schedule" ]]; then echo "type=nightly" >> $GITHUB_OUTPUT elif [[ "${{ github.event_name }}" == "push" && "${{ github.ref }}" == refs/tags/* ]]; then echo "type=official" >> $GITHUB_OUTPUT # Extract version from tag (remove 'v' prefix) echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT elif [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then echo "type=${{ github.event.inputs.release_type }}" >> $GITHUB_OUTPUT if [[ "${{ github.event.inputs.release_type }}" == "official" ]]; then echo "version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT fi elif [[ "${{ github.event_name }}" == "workflow_call" ]]; then echo "type=nightly" >> $GITHUB_OUTPUT fi - name: Check for changes (nightly only) id: changes if: steps.release_info.outputs.type == 'nightly' run: | # Check if there are any commits since yesterday YESTERDAY=$(date -d "yesterday" +%Y-%m-%d) COMMITS_SINCE=$(git rev-list --count --since="$YESTERDAY 00:00:00" HEAD) if [[ "$COMMITS_SINCE" == "0" ]]; then echo "has_changes=false" >> $GITHUB_OUTPUT echo "No changes since yesterday, skipping nightly build..." else echo "has_changes=true" >> $GITHUB_OUTPUT echo "Found $COMMITS_SINCE commits since yesterday" fi - name: Skip nightly if no changes if: steps.release_info.outputs.type == 'nightly' && steps.changes.outputs.has_changes == 'false' run: | echo "Skipping nightly release - no changes detected" exit 0 - name: Create nightly version if: steps.release_info.outputs.type == 'nightly' && steps.changes.outputs.has_changes == 'true' id: nightly_version run: | # Get current package version CURRENT_VERSION=$(node -p "require('./package.json').version") # Remove any existing pre-release suffix BASE_VERSION=$(echo $CURRENT_VERSION | sed 's/-.*$//') # Parse semantic version and increment patch IFS='.' read -r major minor patch <<< "$BASE_VERSION" INCREMENTED_PATCH=$((patch + 1)) INCREMENTED_VERSION="${major}.${minor}.${INCREMENTED_PATCH}" # Create nightly version with date DATE=$(date +%Y%m%d) NIGHTLY_VERSION="${INCREMENTED_VERSION}-nightly.${DATE}" echo "version=$NIGHTLY_VERSION" >> $GITHUB_OUTPUT echo "Created nightly version: $NIGHTLY_VERSION" - name: Create official version if: steps.release_info.outputs.type == 'official' id: official_version run: | VERSION="${{ steps.release_info.outputs.version }}" echo "version=$VERSION" >> $GITHUB_OUTPUT echo "Official version: $VERSION" - name: Update package.json version run: | if [[ "${{ steps.release_info.outputs.type }}" == "nightly" ]]; then VERSION="${{ steps.nightly_version.outputs.version }}" else VERSION="${{ steps.official_version.outputs.version }}" fi # Update package.json npm version $VERSION --no-git-tag-version echo "Updated package.json to version: $VERSION" - name: Publish to npm (nightly) if: steps.release_info.outputs.type == 'nightly' && steps.changes.outputs.has_changes == 'true' run: | npm publish --tag nightly --access public env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Publish to npm (official) if: steps.release_info.outputs.type == 'official' run: | npm publish --tag latest --access public env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} ```` ## File: examples/basic-usage.ts ````typescript /** * Basic usage example for the Symbiotic Relay TypeScript client. * * This example demonstrates how to: * 1. Connect to a Symbiotic Relay server * 2. Get the current epoch * 3. Calculate last committed epoch * 4. Get validator set information * 5. Sign a message * 6. Retrieve aggregation proofs * 7. Get individual signatures * 8. Get aggregation proofs by epoch * 9. Get signatures by epoch * 10. Get signature request IDs by epoch * 11. Get signature requests by epoch * 12. Get validator by key * 13. Get local validator * 14. Listen to signatures via streaming * 15. Listen to proofs via streaming * 16. Listen to validator set changes via streaming */ ⋮---- import { createClient } from "@connectrpc/connect"; import { createGrpcTransport } from "@connectrpc/connect-node"; import { SymbioticAPIService } from "@symbioticfi/relay-client-ts"; import { GetCurrentEpochRequestSchema, GetLastAllCommittedRequestSchema, SignMessageRequestSchema, GetAggregationProofRequestSchema, GetAggregationProofsByEpochRequestSchema, GetSignaturesRequestSchema, GetSignaturesByEpochRequestSchema, GetSignatureRequestIDsByEpochRequestSchema, GetSignatureRequestsByEpochRequestSchema, GetValidatorSetRequestSchema, GetValidatorByKeyRequestSchema, GetLocalValidatorRequestSchema, ListenSignaturesRequestSchema, ListenProofsRequestSchema, ListenValidatorSetRequestSchema, Signature, ChainEpochInfo, } from "@symbioticfi/relay-client-ts"; import { create } from "@bufbuild/protobuf"; ⋮---- /** * Simple wrapper around the generated Connect client. */ export class RelayClient ⋮---- constructor(serverUrl: string = "http://localhost:8080") ⋮---- /** * Get the current epoch information. */ async getCurrentEpoch() ⋮---- /** * Get the last all committed epochs for all chains. */ async getLastAllCommitted() ⋮---- /** * Sign a message using the specified key tag. */ async signMessage(keyTag: number, message: Uint8Array, requiredEpoch?: bigint) ⋮---- /** * Get aggregation proof for a specific request. */ async getAggregationProof(requestId: string) ⋮---- /** * Get individual signatures for a request. */ async getSignatures(requestId: string) ⋮---- /** * Get validator set information. */ async getValidatorSet(epoch?: bigint) ⋮---- /** * Get aggregation proofs by epoch. */ async getAggregationProofsByEpoch(epoch: bigint) ⋮---- /** * Get signatures by epoch. */ async getSignaturesByEpoch(epoch: bigint) ⋮---- /** * Get signature request IDs by epoch. */ async getSignatureRequestIDsByEpoch(epoch: bigint) ⋮---- /** * Get signature requests by epoch. */ async getSignatureRequestsByEpoch(epoch: bigint) ⋮---- /** * Get validator by key. */ async getValidatorByKey(keyTag: number, onChainKey: Uint8Array, epoch?: bigint) ⋮---- /** * Get local validator. */ async getLocalValidator(epoch?: bigint) ⋮---- /** * Listen to signatures in real-time via streaming response. */ async *listenSignatures(startEpoch?: bigint) ⋮---- /** * Listen to aggregation proofs in real-time via streaming response. */ async *listenProofs(startEpoch?: bigint) ⋮---- /** * Listen to validator set changes in real-time via streaming response. */ async *listenValidatorSet(startEpoch?: bigint) ⋮---- /** * Main example function demonstrating client usage. */ async function main() ⋮---- // Initialize client ⋮---- // Example 1: Get current epoch ⋮---- // Example 2: Get suggested epoch ⋮---- // Example 3: Get validator set ⋮---- // Display some validator details ⋮---- // Example 4: Sign a message ⋮---- // Example 5: Get aggregation proof (this might fail if signing is not complete) ⋮---- // Example 6: Get individual signatures ⋮---- // Example 7: Get aggregation proofs by epoch ⋮---- // Example 8: Get signatures by epoch ⋮---- // Example 9: Get signature request IDs by epoch ⋮---- // Example 10: Get signature requests by epoch ⋮---- // Example 12: Get validator by key ⋮---- // Example 13: Get local validator ⋮---- // Example 14: Listen to signatures (streaming) ⋮---- // Example 15: Listen to proofs (streaming) ⋮---- // Example 16: Listen to validator set changes (streaming) ⋮---- // Run the example if this file is executed directly ```` ## File: examples/package.json ````json { "name": "@symbioticfi/relay-client-ts-examples", "version": "0.1.0", "description": "Examples for the Symbiotic Relay TypeScript client", "type": "module", "private": true, "scripts": { "preinstall": "cd .. && npm install", "postinstall": "npm run build:client", "build:client": "cd .. && npm run build", "basic-usage": "tsx basic-usage.ts", "build": "tsc", "dev": "tsx --watch basic-usage.ts", "check": "tsc --noEmit", "setup": "npm install && npm run build:client" }, "dependencies": { "@bufbuild/protobuf": "^2.0.0", "@connectrpc/connect": "^2.0.0", "@connectrpc/connect-node": "^2.0.0", "@symbioticfi/relay-client-ts": "file:.." }, "devDependencies": { "@types/node": "^20.12.0", "tsx": "^4.0.0", "typescript": "^5.5.0" } } ```` ## File: examples/README.md ````markdown # Symbiotic Relay TypeScript Client Examples This directory contains examples demonstrating how to use the Symbiotic Relay TypeScript client library. ## Prerequisites 1. Install dependencies and build the client library: ```bash cd relay-client-ts-ts/examples npm install ``` This will automatically: - Install dependencies for the root relay-client-ts library - Build the TypeScript client library - Install example dependencies 2. Make sure you have a Symbiotic Relay server running (default: `localhost:8080`) ## Examples ### `basic-usage.ts` A comprehensive example showing how to: - Connect to a Symbiotic Relay server using Connect-RPC - Get current and suggested epoch information - Retrieve validator set data - Sign messages and get aggregation proofs - Use streaming sign-and-wait functionality **Run the example:** ```bash npm run basic-usage ``` **Environment variables:** - `RELAY_SERVER_URL`: Override the default server URL (default: `localhost:8080`) NOTE: for the signature/proof generation to work you need to run the script for all active relay servers to get the majority consensus to generate proof. ## Key Concepts ### Connect-RPC This client uses [Connect-RPC](https://connectrpc.com/), a modern RPC framework that works over HTTP/1.1, HTTP/2, and HTTP/3. It provides: - Type-safe client generation from protobuf definitions - Streaming support - Better error handling - Web and Node.js compatibility ### Client Setup ```typescript import { createClient } from "@connectrpc/connect"; import { createGrpcTransport } from "@connectrpc/connect-node"; import { SymbioticAPIService } from "@symbioticfi/relay-client-ts"; const transport = createGrpcTransport({ baseUrl: "localhost:8080", }); const client = createClient(SymbioticAPIService, transport); ``` ### Error Handling Connect-RPC provides structured error handling: ```typescript try { const response = await client.getCurrentEpoch(request); } catch (error) { if (error.code) { console.error(`RPC error: ${error.code} - ${error.message}`); } } ``` ### Message Signing Workflow 1. **Get suggested epoch**: Use `getSuggestedEpoch` to get the recommended epoch for signing 2. **Sign message**: Call `signMessage` with your key tag, message, and optional epoch. Use `signMessageWait` for live streaming proof data. 3. **Wait for aggregation**: Either poll with `getAggregationProof` or use `signMessageWait` for real-time updates 4. **Retrieve proof**: Get the final aggregation proof for verification ### Streaming Responses The `signMessageWait` method returns an async iterator: ```typescript for await (const response of client.signMessageWait(request)) { switch (response.status) { case SigningStatus.SIGNING_STATUS_COMPLETED: console.log("Signing completed!"); return; case SigningStatus.SIGNING_STATUS_FAILED: console.error("Signing failed:", response.error?.errorMessage); return; } } ``` ### Type Safety All message types are fully typed with TypeScript: ```typescript import { create } from "@bufbuild/protobuf"; import { SignMessageRequestSchema, SigningStatus, ValidatorSetStatus, } from "@symbioticfi/relay-client-ts"; const request = create(SignMessageRequestSchema, { keyTag: 1, message: new TextEncoder().encode("Hello"), requiredEpoch: 123n, // BigInt for uint64 }); ``` ### Data Types #### BigInt Handling Protobuf `uint64` fields are represented as `bigint` in TypeScript: ```typescript const epoch: bigint = 123n; const request = new SignMessageRequest({ requiredEpoch: epoch }); ``` #### Bytes Handling Protobuf `bytes` fields use `Uint8Array`: ```typescript const message = new TextEncoder().encode("Hello, world!"); const signature: Uint8Array = response.aggregationProof.proof; ``` #### Timestamps Protobuf timestamps are converted to JavaScript `Date` objects: ```typescript const startTime: Date = epochResponse.startTime.toDate(); ``` ```` ## File: examples/tsconfig.json ````json { "extends": "../tsconfig.json", "compilerOptions": { "outDir": "./dist", "rootDir": "..", "moduleResolution": "bundler", "allowImportingTsExtensions": true, "noEmit": true }, "include": [ "*.ts", "../src/**/*" ], "exclude": [ "node_modules", "dist" ] } ```` ## File: scripts/update-proto.sh ````bash #!/usr/bin/env bash set -euo pipefail ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")"/.. && pwd)" PROTO_DIR="$ROOT_DIR/api/proto/v1" rm -rf "$ROOT_DIR/api" "$ROOT_DIR/src/gen" mkdir -p "$PROTO_DIR" curl -sfL https://raw.githubusercontent.com/symbioticfi/relay/dev/api/proto/v1/api.proto -o "$PROTO_DIR/api.proto" cd "$ROOT_DIR" buf format -w buf lint buf generate # TypeScript specific: ensure index file exists for consumers if [ ! -f src/index.ts ]; then mkdir -p src cat > src/index.ts <<'EOF' export * from "./gen/api/proto/v1/api_pb"; EOF fi ```` ## File: src/gen/api/proto/v1/api_pb.ts ````typescript // @generated by protoc-gen-es v2.6.3 with parameter "target=ts" // @generated from file api/proto/v1/api.proto (package api.proto.v1, syntax proto3) /* eslint-disable */ ⋮---- import type { GenEnum, GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2"; import { enumDesc, fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2"; import { file_google_api_annotations } from "../../../google/api/annotations_pb"; import type { Timestamp } from "@bufbuild/protobuf/wkt"; import { file_google_protobuf_timestamp } from "@bufbuild/protobuf/wkt"; import type { Message } from "@bufbuild/protobuf"; ⋮---- /** * Describes the file api/proto/v1/api.proto. */ export const file_api_proto_v1_api: GenFile = /*@__PURE__*/ ⋮---- /** * Request message for signing a message * * @generated from message api.proto.v1.SignMessageRequest */ export type SignMessageRequest = Message<"api.proto.v1.SignMessageRequest"> & { /** * Key tag identifier (0-127) * * @generated from field: uint32 key_tag = 1; */ keyTag: number; /** * Message to be signed * * @generated from field: bytes message = 2; */ message: Uint8Array; /** * Required epoch (optional, if not provided latest committed epoch will be used) * * @generated from field: optional uint64 required_epoch = 3; */ requiredEpoch?: bigint; }; ⋮---- /** * Key tag identifier (0-127) * * @generated from field: uint32 key_tag = 1; */ ⋮---- /** * Message to be signed * * @generated from field: bytes message = 2; */ ⋮---- /** * Required epoch (optional, if not provided latest committed epoch will be used) * * @generated from field: optional uint64 required_epoch = 3; */ ⋮---- /** * Describes the message api.proto.v1.SignMessageRequest. * Use `create(SignMessageRequestSchema)` to create a new message. */ export const SignMessageRequestSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Response message for sign message request * * @generated from message api.proto.v1.SignMessageResponse */ export type SignMessageResponse = Message<"api.proto.v1.SignMessageResponse"> & { /** * Hash of the signature request * * @generated from field: string request_id = 1; */ requestId: string; /** * Epoch number * * @generated from field: uint64 epoch = 2; */ epoch: bigint; }; ⋮---- /** * Hash of the signature request * * @generated from field: string request_id = 1; */ ⋮---- /** * Epoch number * * @generated from field: uint64 epoch = 2; */ ⋮---- /** * Describes the message api.proto.v1.SignMessageResponse. * Use `create(SignMessageResponseSchema)` to create a new message. */ export const SignMessageResponseSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Request message for listening to signatures stream * * @generated from message api.proto.v1.ListenSignaturesRequest */ export type ListenSignaturesRequest = Message<"api.proto.v1.ListenSignaturesRequest"> & { /** * Optional: start epoch. If provided, stream will first send all historical signatures starting from this epoch, then continue with real-time updates * If not provided, only signatures generated after stream creation will be sent * * @generated from field: optional uint64 start_epoch = 1; */ startEpoch?: bigint; }; ⋮---- /** * Optional: start epoch. If provided, stream will first send all historical signatures starting from this epoch, then continue with real-time updates * If not provided, only signatures generated after stream creation will be sent * * @generated from field: optional uint64 start_epoch = 1; */ ⋮---- /** * Describes the message api.proto.v1.ListenSignaturesRequest. * Use `create(ListenSignaturesRequestSchema)` to create a new message. */ export const ListenSignaturesRequestSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Response message for signatures stream * * @generated from message api.proto.v1.ListenSignaturesResponse */ export type ListenSignaturesResponse = Message<"api.proto.v1.ListenSignaturesResponse"> & { /** * Id of the signature request * * @generated from field: string request_id = 1; */ requestId: string; /** * Epoch number * * @generated from field: uint64 epoch = 2; */ epoch: bigint; /** * Signature data * * @generated from field: api.proto.v1.Signature signature = 3; */ signature?: Signature; }; ⋮---- /** * Id of the signature request * * @generated from field: string request_id = 1; */ ⋮---- /** * Epoch number * * @generated from field: uint64 epoch = 2; */ ⋮---- /** * Signature data * * @generated from field: api.proto.v1.Signature signature = 3; */ ⋮---- /** * Describes the message api.proto.v1.ListenSignaturesResponse. * Use `create(ListenSignaturesResponseSchema)` to create a new message. */ export const ListenSignaturesResponseSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Request message for listening to aggregation proofs stream * * @generated from message api.proto.v1.ListenProofsRequest */ export type ListenProofsRequest = Message<"api.proto.v1.ListenProofsRequest"> & { /** * Optional: start epoch. If provided, stream will first send all historical proofs starting from this epoch, then continue with real-time updates * If not provided, only proofs generated after stream creation will be sent * * @generated from field: optional uint64 start_epoch = 1; */ startEpoch?: bigint; }; ⋮---- /** * Optional: start epoch. If provided, stream will first send all historical proofs starting from this epoch, then continue with real-time updates * If not provided, only proofs generated after stream creation will be sent * * @generated from field: optional uint64 start_epoch = 1; */ ⋮---- /** * Describes the message api.proto.v1.ListenProofsRequest. * Use `create(ListenProofsRequestSchema)` to create a new message. */ export const ListenProofsRequestSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Response message for aggregation proofs stream * * @generated from message api.proto.v1.ListenProofsResponse */ export type ListenProofsResponse = Message<"api.proto.v1.ListenProofsResponse"> & { /** * Id of the request * * @generated from field: string request_id = 1; */ requestId: string; /** * Epoch number * * @generated from field: uint64 epoch = 2; */ epoch: bigint; /** * Final aggregation proof * * @generated from field: api.proto.v1.AggregationProof aggregation_proof = 3; */ aggregationProof?: AggregationProof; }; ⋮---- /** * Id of the request * * @generated from field: string request_id = 1; */ ⋮---- /** * Epoch number * * @generated from field: uint64 epoch = 2; */ ⋮---- /** * Final aggregation proof * * @generated from field: api.proto.v1.AggregationProof aggregation_proof = 3; */ ⋮---- /** * Describes the message api.proto.v1.ListenProofsResponse. * Use `create(ListenProofsResponseSchema)` to create a new message. */ export const ListenProofsResponseSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Request message for listening to validator set changes stream * * @generated from message api.proto.v1.ListenValidatorSetRequest */ export type ListenValidatorSetRequest = Message<"api.proto.v1.ListenValidatorSetRequest"> & { /** * Optional: start epoch. If provided, stream will first send all historical validator sets starting from this epoch, then continue with real-time updates * If not provided, only validator sets generated after stream creation will be sent * * @generated from field: optional uint64 start_epoch = 1; */ startEpoch?: bigint; }; ⋮---- /** * Optional: start epoch. If provided, stream will first send all historical validator sets starting from this epoch, then continue with real-time updates * If not provided, only validator sets generated after stream creation will be sent * * @generated from field: optional uint64 start_epoch = 1; */ ⋮---- /** * Describes the message api.proto.v1.ListenValidatorSetRequest. * Use `create(ListenValidatorSetRequestSchema)` to create a new message. */ export const ListenValidatorSetRequestSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Response message for validator set changes stream * * @generated from message api.proto.v1.ListenValidatorSetResponse */ export type ListenValidatorSetResponse = Message<"api.proto.v1.ListenValidatorSetResponse"> & { /** * The validator set * * @generated from field: api.proto.v1.ValidatorSet validator_set = 1; */ validatorSet?: ValidatorSet; }; ⋮---- /** * The validator set * * @generated from field: api.proto.v1.ValidatorSet validator_set = 1; */ ⋮---- /** * Describes the message api.proto.v1.ListenValidatorSetResponse. * Use `create(ListenValidatorSetResponseSchema)` to create a new message. */ export const ListenValidatorSetResponseSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Request message for getting aggregation proof * * @generated from message api.proto.v1.GetAggregationProofRequest */ export type GetAggregationProofRequest = Message<"api.proto.v1.GetAggregationProofRequest"> & { /** * @generated from field: string request_id = 1; */ requestId: string; }; ⋮---- /** * @generated from field: string request_id = 1; */ ⋮---- /** * Describes the message api.proto.v1.GetAggregationProofRequest. * Use `create(GetAggregationProofRequestSchema)` to create a new message. */ export const GetAggregationProofRequestSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Request message for getting aggregation proof * * @generated from message api.proto.v1.GetAggregationProofsByEpochRequest */ export type GetAggregationProofsByEpochRequest = Message<"api.proto.v1.GetAggregationProofsByEpochRequest"> & { /** * Epoch number * * @generated from field: uint64 epoch = 1; */ epoch: bigint; }; ⋮---- /** * Epoch number * * @generated from field: uint64 epoch = 1; */ ⋮---- /** * Describes the message api.proto.v1.GetAggregationProofsByEpochRequest. * Use `create(GetAggregationProofsByEpochRequestSchema)` to create a new message. */ export const GetAggregationProofsByEpochRequestSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Request message for getting current epoch * * @generated from message api.proto.v1.GetCurrentEpochRequest */ export type GetCurrentEpochRequest = Message<"api.proto.v1.GetCurrentEpochRequest"> & { }; ⋮---- /** * Describes the message api.proto.v1.GetCurrentEpochRequest. * Use `create(GetCurrentEpochRequestSchema)` to create a new message. */ export const GetCurrentEpochRequestSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Request message for getting signatures * * @generated from message api.proto.v1.GetSignaturesRequest */ export type GetSignaturesRequest = Message<"api.proto.v1.GetSignaturesRequest"> & { /** * @generated from field: string request_id = 1; */ requestId: string; }; ⋮---- /** * @generated from field: string request_id = 1; */ ⋮---- /** * Describes the message api.proto.v1.GetSignaturesRequest. * Use `create(GetSignaturesRequestSchema)` to create a new message. */ export const GetSignaturesRequestSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Request message for getting signatures by epoch * * @generated from message api.proto.v1.GetSignaturesByEpochRequest */ export type GetSignaturesByEpochRequest = Message<"api.proto.v1.GetSignaturesByEpochRequest"> & { /** * Epoch number * * @generated from field: uint64 epoch = 1; */ epoch: bigint; }; ⋮---- /** * Epoch number * * @generated from field: uint64 epoch = 1; */ ⋮---- /** * Describes the message api.proto.v1.GetSignaturesByEpochRequest. * Use `create(GetSignaturesByEpochRequestSchema)` to create a new message. */ export const GetSignaturesByEpochRequestSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Response message for getting signatures * * @generated from message api.proto.v1.GetSignaturesResponse */ export type GetSignaturesResponse = Message<"api.proto.v1.GetSignaturesResponse"> & { /** * List of signatures * * @generated from field: repeated api.proto.v1.Signature signatures = 1; */ signatures: Signature[]; }; ⋮---- /** * List of signatures * * @generated from field: repeated api.proto.v1.Signature signatures = 1; */ ⋮---- /** * Describes the message api.proto.v1.GetSignaturesResponse. * Use `create(GetSignaturesResponseSchema)` to create a new message. */ export const GetSignaturesResponseSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Response message for getting signatures by epoch * * @generated from message api.proto.v1.GetSignaturesByEpochResponse */ export type GetSignaturesByEpochResponse = Message<"api.proto.v1.GetSignaturesByEpochResponse"> & { /** * List of signatures * * @generated from field: repeated api.proto.v1.Signature signatures = 1; */ signatures: Signature[]; }; ⋮---- /** * List of signatures * * @generated from field: repeated api.proto.v1.Signature signatures = 1; */ ⋮---- /** * Describes the message api.proto.v1.GetSignaturesByEpochResponse. * Use `create(GetSignaturesByEpochResponseSchema)` to create a new message. */ export const GetSignaturesByEpochResponseSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Request message for getting all signature request IDs by epoch * * @generated from message api.proto.v1.GetSignatureRequestIDsByEpochRequest */ export type GetSignatureRequestIDsByEpochRequest = Message<"api.proto.v1.GetSignatureRequestIDsByEpochRequest"> & { /** * Epoch number * * @generated from field: uint64 epoch = 1; */ epoch: bigint; }; ⋮---- /** * Epoch number * * @generated from field: uint64 epoch = 1; */ ⋮---- /** * Describes the message api.proto.v1.GetSignatureRequestIDsByEpochRequest. * Use `create(GetSignatureRequestIDsByEpochRequestSchema)` to create a new message. */ export const GetSignatureRequestIDsByEpochRequestSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Response message for getting all signature request IDs by epoch * * @generated from message api.proto.v1.GetSignatureRequestIDsByEpochResponse */ export type GetSignatureRequestIDsByEpochResponse = Message<"api.proto.v1.GetSignatureRequestIDsByEpochResponse"> & { /** * List of all signature request IDs for the epoch * * @generated from field: repeated string request_ids = 1; */ requestIds: string[]; }; ⋮---- /** * List of all signature request IDs for the epoch * * @generated from field: repeated string request_ids = 1; */ ⋮---- /** * Describes the message api.proto.v1.GetSignatureRequestIDsByEpochResponse. * Use `create(GetSignatureRequestIDsByEpochResponseSchema)` to create a new message. */ export const GetSignatureRequestIDsByEpochResponseSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Request message for getting all signature requests by epoch * * @generated from message api.proto.v1.GetSignatureRequestsByEpochRequest */ export type GetSignatureRequestsByEpochRequest = Message<"api.proto.v1.GetSignatureRequestsByEpochRequest"> & { /** * Epoch number * * @generated from field: uint64 epoch = 1; */ epoch: bigint; }; ⋮---- /** * Epoch number * * @generated from field: uint64 epoch = 1; */ ⋮---- /** * Describes the message api.proto.v1.GetSignatureRequestsByEpochRequest. * Use `create(GetSignatureRequestsByEpochRequestSchema)` to create a new message. */ export const GetSignatureRequestsByEpochRequestSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Response message for getting all signature requests by epoch * * @generated from message api.proto.v1.GetSignatureRequestsByEpochResponse */ export type GetSignatureRequestsByEpochResponse = Message<"api.proto.v1.GetSignatureRequestsByEpochResponse"> & { /** * List of all signature requests for the epoch * * @generated from field: repeated api.proto.v1.SignatureRequest signature_requests = 1; */ signatureRequests: SignatureRequest[]; }; ⋮---- /** * List of all signature requests for the epoch * * @generated from field: repeated api.proto.v1.SignatureRequest signature_requests = 1; */ ⋮---- /** * Describes the message api.proto.v1.GetSignatureRequestsByEpochResponse. * Use `create(GetSignatureRequestsByEpochResponseSchema)` to create a new message. */ export const GetSignatureRequestsByEpochResponseSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Request message for getting signature request * * @generated from message api.proto.v1.GetSignatureRequestRequest */ export type GetSignatureRequestRequest = Message<"api.proto.v1.GetSignatureRequestRequest"> & { /** * @generated from field: string request_id = 1; */ requestId: string; }; ⋮---- /** * @generated from field: string request_id = 1; */ ⋮---- /** * Describes the message api.proto.v1.GetSignatureRequestRequest. * Use `create(GetSignatureRequestRequestSchema)` to create a new message. */ export const GetSignatureRequestRequestSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Request message for getting aggregation status * * @generated from message api.proto.v1.GetAggregationStatusRequest */ export type GetAggregationStatusRequest = Message<"api.proto.v1.GetAggregationStatusRequest"> & { /** * @generated from field: string request_id = 1; */ requestId: string; }; ⋮---- /** * @generated from field: string request_id = 1; */ ⋮---- /** * Describes the message api.proto.v1.GetAggregationStatusRequest. * Use `create(GetAggregationStatusRequestSchema)` to create a new message. */ export const GetAggregationStatusRequestSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Request message for getting validator set * * @generated from message api.proto.v1.GetValidatorSetRequest */ export type GetValidatorSetRequest = Message<"api.proto.v1.GetValidatorSetRequest"> & { /** * Epoch number (optional, if not provided current epoch will be used) * * @generated from field: optional uint64 epoch = 1; */ epoch?: bigint; }; ⋮---- /** * Epoch number (optional, if not provided current epoch will be used) * * @generated from field: optional uint64 epoch = 1; */ ⋮---- /** * Describes the message api.proto.v1.GetValidatorSetRequest. * Use `create(GetValidatorSetRequestSchema)` to create a new message. */ export const GetValidatorSetRequestSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Request message for getting validator by address * * @generated from message api.proto.v1.GetValidatorByAddressRequest */ export type GetValidatorByAddressRequest = Message<"api.proto.v1.GetValidatorByAddressRequest"> & { /** * Epoch number (optional, if not provided current epoch will be used) * * @generated from field: optional uint64 epoch = 1; */ epoch?: bigint; /** * Validator address (required) * * @generated from field: string address = 2; */ address: string; }; ⋮---- /** * Epoch number (optional, if not provided current epoch will be used) * * @generated from field: optional uint64 epoch = 1; */ ⋮---- /** * Validator address (required) * * @generated from field: string address = 2; */ ⋮---- /** * Describes the message api.proto.v1.GetValidatorByAddressRequest. * Use `create(GetValidatorByAddressRequestSchema)` to create a new message. */ export const GetValidatorByAddressRequestSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Request message for getting validator by key * * @generated from message api.proto.v1.GetValidatorByKeyRequest */ export type GetValidatorByKeyRequest = Message<"api.proto.v1.GetValidatorByKeyRequest"> & { /** * Epoch number (optional, if not provided current epoch will be used) * * @generated from field: optional uint64 epoch = 1; */ epoch?: bigint; /** * Validator key tag (required) * * @generated from field: uint32 key_tag = 2; */ keyTag: number; /** * Validator on chain (public) key (required) * * @generated from field: bytes on_chain_key = 3; */ onChainKey: Uint8Array; }; ⋮---- /** * Epoch number (optional, if not provided current epoch will be used) * * @generated from field: optional uint64 epoch = 1; */ ⋮---- /** * Validator key tag (required) * * @generated from field: uint32 key_tag = 2; */ ⋮---- /** * Validator on chain (public) key (required) * * @generated from field: bytes on_chain_key = 3; */ ⋮---- /** * Describes the message api.proto.v1.GetValidatorByKeyRequest. * Use `create(GetValidatorByKeyRequestSchema)` to create a new message. */ export const GetValidatorByKeyRequestSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Request message for getting local validator * * @generated from message api.proto.v1.GetLocalValidatorRequest */ export type GetLocalValidatorRequest = Message<"api.proto.v1.GetLocalValidatorRequest"> & { /** * Epoch number (optional, if not provided current epoch will be used) * * @generated from field: optional uint64 epoch = 1; */ epoch?: bigint; }; ⋮---- /** * Epoch number (optional, if not provided current epoch will be used) * * @generated from field: optional uint64 epoch = 1; */ ⋮---- /** * Describes the message api.proto.v1.GetLocalValidatorRequest. * Use `create(GetLocalValidatorRequestSchema)` to create a new message. */ export const GetLocalValidatorRequestSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Request message for getting validator set header * * @generated from message api.proto.v1.GetValidatorSetHeaderRequest */ export type GetValidatorSetHeaderRequest = Message<"api.proto.v1.GetValidatorSetHeaderRequest"> & { /** * Epoch number (optional, if not provided current epoch will be used) * * @generated from field: optional uint64 epoch = 1; */ epoch?: bigint; }; ⋮---- /** * Epoch number (optional, if not provided current epoch will be used) * * @generated from field: optional uint64 epoch = 1; */ ⋮---- /** * Describes the message api.proto.v1.GetValidatorSetHeaderRequest. * Use `create(GetValidatorSetHeaderRequestSchema)` to create a new message. */ export const GetValidatorSetHeaderRequestSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Request message for getting validator set metadata * * @generated from message api.proto.v1.GetValidatorSetMetadataRequest */ export type GetValidatorSetMetadataRequest = Message<"api.proto.v1.GetValidatorSetMetadataRequest"> & { /** * Epoch number (optional, if not provided current epoch will be used) * * @generated from field: optional uint64 epoch = 1; */ epoch?: bigint; }; ⋮---- /** * Epoch number (optional, if not provided current epoch will be used) * * @generated from field: optional uint64 epoch = 1; */ ⋮---- /** * Describes the message api.proto.v1.GetValidatorSetMetadataRequest. * Use `create(GetValidatorSetMetadataRequestSchema)` to create a new message. */ export const GetValidatorSetMetadataRequestSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Response message for getting current epoch * * @generated from message api.proto.v1.GetCurrentEpochResponse */ export type GetCurrentEpochResponse = Message<"api.proto.v1.GetCurrentEpochResponse"> & { /** * Epoch number * * @generated from field: uint64 epoch = 1; */ epoch: bigint; /** * Epoch start time * * @generated from field: google.protobuf.Timestamp start_time = 2; */ startTime?: Timestamp; }; ⋮---- /** * Epoch number * * @generated from field: uint64 epoch = 1; */ ⋮---- /** * Epoch start time * * @generated from field: google.protobuf.Timestamp start_time = 2; */ ⋮---- /** * Describes the message api.proto.v1.GetCurrentEpochResponse. * Use `create(GetCurrentEpochResponseSchema)` to create a new message. */ export const GetCurrentEpochResponseSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * SignatureRequest represents a signature request * * @generated from message api.proto.v1.SignatureRequest */ export type SignatureRequest = Message<"api.proto.v1.SignatureRequest"> & { /** * Request ID * * @generated from field: string request_id = 1; */ requestId: string; /** * Key tag identifier (0-127) * * @generated from field: uint32 key_tag = 2; */ keyTag: number; /** * Message to be signed * * @generated from field: bytes message = 3; */ message: Uint8Array; /** * Required epoch * * @generated from field: uint64 required_epoch = 4; */ requiredEpoch: bigint; }; ⋮---- /** * Request ID * * @generated from field: string request_id = 1; */ ⋮---- /** * Key tag identifier (0-127) * * @generated from field: uint32 key_tag = 2; */ ⋮---- /** * Message to be signed * * @generated from field: bytes message = 3; */ ⋮---- /** * Required epoch * * @generated from field: uint64 required_epoch = 4; */ ⋮---- /** * Describes the message api.proto.v1.SignatureRequest. * Use `create(SignatureRequestSchema)` to create a new message. */ export const SignatureRequestSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Response message for getting signature request * * @generated from message api.proto.v1.GetSignatureRequestResponse */ export type GetSignatureRequestResponse = Message<"api.proto.v1.GetSignatureRequestResponse"> & { /** * @generated from field: api.proto.v1.SignatureRequest signature_request = 1; */ signatureRequest?: SignatureRequest; }; ⋮---- /** * @generated from field: api.proto.v1.SignatureRequest signature_request = 1; */ ⋮---- /** * Describes the message api.proto.v1.GetSignatureRequestResponse. * Use `create(GetSignatureRequestResponseSchema)` to create a new message. */ export const GetSignatureRequestResponseSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Response message for getting aggregation proof * * @generated from message api.proto.v1.GetAggregationProofResponse */ export type GetAggregationProofResponse = Message<"api.proto.v1.GetAggregationProofResponse"> & { /** * @generated from field: api.proto.v1.AggregationProof aggregation_proof = 1; */ aggregationProof?: AggregationProof; }; ⋮---- /** * @generated from field: api.proto.v1.AggregationProof aggregation_proof = 1; */ ⋮---- /** * Describes the message api.proto.v1.GetAggregationProofResponse. * Use `create(GetAggregationProofResponseSchema)` to create a new message. */ export const GetAggregationProofResponseSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Response message for getting aggregation proof * * @generated from message api.proto.v1.GetAggregationProofsByEpochResponse */ export type GetAggregationProofsByEpochResponse = Message<"api.proto.v1.GetAggregationProofsByEpochResponse"> & { /** * @generated from field: repeated api.proto.v1.AggregationProof aggregation_proofs = 1; */ aggregationProofs: AggregationProof[]; }; ⋮---- /** * @generated from field: repeated api.proto.v1.AggregationProof aggregation_proofs = 1; */ ⋮---- /** * Describes the message api.proto.v1.GetAggregationProofsByEpochResponse. * Use `create(GetAggregationProofsByEpochResponseSchema)` to create a new message. */ export const GetAggregationProofsByEpochResponseSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Response message for getting aggregation proof * * @generated from message api.proto.v1.AggregationProof */ export type AggregationProof = Message<"api.proto.v1.AggregationProof"> & { /** * Message hash * * @generated from field: bytes message_hash = 2; */ messageHash: Uint8Array; /** * Proof data * * @generated from field: bytes proof = 3; */ proof: Uint8Array; /** * Request ID * * @generated from field: string request_id = 4; */ requestId: string; }; ⋮---- /** * Message hash * * @generated from field: bytes message_hash = 2; */ ⋮---- /** * Proof data * * @generated from field: bytes proof = 3; */ ⋮---- /** * Request ID * * @generated from field: string request_id = 4; */ ⋮---- /** * Describes the message api.proto.v1.AggregationProof. * Use `create(AggregationProofSchema)` to create a new message. */ export const AggregationProofSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Response message for getting aggregation status * * @generated from message api.proto.v1.GetAggregationStatusResponse */ export type GetAggregationStatusResponse = Message<"api.proto.v1.GetAggregationStatusResponse"> & { /** * Current voting power of the aggregator (big integer as string) * * @generated from field: string current_voting_power = 1; */ currentVotingPower: string; /** * List of operator addresses that signed the request * * @generated from field: repeated string signer_operators = 2; */ signerOperators: string[]; }; ⋮---- /** * Current voting power of the aggregator (big integer as string) * * @generated from field: string current_voting_power = 1; */ ⋮---- /** * List of operator addresses that signed the request * * @generated from field: repeated string signer_operators = 2; */ ⋮---- /** * Describes the message api.proto.v1.GetAggregationStatusResponse. * Use `create(GetAggregationStatusResponseSchema)` to create a new message. */ export const GetAggregationStatusResponseSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Digital signature * * @generated from message api.proto.v1.Signature */ export type Signature = Message<"api.proto.v1.Signature"> & { /** * Signature data * * @generated from field: bytes signature = 1; */ signature: Uint8Array; /** * Message hash * * @generated from field: bytes message_hash = 2; */ messageHash: Uint8Array; /** * Public key * * @generated from field: bytes public_key = 3; */ publicKey: Uint8Array; /** * Request ID * * @generated from field: string request_id = 4; */ requestId: string; }; ⋮---- /** * Signature data * * @generated from field: bytes signature = 1; */ ⋮---- /** * Message hash * * @generated from field: bytes message_hash = 2; */ ⋮---- /** * Public key * * @generated from field: bytes public_key = 3; */ ⋮---- /** * Request ID * * @generated from field: string request_id = 4; */ ⋮---- /** * Describes the message api.proto.v1.Signature. * Use `create(SignatureSchema)` to create a new message. */ export const SignatureSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Response message for getting validator set * * @generated from message api.proto.v1.GetValidatorSetResponse */ export type GetValidatorSetResponse = Message<"api.proto.v1.GetValidatorSetResponse"> & { /** * The validator set * * @generated from field: api.proto.v1.ValidatorSet validator_set = 1; */ validatorSet?: ValidatorSet; }; ⋮---- /** * The validator set * * @generated from field: api.proto.v1.ValidatorSet validator_set = 1; */ ⋮---- /** * Describes the message api.proto.v1.GetValidatorSetResponse. * Use `create(GetValidatorSetResponseSchema)` to create a new message. */ export const GetValidatorSetResponseSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Response message for getting validator by address * * @generated from message api.proto.v1.GetValidatorByAddressResponse */ export type GetValidatorByAddressResponse = Message<"api.proto.v1.GetValidatorByAddressResponse"> & { /** * The validator * * @generated from field: api.proto.v1.Validator validator = 1; */ validator?: Validator; }; ⋮---- /** * The validator * * @generated from field: api.proto.v1.Validator validator = 1; */ ⋮---- /** * Describes the message api.proto.v1.GetValidatorByAddressResponse. * Use `create(GetValidatorByAddressResponseSchema)` to create a new message. */ export const GetValidatorByAddressResponseSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Response message for getting validator by key * * @generated from message api.proto.v1.GetValidatorByKeyResponse */ export type GetValidatorByKeyResponse = Message<"api.proto.v1.GetValidatorByKeyResponse"> & { /** * The validator * * @generated from field: api.proto.v1.Validator validator = 1; */ validator?: Validator; }; ⋮---- /** * The validator * * @generated from field: api.proto.v1.Validator validator = 1; */ ⋮---- /** * Describes the message api.proto.v1.GetValidatorByKeyResponse. * Use `create(GetValidatorByKeyResponseSchema)` to create a new message. */ export const GetValidatorByKeyResponseSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Response message for getting local validator * * @generated from message api.proto.v1.GetLocalValidatorResponse */ export type GetLocalValidatorResponse = Message<"api.proto.v1.GetLocalValidatorResponse"> & { /** * The validator * * @generated from field: api.proto.v1.Validator validator = 1; */ validator?: Validator; }; ⋮---- /** * The validator * * @generated from field: api.proto.v1.Validator validator = 1; */ ⋮---- /** * Describes the message api.proto.v1.GetLocalValidatorResponse. * Use `create(GetLocalValidatorResponseSchema)` to create a new message. */ export const GetLocalValidatorResponseSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * @generated from message api.proto.v1.ExtraData */ export type ExtraData = Message<"api.proto.v1.ExtraData"> & { /** * @generated from field: bytes key = 1; */ key: Uint8Array; /** * @generated from field: bytes value = 2; */ value: Uint8Array; }; ⋮---- /** * @generated from field: bytes key = 1; */ ⋮---- /** * @generated from field: bytes value = 2; */ ⋮---- /** * Describes the message api.proto.v1.ExtraData. * Use `create(ExtraDataSchema)` to create a new message. */ export const ExtraDataSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Response message for getting validator set header * * @generated from message api.proto.v1.GetValidatorSetMetadataResponse */ export type GetValidatorSetMetadataResponse = Message<"api.proto.v1.GetValidatorSetMetadataResponse"> & { /** * @generated from field: repeated api.proto.v1.ExtraData extra_data = 1; */ extraData: ExtraData[]; /** * @generated from field: bytes commitment_data = 2; */ commitmentData: Uint8Array; /** * @generated from field: string request_id = 3; */ requestId: string; }; ⋮---- /** * @generated from field: repeated api.proto.v1.ExtraData extra_data = 1; */ ⋮---- /** * @generated from field: bytes commitment_data = 2; */ ⋮---- /** * @generated from field: string request_id = 3; */ ⋮---- /** * Describes the message api.proto.v1.GetValidatorSetMetadataResponse. * Use `create(GetValidatorSetMetadataResponseSchema)` to create a new message. */ export const GetValidatorSetMetadataResponseSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Response message for getting validator set header * * @generated from message api.proto.v1.GetValidatorSetHeaderResponse */ export type GetValidatorSetHeaderResponse = Message<"api.proto.v1.GetValidatorSetHeaderResponse"> & { /** * Version of the validator set * * @generated from field: uint32 version = 1; */ version: number; /** * Key tag required to commit next validator set * * @generated from field: uint32 required_key_tag = 2; */ requiredKeyTag: number; /** * Validator set epoch * * @generated from field: uint64 epoch = 3; */ epoch: bigint; /** * Epoch capture timestamp * * @generated from field: google.protobuf.Timestamp capture_timestamp = 4; */ captureTimestamp?: Timestamp; /** * Quorum threshold (big integer as string) * * @generated from field: string quorum_threshold = 5; */ quorumThreshold: string; /** * Total voting power (big integer as string) * * @generated from field: string total_voting_power = 6; */ totalVotingPower: string; /** * Validators SSZ Merkle root (hex string) * * @generated from field: string validators_ssz_mroot = 7; */ validatorsSszMroot: string; }; ⋮---- /** * Version of the validator set * * @generated from field: uint32 version = 1; */ ⋮---- /** * Key tag required to commit next validator set * * @generated from field: uint32 required_key_tag = 2; */ ⋮---- /** * Validator set epoch * * @generated from field: uint64 epoch = 3; */ ⋮---- /** * Epoch capture timestamp * * @generated from field: google.protobuf.Timestamp capture_timestamp = 4; */ ⋮---- /** * Quorum threshold (big integer as string) * * @generated from field: string quorum_threshold = 5; */ ⋮---- /** * Total voting power (big integer as string) * * @generated from field: string total_voting_power = 6; */ ⋮---- /** * Validators SSZ Merkle root (hex string) * * @generated from field: string validators_ssz_mroot = 7; */ ⋮---- /** * Describes the message api.proto.v1.GetValidatorSetHeaderResponse. * Use `create(GetValidatorSetHeaderResponseSchema)` to create a new message. */ export const GetValidatorSetHeaderResponseSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Validator information * * @generated from message api.proto.v1.Validator */ export type Validator = Message<"api.proto.v1.Validator"> & { /** * Operator address (hex string) * * @generated from field: string operator = 1; */ operator: string; /** * Voting power of the validator (big integer as string) * * @generated from field: string voting_power = 2; */ votingPower: string; /** * Indicates if the validator is active * * @generated from field: bool is_active = 3; */ isActive: boolean; /** * List of cryptographic keys * * @generated from field: repeated api.proto.v1.Key keys = 4; */ keys: Key[]; /** * List of validator vaults * * @generated from field: repeated api.proto.v1.ValidatorVault vaults = 5; */ vaults: ValidatorVault[]; }; ⋮---- /** * Operator address (hex string) * * @generated from field: string operator = 1; */ ⋮---- /** * Voting power of the validator (big integer as string) * * @generated from field: string voting_power = 2; */ ⋮---- /** * Indicates if the validator is active * * @generated from field: bool is_active = 3; */ ⋮---- /** * List of cryptographic keys * * @generated from field: repeated api.proto.v1.Key keys = 4; */ ⋮---- /** * List of validator vaults * * @generated from field: repeated api.proto.v1.ValidatorVault vaults = 5; */ ⋮---- /** * Describes the message api.proto.v1.Validator. * Use `create(ValidatorSchema)` to create a new message. */ export const ValidatorSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Cryptographic key * * @generated from message api.proto.v1.Key */ export type Key = Message<"api.proto.v1.Key"> & { /** * Key tag identifier (0-127) * * @generated from field: uint32 tag = 1; */ tag: number; /** * Key payload * * @generated from field: bytes payload = 2; */ payload: Uint8Array; }; ⋮---- /** * Key tag identifier (0-127) * * @generated from field: uint32 tag = 1; */ ⋮---- /** * Key payload * * @generated from field: bytes payload = 2; */ ⋮---- /** * Describes the message api.proto.v1.Key. * Use `create(KeySchema)` to create a new message. */ export const KeySchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Validator vault information * * @generated from message api.proto.v1.ValidatorVault */ export type ValidatorVault = Message<"api.proto.v1.ValidatorVault"> & { /** * Chain identifier * * @generated from field: uint64 chain_id = 1; */ chainId: bigint; /** * Vault address * * @generated from field: string vault = 2; */ vault: string; /** * Voting power for this vault (big integer as string) * * @generated from field: string voting_power = 3; */ votingPower: string; }; ⋮---- /** * Chain identifier * * @generated from field: uint64 chain_id = 1; */ ⋮---- /** * Vault address * * @generated from field: string vault = 2; */ ⋮---- /** * Voting power for this vault (big integer as string) * * @generated from field: string voting_power = 3; */ ⋮---- /** * Describes the message api.proto.v1.ValidatorVault. * Use `create(ValidatorVaultSchema)` to create a new message. */ export const ValidatorVaultSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Request message for getting last committed epoch for a specific settlement chain * * @generated from message api.proto.v1.GetLastCommittedRequest */ export type GetLastCommittedRequest = Message<"api.proto.v1.GetLastCommittedRequest"> & { /** * Settlement chain ID * * @generated from field: uint64 settlement_chain_id = 1; */ settlementChainId: bigint; }; ⋮---- /** * Settlement chain ID * * @generated from field: uint64 settlement_chain_id = 1; */ ⋮---- /** * Describes the message api.proto.v1.GetLastCommittedRequest. * Use `create(GetLastCommittedRequestSchema)` to create a new message. */ export const GetLastCommittedRequestSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Response message for getting last committed epoch * * @generated from message api.proto.v1.GetLastCommittedResponse */ export type GetLastCommittedResponse = Message<"api.proto.v1.GetLastCommittedResponse"> & { /** * Settlement chain ID * * @generated from field: uint64 settlement_chain_id = 1; */ settlementChainId: bigint; /** * @generated from field: api.proto.v1.ChainEpochInfo epoch_info = 2; */ epochInfo?: ChainEpochInfo; }; ⋮---- /** * Settlement chain ID * * @generated from field: uint64 settlement_chain_id = 1; */ ⋮---- /** * @generated from field: api.proto.v1.ChainEpochInfo epoch_info = 2; */ ⋮---- /** * Describes the message api.proto.v1.GetLastCommittedResponse. * Use `create(GetLastCommittedResponseSchema)` to create a new message. */ export const GetLastCommittedResponseSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Request message for getting last committed epochs for all chains * * No parameters needed * * @generated from message api.proto.v1.GetLastAllCommittedRequest */ export type GetLastAllCommittedRequest = Message<"api.proto.v1.GetLastAllCommittedRequest"> & { }; ⋮---- /** * Describes the message api.proto.v1.GetLastAllCommittedRequest. * Use `create(GetLastAllCommittedRequestSchema)` to create a new message. */ export const GetLastAllCommittedRequestSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Response message for getting all last committed epochs * * @generated from message api.proto.v1.GetLastAllCommittedResponse */ export type GetLastAllCommittedResponse = Message<"api.proto.v1.GetLastAllCommittedResponse"> & { /** * List of settlement chains with their last committed epochs * * @generated from field: map epoch_infos = 1; */ epochInfos: { [key: string]: ChainEpochInfo }; /** * Suggested epoch info for signatures, it is the minimum commited epoch among all chains * * @generated from field: api.proto.v1.ChainEpochInfo suggested_epoch_info = 2; */ suggestedEpochInfo?: ChainEpochInfo; }; ⋮---- /** * List of settlement chains with their last committed epochs * * @generated from field: map epoch_infos = 1; */ ⋮---- /** * Suggested epoch info for signatures, it is the minimum commited epoch among all chains * * @generated from field: api.proto.v1.ChainEpochInfo suggested_epoch_info = 2; */ ⋮---- /** * Describes the message api.proto.v1.GetLastAllCommittedResponse. * Use `create(GetLastAllCommittedResponseSchema)` to create a new message. */ export const GetLastAllCommittedResponseSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Settlement chain with its last committed epoch * * @generated from message api.proto.v1.ChainEpochInfo */ export type ChainEpochInfo = Message<"api.proto.v1.ChainEpochInfo"> & { /** * Last committed epoch for this chain * * @generated from field: uint64 last_committed_epoch = 1; */ lastCommittedEpoch: bigint; /** * Epoch start time * * @generated from field: google.protobuf.Timestamp start_time = 2; */ startTime?: Timestamp; }; ⋮---- /** * Last committed epoch for this chain * * @generated from field: uint64 last_committed_epoch = 1; */ ⋮---- /** * Epoch start time * * @generated from field: google.protobuf.Timestamp start_time = 2; */ ⋮---- /** * Describes the message api.proto.v1.ChainEpochInfo. * Use `create(ChainEpochInfoSchema)` to create a new message. */ export const ChainEpochInfoSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * @generated from message api.proto.v1.ValidatorSet */ export type ValidatorSet = Message<"api.proto.v1.ValidatorSet"> & { /** * Version of the validator set * * @generated from field: uint32 version = 1; */ version: number; /** * Key tag required to commit next validator set * * @generated from field: uint32 required_key_tag = 2; */ requiredKeyTag: number; /** * Validator set epoch * * @generated from field: uint64 epoch = 3; */ epoch: bigint; /** * Epoch capture timestamp * * @generated from field: google.protobuf.Timestamp capture_timestamp = 4; */ captureTimestamp?: Timestamp; /** * Quorum threshold (big integer as string) * * @generated from field: string quorum_threshold = 5; */ quorumThreshold: string; /** * Status of validator set header * * @generated from field: api.proto.v1.ValidatorSetStatus status = 6; */ status: ValidatorSetStatus; /** * List of validators * * @generated from field: repeated api.proto.v1.Validator validators = 7; */ validators: Validator[]; }; ⋮---- /** * Version of the validator set * * @generated from field: uint32 version = 1; */ ⋮---- /** * Key tag required to commit next validator set * * @generated from field: uint32 required_key_tag = 2; */ ⋮---- /** * Validator set epoch * * @generated from field: uint64 epoch = 3; */ ⋮---- /** * Epoch capture timestamp * * @generated from field: google.protobuf.Timestamp capture_timestamp = 4; */ ⋮---- /** * Quorum threshold (big integer as string) * * @generated from field: string quorum_threshold = 5; */ ⋮---- /** * Status of validator set header * * @generated from field: api.proto.v1.ValidatorSetStatus status = 6; */ ⋮---- /** * List of validators * * @generated from field: repeated api.proto.v1.Validator validators = 7; */ ⋮---- /** * Describes the message api.proto.v1.ValidatorSet. * Use `create(ValidatorSetSchema)` to create a new message. */ export const ValidatorSetSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Validator set status enumeration * * @generated from enum api.proto.v1.ValidatorSetStatus */ export enum ValidatorSetStatus { /** * Default/unknown status * * @generated from enum value: VALIDATOR_SET_STATUS_UNSPECIFIED = 0; */ UNSPECIFIED = 0, /** * Derived status * * @generated from enum value: VALIDATOR_SET_STATUS_DERIVED = 1; */ DERIVED = 1, /** * Aggregated status * * @generated from enum value: VALIDATOR_SET_STATUS_AGGREGATED = 2; */ AGGREGATED = 2, /** * Committed status * * @generated from enum value: VALIDATOR_SET_STATUS_COMMITTED = 3; */ COMMITTED = 3, /** * Missed status * * @generated from enum value: VALIDATOR_SET_STATUS_MISSED = 4; */ MISSED = 4, } ⋮---- /** * Default/unknown status * * @generated from enum value: VALIDATOR_SET_STATUS_UNSPECIFIED = 0; */ ⋮---- /** * Derived status * * @generated from enum value: VALIDATOR_SET_STATUS_DERIVED = 1; */ ⋮---- /** * Aggregated status * * @generated from enum value: VALIDATOR_SET_STATUS_AGGREGATED = 2; */ ⋮---- /** * Committed status * * @generated from enum value: VALIDATOR_SET_STATUS_COMMITTED = 3; */ ⋮---- /** * Missed status * * @generated from enum value: VALIDATOR_SET_STATUS_MISSED = 4; */ ⋮---- /** * Describes the enum api.proto.v1.ValidatorSetStatus. */ export const ValidatorSetStatusSchema: GenEnum = /*@__PURE__*/ ⋮---- /** * Signing process status enumeration * * @generated from enum api.proto.v1.SigningStatus */ export enum SigningStatus { /** * Default/unknown status * * @generated from enum value: SIGNING_STATUS_UNSPECIFIED = 0; */ UNSPECIFIED = 0, /** * Request has been created and is waiting for signatures * * @generated from enum value: SIGNING_STATUS_PENDING = 1; */ PENDING = 1, /** * Signing process completed successfully with proof * * @generated from enum value: SIGNING_STATUS_COMPLETED = 2; */ COMPLETED = 2, /** * Signing process failed * * @generated from enum value: SIGNING_STATUS_FAILED = 3; */ FAILED = 3, /** * Signing request timed out * * @generated from enum value: SIGNING_STATUS_TIMEOUT = 4; */ TIMEOUT = 4, } ⋮---- /** * Default/unknown status * * @generated from enum value: SIGNING_STATUS_UNSPECIFIED = 0; */ ⋮---- /** * Request has been created and is waiting for signatures * * @generated from enum value: SIGNING_STATUS_PENDING = 1; */ ⋮---- /** * Signing process completed successfully with proof * * @generated from enum value: SIGNING_STATUS_COMPLETED = 2; */ ⋮---- /** * Signing process failed * * @generated from enum value: SIGNING_STATUS_FAILED = 3; */ ⋮---- /** * Signing request timed out * * @generated from enum value: SIGNING_STATUS_TIMEOUT = 4; */ ⋮---- /** * Describes the enum api.proto.v1.SigningStatus. */ export const SigningStatusSchema: GenEnum = /*@__PURE__*/ ⋮---- /** * Error code enumeration * * @generated from enum api.proto.v1.ErrorCode */ export enum ErrorCode { /** * Default/unknown error * * @generated from enum value: ERROR_CODE_UNSPECIFIED = 0; */ UNSPECIFIED = 0, /** * No data found * * @generated from enum value: ERROR_CODE_NO_DATA = 1; */ NO_DATA = 1, /** * Internal server error * * @generated from enum value: ERROR_CODE_INTERNAL = 2; */ INTERNAL = 2, /** * Not an aggregator node * * @generated from enum value: ERROR_CODE_NOT_AGGREGATOR = 3; */ NOT_AGGREGATOR = 3, } ⋮---- /** * Default/unknown error * * @generated from enum value: ERROR_CODE_UNSPECIFIED = 0; */ ⋮---- /** * No data found * * @generated from enum value: ERROR_CODE_NO_DATA = 1; */ ⋮---- /** * Internal server error * * @generated from enum value: ERROR_CODE_INTERNAL = 2; */ ⋮---- /** * Not an aggregator node * * @generated from enum value: ERROR_CODE_NOT_AGGREGATOR = 3; */ ⋮---- /** * Describes the enum api.proto.v1.ErrorCode. */ export const ErrorCodeSchema: GenEnum = /*@__PURE__*/ ⋮---- /** * SymbioticAPI provides access to the Symbiotic relay functions * * @generated from service api.proto.v1.SymbioticAPIService */ ⋮---- /** * Sign a message * * @generated from rpc api.proto.v1.SymbioticAPIService.SignMessage */ ⋮---- /** * Get aggregation proof * * @generated from rpc api.proto.v1.SymbioticAPIService.GetAggregationProof */ ⋮---- /** * Get aggregation proofs by epoch * * @generated from rpc api.proto.v1.SymbioticAPIService.GetAggregationProofsByEpoch */ ⋮---- /** * Get current epoch * * @generated from rpc api.proto.v1.SymbioticAPIService.GetCurrentEpoch */ ⋮---- /** * Get signature by request id * * @generated from rpc api.proto.v1.SymbioticAPIService.GetSignatures */ ⋮---- /** * Get signature by epoch * * @generated from rpc api.proto.v1.SymbioticAPIService.GetSignaturesByEpoch */ ⋮---- /** * Get all signature request IDs by epoch * * @generated from rpc api.proto.v1.SymbioticAPIService.GetSignatureRequestIDsByEpoch */ ⋮---- /** * Get all signature requests by epoch * * @generated from rpc api.proto.v1.SymbioticAPIService.GetSignatureRequestsByEpoch */ ⋮---- /** * Get signature request by request id * * @generated from rpc api.proto.v1.SymbioticAPIService.GetSignatureRequest */ ⋮---- /** * Get aggregation status, can be sent only to aggregator nodes * * @generated from rpc api.proto.v1.SymbioticAPIService.GetAggregationStatus */ ⋮---- /** * Get current validator set * * @generated from rpc api.proto.v1.SymbioticAPIService.GetValidatorSet */ ⋮---- /** * Get validator by address * * @generated from rpc api.proto.v1.SymbioticAPIService.GetValidatorByAddress */ ⋮---- /** * Get validator by key * * @generated from rpc api.proto.v1.SymbioticAPIService.GetValidatorByKey */ ⋮---- /** * Get local validator * * @generated from rpc api.proto.v1.SymbioticAPIService.GetLocalValidator */ ⋮---- /** * Get validator set header * * @generated from rpc api.proto.v1.SymbioticAPIService.GetValidatorSetHeader */ ⋮---- /** * Get last committed epoch for a specific settlement chain * * @generated from rpc api.proto.v1.SymbioticAPIService.GetLastCommitted */ ⋮---- /** * Get last committed epochs for all settlement chains * * @generated from rpc api.proto.v1.SymbioticAPIService.GetLastAllCommitted */ ⋮---- /** * Get validator set metadata like extra data and request id to fetch aggregation and signature requests * * @generated from rpc api.proto.v1.SymbioticAPIService.GetValidatorSetMetadata */ ⋮---- /** * Stream signatures in real-time. If start_epoch is provided, sends historical data first * * @generated from rpc api.proto.v1.SymbioticAPIService.ListenSignatures */ ⋮---- /** * Stream aggregation proofs in real-time. If start_epoch is provided, sends historical data first * * @generated from rpc api.proto.v1.SymbioticAPIService.ListenProofs */ ⋮---- /** * Stream validator set changes in real-time. If start_epoch is provided, sends historical data first * * @generated from rpc api.proto.v1.SymbioticAPIService.ListenValidatorSet */ ⋮---- }> = /*@__PURE__*/ ```` ## File: src/gen/google/api/expr/v1alpha1/checked_pb.ts ````typescript // Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. ⋮---- // @generated by protoc-gen-es v2.6.3 with parameter "target=ts" // @generated from file google/api/expr/v1alpha1/checked.proto (package google.api.expr.v1alpha1, syntax proto3) /* eslint-disable */ ⋮---- import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; import { enumDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; import type { Constant, Expr, SourceInfo } from "./syntax_pb"; import { file_google_api_expr_v1alpha1_syntax } from "./syntax_pb"; import type { Empty, NullValue } from "@bufbuild/protobuf/wkt"; import { file_google_protobuf_empty, file_google_protobuf_struct } from "@bufbuild/protobuf/wkt"; import type { Message } from "@bufbuild/protobuf"; ⋮---- /** * Describes the file google/api/expr/v1alpha1/checked.proto. */ export const file_google_api_expr_v1alpha1_checked: GenFile = /*@__PURE__*/ ⋮---- /** * A CEL expression which has been successfully type checked. * * @generated from message google.api.expr.v1alpha1.CheckedExpr */ export type CheckedExpr = Message<"google.api.expr.v1alpha1.CheckedExpr"> & { /** * A map from expression ids to resolved references. * * The following entries are in this table: * * - An Ident or Select expression is represented here if it resolves to a * declaration. For instance, if `a.b.c` is represented by * `select(select(id(a), b), c)`, and `a.b` resolves to a declaration, * while `c` is a field selection, then the reference is attached to the * nested select expression (but not to the id or or the outer select). * In turn, if `a` resolves to a declaration and `b.c` are field selections, * the reference is attached to the ident expression. * - Every Call expression has an entry here, identifying the function being * called. * - Every CreateStruct expression for a message has an entry, identifying * the message. * * @generated from field: map reference_map = 2; */ referenceMap: { [key: string]: Reference }; /** * A map from expression ids to types. * * Every expression node which has a type different than DYN has a mapping * here. If an expression has type DYN, it is omitted from this map to save * space. * * @generated from field: map type_map = 3; */ typeMap: { [key: string]: Type }; /** * The source info derived from input that generated the parsed `expr` and * any optimizations made during the type-checking pass. * * @generated from field: google.api.expr.v1alpha1.SourceInfo source_info = 5; */ sourceInfo?: SourceInfo; /** * The expr version indicates the major / minor version number of the `expr` * representation. * * The most common reason for a version change will be to indicate to the CEL * runtimes that transformations have been performed on the expr during static * analysis. In some cases, this will save the runtime the work of applying * the same or similar transformations prior to evaluation. * * @generated from field: string expr_version = 6; */ exprVersion: string; /** * The checked expression. Semantically equivalent to the parsed `expr`, but * may have structural differences. * * @generated from field: google.api.expr.v1alpha1.Expr expr = 4; */ expr?: Expr; }; ⋮---- /** * A map from expression ids to resolved references. * * The following entries are in this table: * * - An Ident or Select expression is represented here if it resolves to a * declaration. For instance, if `a.b.c` is represented by * `select(select(id(a), b), c)`, and `a.b` resolves to a declaration, * while `c` is a field selection, then the reference is attached to the * nested select expression (but not to the id or or the outer select). * In turn, if `a` resolves to a declaration and `b.c` are field selections, * the reference is attached to the ident expression. * - Every Call expression has an entry here, identifying the function being * called. * - Every CreateStruct expression for a message has an entry, identifying * the message. * * @generated from field: map reference_map = 2; */ ⋮---- /** * A map from expression ids to types. * * Every expression node which has a type different than DYN has a mapping * here. If an expression has type DYN, it is omitted from this map to save * space. * * @generated from field: map type_map = 3; */ ⋮---- /** * The source info derived from input that generated the parsed `expr` and * any optimizations made during the type-checking pass. * * @generated from field: google.api.expr.v1alpha1.SourceInfo source_info = 5; */ ⋮---- /** * The expr version indicates the major / minor version number of the `expr` * representation. * * The most common reason for a version change will be to indicate to the CEL * runtimes that transformations have been performed on the expr during static * analysis. In some cases, this will save the runtime the work of applying * the same or similar transformations prior to evaluation. * * @generated from field: string expr_version = 6; */ ⋮---- /** * The checked expression. Semantically equivalent to the parsed `expr`, but * may have structural differences. * * @generated from field: google.api.expr.v1alpha1.Expr expr = 4; */ ⋮---- /** * Describes the message google.api.expr.v1alpha1.CheckedExpr. * Use `create(CheckedExprSchema)` to create a new message. */ export const CheckedExprSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Represents a CEL type. * * @generated from message google.api.expr.v1alpha1.Type */ export type Type = Message<"google.api.expr.v1alpha1.Type"> & { /** * The kind of type. * * @generated from oneof google.api.expr.v1alpha1.Type.type_kind */ typeKind: { /** * Dynamic type. * * @generated from field: google.protobuf.Empty dyn = 1; */ value: Empty; case: "dyn"; } | { /** * Null value. * * @generated from field: google.protobuf.NullValue null = 2; */ value: NullValue; case: "null"; } | { /** * Primitive types: `true`, `1u`, `-2.0`, `'string'`, `b'bytes'`. * * @generated from field: google.api.expr.v1alpha1.Type.PrimitiveType primitive = 3; */ value: Type_PrimitiveType; case: "primitive"; } | { /** * Wrapper of a primitive type, e.g. `google.protobuf.Int64Value`. * * @generated from field: google.api.expr.v1alpha1.Type.PrimitiveType wrapper = 4; */ value: Type_PrimitiveType; case: "wrapper"; } | { /** * Well-known protobuf type such as `google.protobuf.Timestamp`. * * @generated from field: google.api.expr.v1alpha1.Type.WellKnownType well_known = 5; */ value: Type_WellKnownType; case: "wellKnown"; } | { /** * Parameterized list with elements of `list_type`, e.g. `list`. * * @generated from field: google.api.expr.v1alpha1.Type.ListType list_type = 6; */ value: Type_ListType; case: "listType"; } | { /** * Parameterized map with typed keys and values. * * @generated from field: google.api.expr.v1alpha1.Type.MapType map_type = 7; */ value: Type_MapType; case: "mapType"; } | { /** * Function type. * * @generated from field: google.api.expr.v1alpha1.Type.FunctionType function = 8; */ value: Type_FunctionType; case: "function"; } | { /** * Protocol buffer message type. * * The `message_type` string specifies the qualified message type name. For * example, `google.plus.Profile`. * * @generated from field: string message_type = 9; */ value: string; case: "messageType"; } | { /** * Type param type. * * The `type_param` string specifies the type parameter name, e.g. `list` * would be a `list_type` whose element type was a `type_param` type * named `E`. * * @generated from field: string type_param = 10; */ value: string; case: "typeParam"; } | { /** * Type type. * * The `type` value specifies the target type. e.g. int is type with a * target type of `Primitive.INT`. * * @generated from field: google.api.expr.v1alpha1.Type type = 11; */ value: Type; case: "type"; } | { /** * Error type. * * During type-checking if an expression is an error, its type is propagated * as the `ERROR` type. This permits the type-checker to discover other * errors present in the expression. * * @generated from field: google.protobuf.Empty error = 12; */ value: Empty; case: "error"; } | { /** * Abstract, application defined type. * * @generated from field: google.api.expr.v1alpha1.Type.AbstractType abstract_type = 14; */ value: Type_AbstractType; case: "abstractType"; } | { case: undefined; value?: undefined }; }; ⋮---- /** * The kind of type. * * @generated from oneof google.api.expr.v1alpha1.Type.type_kind */ ⋮---- /** * Dynamic type. * * @generated from field: google.protobuf.Empty dyn = 1; */ ⋮---- /** * Null value. * * @generated from field: google.protobuf.NullValue null = 2; */ ⋮---- /** * Primitive types: `true`, `1u`, `-2.0`, `'string'`, `b'bytes'`. * * @generated from field: google.api.expr.v1alpha1.Type.PrimitiveType primitive = 3; */ ⋮---- /** * Wrapper of a primitive type, e.g. `google.protobuf.Int64Value`. * * @generated from field: google.api.expr.v1alpha1.Type.PrimitiveType wrapper = 4; */ ⋮---- /** * Well-known protobuf type such as `google.protobuf.Timestamp`. * * @generated from field: google.api.expr.v1alpha1.Type.WellKnownType well_known = 5; */ ⋮---- /** * Parameterized list with elements of `list_type`, e.g. `list`. * * @generated from field: google.api.expr.v1alpha1.Type.ListType list_type = 6; */ ⋮---- /** * Parameterized map with typed keys and values. * * @generated from field: google.api.expr.v1alpha1.Type.MapType map_type = 7; */ ⋮---- /** * Function type. * * @generated from field: google.api.expr.v1alpha1.Type.FunctionType function = 8; */ ⋮---- /** * Protocol buffer message type. * * The `message_type` string specifies the qualified message type name. For * example, `google.plus.Profile`. * * @generated from field: string message_type = 9; */ ⋮---- /** * Type param type. * * The `type_param` string specifies the type parameter name, e.g. `list` * would be a `list_type` whose element type was a `type_param` type * named `E`. * * @generated from field: string type_param = 10; */ ⋮---- /** * Type type. * * The `type` value specifies the target type. e.g. int is type with a * target type of `Primitive.INT`. * * @generated from field: google.api.expr.v1alpha1.Type type = 11; */ ⋮---- /** * Error type. * * During type-checking if an expression is an error, its type is propagated * as the `ERROR` type. This permits the type-checker to discover other * errors present in the expression. * * @generated from field: google.protobuf.Empty error = 12; */ ⋮---- /** * Abstract, application defined type. * * @generated from field: google.api.expr.v1alpha1.Type.AbstractType abstract_type = 14; */ ⋮---- /** * Describes the message google.api.expr.v1alpha1.Type. * Use `create(TypeSchema)` to create a new message. */ export const TypeSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * List type with typed elements, e.g. `list`. * * @generated from message google.api.expr.v1alpha1.Type.ListType */ export type Type_ListType = Message<"google.api.expr.v1alpha1.Type.ListType"> & { /** * The element type. * * @generated from field: google.api.expr.v1alpha1.Type elem_type = 1; */ elemType?: Type; }; ⋮---- /** * The element type. * * @generated from field: google.api.expr.v1alpha1.Type elem_type = 1; */ ⋮---- /** * Describes the message google.api.expr.v1alpha1.Type.ListType. * Use `create(Type_ListTypeSchema)` to create a new message. */ export const Type_ListTypeSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Map type with parameterized key and value types, e.g. `map`. * * @generated from message google.api.expr.v1alpha1.Type.MapType */ export type Type_MapType = Message<"google.api.expr.v1alpha1.Type.MapType"> & { /** * The type of the key. * * @generated from field: google.api.expr.v1alpha1.Type key_type = 1; */ keyType?: Type; /** * The type of the value. * * @generated from field: google.api.expr.v1alpha1.Type value_type = 2; */ valueType?: Type; }; ⋮---- /** * The type of the key. * * @generated from field: google.api.expr.v1alpha1.Type key_type = 1; */ ⋮---- /** * The type of the value. * * @generated from field: google.api.expr.v1alpha1.Type value_type = 2; */ ⋮---- /** * Describes the message google.api.expr.v1alpha1.Type.MapType. * Use `create(Type_MapTypeSchema)` to create a new message. */ export const Type_MapTypeSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Function type with result and arg types. * * @generated from message google.api.expr.v1alpha1.Type.FunctionType */ export type Type_FunctionType = Message<"google.api.expr.v1alpha1.Type.FunctionType"> & { /** * Result type of the function. * * @generated from field: google.api.expr.v1alpha1.Type result_type = 1; */ resultType?: Type; /** * Argument types of the function. * * @generated from field: repeated google.api.expr.v1alpha1.Type arg_types = 2; */ argTypes: Type[]; }; ⋮---- /** * Result type of the function. * * @generated from field: google.api.expr.v1alpha1.Type result_type = 1; */ ⋮---- /** * Argument types of the function. * * @generated from field: repeated google.api.expr.v1alpha1.Type arg_types = 2; */ ⋮---- /** * Describes the message google.api.expr.v1alpha1.Type.FunctionType. * Use `create(Type_FunctionTypeSchema)` to create a new message. */ export const Type_FunctionTypeSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Application defined abstract type. * * @generated from message google.api.expr.v1alpha1.Type.AbstractType */ export type Type_AbstractType = Message<"google.api.expr.v1alpha1.Type.AbstractType"> & { /** * The fully qualified name of this abstract type. * * @generated from field: string name = 1; */ name: string; /** * Parameter types for this abstract type. * * @generated from field: repeated google.api.expr.v1alpha1.Type parameter_types = 2; */ parameterTypes: Type[]; }; ⋮---- /** * The fully qualified name of this abstract type. * * @generated from field: string name = 1; */ ⋮---- /** * Parameter types for this abstract type. * * @generated from field: repeated google.api.expr.v1alpha1.Type parameter_types = 2; */ ⋮---- /** * Describes the message google.api.expr.v1alpha1.Type.AbstractType. * Use `create(Type_AbstractTypeSchema)` to create a new message. */ export const Type_AbstractTypeSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * CEL primitive types. * * @generated from enum google.api.expr.v1alpha1.Type.PrimitiveType */ export enum Type_PrimitiveType { /** * Unspecified type. * * @generated from enum value: PRIMITIVE_TYPE_UNSPECIFIED = 0; */ PRIMITIVE_TYPE_UNSPECIFIED = 0, /** * Boolean type. * * @generated from enum value: BOOL = 1; */ BOOL = 1, /** * Int64 type. * * Proto-based integer values are widened to int64. * * @generated from enum value: INT64 = 2; */ INT64 = 2, /** * Uint64 type. * * Proto-based unsigned integer values are widened to uint64. * * @generated from enum value: UINT64 = 3; */ UINT64 = 3, /** * Double type. * * Proto-based float values are widened to double values. * * @generated from enum value: DOUBLE = 4; */ DOUBLE = 4, /** * String type. * * @generated from enum value: STRING = 5; */ STRING = 5, /** * Bytes type. * * @generated from enum value: BYTES = 6; */ BYTES = 6, } ⋮---- /** * Unspecified type. * * @generated from enum value: PRIMITIVE_TYPE_UNSPECIFIED = 0; */ ⋮---- /** * Boolean type. * * @generated from enum value: BOOL = 1; */ ⋮---- /** * Int64 type. * * Proto-based integer values are widened to int64. * * @generated from enum value: INT64 = 2; */ ⋮---- /** * Uint64 type. * * Proto-based unsigned integer values are widened to uint64. * * @generated from enum value: UINT64 = 3; */ ⋮---- /** * Double type. * * Proto-based float values are widened to double values. * * @generated from enum value: DOUBLE = 4; */ ⋮---- /** * String type. * * @generated from enum value: STRING = 5; */ ⋮---- /** * Bytes type. * * @generated from enum value: BYTES = 6; */ ⋮---- /** * Describes the enum google.api.expr.v1alpha1.Type.PrimitiveType. */ export const Type_PrimitiveTypeSchema: GenEnum = /*@__PURE__*/ ⋮---- /** * Well-known protobuf types treated with first-class support in CEL. * * @generated from enum google.api.expr.v1alpha1.Type.WellKnownType */ export enum Type_WellKnownType { /** * Unspecified type. * * @generated from enum value: WELL_KNOWN_TYPE_UNSPECIFIED = 0; */ WELL_KNOWN_TYPE_UNSPECIFIED = 0, /** * Well-known protobuf.Any type. * * Any types are a polymorphic message type. During type-checking they are * treated like `DYN` types, but at runtime they are resolved to a specific * message type specified at evaluation time. * * @generated from enum value: ANY = 1; */ ANY = 1, /** * Well-known protobuf.Timestamp type, internally referenced as `timestamp`. * * @generated from enum value: TIMESTAMP = 2; */ TIMESTAMP = 2, /** * Well-known protobuf.Duration type, internally referenced as `duration`. * * @generated from enum value: DURATION = 3; */ DURATION = 3, } ⋮---- /** * Unspecified type. * * @generated from enum value: WELL_KNOWN_TYPE_UNSPECIFIED = 0; */ ⋮---- /** * Well-known protobuf.Any type. * * Any types are a polymorphic message type. During type-checking they are * treated like `DYN` types, but at runtime they are resolved to a specific * message type specified at evaluation time. * * @generated from enum value: ANY = 1; */ ⋮---- /** * Well-known protobuf.Timestamp type, internally referenced as `timestamp`. * * @generated from enum value: TIMESTAMP = 2; */ ⋮---- /** * Well-known protobuf.Duration type, internally referenced as `duration`. * * @generated from enum value: DURATION = 3; */ ⋮---- /** * Describes the enum google.api.expr.v1alpha1.Type.WellKnownType. */ export const Type_WellKnownTypeSchema: GenEnum = /*@__PURE__*/ ⋮---- /** * Represents a declaration of a named value or function. * * A declaration is part of the contract between the expression, the agent * evaluating that expression, and the caller requesting evaluation. * * @generated from message google.api.expr.v1alpha1.Decl */ export type Decl = Message<"google.api.expr.v1alpha1.Decl"> & { /** * The fully qualified name of the declaration. * * Declarations are organized in containers and this represents the full path * to the declaration in its container, as in `google.api.expr.Decl`. * * Declarations used as * [FunctionDecl.Overload][google.api.expr.v1alpha1.Decl.FunctionDecl.Overload] * parameters may or may not have a name depending on whether the overload is * function declaration or a function definition containing a result * [Expr][google.api.expr.v1alpha1.Expr]. * * @generated from field: string name = 1; */ name: string; /** * Required. The declaration kind. * * @generated from oneof google.api.expr.v1alpha1.Decl.decl_kind */ declKind: { /** * Identifier declaration. * * @generated from field: google.api.expr.v1alpha1.Decl.IdentDecl ident = 2; */ value: Decl_IdentDecl; case: "ident"; } | { /** * Function declaration. * * @generated from field: google.api.expr.v1alpha1.Decl.FunctionDecl function = 3; */ value: Decl_FunctionDecl; case: "function"; } | { case: undefined; value?: undefined }; }; ⋮---- /** * The fully qualified name of the declaration. * * Declarations are organized in containers and this represents the full path * to the declaration in its container, as in `google.api.expr.Decl`. * * Declarations used as * [FunctionDecl.Overload][google.api.expr.v1alpha1.Decl.FunctionDecl.Overload] * parameters may or may not have a name depending on whether the overload is * function declaration or a function definition containing a result * [Expr][google.api.expr.v1alpha1.Expr]. * * @generated from field: string name = 1; */ ⋮---- /** * Required. The declaration kind. * * @generated from oneof google.api.expr.v1alpha1.Decl.decl_kind */ ⋮---- /** * Identifier declaration. * * @generated from field: google.api.expr.v1alpha1.Decl.IdentDecl ident = 2; */ ⋮---- /** * Function declaration. * * @generated from field: google.api.expr.v1alpha1.Decl.FunctionDecl function = 3; */ ⋮---- /** * Describes the message google.api.expr.v1alpha1.Decl. * Use `create(DeclSchema)` to create a new message. */ export const DeclSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Identifier declaration which specifies its type and optional `Expr` value. * * An identifier without a value is a declaration that must be provided at * evaluation time. An identifier with a value should resolve to a constant, * but may be used in conjunction with other identifiers bound at evaluation * time. * * @generated from message google.api.expr.v1alpha1.Decl.IdentDecl */ export type Decl_IdentDecl = Message<"google.api.expr.v1alpha1.Decl.IdentDecl"> & { /** * Required. The type of the identifier. * * @generated from field: google.api.expr.v1alpha1.Type type = 1; */ type?: Type; /** * The constant value of the identifier. If not specified, the identifier * must be supplied at evaluation time. * * @generated from field: google.api.expr.v1alpha1.Constant value = 2; */ value?: Constant; /** * Documentation string for the identifier. * * @generated from field: string doc = 3; */ doc: string; }; ⋮---- /** * Required. The type of the identifier. * * @generated from field: google.api.expr.v1alpha1.Type type = 1; */ ⋮---- /** * The constant value of the identifier. If not specified, the identifier * must be supplied at evaluation time. * * @generated from field: google.api.expr.v1alpha1.Constant value = 2; */ ⋮---- /** * Documentation string for the identifier. * * @generated from field: string doc = 3; */ ⋮---- /** * Describes the message google.api.expr.v1alpha1.Decl.IdentDecl. * Use `create(Decl_IdentDeclSchema)` to create a new message. */ export const Decl_IdentDeclSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Function declaration specifies one or more overloads which indicate the * function's parameter types and return type. * * Functions have no observable side-effects (there may be side-effects like * logging which are not observable from CEL). * * @generated from message google.api.expr.v1alpha1.Decl.FunctionDecl */ export type Decl_FunctionDecl = Message<"google.api.expr.v1alpha1.Decl.FunctionDecl"> & { /** * Required. List of function overloads, must contain at least one overload. * * @generated from field: repeated google.api.expr.v1alpha1.Decl.FunctionDecl.Overload overloads = 1; */ overloads: Decl_FunctionDecl_Overload[]; }; ⋮---- /** * Required. List of function overloads, must contain at least one overload. * * @generated from field: repeated google.api.expr.v1alpha1.Decl.FunctionDecl.Overload overloads = 1; */ ⋮---- /** * Describes the message google.api.expr.v1alpha1.Decl.FunctionDecl. * Use `create(Decl_FunctionDeclSchema)` to create a new message. */ export const Decl_FunctionDeclSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * An overload indicates a function's parameter types and return type, and * may optionally include a function body described in terms of * [Expr][google.api.expr.v1alpha1.Expr] values. * * Functions overloads are declared in either a function or method * call-style. For methods, the `params[0]` is the expected type of the * target receiver. * * Overloads must have non-overlapping argument types after erasure of all * parameterized type variables (similar as type erasure in Java). * * @generated from message google.api.expr.v1alpha1.Decl.FunctionDecl.Overload */ export type Decl_FunctionDecl_Overload = Message<"google.api.expr.v1alpha1.Decl.FunctionDecl.Overload"> & { /** * Required. Globally unique overload name of the function which reflects * the function name and argument types. * * This will be used by a [Reference][google.api.expr.v1alpha1.Reference] * to indicate the `overload_id` that was resolved for the function * `name`. * * @generated from field: string overload_id = 1; */ overloadId: string; /** * List of function parameter [Type][google.api.expr.v1alpha1.Type] * values. * * Param types are disjoint after generic type parameters have been * replaced with the type `DYN`. Since the `DYN` type is compatible with * any other type, this means that if `A` is a type parameter, the * function types `int` and `int` are not disjoint. Likewise, * `map` is not disjoint from `map`. * * When the `result_type` of a function is a generic type param, the * type param name also appears as the `type` of on at least one params. * * @generated from field: repeated google.api.expr.v1alpha1.Type params = 2; */ params: Type[]; /** * The type param names associated with the function declaration. * * For example, `function ex(K key, map map) : V` would yield * the type params of `K, V`. * * @generated from field: repeated string type_params = 3; */ typeParams: string[]; /** * Required. The result type of the function. For example, the operator * `string.isEmpty()` would have `result_type` of `kind: BOOL`. * * @generated from field: google.api.expr.v1alpha1.Type result_type = 4; */ resultType?: Type; /** * Whether the function is to be used in a method call-style `x.f(...)` * or a function call-style `f(x, ...)`. * * For methods, the first parameter declaration, `params[0]` is the * expected type of the target receiver. * * @generated from field: bool is_instance_function = 5; */ isInstanceFunction: boolean; /** * Documentation string for the overload. * * @generated from field: string doc = 6; */ doc: string; }; ⋮---- /** * Required. Globally unique overload name of the function which reflects * the function name and argument types. * * This will be used by a [Reference][google.api.expr.v1alpha1.Reference] * to indicate the `overload_id` that was resolved for the function * `name`. * * @generated from field: string overload_id = 1; */ ⋮---- /** * List of function parameter [Type][google.api.expr.v1alpha1.Type] * values. * * Param types are disjoint after generic type parameters have been * replaced with the type `DYN`. Since the `DYN` type is compatible with * any other type, this means that if `A` is a type parameter, the * function types `int` and `int` are not disjoint. Likewise, * `map` is not disjoint from `map`. * * When the `result_type` of a function is a generic type param, the * type param name also appears as the `type` of on at least one params. * * @generated from field: repeated google.api.expr.v1alpha1.Type params = 2; */ ⋮---- /** * The type param names associated with the function declaration. * * For example, `function ex(K key, map map) : V` would yield * the type params of `K, V`. * * @generated from field: repeated string type_params = 3; */ ⋮---- /** * Required. The result type of the function. For example, the operator * `string.isEmpty()` would have `result_type` of `kind: BOOL`. * * @generated from field: google.api.expr.v1alpha1.Type result_type = 4; */ ⋮---- /** * Whether the function is to be used in a method call-style `x.f(...)` * or a function call-style `f(x, ...)`. * * For methods, the first parameter declaration, `params[0]` is the * expected type of the target receiver. * * @generated from field: bool is_instance_function = 5; */ ⋮---- /** * Documentation string for the overload. * * @generated from field: string doc = 6; */ ⋮---- /** * Describes the message google.api.expr.v1alpha1.Decl.FunctionDecl.Overload. * Use `create(Decl_FunctionDecl_OverloadSchema)` to create a new message. */ export const Decl_FunctionDecl_OverloadSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Describes a resolved reference to a declaration. * * @generated from message google.api.expr.v1alpha1.Reference */ export type Reference = Message<"google.api.expr.v1alpha1.Reference"> & { /** * The fully qualified name of the declaration. * * @generated from field: string name = 1; */ name: string; /** * For references to functions, this is a list of `Overload.overload_id` * values which match according to typing rules. * * If the list has more than one element, overload resolution among the * presented candidates must happen at runtime because of dynamic types. The * type checker attempts to narrow down this list as much as possible. * * Empty if this is not a reference to a * [Decl.FunctionDecl][google.api.expr.v1alpha1.Decl.FunctionDecl]. * * @generated from field: repeated string overload_id = 3; */ overloadId: string[]; /** * For references to constants, this may contain the value of the * constant if known at compile time. * * @generated from field: google.api.expr.v1alpha1.Constant value = 4; */ value?: Constant; }; ⋮---- /** * The fully qualified name of the declaration. * * @generated from field: string name = 1; */ ⋮---- /** * For references to functions, this is a list of `Overload.overload_id` * values which match according to typing rules. * * If the list has more than one element, overload resolution among the * presented candidates must happen at runtime because of dynamic types. The * type checker attempts to narrow down this list as much as possible. * * Empty if this is not a reference to a * [Decl.FunctionDecl][google.api.expr.v1alpha1.Decl.FunctionDecl]. * * @generated from field: repeated string overload_id = 3; */ ⋮---- /** * For references to constants, this may contain the value of the * constant if known at compile time. * * @generated from field: google.api.expr.v1alpha1.Constant value = 4; */ ⋮---- /** * Describes the message google.api.expr.v1alpha1.Reference. * Use `create(ReferenceSchema)` to create a new message. */ export const ReferenceSchema: GenMessage = /*@__PURE__*/ ```` ## File: src/gen/google/api/expr/v1alpha1/eval_pb.ts ````typescript // Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. ⋮---- // @generated by protoc-gen-es v2.6.3 with parameter "target=ts" // @generated from file google/api/expr/v1alpha1/eval.proto (package google.api.expr.v1alpha1, syntax proto3) /* eslint-disable */ ⋮---- import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; import type { Value } from "./value_pb"; import { file_google_api_expr_v1alpha1_value } from "./value_pb"; import type { Status } from "../../../rpc/status_pb"; import { file_google_rpc_status } from "../../../rpc/status_pb"; import type { Message } from "@bufbuild/protobuf"; ⋮---- /** * Describes the file google/api/expr/v1alpha1/eval.proto. */ export const file_google_api_expr_v1alpha1_eval: GenFile = /*@__PURE__*/ ⋮---- /** * The state of an evaluation. * * Can represent an inital, partial, or completed state of evaluation. * * @generated from message google.api.expr.v1alpha1.EvalState */ export type EvalState = Message<"google.api.expr.v1alpha1.EvalState"> & { /** * The unique values referenced in this message. * * @generated from field: repeated google.api.expr.v1alpha1.ExprValue values = 1; */ values: ExprValue[]; /** * An ordered list of results. * * Tracks the flow of evaluation through the expression. * May be sparse. * * @generated from field: repeated google.api.expr.v1alpha1.EvalState.Result results = 3; */ results: EvalState_Result[]; }; ⋮---- /** * The unique values referenced in this message. * * @generated from field: repeated google.api.expr.v1alpha1.ExprValue values = 1; */ ⋮---- /** * An ordered list of results. * * Tracks the flow of evaluation through the expression. * May be sparse. * * @generated from field: repeated google.api.expr.v1alpha1.EvalState.Result results = 3; */ ⋮---- /** * Describes the message google.api.expr.v1alpha1.EvalState. * Use `create(EvalStateSchema)` to create a new message. */ export const EvalStateSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * A single evalution result. * * @generated from message google.api.expr.v1alpha1.EvalState.Result */ export type EvalState_Result = Message<"google.api.expr.v1alpha1.EvalState.Result"> & { /** * The id of the expression this result if for. * * @generated from field: int64 expr = 1; */ expr: bigint; /** * The index in `values` of the resulting value. * * @generated from field: int64 value = 2; */ value: bigint; }; ⋮---- /** * The id of the expression this result if for. * * @generated from field: int64 expr = 1; */ ⋮---- /** * The index in `values` of the resulting value. * * @generated from field: int64 value = 2; */ ⋮---- /** * Describes the message google.api.expr.v1alpha1.EvalState.Result. * Use `create(EvalState_ResultSchema)` to create a new message. */ export const EvalState_ResultSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * The value of an evaluated expression. * * @generated from message google.api.expr.v1alpha1.ExprValue */ export type ExprValue = Message<"google.api.expr.v1alpha1.ExprValue"> & { /** * An expression can resolve to a value, error or unknown. * * @generated from oneof google.api.expr.v1alpha1.ExprValue.kind */ kind: { /** * A concrete value. * * @generated from field: google.api.expr.v1alpha1.Value value = 1; */ value: Value; case: "value"; } | { /** * The set of errors in the critical path of evalution. * * Only errors in the critical path are included. For example, * `( || true) && ` will only result in ``, * while ` || ` will result in both `` and * ``. * * Errors cause by the presence of other errors are not included in the * set. For example `.foo`, `foo()`, and ` + 1` will * only result in ``. * * Multiple errors *might* be included when evaluation could result * in different errors. For example ` + ` and * `foo(, )` may result in ``, `` or both. * The exact subset of errors included for this case is unspecified and * depends on the implementation details of the evaluator. * * @generated from field: google.api.expr.v1alpha1.ErrorSet error = 2; */ value: ErrorSet; case: "error"; } | { /** * The set of unknowns in the critical path of evaluation. * * Unknown behaves identically to Error with regards to propagation. * Specifically, only unknowns in the critical path are included, unknowns * caused by the presence of other unknowns are not included, and multiple * unknowns *might* be included included when evaluation could result in * different unknowns. For example: * * ( || true) && -> * || -> * .foo -> * foo() -> * + -> or * * Unknown takes precidence over Error in cases where a `Value` can short * circuit the result: * * || -> * && -> * * Errors take precidence in all other cases: * * + -> * foo(, ) -> * * @generated from field: google.api.expr.v1alpha1.UnknownSet unknown = 3; */ value: UnknownSet; case: "unknown"; } | { case: undefined; value?: undefined }; }; ⋮---- /** * An expression can resolve to a value, error or unknown. * * @generated from oneof google.api.expr.v1alpha1.ExprValue.kind */ ⋮---- /** * A concrete value. * * @generated from field: google.api.expr.v1alpha1.Value value = 1; */ ⋮---- /** * The set of errors in the critical path of evalution. * * Only errors in the critical path are included. For example, * `( || true) && ` will only result in ``, * while ` || ` will result in both `` and * ``. * * Errors cause by the presence of other errors are not included in the * set. For example `.foo`, `foo()`, and ` + 1` will * only result in ``. * * Multiple errors *might* be included when evaluation could result * in different errors. For example ` + ` and * `foo(, )` may result in ``, `` or both. * The exact subset of errors included for this case is unspecified and * depends on the implementation details of the evaluator. * * @generated from field: google.api.expr.v1alpha1.ErrorSet error = 2; */ ⋮---- /** * The set of unknowns in the critical path of evaluation. * * Unknown behaves identically to Error with regards to propagation. * Specifically, only unknowns in the critical path are included, unknowns * caused by the presence of other unknowns are not included, and multiple * unknowns *might* be included included when evaluation could result in * different unknowns. For example: * * ( || true) && -> * || -> * .foo -> * foo() -> * + -> or * * Unknown takes precidence over Error in cases where a `Value` can short * circuit the result: * * || -> * && -> * * Errors take precidence in all other cases: * * + -> * foo(, ) -> * * @generated from field: google.api.expr.v1alpha1.UnknownSet unknown = 3; */ ⋮---- /** * Describes the message google.api.expr.v1alpha1.ExprValue. * Use `create(ExprValueSchema)` to create a new message. */ export const ExprValueSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * A set of errors. * * The errors included depend on the context. See `ExprValue.error`. * * @generated from message google.api.expr.v1alpha1.ErrorSet */ export type ErrorSet = Message<"google.api.expr.v1alpha1.ErrorSet"> & { /** * The errors in the set. * * @generated from field: repeated google.rpc.Status errors = 1; */ errors: Status[]; }; ⋮---- /** * The errors in the set. * * @generated from field: repeated google.rpc.Status errors = 1; */ ⋮---- /** * Describes the message google.api.expr.v1alpha1.ErrorSet. * Use `create(ErrorSetSchema)` to create a new message. */ export const ErrorSetSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * A set of expressions for which the value is unknown. * * The unknowns included depend on the context. See `ExprValue.unknown`. * * @generated from message google.api.expr.v1alpha1.UnknownSet */ export type UnknownSet = Message<"google.api.expr.v1alpha1.UnknownSet"> & { /** * The ids of the expressions with unknown values. * * @generated from field: repeated int64 exprs = 1; */ exprs: bigint[]; }; ⋮---- /** * The ids of the expressions with unknown values. * * @generated from field: repeated int64 exprs = 1; */ ⋮---- /** * Describes the message google.api.expr.v1alpha1.UnknownSet. * Use `create(UnknownSetSchema)` to create a new message. */ export const UnknownSetSchema: GenMessage = /*@__PURE__*/ ```` ## File: src/gen/google/api/expr/v1alpha1/explain_pb.ts ````typescript // Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. ⋮---- // @generated by protoc-gen-es v2.6.3 with parameter "target=ts" // @generated from file google/api/expr/v1alpha1/explain.proto (package google.api.expr.v1alpha1, syntax proto3) /* eslint-disable */ ⋮---- import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; import type { Value } from "./value_pb"; import { file_google_api_expr_v1alpha1_value } from "./value_pb"; import type { Message } from "@bufbuild/protobuf"; ⋮---- /** * Describes the file google/api/expr/v1alpha1/explain.proto. */ export const file_google_api_expr_v1alpha1_explain: GenFile = /*@__PURE__*/ ⋮---- /** * Values of intermediate expressions produced when evaluating expression. * Deprecated, use `EvalState` instead. * * @generated from message google.api.expr.v1alpha1.Explain * @deprecated */ export type Explain = Message<"google.api.expr.v1alpha1.Explain"> & { /** * All of the observed values. * * The field value_index is an index in the values list. * Separating values from steps is needed to remove redundant values. * * @generated from field: repeated google.api.expr.v1alpha1.Value values = 1; */ values: Value[]; /** * List of steps. * * Repeated evaluations of the same expression generate new ExprStep * instances. The order of such ExprStep instances matches the order of * elements returned by Comprehension.iter_range. * * @generated from field: repeated google.api.expr.v1alpha1.Explain.ExprStep expr_steps = 2; */ exprSteps: Explain_ExprStep[]; }; ⋮---- /** * All of the observed values. * * The field value_index is an index in the values list. * Separating values from steps is needed to remove redundant values. * * @generated from field: repeated google.api.expr.v1alpha1.Value values = 1; */ ⋮---- /** * List of steps. * * Repeated evaluations of the same expression generate new ExprStep * instances. The order of such ExprStep instances matches the order of * elements returned by Comprehension.iter_range. * * @generated from field: repeated google.api.expr.v1alpha1.Explain.ExprStep expr_steps = 2; */ ⋮---- /** * Describes the message google.api.expr.v1alpha1.Explain. * Use `create(ExplainSchema)` to create a new message. * @deprecated */ export const ExplainSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * ID and value index of one step. * * @generated from message google.api.expr.v1alpha1.Explain.ExprStep * @deprecated */ export type Explain_ExprStep = Message<"google.api.expr.v1alpha1.Explain.ExprStep"> & { /** * ID of corresponding Expr node. * * @generated from field: int64 id = 1; */ id: bigint; /** * Index of the value in the values list. * * @generated from field: int32 value_index = 2; */ valueIndex: number; }; ⋮---- /** * ID of corresponding Expr node. * * @generated from field: int64 id = 1; */ ⋮---- /** * Index of the value in the values list. * * @generated from field: int32 value_index = 2; */ ⋮---- /** * Describes the message google.api.expr.v1alpha1.Explain.ExprStep. * Use `create(Explain_ExprStepSchema)` to create a new message. * @deprecated */ export const Explain_ExprStepSchema: GenMessage = /*@__PURE__*/ ```` ## File: src/gen/google/api/expr/v1alpha1/syntax_pb.ts ````typescript // Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. ⋮---- // @generated by protoc-gen-es v2.6.3 with parameter "target=ts" // @generated from file google/api/expr/v1alpha1/syntax.proto (package google.api.expr.v1alpha1, syntax proto3) /* eslint-disable */ ⋮---- import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; import { enumDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; import type { Duration, NullValue, Timestamp } from "@bufbuild/protobuf/wkt"; import { file_google_protobuf_duration, file_google_protobuf_struct, file_google_protobuf_timestamp } from "@bufbuild/protobuf/wkt"; import type { Message } from "@bufbuild/protobuf"; ⋮---- /** * Describes the file google/api/expr/v1alpha1/syntax.proto. */ export const file_google_api_expr_v1alpha1_syntax: GenFile = /*@__PURE__*/ ⋮---- /** * An expression together with source information as returned by the parser. * * @generated from message google.api.expr.v1alpha1.ParsedExpr */ export type ParsedExpr = Message<"google.api.expr.v1alpha1.ParsedExpr"> & { /** * The parsed expression. * * @generated from field: google.api.expr.v1alpha1.Expr expr = 2; */ expr?: Expr; /** * The source info derived from input that generated the parsed `expr`. * * @generated from field: google.api.expr.v1alpha1.SourceInfo source_info = 3; */ sourceInfo?: SourceInfo; }; ⋮---- /** * The parsed expression. * * @generated from field: google.api.expr.v1alpha1.Expr expr = 2; */ ⋮---- /** * The source info derived from input that generated the parsed `expr`. * * @generated from field: google.api.expr.v1alpha1.SourceInfo source_info = 3; */ ⋮---- /** * Describes the message google.api.expr.v1alpha1.ParsedExpr. * Use `create(ParsedExprSchema)` to create a new message. */ export const ParsedExprSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * An abstract representation of a common expression. * * Expressions are abstractly represented as a collection of identifiers, * select statements, function calls, literals, and comprehensions. All * operators with the exception of the '.' operator are modelled as function * calls. This makes it easy to represent new operators into the existing AST. * * All references within expressions must resolve to a * [Decl][google.api.expr.v1alpha1.Decl] provided at type-check for an * expression to be valid. A reference may either be a bare identifier `name` or * a qualified identifier `google.api.name`. References may either refer to a * value or a function declaration. * * For example, the expression `google.api.name.startsWith('expr')` references * the declaration `google.api.name` within a * [Expr.Select][google.api.expr.v1alpha1.Expr.Select] expression, and the * function declaration `startsWith`. * * @generated from message google.api.expr.v1alpha1.Expr */ export type Expr = Message<"google.api.expr.v1alpha1.Expr"> & { /** * Required. An id assigned to this node by the parser which is unique in a * given expression tree. This is used to associate type information and other * attributes to a node in the parse tree. * * @generated from field: int64 id = 2; */ id: bigint; /** * Required. Variants of expressions. * * @generated from oneof google.api.expr.v1alpha1.Expr.expr_kind */ exprKind: { /** * A literal expression. * * @generated from field: google.api.expr.v1alpha1.Constant const_expr = 3; */ value: Constant; case: "constExpr"; } | { /** * An identifier expression. * * @generated from field: google.api.expr.v1alpha1.Expr.Ident ident_expr = 4; */ value: Expr_Ident; case: "identExpr"; } | { /** * A field selection expression, e.g. `request.auth`. * * @generated from field: google.api.expr.v1alpha1.Expr.Select select_expr = 5; */ value: Expr_Select; case: "selectExpr"; } | { /** * A call expression, including calls to predefined functions and operators. * * @generated from field: google.api.expr.v1alpha1.Expr.Call call_expr = 6; */ value: Expr_Call; case: "callExpr"; } | { /** * A list creation expression. * * @generated from field: google.api.expr.v1alpha1.Expr.CreateList list_expr = 7; */ value: Expr_CreateList; case: "listExpr"; } | { /** * A map or message creation expression. * * @generated from field: google.api.expr.v1alpha1.Expr.CreateStruct struct_expr = 8; */ value: Expr_CreateStruct; case: "structExpr"; } | { /** * A comprehension expression. * * @generated from field: google.api.expr.v1alpha1.Expr.Comprehension comprehension_expr = 9; */ value: Expr_Comprehension; case: "comprehensionExpr"; } | { case: undefined; value?: undefined }; }; ⋮---- /** * Required. An id assigned to this node by the parser which is unique in a * given expression tree. This is used to associate type information and other * attributes to a node in the parse tree. * * @generated from field: int64 id = 2; */ ⋮---- /** * Required. Variants of expressions. * * @generated from oneof google.api.expr.v1alpha1.Expr.expr_kind */ ⋮---- /** * A literal expression. * * @generated from field: google.api.expr.v1alpha1.Constant const_expr = 3; */ ⋮---- /** * An identifier expression. * * @generated from field: google.api.expr.v1alpha1.Expr.Ident ident_expr = 4; */ ⋮---- /** * A field selection expression, e.g. `request.auth`. * * @generated from field: google.api.expr.v1alpha1.Expr.Select select_expr = 5; */ ⋮---- /** * A call expression, including calls to predefined functions and operators. * * @generated from field: google.api.expr.v1alpha1.Expr.Call call_expr = 6; */ ⋮---- /** * A list creation expression. * * @generated from field: google.api.expr.v1alpha1.Expr.CreateList list_expr = 7; */ ⋮---- /** * A map or message creation expression. * * @generated from field: google.api.expr.v1alpha1.Expr.CreateStruct struct_expr = 8; */ ⋮---- /** * A comprehension expression. * * @generated from field: google.api.expr.v1alpha1.Expr.Comprehension comprehension_expr = 9; */ ⋮---- /** * Describes the message google.api.expr.v1alpha1.Expr. * Use `create(ExprSchema)` to create a new message. */ export const ExprSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * An identifier expression. e.g. `request`. * * @generated from message google.api.expr.v1alpha1.Expr.Ident */ export type Expr_Ident = Message<"google.api.expr.v1alpha1.Expr.Ident"> & { /** * Required. Holds a single, unqualified identifier, possibly preceded by a * '.'. * * Qualified names are represented by the * [Expr.Select][google.api.expr.v1alpha1.Expr.Select] expression. * * @generated from field: string name = 1; */ name: string; }; ⋮---- /** * Required. Holds a single, unqualified identifier, possibly preceded by a * '.'. * * Qualified names are represented by the * [Expr.Select][google.api.expr.v1alpha1.Expr.Select] expression. * * @generated from field: string name = 1; */ ⋮---- /** * Describes the message google.api.expr.v1alpha1.Expr.Ident. * Use `create(Expr_IdentSchema)` to create a new message. */ export const Expr_IdentSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * A field selection expression. e.g. `request.auth`. * * @generated from message google.api.expr.v1alpha1.Expr.Select */ export type Expr_Select = Message<"google.api.expr.v1alpha1.Expr.Select"> & { /** * Required. The target of the selection expression. * * For example, in the select expression `request.auth`, the `request` * portion of the expression is the `operand`. * * @generated from field: google.api.expr.v1alpha1.Expr operand = 1; */ operand?: Expr; /** * Required. The name of the field to select. * * For example, in the select expression `request.auth`, the `auth` portion * of the expression would be the `field`. * * @generated from field: string field = 2; */ field: string; /** * Whether the select is to be interpreted as a field presence test. * * This results from the macro `has(request.auth)`. * * @generated from field: bool test_only = 3; */ testOnly: boolean; }; ⋮---- /** * Required. The target of the selection expression. * * For example, in the select expression `request.auth`, the `request` * portion of the expression is the `operand`. * * @generated from field: google.api.expr.v1alpha1.Expr operand = 1; */ ⋮---- /** * Required. The name of the field to select. * * For example, in the select expression `request.auth`, the `auth` portion * of the expression would be the `field`. * * @generated from field: string field = 2; */ ⋮---- /** * Whether the select is to be interpreted as a field presence test. * * This results from the macro `has(request.auth)`. * * @generated from field: bool test_only = 3; */ ⋮---- /** * Describes the message google.api.expr.v1alpha1.Expr.Select. * Use `create(Expr_SelectSchema)` to create a new message. */ export const Expr_SelectSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * A call expression, including calls to predefined functions and operators. * * For example, `value == 10`, `size(map_value)`. * * @generated from message google.api.expr.v1alpha1.Expr.Call */ export type Expr_Call = Message<"google.api.expr.v1alpha1.Expr.Call"> & { /** * The target of an method call-style expression. For example, `x` in * `x.f()`. * * @generated from field: google.api.expr.v1alpha1.Expr target = 1; */ target?: Expr; /** * Required. The name of the function or method being called. * * @generated from field: string function = 2; */ function: string; /** * The arguments. * * @generated from field: repeated google.api.expr.v1alpha1.Expr args = 3; */ args: Expr[]; }; ⋮---- /** * The target of an method call-style expression. For example, `x` in * `x.f()`. * * @generated from field: google.api.expr.v1alpha1.Expr target = 1; */ ⋮---- /** * Required. The name of the function or method being called. * * @generated from field: string function = 2; */ ⋮---- /** * The arguments. * * @generated from field: repeated google.api.expr.v1alpha1.Expr args = 3; */ ⋮---- /** * Describes the message google.api.expr.v1alpha1.Expr.Call. * Use `create(Expr_CallSchema)` to create a new message. */ export const Expr_CallSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * A list creation expression. * * Lists may either be homogenous, e.g. `[1, 2, 3]`, or heterogeneous, e.g. * `dyn([1, 'hello', 2.0])` * * @generated from message google.api.expr.v1alpha1.Expr.CreateList */ export type Expr_CreateList = Message<"google.api.expr.v1alpha1.Expr.CreateList"> & { /** * The elements part of the list. * * @generated from field: repeated google.api.expr.v1alpha1.Expr elements = 1; */ elements: Expr[]; /** * The indices within the elements list which are marked as optional * elements. * * When an optional-typed value is present, the value it contains * is included in the list. If the optional-typed value is absent, the list * element is omitted from the CreateList result. * * @generated from field: repeated int32 optional_indices = 2; */ optionalIndices: number[]; }; ⋮---- /** * The elements part of the list. * * @generated from field: repeated google.api.expr.v1alpha1.Expr elements = 1; */ ⋮---- /** * The indices within the elements list which are marked as optional * elements. * * When an optional-typed value is present, the value it contains * is included in the list. If the optional-typed value is absent, the list * element is omitted from the CreateList result. * * @generated from field: repeated int32 optional_indices = 2; */ ⋮---- /** * Describes the message google.api.expr.v1alpha1.Expr.CreateList. * Use `create(Expr_CreateListSchema)` to create a new message. */ export const Expr_CreateListSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * A map or message creation expression. * * Maps are constructed as `{'key_name': 'value'}`. Message construction is * similar, but prefixed with a type name and composed of field ids: * `types.MyType{field_id: 'value'}`. * * @generated from message google.api.expr.v1alpha1.Expr.CreateStruct */ export type Expr_CreateStruct = Message<"google.api.expr.v1alpha1.Expr.CreateStruct"> & { /** * The type name of the message to be created, empty when creating map * literals. * * @generated from field: string message_name = 1; */ messageName: string; /** * The entries in the creation expression. * * @generated from field: repeated google.api.expr.v1alpha1.Expr.CreateStruct.Entry entries = 2; */ entries: Expr_CreateStruct_Entry[]; }; ⋮---- /** * The type name of the message to be created, empty when creating map * literals. * * @generated from field: string message_name = 1; */ ⋮---- /** * The entries in the creation expression. * * @generated from field: repeated google.api.expr.v1alpha1.Expr.CreateStruct.Entry entries = 2; */ ⋮---- /** * Describes the message google.api.expr.v1alpha1.Expr.CreateStruct. * Use `create(Expr_CreateStructSchema)` to create a new message. */ export const Expr_CreateStructSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Represents an entry. * * @generated from message google.api.expr.v1alpha1.Expr.CreateStruct.Entry */ export type Expr_CreateStruct_Entry = Message<"google.api.expr.v1alpha1.Expr.CreateStruct.Entry"> & { /** * Required. An id assigned to this node by the parser which is unique * in a given expression tree. This is used to associate type * information and other attributes to the node. * * @generated from field: int64 id = 1; */ id: bigint; /** * The `Entry` key kinds. * * @generated from oneof google.api.expr.v1alpha1.Expr.CreateStruct.Entry.key_kind */ keyKind: { /** * The field key for a message creator statement. * * @generated from field: string field_key = 2; */ value: string; case: "fieldKey"; } | { /** * The key expression for a map creation statement. * * @generated from field: google.api.expr.v1alpha1.Expr map_key = 3; */ value: Expr; case: "mapKey"; } | { case: undefined; value?: undefined }; /** * Required. The value assigned to the key. * * If the optional_entry field is true, the expression must resolve to an * optional-typed value. If the optional value is present, the key will be * set; however, if the optional value is absent, the key will be unset. * * @generated from field: google.api.expr.v1alpha1.Expr value = 4; */ value?: Expr; /** * Whether the key-value pair is optional. * * @generated from field: bool optional_entry = 5; */ optionalEntry: boolean; }; ⋮---- /** * Required. An id assigned to this node by the parser which is unique * in a given expression tree. This is used to associate type * information and other attributes to the node. * * @generated from field: int64 id = 1; */ ⋮---- /** * The `Entry` key kinds. * * @generated from oneof google.api.expr.v1alpha1.Expr.CreateStruct.Entry.key_kind */ ⋮---- /** * The field key for a message creator statement. * * @generated from field: string field_key = 2; */ ⋮---- /** * The key expression for a map creation statement. * * @generated from field: google.api.expr.v1alpha1.Expr map_key = 3; */ ⋮---- /** * Required. The value assigned to the key. * * If the optional_entry field is true, the expression must resolve to an * optional-typed value. If the optional value is present, the key will be * set; however, if the optional value is absent, the key will be unset. * * @generated from field: google.api.expr.v1alpha1.Expr value = 4; */ ⋮---- /** * Whether the key-value pair is optional. * * @generated from field: bool optional_entry = 5; */ ⋮---- /** * Describes the message google.api.expr.v1alpha1.Expr.CreateStruct.Entry. * Use `create(Expr_CreateStruct_EntrySchema)` to create a new message. */ export const Expr_CreateStruct_EntrySchema: GenMessage = /*@__PURE__*/ ⋮---- /** * A comprehension expression applied to a list or map. * * Comprehensions are not part of the core syntax, but enabled with macros. * A macro matches a specific call signature within a parsed AST and replaces * the call with an alternate AST block. Macro expansion happens at parse * time. * * The following macros are supported within CEL: * * Aggregate type macros may be applied to all elements in a list or all keys * in a map: * * * `all`, `exists`, `exists_one` - test a predicate expression against * the inputs and return `true` if the predicate is satisfied for all, * any, or only one value `list.all(x, x < 10)`. * * `filter` - test a predicate expression against the inputs and return * the subset of elements which satisfy the predicate: * `payments.filter(p, p > 1000)`. * * `map` - apply an expression to all elements in the input and return the * output aggregate type: `[1, 2, 3].map(i, i * i)`. * * The `has(m.x)` macro tests whether the property `x` is present in struct * `m`. The semantics of this macro depend on the type of `m`. For proto2 * messages `has(m.x)` is defined as 'defined, but not set`. For proto3, the * macro tests whether the property is set to its default. For map and struct * types, the macro tests whether the property `x` is defined on `m`. * * Comprehensions for the standard environment macros evaluation can be best * visualized as the following pseudocode: * * ``` * let `accu_var` = `accu_init` * for (let `iter_var` in `iter_range`) { * if (!`loop_condition`) { * break * } * `accu_var` = `loop_step` * } * return `result` * ``` * * Comprehensions for the optional V2 macros which support map-to-map * translation differ slightly from the standard environment macros in that * they expose both the key or index in addition to the value for each list * or map entry: * * ``` * let `accu_var` = `accu_init` * for (let `iter_var`, `iter_var2` in `iter_range`) { * if (!`loop_condition`) { * break * } * `accu_var` = `loop_step` * } * return `result` * ``` * * @generated from message google.api.expr.v1alpha1.Expr.Comprehension */ export type Expr_Comprehension = Message<"google.api.expr.v1alpha1.Expr.Comprehension"> & { /** * The name of the first iteration variable. * When the iter_range is a list, this variable is the list element. * When the iter_range is a map, this variable is the map entry key. * * @generated from field: string iter_var = 1; */ iterVar: string; /** * The name of the second iteration variable, empty if not set. * When the iter_range is a list, this variable is the integer index. * When the iter_range is a map, this variable is the map entry value. * This field is only set for comprehension v2 macros. * * @generated from field: string iter_var2 = 8; */ iterVar2: string; /** * The range over which the comprehension iterates. * * @generated from field: google.api.expr.v1alpha1.Expr iter_range = 2; */ iterRange?: Expr; /** * The name of the variable used for accumulation of the result. * * @generated from field: string accu_var = 3; */ accuVar: string; /** * The initial value of the accumulator. * * @generated from field: google.api.expr.v1alpha1.Expr accu_init = 4; */ accuInit?: Expr; /** * An expression which can contain iter_var, iter_var2, and accu_var. * * Returns false when the result has been computed and may be used as * a hint to short-circuit the remainder of the comprehension. * * @generated from field: google.api.expr.v1alpha1.Expr loop_condition = 5; */ loopCondition?: Expr; /** * An expression which can contain iter_var, iter_var2, and accu_var. * * Computes the next value of accu_var. * * @generated from field: google.api.expr.v1alpha1.Expr loop_step = 6; */ loopStep?: Expr; /** * An expression which can contain accu_var. * * Computes the result. * * @generated from field: google.api.expr.v1alpha1.Expr result = 7; */ result?: Expr; }; ⋮---- /** * The name of the first iteration variable. * When the iter_range is a list, this variable is the list element. * When the iter_range is a map, this variable is the map entry key. * * @generated from field: string iter_var = 1; */ ⋮---- /** * The name of the second iteration variable, empty if not set. * When the iter_range is a list, this variable is the integer index. * When the iter_range is a map, this variable is the map entry value. * This field is only set for comprehension v2 macros. * * @generated from field: string iter_var2 = 8; */ ⋮---- /** * The range over which the comprehension iterates. * * @generated from field: google.api.expr.v1alpha1.Expr iter_range = 2; */ ⋮---- /** * The name of the variable used for accumulation of the result. * * @generated from field: string accu_var = 3; */ ⋮---- /** * The initial value of the accumulator. * * @generated from field: google.api.expr.v1alpha1.Expr accu_init = 4; */ ⋮---- /** * An expression which can contain iter_var, iter_var2, and accu_var. * * Returns false when the result has been computed and may be used as * a hint to short-circuit the remainder of the comprehension. * * @generated from field: google.api.expr.v1alpha1.Expr loop_condition = 5; */ ⋮---- /** * An expression which can contain iter_var, iter_var2, and accu_var. * * Computes the next value of accu_var. * * @generated from field: google.api.expr.v1alpha1.Expr loop_step = 6; */ ⋮---- /** * An expression which can contain accu_var. * * Computes the result. * * @generated from field: google.api.expr.v1alpha1.Expr result = 7; */ ⋮---- /** * Describes the message google.api.expr.v1alpha1.Expr.Comprehension. * Use `create(Expr_ComprehensionSchema)` to create a new message. */ export const Expr_ComprehensionSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Represents a primitive literal. * * Named 'Constant' here for backwards compatibility. * * This is similar as the primitives supported in the well-known type * `google.protobuf.Value`, but richer so it can represent CEL's full range of * primitives. * * Lists and structs are not included as constants as these aggregate types may * contain [Expr][google.api.expr.v1alpha1.Expr] elements which require * evaluation and are thus not constant. * * Examples of literals include: `"hello"`, `b'bytes'`, `1u`, `4.2`, `-2`, * `true`, `null`. * * @generated from message google.api.expr.v1alpha1.Constant */ export type Constant = Message<"google.api.expr.v1alpha1.Constant"> & { /** * Required. The valid constant kinds. * * @generated from oneof google.api.expr.v1alpha1.Constant.constant_kind */ constantKind: { /** * null value. * * @generated from field: google.protobuf.NullValue null_value = 1; */ value: NullValue; case: "nullValue"; } | { /** * boolean value. * * @generated from field: bool bool_value = 2; */ value: boolean; case: "boolValue"; } | { /** * int64 value. * * @generated from field: int64 int64_value = 3; */ value: bigint; case: "int64Value"; } | { /** * uint64 value. * * @generated from field: uint64 uint64_value = 4; */ value: bigint; case: "uint64Value"; } | { /** * double value. * * @generated from field: double double_value = 5; */ value: number; case: "doubleValue"; } | { /** * string value. * * @generated from field: string string_value = 6; */ value: string; case: "stringValue"; } | { /** * bytes value. * * @generated from field: bytes bytes_value = 7; */ value: Uint8Array; case: "bytesValue"; } | { /** * protobuf.Duration value. * * Deprecated: duration is no longer considered a builtin cel type. * * @generated from field: google.protobuf.Duration duration_value = 8 [deprecated = true]; * @deprecated */ value: Duration; case: "durationValue"; } | { /** * protobuf.Timestamp value. * * Deprecated: timestamp is no longer considered a builtin cel type. * * @generated from field: google.protobuf.Timestamp timestamp_value = 9 [deprecated = true]; * @deprecated */ value: Timestamp; case: "timestampValue"; } | { case: undefined; value?: undefined }; }; ⋮---- /** * Required. The valid constant kinds. * * @generated from oneof google.api.expr.v1alpha1.Constant.constant_kind */ ⋮---- /** * null value. * * @generated from field: google.protobuf.NullValue null_value = 1; */ ⋮---- /** * boolean value. * * @generated from field: bool bool_value = 2; */ ⋮---- /** * int64 value. * * @generated from field: int64 int64_value = 3; */ ⋮---- /** * uint64 value. * * @generated from field: uint64 uint64_value = 4; */ ⋮---- /** * double value. * * @generated from field: double double_value = 5; */ ⋮---- /** * string value. * * @generated from field: string string_value = 6; */ ⋮---- /** * bytes value. * * @generated from field: bytes bytes_value = 7; */ ⋮---- /** * protobuf.Duration value. * * Deprecated: duration is no longer considered a builtin cel type. * * @generated from field: google.protobuf.Duration duration_value = 8 [deprecated = true]; * @deprecated */ ⋮---- /** * protobuf.Timestamp value. * * Deprecated: timestamp is no longer considered a builtin cel type. * * @generated from field: google.protobuf.Timestamp timestamp_value = 9 [deprecated = true]; * @deprecated */ ⋮---- /** * Describes the message google.api.expr.v1alpha1.Constant. * Use `create(ConstantSchema)` to create a new message. */ export const ConstantSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Source information collected at parse time. * * @generated from message google.api.expr.v1alpha1.SourceInfo */ export type SourceInfo = Message<"google.api.expr.v1alpha1.SourceInfo"> & { /** * The syntax version of the source, e.g. `cel1`. * * @generated from field: string syntax_version = 1; */ syntaxVersion: string; /** * The location name. All position information attached to an expression is * relative to this location. * * The location could be a file, UI element, or similar. For example, * `acme/app/AnvilPolicy.cel`. * * @generated from field: string location = 2; */ location: string; /** * Monotonically increasing list of code point offsets where newlines * `\n` appear. * * The line number of a given position is the index `i` where for a given * `id` the `line_offsets[i] < id_positions[id] < line_offsets[i+1]`. The * column may be derivd from `id_positions[id] - line_offsets[i]`. * * @generated from field: repeated int32 line_offsets = 3; */ lineOffsets: number[]; /** * A map from the parse node id (e.g. `Expr.id`) to the code point offset * within the source. * * @generated from field: map positions = 4; */ positions: { [key: string]: number }; /** * A map from the parse node id where a macro replacement was made to the * call `Expr` that resulted in a macro expansion. * * For example, `has(value.field)` is a function call that is replaced by a * `test_only` field selection in the AST. Likewise, the call * `list.exists(e, e > 10)` translates to a comprehension expression. The key * in the map corresponds to the expression id of the expanded macro, and the * value is the call `Expr` that was replaced. * * @generated from field: map macro_calls = 5; */ macroCalls: { [key: string]: Expr }; /** * A list of tags for extensions that were used while parsing or type checking * the source expression. For example, optimizations that require special * runtime support may be specified. * * These are used to check feature support between components in separate * implementations. This can be used to either skip redundant work or * report an error if the extension is unsupported. * * @generated from field: repeated google.api.expr.v1alpha1.SourceInfo.Extension extensions = 6; */ extensions: SourceInfo_Extension[]; }; ⋮---- /** * The syntax version of the source, e.g. `cel1`. * * @generated from field: string syntax_version = 1; */ ⋮---- /** * The location name. All position information attached to an expression is * relative to this location. * * The location could be a file, UI element, or similar. For example, * `acme/app/AnvilPolicy.cel`. * * @generated from field: string location = 2; */ ⋮---- /** * Monotonically increasing list of code point offsets where newlines * `\n` appear. * * The line number of a given position is the index `i` where for a given * `id` the `line_offsets[i] < id_positions[id] < line_offsets[i+1]`. The * column may be derivd from `id_positions[id] - line_offsets[i]`. * * @generated from field: repeated int32 line_offsets = 3; */ ⋮---- /** * A map from the parse node id (e.g. `Expr.id`) to the code point offset * within the source. * * @generated from field: map positions = 4; */ ⋮---- /** * A map from the parse node id where a macro replacement was made to the * call `Expr` that resulted in a macro expansion. * * For example, `has(value.field)` is a function call that is replaced by a * `test_only` field selection in the AST. Likewise, the call * `list.exists(e, e > 10)` translates to a comprehension expression. The key * in the map corresponds to the expression id of the expanded macro, and the * value is the call `Expr` that was replaced. * * @generated from field: map macro_calls = 5; */ ⋮---- /** * A list of tags for extensions that were used while parsing or type checking * the source expression. For example, optimizations that require special * runtime support may be specified. * * These are used to check feature support between components in separate * implementations. This can be used to either skip redundant work or * report an error if the extension is unsupported. * * @generated from field: repeated google.api.expr.v1alpha1.SourceInfo.Extension extensions = 6; */ ⋮---- /** * Describes the message google.api.expr.v1alpha1.SourceInfo. * Use `create(SourceInfoSchema)` to create a new message. */ export const SourceInfoSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * An extension that was requested for the source expression. * * @generated from message google.api.expr.v1alpha1.SourceInfo.Extension */ export type SourceInfo_Extension = Message<"google.api.expr.v1alpha1.SourceInfo.Extension"> & { /** * Identifier for the extension. Example: constant_folding * * @generated from field: string id = 1; */ id: string; /** * If set, the listed components must understand the extension for the * expression to evaluate correctly. * * This field has set semantics, repeated values should be deduplicated. * * @generated from field: repeated google.api.expr.v1alpha1.SourceInfo.Extension.Component affected_components = 2; */ affectedComponents: SourceInfo_Extension_Component[]; /** * Version info. May be skipped if it isn't meaningful for the extension. * (for example constant_folding might always be v0.0). * * @generated from field: google.api.expr.v1alpha1.SourceInfo.Extension.Version version = 3; */ version?: SourceInfo_Extension_Version; }; ⋮---- /** * Identifier for the extension. Example: constant_folding * * @generated from field: string id = 1; */ ⋮---- /** * If set, the listed components must understand the extension for the * expression to evaluate correctly. * * This field has set semantics, repeated values should be deduplicated. * * @generated from field: repeated google.api.expr.v1alpha1.SourceInfo.Extension.Component affected_components = 2; */ ⋮---- /** * Version info. May be skipped if it isn't meaningful for the extension. * (for example constant_folding might always be v0.0). * * @generated from field: google.api.expr.v1alpha1.SourceInfo.Extension.Version version = 3; */ ⋮---- /** * Describes the message google.api.expr.v1alpha1.SourceInfo.Extension. * Use `create(SourceInfo_ExtensionSchema)` to create a new message. */ export const SourceInfo_ExtensionSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Version * * @generated from message google.api.expr.v1alpha1.SourceInfo.Extension.Version */ export type SourceInfo_Extension_Version = Message<"google.api.expr.v1alpha1.SourceInfo.Extension.Version"> & { /** * Major version changes indicate different required support level from * the required components. * * @generated from field: int64 major = 1; */ major: bigint; /** * Minor version changes must not change the observed behavior from * existing implementations, but may be provided informationally. * * @generated from field: int64 minor = 2; */ minor: bigint; }; ⋮---- /** * Major version changes indicate different required support level from * the required components. * * @generated from field: int64 major = 1; */ ⋮---- /** * Minor version changes must not change the observed behavior from * existing implementations, but may be provided informationally. * * @generated from field: int64 minor = 2; */ ⋮---- /** * Describes the message google.api.expr.v1alpha1.SourceInfo.Extension.Version. * Use `create(SourceInfo_Extension_VersionSchema)` to create a new message. */ export const SourceInfo_Extension_VersionSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * CEL component specifier. * * @generated from enum google.api.expr.v1alpha1.SourceInfo.Extension.Component */ export enum SourceInfo_Extension_Component { /** * Unspecified, default. * * @generated from enum value: COMPONENT_UNSPECIFIED = 0; */ UNSPECIFIED = 0, /** * Parser. Converts a CEL string to an AST. * * @generated from enum value: COMPONENT_PARSER = 1; */ PARSER = 1, /** * Type checker. Checks that references in an AST are defined and types * agree. * * @generated from enum value: COMPONENT_TYPE_CHECKER = 2; */ TYPE_CHECKER = 2, /** * Runtime. Evaluates a parsed and optionally checked CEL AST against a * context. * * @generated from enum value: COMPONENT_RUNTIME = 3; */ RUNTIME = 3, } ⋮---- /** * Unspecified, default. * * @generated from enum value: COMPONENT_UNSPECIFIED = 0; */ ⋮---- /** * Parser. Converts a CEL string to an AST. * * @generated from enum value: COMPONENT_PARSER = 1; */ ⋮---- /** * Type checker. Checks that references in an AST are defined and types * agree. * * @generated from enum value: COMPONENT_TYPE_CHECKER = 2; */ ⋮---- /** * Runtime. Evaluates a parsed and optionally checked CEL AST against a * context. * * @generated from enum value: COMPONENT_RUNTIME = 3; */ ⋮---- /** * Describes the enum google.api.expr.v1alpha1.SourceInfo.Extension.Component. */ export const SourceInfo_Extension_ComponentSchema: GenEnum = /*@__PURE__*/ ⋮---- /** * A specific position in source. * * @generated from message google.api.expr.v1alpha1.SourcePosition */ export type SourcePosition = Message<"google.api.expr.v1alpha1.SourcePosition"> & { /** * The soucre location name (e.g. file name). * * @generated from field: string location = 1; */ location: string; /** * The UTF-8 code unit offset. * * @generated from field: int32 offset = 2; */ offset: number; /** * The 1-based index of the starting line in the source text * where the issue occurs, or 0 if unknown. * * @generated from field: int32 line = 3; */ line: number; /** * The 0-based index of the starting position within the line of source text * where the issue occurs. Only meaningful if line is nonzero. * * @generated from field: int32 column = 4; */ column: number; }; ⋮---- /** * The soucre location name (e.g. file name). * * @generated from field: string location = 1; */ ⋮---- /** * The UTF-8 code unit offset. * * @generated from field: int32 offset = 2; */ ⋮---- /** * The 1-based index of the starting line in the source text * where the issue occurs, or 0 if unknown. * * @generated from field: int32 line = 3; */ ⋮---- /** * The 0-based index of the starting position within the line of source text * where the issue occurs. Only meaningful if line is nonzero. * * @generated from field: int32 column = 4; */ ⋮---- /** * Describes the message google.api.expr.v1alpha1.SourcePosition. * Use `create(SourcePositionSchema)` to create a new message. */ export const SourcePositionSchema: GenMessage = /*@__PURE__*/ ```` ## File: src/gen/google/api/expr/v1alpha1/value_pb.ts ````typescript // Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. ⋮---- // @generated by protoc-gen-es v2.6.3 with parameter "target=ts" // @generated from file google/api/expr/v1alpha1/value.proto (package google.api.expr.v1alpha1, syntax proto3) /* eslint-disable */ ⋮---- import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; import type { Any, NullValue } from "@bufbuild/protobuf/wkt"; import { file_google_protobuf_any, file_google_protobuf_struct } from "@bufbuild/protobuf/wkt"; import type { Message } from "@bufbuild/protobuf"; ⋮---- /** * Describes the file google/api/expr/v1alpha1/value.proto. */ export const file_google_api_expr_v1alpha1_value: GenFile = /*@__PURE__*/ ⋮---- /** * Represents a CEL value. * * This is similar to `google.protobuf.Value`, but can represent CEL's full * range of values. * * @generated from message google.api.expr.v1alpha1.Value */ export type Value = Message<"google.api.expr.v1alpha1.Value"> & { /** * Required. The valid kinds of values. * * @generated from oneof google.api.expr.v1alpha1.Value.kind */ kind: { /** * Null value. * * @generated from field: google.protobuf.NullValue null_value = 1; */ value: NullValue; case: "nullValue"; } | { /** * Boolean value. * * @generated from field: bool bool_value = 2; */ value: boolean; case: "boolValue"; } | { /** * Signed integer value. * * @generated from field: int64 int64_value = 3; */ value: bigint; case: "int64Value"; } | { /** * Unsigned integer value. * * @generated from field: uint64 uint64_value = 4; */ value: bigint; case: "uint64Value"; } | { /** * Floating point value. * * @generated from field: double double_value = 5; */ value: number; case: "doubleValue"; } | { /** * UTF-8 string value. * * @generated from field: string string_value = 6; */ value: string; case: "stringValue"; } | { /** * Byte string value. * * @generated from field: bytes bytes_value = 7; */ value: Uint8Array; case: "bytesValue"; } | { /** * An enum value. * * @generated from field: google.api.expr.v1alpha1.EnumValue enum_value = 9; */ value: EnumValue; case: "enumValue"; } | { /** * The proto message backing an object value. * * @generated from field: google.protobuf.Any object_value = 10; */ value: Any; case: "objectValue"; } | { /** * Map value. * * @generated from field: google.api.expr.v1alpha1.MapValue map_value = 11; */ value: MapValue; case: "mapValue"; } | { /** * List value. * * @generated from field: google.api.expr.v1alpha1.ListValue list_value = 12; */ value: ListValue; case: "listValue"; } | { /** * Type value. * * @generated from field: string type_value = 15; */ value: string; case: "typeValue"; } | { case: undefined; value?: undefined }; }; ⋮---- /** * Required. The valid kinds of values. * * @generated from oneof google.api.expr.v1alpha1.Value.kind */ ⋮---- /** * Null value. * * @generated from field: google.protobuf.NullValue null_value = 1; */ ⋮---- /** * Boolean value. * * @generated from field: bool bool_value = 2; */ ⋮---- /** * Signed integer value. * * @generated from field: int64 int64_value = 3; */ ⋮---- /** * Unsigned integer value. * * @generated from field: uint64 uint64_value = 4; */ ⋮---- /** * Floating point value. * * @generated from field: double double_value = 5; */ ⋮---- /** * UTF-8 string value. * * @generated from field: string string_value = 6; */ ⋮---- /** * Byte string value. * * @generated from field: bytes bytes_value = 7; */ ⋮---- /** * An enum value. * * @generated from field: google.api.expr.v1alpha1.EnumValue enum_value = 9; */ ⋮---- /** * The proto message backing an object value. * * @generated from field: google.protobuf.Any object_value = 10; */ ⋮---- /** * Map value. * * @generated from field: google.api.expr.v1alpha1.MapValue map_value = 11; */ ⋮---- /** * List value. * * @generated from field: google.api.expr.v1alpha1.ListValue list_value = 12; */ ⋮---- /** * Type value. * * @generated from field: string type_value = 15; */ ⋮---- /** * Describes the message google.api.expr.v1alpha1.Value. * Use `create(ValueSchema)` to create a new message. */ export const ValueSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * An enum value. * * @generated from message google.api.expr.v1alpha1.EnumValue */ export type EnumValue = Message<"google.api.expr.v1alpha1.EnumValue"> & { /** * The fully qualified name of the enum type. * * @generated from field: string type = 1; */ type: string; /** * The value of the enum. * * @generated from field: int32 value = 2; */ value: number; }; ⋮---- /** * The fully qualified name of the enum type. * * @generated from field: string type = 1; */ ⋮---- /** * The value of the enum. * * @generated from field: int32 value = 2; */ ⋮---- /** * Describes the message google.api.expr.v1alpha1.EnumValue. * Use `create(EnumValueSchema)` to create a new message. */ export const EnumValueSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * A list. * * Wrapped in a message so 'not set' and empty can be differentiated, which is * required for use in a 'oneof'. * * @generated from message google.api.expr.v1alpha1.ListValue */ export type ListValue = Message<"google.api.expr.v1alpha1.ListValue"> & { /** * The ordered values in the list. * * @generated from field: repeated google.api.expr.v1alpha1.Value values = 1; */ values: Value[]; }; ⋮---- /** * The ordered values in the list. * * @generated from field: repeated google.api.expr.v1alpha1.Value values = 1; */ ⋮---- /** * Describes the message google.api.expr.v1alpha1.ListValue. * Use `create(ListValueSchema)` to create a new message. */ export const ListValueSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * A map. * * Wrapped in a message so 'not set' and empty can be differentiated, which is * required for use in a 'oneof'. * * @generated from message google.api.expr.v1alpha1.MapValue */ export type MapValue = Message<"google.api.expr.v1alpha1.MapValue"> & { /** * The set of map entries. * * CEL has fewer restrictions on keys, so a protobuf map represenation * cannot be used. * * @generated from field: repeated google.api.expr.v1alpha1.MapValue.Entry entries = 1; */ entries: MapValue_Entry[]; }; ⋮---- /** * The set of map entries. * * CEL has fewer restrictions on keys, so a protobuf map represenation * cannot be used. * * @generated from field: repeated google.api.expr.v1alpha1.MapValue.Entry entries = 1; */ ⋮---- /** * Describes the message google.api.expr.v1alpha1.MapValue. * Use `create(MapValueSchema)` to create a new message. */ export const MapValueSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * An entry in the map. * * @generated from message google.api.expr.v1alpha1.MapValue.Entry */ export type MapValue_Entry = Message<"google.api.expr.v1alpha1.MapValue.Entry"> & { /** * The key. * * Must be unique with in the map. * Currently only boolean, int, uint, and string values can be keys. * * @generated from field: google.api.expr.v1alpha1.Value key = 1; */ key?: Value; /** * The value. * * @generated from field: google.api.expr.v1alpha1.Value value = 2; */ value?: Value; }; ⋮---- /** * The key. * * Must be unique with in the map. * Currently only boolean, int, uint, and string values can be keys. * * @generated from field: google.api.expr.v1alpha1.Value key = 1; */ ⋮---- /** * The value. * * @generated from field: google.api.expr.v1alpha1.Value value = 2; */ ⋮---- /** * Describes the message google.api.expr.v1alpha1.MapValue.Entry. * Use `create(MapValue_EntrySchema)` to create a new message. */ export const MapValue_EntrySchema: GenMessage = /*@__PURE__*/ ```` ## File: src/gen/google/api/expr/v1beta1/decl_pb.ts ````typescript // Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // ⋮---- // @generated by protoc-gen-es v2.6.3 with parameter "target=ts" // @generated from file google/api/expr/v1beta1/decl.proto (package google.api.expr.v1beta1, syntax proto3) /* eslint-disable */ ⋮---- import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; import type { Expr } from "./expr_pb"; import { file_google_api_expr_v1beta1_expr } from "./expr_pb"; import type { Message } from "@bufbuild/protobuf"; ⋮---- /** * Describes the file google/api/expr/v1beta1/decl.proto. */ export const file_google_api_expr_v1beta1_decl: GenFile = /*@__PURE__*/ ⋮---- /** * A declaration. * * @generated from message google.api.expr.v1beta1.Decl */ export type Decl = Message<"google.api.expr.v1beta1.Decl"> & { /** * The id of the declaration. * * @generated from field: int32 id = 1; */ id: number; /** * The name of the declaration. * * @generated from field: string name = 2; */ name: string; /** * The documentation string for the declaration. * * @generated from field: string doc = 3; */ doc: string; /** * The kind of declaration. * * @generated from oneof google.api.expr.v1beta1.Decl.kind */ kind: { /** * An identifier declaration. * * @generated from field: google.api.expr.v1beta1.IdentDecl ident = 4; */ value: IdentDecl; case: "ident"; } | { /** * A function declaration. * * @generated from field: google.api.expr.v1beta1.FunctionDecl function = 5; */ value: FunctionDecl; case: "function"; } | { case: undefined; value?: undefined }; }; ⋮---- /** * The id of the declaration. * * @generated from field: int32 id = 1; */ ⋮---- /** * The name of the declaration. * * @generated from field: string name = 2; */ ⋮---- /** * The documentation string for the declaration. * * @generated from field: string doc = 3; */ ⋮---- /** * The kind of declaration. * * @generated from oneof google.api.expr.v1beta1.Decl.kind */ ⋮---- /** * An identifier declaration. * * @generated from field: google.api.expr.v1beta1.IdentDecl ident = 4; */ ⋮---- /** * A function declaration. * * @generated from field: google.api.expr.v1beta1.FunctionDecl function = 5; */ ⋮---- /** * Describes the message google.api.expr.v1beta1.Decl. * Use `create(DeclSchema)` to create a new message. */ export const DeclSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * The declared type of a variable. * * Extends runtime type values with extra information used for type checking * and dispatching. * * @generated from message google.api.expr.v1beta1.DeclType */ export type DeclType = Message<"google.api.expr.v1beta1.DeclType"> & { /** * The expression id of the declared type, if applicable. * * @generated from field: int32 id = 1; */ id: number; /** * The type name, e.g. 'int', 'my.type.Type' or 'T' * * @generated from field: string type = 2; */ type: string; /** * An ordered list of type parameters, e.g. ``. * Only applies to a subset of types, e.g. `map`, `list`. * * @generated from field: repeated google.api.expr.v1beta1.DeclType type_params = 4; */ typeParams: DeclType[]; }; ⋮---- /** * The expression id of the declared type, if applicable. * * @generated from field: int32 id = 1; */ ⋮---- /** * The type name, e.g. 'int', 'my.type.Type' or 'T' * * @generated from field: string type = 2; */ ⋮---- /** * An ordered list of type parameters, e.g. ``. * Only applies to a subset of types, e.g. `map`, `list`. * * @generated from field: repeated google.api.expr.v1beta1.DeclType type_params = 4; */ ⋮---- /** * Describes the message google.api.expr.v1beta1.DeclType. * Use `create(DeclTypeSchema)` to create a new message. */ export const DeclTypeSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * An identifier declaration. * * @generated from message google.api.expr.v1beta1.IdentDecl */ export type IdentDecl = Message<"google.api.expr.v1beta1.IdentDecl"> & { /** * Optional type of the identifier. * * @generated from field: google.api.expr.v1beta1.DeclType type = 3; */ type?: DeclType; /** * Optional value of the identifier. * * @generated from field: google.api.expr.v1beta1.Expr value = 4; */ value?: Expr; }; ⋮---- /** * Optional type of the identifier. * * @generated from field: google.api.expr.v1beta1.DeclType type = 3; */ ⋮---- /** * Optional value of the identifier. * * @generated from field: google.api.expr.v1beta1.Expr value = 4; */ ⋮---- /** * Describes the message google.api.expr.v1beta1.IdentDecl. * Use `create(IdentDeclSchema)` to create a new message. */ export const IdentDeclSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * A function declaration. * * @generated from message google.api.expr.v1beta1.FunctionDecl */ export type FunctionDecl = Message<"google.api.expr.v1beta1.FunctionDecl"> & { /** * The function arguments. * * @generated from field: repeated google.api.expr.v1beta1.IdentDecl args = 1; */ args: IdentDecl[]; /** * Optional declared return type. * * @generated from field: google.api.expr.v1beta1.DeclType return_type = 2; */ returnType?: DeclType; /** * If the first argument of the function is the receiver. * * @generated from field: bool receiver_function = 3; */ receiverFunction: boolean; }; ⋮---- /** * The function arguments. * * @generated from field: repeated google.api.expr.v1beta1.IdentDecl args = 1; */ ⋮---- /** * Optional declared return type. * * @generated from field: google.api.expr.v1beta1.DeclType return_type = 2; */ ⋮---- /** * If the first argument of the function is the receiver. * * @generated from field: bool receiver_function = 3; */ ⋮---- /** * Describes the message google.api.expr.v1beta1.FunctionDecl. * Use `create(FunctionDeclSchema)` to create a new message. */ export const FunctionDeclSchema: GenMessage = /*@__PURE__*/ ```` ## File: src/gen/google/api/expr/v1beta1/eval_pb.ts ````typescript // Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // ⋮---- // @generated by protoc-gen-es v2.6.3 with parameter "target=ts" // @generated from file google/api/expr/v1beta1/eval.proto (package google.api.expr.v1beta1, syntax proto3) /* eslint-disable */ ⋮---- import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; import type { Value } from "./value_pb"; import { file_google_api_expr_v1beta1_value } from "./value_pb"; import type { Status } from "../../../rpc/status_pb"; import { file_google_rpc_status } from "../../../rpc/status_pb"; import type { Message } from "@bufbuild/protobuf"; ⋮---- /** * Describes the file google/api/expr/v1beta1/eval.proto. */ export const file_google_api_expr_v1beta1_eval: GenFile = /*@__PURE__*/ ⋮---- /** * The state of an evaluation. * * Can represent an initial, partial, or completed state of evaluation. * * @generated from message google.api.expr.v1beta1.EvalState */ export type EvalState = Message<"google.api.expr.v1beta1.EvalState"> & { /** * The unique values referenced in this message. * * @generated from field: repeated google.api.expr.v1beta1.ExprValue values = 1; */ values: ExprValue[]; /** * An ordered list of results. * * Tracks the flow of evaluation through the expression. * May be sparse. * * @generated from field: repeated google.api.expr.v1beta1.EvalState.Result results = 3; */ results: EvalState_Result[]; }; ⋮---- /** * The unique values referenced in this message. * * @generated from field: repeated google.api.expr.v1beta1.ExprValue values = 1; */ ⋮---- /** * An ordered list of results. * * Tracks the flow of evaluation through the expression. * May be sparse. * * @generated from field: repeated google.api.expr.v1beta1.EvalState.Result results = 3; */ ⋮---- /** * Describes the message google.api.expr.v1beta1.EvalState. * Use `create(EvalStateSchema)` to create a new message. */ export const EvalStateSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * A single evaluation result. * * @generated from message google.api.expr.v1beta1.EvalState.Result */ export type EvalState_Result = Message<"google.api.expr.v1beta1.EvalState.Result"> & { /** * The expression this result is for. * * @generated from field: google.api.expr.v1beta1.IdRef expr = 1; */ expr?: IdRef; /** * The index in `values` of the resulting value. * * @generated from field: int32 value = 2; */ value: number; }; ⋮---- /** * The expression this result is for. * * @generated from field: google.api.expr.v1beta1.IdRef expr = 1; */ ⋮---- /** * The index in `values` of the resulting value. * * @generated from field: int32 value = 2; */ ⋮---- /** * Describes the message google.api.expr.v1beta1.EvalState.Result. * Use `create(EvalState_ResultSchema)` to create a new message. */ export const EvalState_ResultSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * The value of an evaluated expression. * * @generated from message google.api.expr.v1beta1.ExprValue */ export type ExprValue = Message<"google.api.expr.v1beta1.ExprValue"> & { /** * An expression can resolve to a value, error or unknown. * * @generated from oneof google.api.expr.v1beta1.ExprValue.kind */ kind: { /** * A concrete value. * * @generated from field: google.api.expr.v1beta1.Value value = 1; */ value: Value; case: "value"; } | { /** * The set of errors in the critical path of evalution. * * Only errors in the critical path are included. For example, * `( || true) && ` will only result in ``, * while ` || ` will result in both `` and * ``. * * Errors cause by the presence of other errors are not included in the * set. For example `.foo`, `foo()`, and ` + 1` will * only result in ``. * * Multiple errors *might* be included when evaluation could result * in different errors. For example ` + ` and * `foo(, )` may result in ``, `` or both. * The exact subset of errors included for this case is unspecified and * depends on the implementation details of the evaluator. * * @generated from field: google.api.expr.v1beta1.ErrorSet error = 2; */ value: ErrorSet; case: "error"; } | { /** * The set of unknowns in the critical path of evaluation. * * Unknown behaves identically to Error with regards to propagation. * Specifically, only unknowns in the critical path are included, unknowns * caused by the presence of other unknowns are not included, and multiple * unknowns *might* be included included when evaluation could result in * different unknowns. For example: * * ( || true) && -> * || -> * .foo -> * foo() -> * + -> or * * Unknown takes precidence over Error in cases where a `Value` can short * circuit the result: * * || -> * && -> * * Errors take precidence in all other cases: * * + -> * foo(, ) -> * * @generated from field: google.api.expr.v1beta1.UnknownSet unknown = 3; */ value: UnknownSet; case: "unknown"; } | { case: undefined; value?: undefined }; }; ⋮---- /** * An expression can resolve to a value, error or unknown. * * @generated from oneof google.api.expr.v1beta1.ExprValue.kind */ ⋮---- /** * A concrete value. * * @generated from field: google.api.expr.v1beta1.Value value = 1; */ ⋮---- /** * The set of errors in the critical path of evalution. * * Only errors in the critical path are included. For example, * `( || true) && ` will only result in ``, * while ` || ` will result in both `` and * ``. * * Errors cause by the presence of other errors are not included in the * set. For example `.foo`, `foo()`, and ` + 1` will * only result in ``. * * Multiple errors *might* be included when evaluation could result * in different errors. For example ` + ` and * `foo(, )` may result in ``, `` or both. * The exact subset of errors included for this case is unspecified and * depends on the implementation details of the evaluator. * * @generated from field: google.api.expr.v1beta1.ErrorSet error = 2; */ ⋮---- /** * The set of unknowns in the critical path of evaluation. * * Unknown behaves identically to Error with regards to propagation. * Specifically, only unknowns in the critical path are included, unknowns * caused by the presence of other unknowns are not included, and multiple * unknowns *might* be included included when evaluation could result in * different unknowns. For example: * * ( || true) && -> * || -> * .foo -> * foo() -> * + -> or * * Unknown takes precidence over Error in cases where a `Value` can short * circuit the result: * * || -> * && -> * * Errors take precidence in all other cases: * * + -> * foo(, ) -> * * @generated from field: google.api.expr.v1beta1.UnknownSet unknown = 3; */ ⋮---- /** * Describes the message google.api.expr.v1beta1.ExprValue. * Use `create(ExprValueSchema)` to create a new message. */ export const ExprValueSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * A set of errors. * * The errors included depend on the context. See `ExprValue.error`. * * @generated from message google.api.expr.v1beta1.ErrorSet */ export type ErrorSet = Message<"google.api.expr.v1beta1.ErrorSet"> & { /** * The errors in the set. * * @generated from field: repeated google.rpc.Status errors = 1; */ errors: Status[]; }; ⋮---- /** * The errors in the set. * * @generated from field: repeated google.rpc.Status errors = 1; */ ⋮---- /** * Describes the message google.api.expr.v1beta1.ErrorSet. * Use `create(ErrorSetSchema)` to create a new message. */ export const ErrorSetSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * A set of expressions for which the value is unknown. * * The unknowns included depend on the context. See `ExprValue.unknown`. * * @generated from message google.api.expr.v1beta1.UnknownSet */ export type UnknownSet = Message<"google.api.expr.v1beta1.UnknownSet"> & { /** * The ids of the expressions with unknown values. * * @generated from field: repeated google.api.expr.v1beta1.IdRef exprs = 1; */ exprs: IdRef[]; }; ⋮---- /** * The ids of the expressions with unknown values. * * @generated from field: repeated google.api.expr.v1beta1.IdRef exprs = 1; */ ⋮---- /** * Describes the message google.api.expr.v1beta1.UnknownSet. * Use `create(UnknownSetSchema)` to create a new message. */ export const UnknownSetSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * A reference to an expression id. * * @generated from message google.api.expr.v1beta1.IdRef */ export type IdRef = Message<"google.api.expr.v1beta1.IdRef"> & { /** * The expression id. * * @generated from field: int32 id = 1; */ id: number; }; ⋮---- /** * The expression id. * * @generated from field: int32 id = 1; */ ⋮---- /** * Describes the message google.api.expr.v1beta1.IdRef. * Use `create(IdRefSchema)` to create a new message. */ export const IdRefSchema: GenMessage = /*@__PURE__*/ ```` ## File: src/gen/google/api/expr/v1beta1/expr_pb.ts ````typescript // Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // ⋮---- // @generated by protoc-gen-es v2.6.3 with parameter "target=ts" // @generated from file google/api/expr/v1beta1/expr.proto (package google.api.expr.v1beta1, syntax proto3) /* eslint-disable */ ⋮---- import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; import type { SourceInfo } from "./source_pb"; import { file_google_api_expr_v1beta1_source } from "./source_pb"; import type { NullValue } from "@bufbuild/protobuf/wkt"; import { file_google_protobuf_struct } from "@bufbuild/protobuf/wkt"; import type { Message } from "@bufbuild/protobuf"; ⋮---- /** * Describes the file google/api/expr/v1beta1/expr.proto. */ export const file_google_api_expr_v1beta1_expr: GenFile = /*@__PURE__*/ ⋮---- /** * An expression together with source information as returned by the parser. * * @generated from message google.api.expr.v1beta1.ParsedExpr */ export type ParsedExpr = Message<"google.api.expr.v1beta1.ParsedExpr"> & { /** * The parsed expression. * * @generated from field: google.api.expr.v1beta1.Expr expr = 2; */ expr?: Expr; /** * The source info derived from input that generated the parsed `expr`. * * @generated from field: google.api.expr.v1beta1.SourceInfo source_info = 3; */ sourceInfo?: SourceInfo; /** * The syntax version of the source, e.g. `cel1`. * * @generated from field: string syntax_version = 4; */ syntaxVersion: string; }; ⋮---- /** * The parsed expression. * * @generated from field: google.api.expr.v1beta1.Expr expr = 2; */ ⋮---- /** * The source info derived from input that generated the parsed `expr`. * * @generated from field: google.api.expr.v1beta1.SourceInfo source_info = 3; */ ⋮---- /** * The syntax version of the source, e.g. `cel1`. * * @generated from field: string syntax_version = 4; */ ⋮---- /** * Describes the message google.api.expr.v1beta1.ParsedExpr. * Use `create(ParsedExprSchema)` to create a new message. */ export const ParsedExprSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * An abstract representation of a common expression. * * Expressions are abstractly represented as a collection of identifiers, * select statements, function calls, literals, and comprehensions. All * operators with the exception of the '.' operator are modelled as function * calls. This makes it easy to represent new operators into the existing AST. * * All references within expressions must resolve to a [Decl][google.api.expr.v1beta1.Decl] provided at * type-check for an expression to be valid. A reference may either be a bare * identifier `name` or a qualified identifier `google.api.name`. References * may either refer to a value or a function declaration. * * For example, the expression `google.api.name.startsWith('expr')` references * the declaration `google.api.name` within a [Expr.Select][google.api.expr.v1beta1.Expr.Select] expression, and * the function declaration `startsWith`. * * @generated from message google.api.expr.v1beta1.Expr */ export type Expr = Message<"google.api.expr.v1beta1.Expr"> & { /** * Required. An id assigned to this node by the parser which is unique in a * given expression tree. This is used to associate type information and other * attributes to a node in the parse tree. * * @generated from field: int32 id = 2; */ id: number; /** * Required. Variants of expressions. * * @generated from oneof google.api.expr.v1beta1.Expr.expr_kind */ exprKind: { /** * A literal expression. * * @generated from field: google.api.expr.v1beta1.Literal literal_expr = 3; */ value: Literal; case: "literalExpr"; } | { /** * An identifier expression. * * @generated from field: google.api.expr.v1beta1.Expr.Ident ident_expr = 4; */ value: Expr_Ident; case: "identExpr"; } | { /** * A field selection expression, e.g. `request.auth`. * * @generated from field: google.api.expr.v1beta1.Expr.Select select_expr = 5; */ value: Expr_Select; case: "selectExpr"; } | { /** * A call expression, including calls to predefined functions and operators. * * @generated from field: google.api.expr.v1beta1.Expr.Call call_expr = 6; */ value: Expr_Call; case: "callExpr"; } | { /** * A list creation expression. * * @generated from field: google.api.expr.v1beta1.Expr.CreateList list_expr = 7; */ value: Expr_CreateList; case: "listExpr"; } | { /** * A map or object creation expression. * * @generated from field: google.api.expr.v1beta1.Expr.CreateStruct struct_expr = 8; */ value: Expr_CreateStruct; case: "structExpr"; } | { /** * A comprehension expression. * * @generated from field: google.api.expr.v1beta1.Expr.Comprehension comprehension_expr = 9; */ value: Expr_Comprehension; case: "comprehensionExpr"; } | { case: undefined; value?: undefined }; }; ⋮---- /** * Required. An id assigned to this node by the parser which is unique in a * given expression tree. This is used to associate type information and other * attributes to a node in the parse tree. * * @generated from field: int32 id = 2; */ ⋮---- /** * Required. Variants of expressions. * * @generated from oneof google.api.expr.v1beta1.Expr.expr_kind */ ⋮---- /** * A literal expression. * * @generated from field: google.api.expr.v1beta1.Literal literal_expr = 3; */ ⋮---- /** * An identifier expression. * * @generated from field: google.api.expr.v1beta1.Expr.Ident ident_expr = 4; */ ⋮---- /** * A field selection expression, e.g. `request.auth`. * * @generated from field: google.api.expr.v1beta1.Expr.Select select_expr = 5; */ ⋮---- /** * A call expression, including calls to predefined functions and operators. * * @generated from field: google.api.expr.v1beta1.Expr.Call call_expr = 6; */ ⋮---- /** * A list creation expression. * * @generated from field: google.api.expr.v1beta1.Expr.CreateList list_expr = 7; */ ⋮---- /** * A map or object creation expression. * * @generated from field: google.api.expr.v1beta1.Expr.CreateStruct struct_expr = 8; */ ⋮---- /** * A comprehension expression. * * @generated from field: google.api.expr.v1beta1.Expr.Comprehension comprehension_expr = 9; */ ⋮---- /** * Describes the message google.api.expr.v1beta1.Expr. * Use `create(ExprSchema)` to create a new message. */ export const ExprSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * An identifier expression. e.g. `request`. * * @generated from message google.api.expr.v1beta1.Expr.Ident */ export type Expr_Ident = Message<"google.api.expr.v1beta1.Expr.Ident"> & { /** * Required. Holds a single, unqualified identifier, possibly preceded by a * '.'. * * Qualified names are represented by the [Expr.Select][google.api.expr.v1beta1.Expr.Select] expression. * * @generated from field: string name = 1; */ name: string; }; ⋮---- /** * Required. Holds a single, unqualified identifier, possibly preceded by a * '.'. * * Qualified names are represented by the [Expr.Select][google.api.expr.v1beta1.Expr.Select] expression. * * @generated from field: string name = 1; */ ⋮---- /** * Describes the message google.api.expr.v1beta1.Expr.Ident. * Use `create(Expr_IdentSchema)` to create a new message. */ export const Expr_IdentSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * A field selection expression. e.g. `request.auth`. * * @generated from message google.api.expr.v1beta1.Expr.Select */ export type Expr_Select = Message<"google.api.expr.v1beta1.Expr.Select"> & { /** * Required. The target of the selection expression. * * For example, in the select expression `request.auth`, the `request` * portion of the expression is the `operand`. * * @generated from field: google.api.expr.v1beta1.Expr operand = 1; */ operand?: Expr; /** * Required. The name of the field to select. * * For example, in the select expression `request.auth`, the `auth` portion * of the expression would be the `field`. * * @generated from field: string field = 2; */ field: string; /** * Whether the select is to be interpreted as a field presence test. * * This results from the macro `has(request.auth)`. * * @generated from field: bool test_only = 3; */ testOnly: boolean; }; ⋮---- /** * Required. The target of the selection expression. * * For example, in the select expression `request.auth`, the `request` * portion of the expression is the `operand`. * * @generated from field: google.api.expr.v1beta1.Expr operand = 1; */ ⋮---- /** * Required. The name of the field to select. * * For example, in the select expression `request.auth`, the `auth` portion * of the expression would be the `field`. * * @generated from field: string field = 2; */ ⋮---- /** * Whether the select is to be interpreted as a field presence test. * * This results from the macro `has(request.auth)`. * * @generated from field: bool test_only = 3; */ ⋮---- /** * Describes the message google.api.expr.v1beta1.Expr.Select. * Use `create(Expr_SelectSchema)` to create a new message. */ export const Expr_SelectSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * A call expression, including calls to predefined functions and operators. * * For example, `value == 10`, `size(map_value)`. * * @generated from message google.api.expr.v1beta1.Expr.Call */ export type Expr_Call = Message<"google.api.expr.v1beta1.Expr.Call"> & { /** * The target of an method call-style expression. For example, `x` in * `x.f()`. * * @generated from field: google.api.expr.v1beta1.Expr target = 1; */ target?: Expr; /** * Required. The name of the function or method being called. * * @generated from field: string function = 2; */ function: string; /** * The arguments. * * @generated from field: repeated google.api.expr.v1beta1.Expr args = 3; */ args: Expr[]; }; ⋮---- /** * The target of an method call-style expression. For example, `x` in * `x.f()`. * * @generated from field: google.api.expr.v1beta1.Expr target = 1; */ ⋮---- /** * Required. The name of the function or method being called. * * @generated from field: string function = 2; */ ⋮---- /** * The arguments. * * @generated from field: repeated google.api.expr.v1beta1.Expr args = 3; */ ⋮---- /** * Describes the message google.api.expr.v1beta1.Expr.Call. * Use `create(Expr_CallSchema)` to create a new message. */ export const Expr_CallSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * A list creation expression. * * Lists may either be homogenous, e.g. `[1, 2, 3]`, or heterogenous, e.g. * `dyn([1, 'hello', 2.0])` * * @generated from message google.api.expr.v1beta1.Expr.CreateList */ export type Expr_CreateList = Message<"google.api.expr.v1beta1.Expr.CreateList"> & { /** * The elements part of the list. * * @generated from field: repeated google.api.expr.v1beta1.Expr elements = 1; */ elements: Expr[]; }; ⋮---- /** * The elements part of the list. * * @generated from field: repeated google.api.expr.v1beta1.Expr elements = 1; */ ⋮---- /** * Describes the message google.api.expr.v1beta1.Expr.CreateList. * Use `create(Expr_CreateListSchema)` to create a new message. */ export const Expr_CreateListSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * A map or message creation expression. * * Maps are constructed as `{'key_name': 'value'}`. Message construction is * similar, but prefixed with a type name and composed of field ids: * `types.MyType{field_id: 'value'}`. * * @generated from message google.api.expr.v1beta1.Expr.CreateStruct */ export type Expr_CreateStruct = Message<"google.api.expr.v1beta1.Expr.CreateStruct"> & { /** * The type name of the message to be created, empty when creating map * literals. * * @generated from field: string type = 1; */ type: string; /** * The entries in the creation expression. * * @generated from field: repeated google.api.expr.v1beta1.Expr.CreateStruct.Entry entries = 2; */ entries: Expr_CreateStruct_Entry[]; }; ⋮---- /** * The type name of the message to be created, empty when creating map * literals. * * @generated from field: string type = 1; */ ⋮---- /** * The entries in the creation expression. * * @generated from field: repeated google.api.expr.v1beta1.Expr.CreateStruct.Entry entries = 2; */ ⋮---- /** * Describes the message google.api.expr.v1beta1.Expr.CreateStruct. * Use `create(Expr_CreateStructSchema)` to create a new message. */ export const Expr_CreateStructSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Represents an entry. * * @generated from message google.api.expr.v1beta1.Expr.CreateStruct.Entry */ export type Expr_CreateStruct_Entry = Message<"google.api.expr.v1beta1.Expr.CreateStruct.Entry"> & { /** * Required. An id assigned to this node by the parser which is unique * in a given expression tree. This is used to associate type * information and other attributes to the node. * * @generated from field: int32 id = 1; */ id: number; /** * The `Entry` key kinds. * * @generated from oneof google.api.expr.v1beta1.Expr.CreateStruct.Entry.key_kind */ keyKind: { /** * The field key for a message creator statement. * * @generated from field: string field_key = 2; */ value: string; case: "fieldKey"; } | { /** * The key expression for a map creation statement. * * @generated from field: google.api.expr.v1beta1.Expr map_key = 3; */ value: Expr; case: "mapKey"; } | { case: undefined; value?: undefined }; /** * Required. The value assigned to the key. * * @generated from field: google.api.expr.v1beta1.Expr value = 4; */ value?: Expr; }; ⋮---- /** * Required. An id assigned to this node by the parser which is unique * in a given expression tree. This is used to associate type * information and other attributes to the node. * * @generated from field: int32 id = 1; */ ⋮---- /** * The `Entry` key kinds. * * @generated from oneof google.api.expr.v1beta1.Expr.CreateStruct.Entry.key_kind */ ⋮---- /** * The field key for a message creator statement. * * @generated from field: string field_key = 2; */ ⋮---- /** * The key expression for a map creation statement. * * @generated from field: google.api.expr.v1beta1.Expr map_key = 3; */ ⋮---- /** * Required. The value assigned to the key. * * @generated from field: google.api.expr.v1beta1.Expr value = 4; */ ⋮---- /** * Describes the message google.api.expr.v1beta1.Expr.CreateStruct.Entry. * Use `create(Expr_CreateStruct_EntrySchema)` to create a new message. */ export const Expr_CreateStruct_EntrySchema: GenMessage = /*@__PURE__*/ ⋮---- /** * A comprehension expression applied to a list or map. * * Comprehensions are not part of the core syntax, but enabled with macros. * A macro matches a specific call signature within a parsed AST and replaces * the call with an alternate AST block. Macro expansion happens at parse * time. * * The following macros are supported within CEL: * * Aggregate type macros may be applied to all elements in a list or all keys * in a map: * * * `all`, `exists`, `exists_one` - test a predicate expression against * the inputs and return `true` if the predicate is satisfied for all, * any, or only one value `list.all(x, x < 10)`. * * `filter` - test a predicate expression against the inputs and return * the subset of elements which satisfy the predicate: * `payments.filter(p, p > 1000)`. * * `map` - apply an expression to all elements in the input and return the * output aggregate type: `[1, 2, 3].map(i, i * i)`. * * The `has(m.x)` macro tests whether the property `x` is present in struct * `m`. The semantics of this macro depend on the type of `m`. For proto2 * messages `has(m.x)` is defined as 'defined, but not set`. For proto3, the * macro tests whether the property is set to its default. For map and struct * types, the macro tests whether the property `x` is defined on `m`. * * @generated from message google.api.expr.v1beta1.Expr.Comprehension */ export type Expr_Comprehension = Message<"google.api.expr.v1beta1.Expr.Comprehension"> & { /** * The name of the iteration variable. * * @generated from field: string iter_var = 1; */ iterVar: string; /** * The range over which var iterates. * * @generated from field: google.api.expr.v1beta1.Expr iter_range = 2; */ iterRange?: Expr; /** * The name of the variable used for accumulation of the result. * * @generated from field: string accu_var = 3; */ accuVar: string; /** * The initial value of the accumulator. * * @generated from field: google.api.expr.v1beta1.Expr accu_init = 4; */ accuInit?: Expr; /** * An expression which can contain iter_var and accu_var. * * Returns false when the result has been computed and may be used as * a hint to short-circuit the remainder of the comprehension. * * @generated from field: google.api.expr.v1beta1.Expr loop_condition = 5; */ loopCondition?: Expr; /** * An expression which can contain iter_var and accu_var. * * Computes the next value of accu_var. * * @generated from field: google.api.expr.v1beta1.Expr loop_step = 6; */ loopStep?: Expr; /** * An expression which can contain accu_var. * * Computes the result. * * @generated from field: google.api.expr.v1beta1.Expr result = 7; */ result?: Expr; }; ⋮---- /** * The name of the iteration variable. * * @generated from field: string iter_var = 1; */ ⋮---- /** * The range over which var iterates. * * @generated from field: google.api.expr.v1beta1.Expr iter_range = 2; */ ⋮---- /** * The name of the variable used for accumulation of the result. * * @generated from field: string accu_var = 3; */ ⋮---- /** * The initial value of the accumulator. * * @generated from field: google.api.expr.v1beta1.Expr accu_init = 4; */ ⋮---- /** * An expression which can contain iter_var and accu_var. * * Returns false when the result has been computed and may be used as * a hint to short-circuit the remainder of the comprehension. * * @generated from field: google.api.expr.v1beta1.Expr loop_condition = 5; */ ⋮---- /** * An expression which can contain iter_var and accu_var. * * Computes the next value of accu_var. * * @generated from field: google.api.expr.v1beta1.Expr loop_step = 6; */ ⋮---- /** * An expression which can contain accu_var. * * Computes the result. * * @generated from field: google.api.expr.v1beta1.Expr result = 7; */ ⋮---- /** * Describes the message google.api.expr.v1beta1.Expr.Comprehension. * Use `create(Expr_ComprehensionSchema)` to create a new message. */ export const Expr_ComprehensionSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Represents a primitive literal. * * This is similar to the primitives supported in the well-known type * `google.protobuf.Value`, but richer so it can represent CEL's full range of * primitives. * * Lists and structs are not included as constants as these aggregate types may * contain [Expr][google.api.expr.v1beta1.Expr] elements which require evaluation and are thus not constant. * * Examples of literals include: `"hello"`, `b'bytes'`, `1u`, `4.2`, `-2`, * `true`, `null`. * * @generated from message google.api.expr.v1beta1.Literal */ export type Literal = Message<"google.api.expr.v1beta1.Literal"> & { /** * Required. The valid constant kinds. * * @generated from oneof google.api.expr.v1beta1.Literal.constant_kind */ constantKind: { /** * null value. * * @generated from field: google.protobuf.NullValue null_value = 1; */ value: NullValue; case: "nullValue"; } | { /** * boolean value. * * @generated from field: bool bool_value = 2; */ value: boolean; case: "boolValue"; } | { /** * int64 value. * * @generated from field: int64 int64_value = 3; */ value: bigint; case: "int64Value"; } | { /** * uint64 value. * * @generated from field: uint64 uint64_value = 4; */ value: bigint; case: "uint64Value"; } | { /** * double value. * * @generated from field: double double_value = 5; */ value: number; case: "doubleValue"; } | { /** * string value. * * @generated from field: string string_value = 6; */ value: string; case: "stringValue"; } | { /** * bytes value. * * @generated from field: bytes bytes_value = 7; */ value: Uint8Array; case: "bytesValue"; } | { case: undefined; value?: undefined }; }; ⋮---- /** * Required. The valid constant kinds. * * @generated from oneof google.api.expr.v1beta1.Literal.constant_kind */ ⋮---- /** * null value. * * @generated from field: google.protobuf.NullValue null_value = 1; */ ⋮---- /** * boolean value. * * @generated from field: bool bool_value = 2; */ ⋮---- /** * int64 value. * * @generated from field: int64 int64_value = 3; */ ⋮---- /** * uint64 value. * * @generated from field: uint64 uint64_value = 4; */ ⋮---- /** * double value. * * @generated from field: double double_value = 5; */ ⋮---- /** * string value. * * @generated from field: string string_value = 6; */ ⋮---- /** * bytes value. * * @generated from field: bytes bytes_value = 7; */ ⋮---- /** * Describes the message google.api.expr.v1beta1.Literal. * Use `create(LiteralSchema)` to create a new message. */ export const LiteralSchema: GenMessage = /*@__PURE__*/ ```` ## File: src/gen/google/api/expr/v1beta1/source_pb.ts ````typescript // Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // ⋮---- // @generated by protoc-gen-es v2.6.3 with parameter "target=ts" // @generated from file google/api/expr/v1beta1/source.proto (package google.api.expr.v1beta1, syntax proto3) /* eslint-disable */ ⋮---- import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; import type { Message } from "@bufbuild/protobuf"; ⋮---- /** * Describes the file google/api/expr/v1beta1/source.proto. */ export const file_google_api_expr_v1beta1_source: GenFile = /*@__PURE__*/ ⋮---- /** * Source information collected at parse time. * * @generated from message google.api.expr.v1beta1.SourceInfo */ export type SourceInfo = Message<"google.api.expr.v1beta1.SourceInfo"> & { /** * The location name. All position information attached to an expression is * relative to this location. * * The location could be a file, UI element, or similar. For example, * `acme/app/AnvilPolicy.cel`. * * @generated from field: string location = 2; */ location: string; /** * Monotonically increasing list of character offsets where newlines appear. * * The line number of a given position is the index `i` where for a given * `id` the `line_offsets[i] < id_positions[id] < line_offsets[i+1]`. The * column may be derivd from `id_positions[id] - line_offsets[i]`. * * @generated from field: repeated int32 line_offsets = 3; */ lineOffsets: number[]; /** * A map from the parse node id (e.g. `Expr.id`) to the character offset * within source. * * @generated from field: map positions = 4; */ positions: { [key: number]: number }; }; ⋮---- /** * The location name. All position information attached to an expression is * relative to this location. * * The location could be a file, UI element, or similar. For example, * `acme/app/AnvilPolicy.cel`. * * @generated from field: string location = 2; */ ⋮---- /** * Monotonically increasing list of character offsets where newlines appear. * * The line number of a given position is the index `i` where for a given * `id` the `line_offsets[i] < id_positions[id] < line_offsets[i+1]`. The * column may be derivd from `id_positions[id] - line_offsets[i]`. * * @generated from field: repeated int32 line_offsets = 3; */ ⋮---- /** * A map from the parse node id (e.g. `Expr.id`) to the character offset * within source. * * @generated from field: map positions = 4; */ ⋮---- /** * Describes the message google.api.expr.v1beta1.SourceInfo. * Use `create(SourceInfoSchema)` to create a new message. */ export const SourceInfoSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * A specific position in source. * * @generated from message google.api.expr.v1beta1.SourcePosition */ export type SourcePosition = Message<"google.api.expr.v1beta1.SourcePosition"> & { /** * The soucre location name (e.g. file name). * * @generated from field: string location = 1; */ location: string; /** * The character offset. * * @generated from field: int32 offset = 2; */ offset: number; /** * The 1-based index of the starting line in the source text * where the issue occurs, or 0 if unknown. * * @generated from field: int32 line = 3; */ line: number; /** * The 0-based index of the starting position within the line of source text * where the issue occurs. Only meaningful if line is nonzer.. * * @generated from field: int32 column = 4; */ column: number; }; ⋮---- /** * The soucre location name (e.g. file name). * * @generated from field: string location = 1; */ ⋮---- /** * The character offset. * * @generated from field: int32 offset = 2; */ ⋮---- /** * The 1-based index of the starting line in the source text * where the issue occurs, or 0 if unknown. * * @generated from field: int32 line = 3; */ ⋮---- /** * The 0-based index of the starting position within the line of source text * where the issue occurs. Only meaningful if line is nonzer.. * * @generated from field: int32 column = 4; */ ⋮---- /** * Describes the message google.api.expr.v1beta1.SourcePosition. * Use `create(SourcePositionSchema)` to create a new message. */ export const SourcePositionSchema: GenMessage = /*@__PURE__*/ ```` ## File: src/gen/google/api/expr/v1beta1/value_pb.ts ````typescript // Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // ⋮---- // @generated by protoc-gen-es v2.6.3 with parameter "target=ts" // @generated from file google/api/expr/v1beta1/value.proto (package google.api.expr.v1beta1, syntax proto3) /* eslint-disable */ ⋮---- import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; import type { Any, NullValue } from "@bufbuild/protobuf/wkt"; import { file_google_protobuf_any, file_google_protobuf_struct } from "@bufbuild/protobuf/wkt"; import type { Message } from "@bufbuild/protobuf"; ⋮---- /** * Describes the file google/api/expr/v1beta1/value.proto. */ export const file_google_api_expr_v1beta1_value: GenFile = /*@__PURE__*/ ⋮---- /** * Represents a CEL value. * * This is similar to `google.protobuf.Value`, but can represent CEL's full * range of values. * * @generated from message google.api.expr.v1beta1.Value */ export type Value = Message<"google.api.expr.v1beta1.Value"> & { /** * Required. The valid kinds of values. * * @generated from oneof google.api.expr.v1beta1.Value.kind */ kind: { /** * Null value. * * @generated from field: google.protobuf.NullValue null_value = 1; */ value: NullValue; case: "nullValue"; } | { /** * Boolean value. * * @generated from field: bool bool_value = 2; */ value: boolean; case: "boolValue"; } | { /** * Signed integer value. * * @generated from field: int64 int64_value = 3; */ value: bigint; case: "int64Value"; } | { /** * Unsigned integer value. * * @generated from field: uint64 uint64_value = 4; */ value: bigint; case: "uint64Value"; } | { /** * Floating point value. * * @generated from field: double double_value = 5; */ value: number; case: "doubleValue"; } | { /** * UTF-8 string value. * * @generated from field: string string_value = 6; */ value: string; case: "stringValue"; } | { /** * Byte string value. * * @generated from field: bytes bytes_value = 7; */ value: Uint8Array; case: "bytesValue"; } | { /** * An enum value. * * @generated from field: google.api.expr.v1beta1.EnumValue enum_value = 9; */ value: EnumValue; case: "enumValue"; } | { /** * The proto message backing an object value. * * @generated from field: google.protobuf.Any object_value = 10; */ value: Any; case: "objectValue"; } | { /** * Map value. * * @generated from field: google.api.expr.v1beta1.MapValue map_value = 11; */ value: MapValue; case: "mapValue"; } | { /** * List value. * * @generated from field: google.api.expr.v1beta1.ListValue list_value = 12; */ value: ListValue; case: "listValue"; } | { /** * A Type value represented by the fully qualified name of the type. * * @generated from field: string type_value = 15; */ value: string; case: "typeValue"; } | { case: undefined; value?: undefined }; }; ⋮---- /** * Required. The valid kinds of values. * * @generated from oneof google.api.expr.v1beta1.Value.kind */ ⋮---- /** * Null value. * * @generated from field: google.protobuf.NullValue null_value = 1; */ ⋮---- /** * Boolean value. * * @generated from field: bool bool_value = 2; */ ⋮---- /** * Signed integer value. * * @generated from field: int64 int64_value = 3; */ ⋮---- /** * Unsigned integer value. * * @generated from field: uint64 uint64_value = 4; */ ⋮---- /** * Floating point value. * * @generated from field: double double_value = 5; */ ⋮---- /** * UTF-8 string value. * * @generated from field: string string_value = 6; */ ⋮---- /** * Byte string value. * * @generated from field: bytes bytes_value = 7; */ ⋮---- /** * An enum value. * * @generated from field: google.api.expr.v1beta1.EnumValue enum_value = 9; */ ⋮---- /** * The proto message backing an object value. * * @generated from field: google.protobuf.Any object_value = 10; */ ⋮---- /** * Map value. * * @generated from field: google.api.expr.v1beta1.MapValue map_value = 11; */ ⋮---- /** * List value. * * @generated from field: google.api.expr.v1beta1.ListValue list_value = 12; */ ⋮---- /** * A Type value represented by the fully qualified name of the type. * * @generated from field: string type_value = 15; */ ⋮---- /** * Describes the message google.api.expr.v1beta1.Value. * Use `create(ValueSchema)` to create a new message. */ export const ValueSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * An enum value. * * @generated from message google.api.expr.v1beta1.EnumValue */ export type EnumValue = Message<"google.api.expr.v1beta1.EnumValue"> & { /** * The fully qualified name of the enum type. * * @generated from field: string type = 1; */ type: string; /** * The value of the enum. * * @generated from field: int32 value = 2; */ value: number; }; ⋮---- /** * The fully qualified name of the enum type. * * @generated from field: string type = 1; */ ⋮---- /** * The value of the enum. * * @generated from field: int32 value = 2; */ ⋮---- /** * Describes the message google.api.expr.v1beta1.EnumValue. * Use `create(EnumValueSchema)` to create a new message. */ export const EnumValueSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * A list. * * Wrapped in a message so 'not set' and empty can be differentiated, which is * required for use in a 'oneof'. * * @generated from message google.api.expr.v1beta1.ListValue */ export type ListValue = Message<"google.api.expr.v1beta1.ListValue"> & { /** * The ordered values in the list. * * @generated from field: repeated google.api.expr.v1beta1.Value values = 1; */ values: Value[]; }; ⋮---- /** * The ordered values in the list. * * @generated from field: repeated google.api.expr.v1beta1.Value values = 1; */ ⋮---- /** * Describes the message google.api.expr.v1beta1.ListValue. * Use `create(ListValueSchema)` to create a new message. */ export const ListValueSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * A map. * * Wrapped in a message so 'not set' and empty can be differentiated, which is * required for use in a 'oneof'. * * @generated from message google.api.expr.v1beta1.MapValue */ export type MapValue = Message<"google.api.expr.v1beta1.MapValue"> & { /** * The set of map entries. * * CEL has fewer restrictions on keys, so a protobuf map represenation * cannot be used. * * @generated from field: repeated google.api.expr.v1beta1.MapValue.Entry entries = 1; */ entries: MapValue_Entry[]; }; ⋮---- /** * The set of map entries. * * CEL has fewer restrictions on keys, so a protobuf map represenation * cannot be used. * * @generated from field: repeated google.api.expr.v1beta1.MapValue.Entry entries = 1; */ ⋮---- /** * Describes the message google.api.expr.v1beta1.MapValue. * Use `create(MapValueSchema)` to create a new message. */ export const MapValueSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * An entry in the map. * * @generated from message google.api.expr.v1beta1.MapValue.Entry */ export type MapValue_Entry = Message<"google.api.expr.v1beta1.MapValue.Entry"> & { /** * The key. * * Must be unique with in the map. * Currently only boolean, int, uint, and string values can be keys. * * @generated from field: google.api.expr.v1beta1.Value key = 1; */ key?: Value; /** * The value. * * @generated from field: google.api.expr.v1beta1.Value value = 2; */ value?: Value; }; ⋮---- /** * The key. * * Must be unique with in the map. * Currently only boolean, int, uint, and string values can be keys. * * @generated from field: google.api.expr.v1beta1.Value key = 1; */ ⋮---- /** * The value. * * @generated from field: google.api.expr.v1beta1.Value value = 2; */ ⋮---- /** * Describes the message google.api.expr.v1beta1.MapValue.Entry. * Use `create(MapValue_EntrySchema)` to create a new message. */ export const MapValue_EntrySchema: GenMessage = /*@__PURE__*/ ```` ## File: src/gen/google/api/annotations_pb.ts ````typescript // Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. ⋮---- // @generated by protoc-gen-es v2.6.3 with parameter "target=ts" // @generated from file google/api/annotations.proto (package google.api, syntax proto3) /* eslint-disable */ ⋮---- import type { GenExtension, GenFile } from "@bufbuild/protobuf/codegenv2"; import { extDesc, fileDesc } from "@bufbuild/protobuf/codegenv2"; import type { HttpRule } from "./http_pb"; import { file_google_api_http } from "./http_pb"; import type { MethodOptions } from "@bufbuild/protobuf/wkt"; import { file_google_protobuf_descriptor } from "@bufbuild/protobuf/wkt"; ⋮---- /** * Describes the file google/api/annotations.proto. */ export const file_google_api_annotations: GenFile = /*@__PURE__*/ ⋮---- /** * See `HttpRule`. * * @generated from extension: google.api.HttpRule http = 72295728; */ export const http: GenExtension = /*@__PURE__*/ ```` ## File: src/gen/google/api/client_pb.ts ````typescript // Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. ⋮---- // @generated by protoc-gen-es v2.6.3 with parameter "target=ts" // @generated from file google/api/client.proto (package google.api, syntax proto3) /* eslint-disable */ ⋮---- import type { GenEnum, GenExtension, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; import { enumDesc, extDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; import type { LaunchStage } from "./launch_stage_pb"; import { file_google_api_launch_stage } from "./launch_stage_pb"; import type { Duration, MethodOptions, ServiceOptions } from "@bufbuild/protobuf/wkt"; import { file_google_protobuf_descriptor, file_google_protobuf_duration } from "@bufbuild/protobuf/wkt"; import type { Message } from "@bufbuild/protobuf"; ⋮---- /** * Describes the file google/api/client.proto. */ export const file_google_api_client: GenFile = /*@__PURE__*/ ⋮---- /** * Required information for every language. * * @generated from message google.api.CommonLanguageSettings */ export type CommonLanguageSettings = Message<"google.api.CommonLanguageSettings"> & { /** * Link to automatically generated reference documentation. Example: * https://cloud.google.com/nodejs/docs/reference/asset/latest * * @generated from field: string reference_docs_uri = 1 [deprecated = true]; * @deprecated */ referenceDocsUri: string; /** * The destination where API teams want this client library to be published. * * @generated from field: repeated google.api.ClientLibraryDestination destinations = 2; */ destinations: ClientLibraryDestination[]; /** * Configuration for which RPCs should be generated in the GAPIC client. * * @generated from field: google.api.SelectiveGapicGeneration selective_gapic_generation = 3; */ selectiveGapicGeneration?: SelectiveGapicGeneration; }; ⋮---- /** * Link to automatically generated reference documentation. Example: * https://cloud.google.com/nodejs/docs/reference/asset/latest * * @generated from field: string reference_docs_uri = 1 [deprecated = true]; * @deprecated */ ⋮---- /** * The destination where API teams want this client library to be published. * * @generated from field: repeated google.api.ClientLibraryDestination destinations = 2; */ ⋮---- /** * Configuration for which RPCs should be generated in the GAPIC client. * * @generated from field: google.api.SelectiveGapicGeneration selective_gapic_generation = 3; */ ⋮---- /** * Describes the message google.api.CommonLanguageSettings. * Use `create(CommonLanguageSettingsSchema)` to create a new message. */ export const CommonLanguageSettingsSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Details about how and where to publish client libraries. * * @generated from message google.api.ClientLibrarySettings */ export type ClientLibrarySettings = Message<"google.api.ClientLibrarySettings"> & { /** * Version of the API to apply these settings to. This is the full protobuf * package for the API, ending in the version element. * Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". * * @generated from field: string version = 1; */ version: string; /** * Launch stage of this version of the API. * * @generated from field: google.api.LaunchStage launch_stage = 2; */ launchStage: LaunchStage; /** * When using transport=rest, the client request will encode enums as * numbers rather than strings. * * @generated from field: bool rest_numeric_enums = 3; */ restNumericEnums: boolean; /** * Settings for legacy Java features, supported in the Service YAML. * * @generated from field: google.api.JavaSettings java_settings = 21; */ javaSettings?: JavaSettings; /** * Settings for C++ client libraries. * * @generated from field: google.api.CppSettings cpp_settings = 22; */ cppSettings?: CppSettings; /** * Settings for PHP client libraries. * * @generated from field: google.api.PhpSettings php_settings = 23; */ phpSettings?: PhpSettings; /** * Settings for Python client libraries. * * @generated from field: google.api.PythonSettings python_settings = 24; */ pythonSettings?: PythonSettings; /** * Settings for Node client libraries. * * @generated from field: google.api.NodeSettings node_settings = 25; */ nodeSettings?: NodeSettings; /** * Settings for .NET client libraries. * * @generated from field: google.api.DotnetSettings dotnet_settings = 26; */ dotnetSettings?: DotnetSettings; /** * Settings for Ruby client libraries. * * @generated from field: google.api.RubySettings ruby_settings = 27; */ rubySettings?: RubySettings; /** * Settings for Go client libraries. * * @generated from field: google.api.GoSettings go_settings = 28; */ goSettings?: GoSettings; }; ⋮---- /** * Version of the API to apply these settings to. This is the full protobuf * package for the API, ending in the version element. * Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". * * @generated from field: string version = 1; */ ⋮---- /** * Launch stage of this version of the API. * * @generated from field: google.api.LaunchStage launch_stage = 2; */ ⋮---- /** * When using transport=rest, the client request will encode enums as * numbers rather than strings. * * @generated from field: bool rest_numeric_enums = 3; */ ⋮---- /** * Settings for legacy Java features, supported in the Service YAML. * * @generated from field: google.api.JavaSettings java_settings = 21; */ ⋮---- /** * Settings for C++ client libraries. * * @generated from field: google.api.CppSettings cpp_settings = 22; */ ⋮---- /** * Settings for PHP client libraries. * * @generated from field: google.api.PhpSettings php_settings = 23; */ ⋮---- /** * Settings for Python client libraries. * * @generated from field: google.api.PythonSettings python_settings = 24; */ ⋮---- /** * Settings for Node client libraries. * * @generated from field: google.api.NodeSettings node_settings = 25; */ ⋮---- /** * Settings for .NET client libraries. * * @generated from field: google.api.DotnetSettings dotnet_settings = 26; */ ⋮---- /** * Settings for Ruby client libraries. * * @generated from field: google.api.RubySettings ruby_settings = 27; */ ⋮---- /** * Settings for Go client libraries. * * @generated from field: google.api.GoSettings go_settings = 28; */ ⋮---- /** * Describes the message google.api.ClientLibrarySettings. * Use `create(ClientLibrarySettingsSchema)` to create a new message. */ export const ClientLibrarySettingsSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * This message configures the settings for publishing [Google Cloud Client * libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) * generated from the service config. * * @generated from message google.api.Publishing */ export type Publishing = Message<"google.api.Publishing"> & { /** * A list of API method settings, e.g. the behavior for methods that use the * long-running operation pattern. * * @generated from field: repeated google.api.MethodSettings method_settings = 2; */ methodSettings: MethodSettings[]; /** * Link to a *public* URI where users can report issues. Example: * https://issuetracker.google.com/issues/new?component=190865&template=1161103 * * @generated from field: string new_issue_uri = 101; */ newIssueUri: string; /** * Link to product home page. Example: * https://cloud.google.com/asset-inventory/docs/overview * * @generated from field: string documentation_uri = 102; */ documentationUri: string; /** * Used as a tracking tag when collecting data about the APIs developer * relations artifacts like docs, packages delivered to package managers, * etc. Example: "speech". * * @generated from field: string api_short_name = 103; */ apiShortName: string; /** * GitHub label to apply to issues and pull requests opened for this API. * * @generated from field: string github_label = 104; */ githubLabel: string; /** * GitHub teams to be added to CODEOWNERS in the directory in GitHub * containing source code for the client libraries for this API. * * @generated from field: repeated string codeowner_github_teams = 105; */ codeownerGithubTeams: string[]; /** * A prefix used in sample code when demarking regions to be included in * documentation. * * @generated from field: string doc_tag_prefix = 106; */ docTagPrefix: string; /** * For whom the client library is being published. * * @generated from field: google.api.ClientLibraryOrganization organization = 107; */ organization: ClientLibraryOrganization; /** * Client library settings. If the same version string appears multiple * times in this list, then the last one wins. Settings from earlier * settings with the same version string are discarded. * * @generated from field: repeated google.api.ClientLibrarySettings library_settings = 109; */ librarySettings: ClientLibrarySettings[]; /** * Optional link to proto reference documentation. Example: * https://cloud.google.com/pubsub/lite/docs/reference/rpc * * @generated from field: string proto_reference_documentation_uri = 110; */ protoReferenceDocumentationUri: string; /** * Optional link to REST reference documentation. Example: * https://cloud.google.com/pubsub/lite/docs/reference/rest * * @generated from field: string rest_reference_documentation_uri = 111; */ restReferenceDocumentationUri: string; }; ⋮---- /** * A list of API method settings, e.g. the behavior for methods that use the * long-running operation pattern. * * @generated from field: repeated google.api.MethodSettings method_settings = 2; */ ⋮---- /** * Link to a *public* URI where users can report issues. Example: * https://issuetracker.google.com/issues/new?component=190865&template=1161103 * * @generated from field: string new_issue_uri = 101; */ ⋮---- /** * Link to product home page. Example: * https://cloud.google.com/asset-inventory/docs/overview * * @generated from field: string documentation_uri = 102; */ ⋮---- /** * Used as a tracking tag when collecting data about the APIs developer * relations artifacts like docs, packages delivered to package managers, * etc. Example: "speech". * * @generated from field: string api_short_name = 103; */ ⋮---- /** * GitHub label to apply to issues and pull requests opened for this API. * * @generated from field: string github_label = 104; */ ⋮---- /** * GitHub teams to be added to CODEOWNERS in the directory in GitHub * containing source code for the client libraries for this API. * * @generated from field: repeated string codeowner_github_teams = 105; */ ⋮---- /** * A prefix used in sample code when demarking regions to be included in * documentation. * * @generated from field: string doc_tag_prefix = 106; */ ⋮---- /** * For whom the client library is being published. * * @generated from field: google.api.ClientLibraryOrganization organization = 107; */ ⋮---- /** * Client library settings. If the same version string appears multiple * times in this list, then the last one wins. Settings from earlier * settings with the same version string are discarded. * * @generated from field: repeated google.api.ClientLibrarySettings library_settings = 109; */ ⋮---- /** * Optional link to proto reference documentation. Example: * https://cloud.google.com/pubsub/lite/docs/reference/rpc * * @generated from field: string proto_reference_documentation_uri = 110; */ ⋮---- /** * Optional link to REST reference documentation. Example: * https://cloud.google.com/pubsub/lite/docs/reference/rest * * @generated from field: string rest_reference_documentation_uri = 111; */ ⋮---- /** * Describes the message google.api.Publishing. * Use `create(PublishingSchema)` to create a new message. */ export const PublishingSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Settings for Java client libraries. * * @generated from message google.api.JavaSettings */ export type JavaSettings = Message<"google.api.JavaSettings"> & { /** * The package name to use in Java. Clobbers the java_package option * set in the protobuf. This should be used **only** by APIs * who have already set the language_settings.java.package_name" field * in gapic.yaml. API teams should use the protobuf java_package option * where possible. * * Example of a YAML configuration:: * * publishing: * java_settings: * library_package: com.google.cloud.pubsub.v1 * * @generated from field: string library_package = 1; */ libraryPackage: string; /** * Configure the Java class name to use instead of the service's for its * corresponding generated GAPIC client. Keys are fully-qualified * service names as they appear in the protobuf (including the full * the language_settings.java.interface_names" field in gapic.yaml. API * teams should otherwise use the service name as it appears in the * protobuf. * * Example of a YAML configuration:: * * publishing: * java_settings: * service_class_names: * - google.pubsub.v1.Publisher: TopicAdmin * - google.pubsub.v1.Subscriber: SubscriptionAdmin * * @generated from field: map service_class_names = 2; */ serviceClassNames: { [key: string]: string }; /** * Some settings. * * @generated from field: google.api.CommonLanguageSettings common = 3; */ common?: CommonLanguageSettings; }; ⋮---- /** * The package name to use in Java. Clobbers the java_package option * set in the protobuf. This should be used **only** by APIs * who have already set the language_settings.java.package_name" field * in gapic.yaml. API teams should use the protobuf java_package option * where possible. * * Example of a YAML configuration:: * * publishing: * java_settings: * library_package: com.google.cloud.pubsub.v1 * * @generated from field: string library_package = 1; */ ⋮---- /** * Configure the Java class name to use instead of the service's for its * corresponding generated GAPIC client. Keys are fully-qualified * service names as they appear in the protobuf (including the full * the language_settings.java.interface_names" field in gapic.yaml. API * teams should otherwise use the service name as it appears in the * protobuf. * * Example of a YAML configuration:: * * publishing: * java_settings: * service_class_names: * - google.pubsub.v1.Publisher: TopicAdmin * - google.pubsub.v1.Subscriber: SubscriptionAdmin * * @generated from field: map service_class_names = 2; */ ⋮---- /** * Some settings. * * @generated from field: google.api.CommonLanguageSettings common = 3; */ ⋮---- /** * Describes the message google.api.JavaSettings. * Use `create(JavaSettingsSchema)` to create a new message. */ export const JavaSettingsSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Settings for C++ client libraries. * * @generated from message google.api.CppSettings */ export type CppSettings = Message<"google.api.CppSettings"> & { /** * Some settings. * * @generated from field: google.api.CommonLanguageSettings common = 1; */ common?: CommonLanguageSettings; }; ⋮---- /** * Some settings. * * @generated from field: google.api.CommonLanguageSettings common = 1; */ ⋮---- /** * Describes the message google.api.CppSettings. * Use `create(CppSettingsSchema)` to create a new message. */ export const CppSettingsSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Settings for Php client libraries. * * @generated from message google.api.PhpSettings */ export type PhpSettings = Message<"google.api.PhpSettings"> & { /** * Some settings. * * @generated from field: google.api.CommonLanguageSettings common = 1; */ common?: CommonLanguageSettings; }; ⋮---- /** * Some settings. * * @generated from field: google.api.CommonLanguageSettings common = 1; */ ⋮---- /** * Describes the message google.api.PhpSettings. * Use `create(PhpSettingsSchema)` to create a new message. */ export const PhpSettingsSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Settings for Python client libraries. * * @generated from message google.api.PythonSettings */ export type PythonSettings = Message<"google.api.PythonSettings"> & { /** * Some settings. * * @generated from field: google.api.CommonLanguageSettings common = 1; */ common?: CommonLanguageSettings; /** * Experimental features to be included during client library generation. * * @generated from field: google.api.PythonSettings.ExperimentalFeatures experimental_features = 2; */ experimentalFeatures?: PythonSettings_ExperimentalFeatures; }; ⋮---- /** * Some settings. * * @generated from field: google.api.CommonLanguageSettings common = 1; */ ⋮---- /** * Experimental features to be included during client library generation. * * @generated from field: google.api.PythonSettings.ExperimentalFeatures experimental_features = 2; */ ⋮---- /** * Describes the message google.api.PythonSettings. * Use `create(PythonSettingsSchema)` to create a new message. */ export const PythonSettingsSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Experimental features to be included during client library generation. * These fields will be deprecated once the feature graduates and is enabled * by default. * * @generated from message google.api.PythonSettings.ExperimentalFeatures */ export type PythonSettings_ExperimentalFeatures = Message<"google.api.PythonSettings.ExperimentalFeatures"> & { /** * Enables generation of asynchronous REST clients if `rest` transport is * enabled. By default, asynchronous REST clients will not be generated. * This feature will be enabled by default 1 month after launching the * feature in preview packages. * * @generated from field: bool rest_async_io_enabled = 1; */ restAsyncIoEnabled: boolean; /** * Enables generation of protobuf code using new types that are more * Pythonic which are included in `protobuf>=5.29.x`. This feature will be * enabled by default 1 month after launching the feature in preview * packages. * * @generated from field: bool protobuf_pythonic_types_enabled = 2; */ protobufPythonicTypesEnabled: boolean; /** * Disables generation of an unversioned Python package for this client * library. This means that the module names will need to be versioned in * import statements. For example `import google.cloud.library_v2` instead * of `import google.cloud.library`. * * @generated from field: bool unversioned_package_disabled = 3; */ unversionedPackageDisabled: boolean; }; ⋮---- /** * Enables generation of asynchronous REST clients if `rest` transport is * enabled. By default, asynchronous REST clients will not be generated. * This feature will be enabled by default 1 month after launching the * feature in preview packages. * * @generated from field: bool rest_async_io_enabled = 1; */ ⋮---- /** * Enables generation of protobuf code using new types that are more * Pythonic which are included in `protobuf>=5.29.x`. This feature will be * enabled by default 1 month after launching the feature in preview * packages. * * @generated from field: bool protobuf_pythonic_types_enabled = 2; */ ⋮---- /** * Disables generation of an unversioned Python package for this client * library. This means that the module names will need to be versioned in * import statements. For example `import google.cloud.library_v2` instead * of `import google.cloud.library`. * * @generated from field: bool unversioned_package_disabled = 3; */ ⋮---- /** * Describes the message google.api.PythonSettings.ExperimentalFeatures. * Use `create(PythonSettings_ExperimentalFeaturesSchema)` to create a new message. */ export const PythonSettings_ExperimentalFeaturesSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Settings for Node client libraries. * * @generated from message google.api.NodeSettings */ export type NodeSettings = Message<"google.api.NodeSettings"> & { /** * Some settings. * * @generated from field: google.api.CommonLanguageSettings common = 1; */ common?: CommonLanguageSettings; }; ⋮---- /** * Some settings. * * @generated from field: google.api.CommonLanguageSettings common = 1; */ ⋮---- /** * Describes the message google.api.NodeSettings. * Use `create(NodeSettingsSchema)` to create a new message. */ export const NodeSettingsSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Settings for Dotnet client libraries. * * @generated from message google.api.DotnetSettings */ export type DotnetSettings = Message<"google.api.DotnetSettings"> & { /** * Some settings. * * @generated from field: google.api.CommonLanguageSettings common = 1; */ common?: CommonLanguageSettings; /** * Map from original service names to renamed versions. * This is used when the default generated types * would cause a naming conflict. (Neither name is * fully-qualified.) * Example: Subscriber to SubscriberServiceApi. * * @generated from field: map renamed_services = 2; */ renamedServices: { [key: string]: string }; /** * Map from full resource types to the effective short name * for the resource. This is used when otherwise resource * named from different services would cause naming collisions. * Example entry: * "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" * * @generated from field: map renamed_resources = 3; */ renamedResources: { [key: string]: string }; /** * List of full resource types to ignore during generation. * This is typically used for API-specific Location resources, * which should be handled by the generator as if they were actually * the common Location resources. * Example entry: "documentai.googleapis.com/Location" * * @generated from field: repeated string ignored_resources = 4; */ ignoredResources: string[]; /** * Namespaces which must be aliased in snippets due to * a known (but non-generator-predictable) naming collision * * @generated from field: repeated string forced_namespace_aliases = 5; */ forcedNamespaceAliases: string[]; /** * Method signatures (in the form "service.method(signature)") * which are provided separately, so shouldn't be generated. * Snippets *calling* these methods are still generated, however. * * @generated from field: repeated string handwritten_signatures = 6; */ handwrittenSignatures: string[]; }; ⋮---- /** * Some settings. * * @generated from field: google.api.CommonLanguageSettings common = 1; */ ⋮---- /** * Map from original service names to renamed versions. * This is used when the default generated types * would cause a naming conflict. (Neither name is * fully-qualified.) * Example: Subscriber to SubscriberServiceApi. * * @generated from field: map renamed_services = 2; */ ⋮---- /** * Map from full resource types to the effective short name * for the resource. This is used when otherwise resource * named from different services would cause naming collisions. * Example entry: * "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" * * @generated from field: map renamed_resources = 3; */ ⋮---- /** * List of full resource types to ignore during generation. * This is typically used for API-specific Location resources, * which should be handled by the generator as if they were actually * the common Location resources. * Example entry: "documentai.googleapis.com/Location" * * @generated from field: repeated string ignored_resources = 4; */ ⋮---- /** * Namespaces which must be aliased in snippets due to * a known (but non-generator-predictable) naming collision * * @generated from field: repeated string forced_namespace_aliases = 5; */ ⋮---- /** * Method signatures (in the form "service.method(signature)") * which are provided separately, so shouldn't be generated. * Snippets *calling* these methods are still generated, however. * * @generated from field: repeated string handwritten_signatures = 6; */ ⋮---- /** * Describes the message google.api.DotnetSettings. * Use `create(DotnetSettingsSchema)` to create a new message. */ export const DotnetSettingsSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Settings for Ruby client libraries. * * @generated from message google.api.RubySettings */ export type RubySettings = Message<"google.api.RubySettings"> & { /** * Some settings. * * @generated from field: google.api.CommonLanguageSettings common = 1; */ common?: CommonLanguageSettings; }; ⋮---- /** * Some settings. * * @generated from field: google.api.CommonLanguageSettings common = 1; */ ⋮---- /** * Describes the message google.api.RubySettings. * Use `create(RubySettingsSchema)` to create a new message. */ export const RubySettingsSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Settings for Go client libraries. * * @generated from message google.api.GoSettings */ export type GoSettings = Message<"google.api.GoSettings"> & { /** * Some settings. * * @generated from field: google.api.CommonLanguageSettings common = 1; */ common?: CommonLanguageSettings; /** * Map of service names to renamed services. Keys are the package relative * service names and values are the name to be used for the service client * and call options. * * publishing: * go_settings: * renamed_services: * Publisher: TopicAdmin * * @generated from field: map renamed_services = 2; */ renamedServices: { [key: string]: string }; }; ⋮---- /** * Some settings. * * @generated from field: google.api.CommonLanguageSettings common = 1; */ ⋮---- /** * Map of service names to renamed services. Keys are the package relative * service names and values are the name to be used for the service client * and call options. * * publishing: * go_settings: * renamed_services: * Publisher: TopicAdmin * * @generated from field: map renamed_services = 2; */ ⋮---- /** * Describes the message google.api.GoSettings. * Use `create(GoSettingsSchema)` to create a new message. */ export const GoSettingsSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Describes the generator configuration for a method. * * @generated from message google.api.MethodSettings */ export type MethodSettings = Message<"google.api.MethodSettings"> & { /** * The fully qualified name of the method, for which the options below apply. * This is used to find the method to apply the options. * * Example: * * publishing: * method_settings: * - selector: google.storage.control.v2.StorageControl.CreateFolder * # method settings for CreateFolder... * * @generated from field: string selector = 1; */ selector: string; /** * Describes settings to use for long-running operations when generating * API methods for RPCs. Complements RPCs that use the annotations in * google/longrunning/operations.proto. * * Example of a YAML configuration:: * * publishing: * method_settings: * - selector: google.cloud.speech.v2.Speech.BatchRecognize * long_running: * initial_poll_delay: 60s # 1 minute * poll_delay_multiplier: 1.5 * max_poll_delay: 360s # 6 minutes * total_poll_timeout: 54000s # 90 minutes * * @generated from field: google.api.MethodSettings.LongRunning long_running = 2; */ longRunning?: MethodSettings_LongRunning; /** * List of top-level fields of the request message, that should be * automatically populated by the client libraries based on their * (google.api.field_info).format. Currently supported format: UUID4. * * Example of a YAML configuration: * * publishing: * method_settings: * - selector: google.example.v1.ExampleService.CreateExample * auto_populated_fields: * - request_id * * @generated from field: repeated string auto_populated_fields = 3; */ autoPopulatedFields: string[]; }; ⋮---- /** * The fully qualified name of the method, for which the options below apply. * This is used to find the method to apply the options. * * Example: * * publishing: * method_settings: * - selector: google.storage.control.v2.StorageControl.CreateFolder * # method settings for CreateFolder... * * @generated from field: string selector = 1; */ ⋮---- /** * Describes settings to use for long-running operations when generating * API methods for RPCs. Complements RPCs that use the annotations in * google/longrunning/operations.proto. * * Example of a YAML configuration:: * * publishing: * method_settings: * - selector: google.cloud.speech.v2.Speech.BatchRecognize * long_running: * initial_poll_delay: 60s # 1 minute * poll_delay_multiplier: 1.5 * max_poll_delay: 360s # 6 minutes * total_poll_timeout: 54000s # 90 minutes * * @generated from field: google.api.MethodSettings.LongRunning long_running = 2; */ ⋮---- /** * List of top-level fields of the request message, that should be * automatically populated by the client libraries based on their * (google.api.field_info).format. Currently supported format: UUID4. * * Example of a YAML configuration: * * publishing: * method_settings: * - selector: google.example.v1.ExampleService.CreateExample * auto_populated_fields: * - request_id * * @generated from field: repeated string auto_populated_fields = 3; */ ⋮---- /** * Describes the message google.api.MethodSettings. * Use `create(MethodSettingsSchema)` to create a new message. */ export const MethodSettingsSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Describes settings to use when generating API methods that use the * long-running operation pattern. * All default values below are from those used in the client library * generators (e.g. * [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). * * @generated from message google.api.MethodSettings.LongRunning */ export type MethodSettings_LongRunning = Message<"google.api.MethodSettings.LongRunning"> & { /** * Initial delay after which the first poll request will be made. * Default value: 5 seconds. * * @generated from field: google.protobuf.Duration initial_poll_delay = 1; */ initialPollDelay?: Duration; /** * Multiplier to gradually increase delay between subsequent polls until it * reaches max_poll_delay. * Default value: 1.5. * * @generated from field: float poll_delay_multiplier = 2; */ pollDelayMultiplier: number; /** * Maximum time between two subsequent poll requests. * Default value: 45 seconds. * * @generated from field: google.protobuf.Duration max_poll_delay = 3; */ maxPollDelay?: Duration; /** * Total polling timeout. * Default value: 5 minutes. * * @generated from field: google.protobuf.Duration total_poll_timeout = 4; */ totalPollTimeout?: Duration; }; ⋮---- /** * Initial delay after which the first poll request will be made. * Default value: 5 seconds. * * @generated from field: google.protobuf.Duration initial_poll_delay = 1; */ ⋮---- /** * Multiplier to gradually increase delay between subsequent polls until it * reaches max_poll_delay. * Default value: 1.5. * * @generated from field: float poll_delay_multiplier = 2; */ ⋮---- /** * Maximum time between two subsequent poll requests. * Default value: 45 seconds. * * @generated from field: google.protobuf.Duration max_poll_delay = 3; */ ⋮---- /** * Total polling timeout. * Default value: 5 minutes. * * @generated from field: google.protobuf.Duration total_poll_timeout = 4; */ ⋮---- /** * Describes the message google.api.MethodSettings.LongRunning. * Use `create(MethodSettings_LongRunningSchema)` to create a new message. */ export const MethodSettings_LongRunningSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * This message is used to configure the generation of a subset of the RPCs in * a service for client libraries. * * @generated from message google.api.SelectiveGapicGeneration */ export type SelectiveGapicGeneration = Message<"google.api.SelectiveGapicGeneration"> & { /** * An allowlist of the fully qualified names of RPCs that should be included * on public client surfaces. * * @generated from field: repeated string methods = 1; */ methods: string[]; /** * Setting this to true indicates to the client generators that methods * that would be excluded from the generation should instead be generated * in a way that indicates these methods should not be consumed by * end users. How this is expressed is up to individual language * implementations to decide. Some examples may be: added annotations, * obfuscated identifiers, or other language idiomatic patterns. * * @generated from field: bool generate_omitted_as_internal = 2; */ generateOmittedAsInternal: boolean; }; ⋮---- /** * An allowlist of the fully qualified names of RPCs that should be included * on public client surfaces. * * @generated from field: repeated string methods = 1; */ ⋮---- /** * Setting this to true indicates to the client generators that methods * that would be excluded from the generation should instead be generated * in a way that indicates these methods should not be consumed by * end users. How this is expressed is up to individual language * implementations to decide. Some examples may be: added annotations, * obfuscated identifiers, or other language idiomatic patterns. * * @generated from field: bool generate_omitted_as_internal = 2; */ ⋮---- /** * Describes the message google.api.SelectiveGapicGeneration. * Use `create(SelectiveGapicGenerationSchema)` to create a new message. */ export const SelectiveGapicGenerationSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * The organization for which the client libraries are being published. * Affects the url where generated docs are published, etc. * * @generated from enum google.api.ClientLibraryOrganization */ export enum ClientLibraryOrganization { /** * Not useful. * * @generated from enum value: CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0; */ CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, /** * Google Cloud Platform Org. * * @generated from enum value: CLOUD = 1; */ CLOUD = 1, /** * Ads (Advertising) Org. * * @generated from enum value: ADS = 2; */ ADS = 2, /** * Photos Org. * * @generated from enum value: PHOTOS = 3; */ PHOTOS = 3, /** * Street View Org. * * @generated from enum value: STREET_VIEW = 4; */ STREET_VIEW = 4, /** * Shopping Org. * * @generated from enum value: SHOPPING = 5; */ SHOPPING = 5, /** * Geo Org. * * @generated from enum value: GEO = 6; */ GEO = 6, /** * Generative AI - https://developers.generativeai.google * * @generated from enum value: GENERATIVE_AI = 7; */ GENERATIVE_AI = 7, } ⋮---- /** * Not useful. * * @generated from enum value: CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0; */ ⋮---- /** * Google Cloud Platform Org. * * @generated from enum value: CLOUD = 1; */ ⋮---- /** * Ads (Advertising) Org. * * @generated from enum value: ADS = 2; */ ⋮---- /** * Photos Org. * * @generated from enum value: PHOTOS = 3; */ ⋮---- /** * Street View Org. * * @generated from enum value: STREET_VIEW = 4; */ ⋮---- /** * Shopping Org. * * @generated from enum value: SHOPPING = 5; */ ⋮---- /** * Geo Org. * * @generated from enum value: GEO = 6; */ ⋮---- /** * Generative AI - https://developers.generativeai.google * * @generated from enum value: GENERATIVE_AI = 7; */ ⋮---- /** * Describes the enum google.api.ClientLibraryOrganization. */ export const ClientLibraryOrganizationSchema: GenEnum = /*@__PURE__*/ ⋮---- /** * To where should client libraries be published? * * @generated from enum google.api.ClientLibraryDestination */ export enum ClientLibraryDestination { /** * Client libraries will neither be generated nor published to package * managers. * * @generated from enum value: CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0; */ CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, /** * Generate the client library in a repo under github.com/googleapis, * but don't publish it to package managers. * * @generated from enum value: GITHUB = 10; */ GITHUB = 10, /** * Publish the library to package managers like nuget.org and npmjs.com. * * @generated from enum value: PACKAGE_MANAGER = 20; */ PACKAGE_MANAGER = 20, } ⋮---- /** * Client libraries will neither be generated nor published to package * managers. * * @generated from enum value: CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0; */ ⋮---- /** * Generate the client library in a repo under github.com/googleapis, * but don't publish it to package managers. * * @generated from enum value: GITHUB = 10; */ ⋮---- /** * Publish the library to package managers like nuget.org and npmjs.com. * * @generated from enum value: PACKAGE_MANAGER = 20; */ ⋮---- /** * Describes the enum google.api.ClientLibraryDestination. */ export const ClientLibraryDestinationSchema: GenEnum = /*@__PURE__*/ ⋮---- /** * A definition of a client library method signature. * * In client libraries, each proto RPC corresponds to one or more methods * which the end user is able to call, and calls the underlying RPC. * Normally, this method receives a single argument (a struct or instance * corresponding to the RPC request object). Defining this field will * add one or more overloads providing flattened or simpler method signatures * in some languages. * * The fields on the method signature are provided as a comma-separated * string. * * For example, the proto RPC and annotation: * * rpc CreateSubscription(CreateSubscriptionRequest) * returns (Subscription) { * option (google.api.method_signature) = "name,topic"; * } * * Would add the following Java overload (in addition to the method accepting * the request object): * * public final Subscription createSubscription(String name, String topic) * * The following backwards-compatibility guidelines apply: * * * Adding this annotation to an unannotated method is backwards * compatible. * * Adding this annotation to a method which already has existing * method signature annotations is backwards compatible if and only if * the new method signature annotation is last in the sequence. * * Modifying or removing an existing method signature annotation is * a breaking change. * * Re-ordering existing method signature annotations is a breaking * change. * * @generated from extension: repeated string method_signature = 1051; */ export const method_signature: GenExtension = /*@__PURE__*/ ⋮---- /** * The hostname for this service. * This should be specified with no prefix or protocol. * * Example: * * service Foo { * option (google.api.default_host) = "foo.googleapi.com"; * ... * } * * @generated from extension: string default_host = 1049; */ export const default_host: GenExtension = /*@__PURE__*/ ⋮---- /** * OAuth scopes needed for the client. * * Example: * * service Foo { * option (google.api.oauth_scopes) = \ * "https://www.googleapis.com/auth/cloud-platform"; * ... * } * * If there is more than one scope, use a comma-separated string: * * Example: * * service Foo { * option (google.api.oauth_scopes) = \ * "https://www.googleapis.com/auth/cloud-platform," * "https://www.googleapis.com/auth/monitoring"; * ... * } * * @generated from extension: string oauth_scopes = 1050; */ export const oauth_scopes: GenExtension = /*@__PURE__*/ ⋮---- /** * The API version of this service, which should be sent by version-aware * clients to the service. This allows services to abide by the schema and * behavior of the service at the time this API version was deployed. * The format of the API version must be treated as opaque by clients. * Services may use a format with an apparent structure, but clients must * not rely on this to determine components within an API version, or attempt * to construct other valid API versions. Note that this is for upcoming * functionality and may not be implemented for all services. * * Example: * * service Foo { * option (google.api.api_version) = "v1_20230821_preview"; * } * * @generated from extension: string api_version = 525000001; */ export const api_version: GenExtension = /*@__PURE__*/ ```` ## File: src/gen/google/api/field_behavior_pb.ts ````typescript // Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. ⋮---- // @generated by protoc-gen-es v2.6.3 with parameter "target=ts" // @generated from file google/api/field_behavior.proto (package google.api, syntax proto3) /* eslint-disable */ ⋮---- import type { GenEnum, GenExtension, GenFile } from "@bufbuild/protobuf/codegenv2"; import { enumDesc, extDesc, fileDesc } from "@bufbuild/protobuf/codegenv2"; import type { FieldOptions } from "@bufbuild/protobuf/wkt"; import { file_google_protobuf_descriptor } from "@bufbuild/protobuf/wkt"; ⋮---- /** * Describes the file google/api/field_behavior.proto. */ export const file_google_api_field_behavior: GenFile = /*@__PURE__*/ ⋮---- /** * An indicator of the behavior of a given field (for example, that a field * is required in requests, or given as output but ignored as input). * This **does not** change the behavior in protocol buffers itself; it only * denotes the behavior and may affect how API tooling handles the field. * * Note: This enum **may** receive new values in the future. * * @generated from enum google.api.FieldBehavior */ export enum FieldBehavior { /** * Conventional default for enums. Do not use this. * * @generated from enum value: FIELD_BEHAVIOR_UNSPECIFIED = 0; */ FIELD_BEHAVIOR_UNSPECIFIED = 0, /** * Specifically denotes a field as optional. * While all fields in protocol buffers are optional, this may be specified * for emphasis if appropriate. * * @generated from enum value: OPTIONAL = 1; */ OPTIONAL = 1, /** * Denotes a field as required. * This indicates that the field **must** be provided as part of the request, * and failure to do so will cause an error (usually `INVALID_ARGUMENT`). * * @generated from enum value: REQUIRED = 2; */ REQUIRED = 2, /** * Denotes a field as output only. * This indicates that the field is provided in responses, but including the * field in a request does nothing (the server *must* ignore it and * *must not* throw an error as a result of the field's presence). * * @generated from enum value: OUTPUT_ONLY = 3; */ OUTPUT_ONLY = 3, /** * Denotes a field as input only. * This indicates that the field is provided in requests, and the * corresponding field is not included in output. * * @generated from enum value: INPUT_ONLY = 4; */ INPUT_ONLY = 4, /** * Denotes a field as immutable. * This indicates that the field may be set once in a request to create a * resource, but may not be changed thereafter. * * @generated from enum value: IMMUTABLE = 5; */ IMMUTABLE = 5, /** * Denotes that a (repeated) field is an unordered list. * This indicates that the service may provide the elements of the list * in any arbitrary order, rather than the order the user originally * provided. Additionally, the list's order may or may not be stable. * * @generated from enum value: UNORDERED_LIST = 6; */ UNORDERED_LIST = 6, /** * Denotes that this field returns a non-empty default value if not set. * This indicates that if the user provides the empty value in a request, * a non-empty value will be returned. The user will not be aware of what * non-empty value to expect. * * @generated from enum value: NON_EMPTY_DEFAULT = 7; */ NON_EMPTY_DEFAULT = 7, /** * Denotes that the field in a resource (a message annotated with * google.api.resource) is used in the resource name to uniquely identify the * resource. For AIP-compliant APIs, this should only be applied to the * `name` field on the resource. * * This behavior should not be applied to references to other resources within * the message. * * The identifier field of resources often have different field behavior * depending on the request it is embedded in (e.g. for Create methods name * is optional and unused, while for Update methods it is required). Instead * of method-specific annotations, only `IDENTIFIER` is required. * * @generated from enum value: IDENTIFIER = 8; */ IDENTIFIER = 8, } ⋮---- /** * Conventional default for enums. Do not use this. * * @generated from enum value: FIELD_BEHAVIOR_UNSPECIFIED = 0; */ ⋮---- /** * Specifically denotes a field as optional. * While all fields in protocol buffers are optional, this may be specified * for emphasis if appropriate. * * @generated from enum value: OPTIONAL = 1; */ ⋮---- /** * Denotes a field as required. * This indicates that the field **must** be provided as part of the request, * and failure to do so will cause an error (usually `INVALID_ARGUMENT`). * * @generated from enum value: REQUIRED = 2; */ ⋮---- /** * Denotes a field as output only. * This indicates that the field is provided in responses, but including the * field in a request does nothing (the server *must* ignore it and * *must not* throw an error as a result of the field's presence). * * @generated from enum value: OUTPUT_ONLY = 3; */ ⋮---- /** * Denotes a field as input only. * This indicates that the field is provided in requests, and the * corresponding field is not included in output. * * @generated from enum value: INPUT_ONLY = 4; */ ⋮---- /** * Denotes a field as immutable. * This indicates that the field may be set once in a request to create a * resource, but may not be changed thereafter. * * @generated from enum value: IMMUTABLE = 5; */ ⋮---- /** * Denotes that a (repeated) field is an unordered list. * This indicates that the service may provide the elements of the list * in any arbitrary order, rather than the order the user originally * provided. Additionally, the list's order may or may not be stable. * * @generated from enum value: UNORDERED_LIST = 6; */ ⋮---- /** * Denotes that this field returns a non-empty default value if not set. * This indicates that if the user provides the empty value in a request, * a non-empty value will be returned. The user will not be aware of what * non-empty value to expect. * * @generated from enum value: NON_EMPTY_DEFAULT = 7; */ ⋮---- /** * Denotes that the field in a resource (a message annotated with * google.api.resource) is used in the resource name to uniquely identify the * resource. For AIP-compliant APIs, this should only be applied to the * `name` field on the resource. * * This behavior should not be applied to references to other resources within * the message. * * The identifier field of resources often have different field behavior * depending on the request it is embedded in (e.g. for Create methods name * is optional and unused, while for Update methods it is required). Instead * of method-specific annotations, only `IDENTIFIER` is required. * * @generated from enum value: IDENTIFIER = 8; */ ⋮---- /** * Describes the enum google.api.FieldBehavior. */ export const FieldBehaviorSchema: GenEnum = /*@__PURE__*/ ⋮---- /** * A designation of a specific field behavior (required, output only, etc.) * in protobuf messages. * * Examples: * * string name = 1 [(google.api.field_behavior) = REQUIRED]; * State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; * google.protobuf.Duration ttl = 1 * [(google.api.field_behavior) = INPUT_ONLY]; * google.protobuf.Timestamp expire_time = 1 * [(google.api.field_behavior) = OUTPUT_ONLY, * (google.api.field_behavior) = IMMUTABLE]; * * @generated from extension: repeated google.api.FieldBehavior field_behavior = 1052 [packed = false]; */ export const field_behavior: GenExtension = /*@__PURE__*/ ```` ## File: src/gen/google/api/field_info_pb.ts ````typescript // Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. ⋮---- // @generated by protoc-gen-es v2.6.3 with parameter "target=ts" // @generated from file google/api/field_info.proto (package google.api, syntax proto3) /* eslint-disable */ ⋮---- import type { GenEnum, GenExtension, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; import { enumDesc, extDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; import type { FieldOptions } from "@bufbuild/protobuf/wkt"; import { file_google_protobuf_descriptor } from "@bufbuild/protobuf/wkt"; import type { Message } from "@bufbuild/protobuf"; ⋮---- /** * Describes the file google/api/field_info.proto. */ export const file_google_api_field_info: GenFile = /*@__PURE__*/ ⋮---- /** * Rich semantic information of an API field beyond basic typing. * * @generated from message google.api.FieldInfo */ export type FieldInfo = Message<"google.api.FieldInfo"> & { /** * The standard format of a field value. This does not explicitly configure * any API consumer, just documents the API's format for the field it is * applied to. * * @generated from field: google.api.FieldInfo.Format format = 1; */ format: FieldInfo_Format; /** * The type(s) that the annotated, generic field may represent. * * Currently, this must only be used on fields of type `google.protobuf.Any`. * Supporting other generic types may be considered in the future. * * @generated from field: repeated google.api.TypeReference referenced_types = 2; */ referencedTypes: TypeReference[]; }; ⋮---- /** * The standard format of a field value. This does not explicitly configure * any API consumer, just documents the API's format for the field it is * applied to. * * @generated from field: google.api.FieldInfo.Format format = 1; */ ⋮---- /** * The type(s) that the annotated, generic field may represent. * * Currently, this must only be used on fields of type `google.protobuf.Any`. * Supporting other generic types may be considered in the future. * * @generated from field: repeated google.api.TypeReference referenced_types = 2; */ ⋮---- /** * Describes the message google.api.FieldInfo. * Use `create(FieldInfoSchema)` to create a new message. */ export const FieldInfoSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * The standard format of a field value. The supported formats are all backed * by either an RFC defined by the IETF or a Google-defined AIP. * * @generated from enum google.api.FieldInfo.Format */ export enum FieldInfo_Format { /** * Default, unspecified value. * * @generated from enum value: FORMAT_UNSPECIFIED = 0; */ FORMAT_UNSPECIFIED = 0, /** * Universally Unique Identifier, version 4, value as defined by * https://datatracker.ietf.org/doc/html/rfc4122. The value may be * normalized to entirely lowercase letters. For example, the value * `F47AC10B-58CC-0372-8567-0E02B2C3D479` would be normalized to * `f47ac10b-58cc-0372-8567-0e02b2c3d479`. * * @generated from enum value: UUID4 = 1; */ UUID4 = 1, /** * Internet Protocol v4 value as defined by [RFC * 791](https://datatracker.ietf.org/doc/html/rfc791). The value may be * condensed, with leading zeros in each octet stripped. For example, * `001.022.233.040` would be condensed to `1.22.233.40`. * * @generated from enum value: IPV4 = 2; */ IPV4 = 2, /** * Internet Protocol v6 value as defined by [RFC * 2460](https://datatracker.ietf.org/doc/html/rfc2460). The value may be * normalized to entirely lowercase letters with zeros compressed, following * [RFC 5952](https://datatracker.ietf.org/doc/html/rfc5952). For example, * the value `2001:0DB8:0::0` would be normalized to `2001:db8::`. * * @generated from enum value: IPV6 = 3; */ IPV6 = 3, /** * An IP address in either v4 or v6 format as described by the individual * values defined herein. See the comments on the IPV4 and IPV6 types for * allowed normalizations of each. * * @generated from enum value: IPV4_OR_IPV6 = 4; */ IPV4_OR_IPV6 = 4, } ⋮---- /** * Default, unspecified value. * * @generated from enum value: FORMAT_UNSPECIFIED = 0; */ ⋮---- /** * Universally Unique Identifier, version 4, value as defined by * https://datatracker.ietf.org/doc/html/rfc4122. The value may be * normalized to entirely lowercase letters. For example, the value * `F47AC10B-58CC-0372-8567-0E02B2C3D479` would be normalized to * `f47ac10b-58cc-0372-8567-0e02b2c3d479`. * * @generated from enum value: UUID4 = 1; */ ⋮---- /** * Internet Protocol v4 value as defined by [RFC * 791](https://datatracker.ietf.org/doc/html/rfc791). The value may be * condensed, with leading zeros in each octet stripped. For example, * `001.022.233.040` would be condensed to `1.22.233.40`. * * @generated from enum value: IPV4 = 2; */ ⋮---- /** * Internet Protocol v6 value as defined by [RFC * 2460](https://datatracker.ietf.org/doc/html/rfc2460). The value may be * normalized to entirely lowercase letters with zeros compressed, following * [RFC 5952](https://datatracker.ietf.org/doc/html/rfc5952). For example, * the value `2001:0DB8:0::0` would be normalized to `2001:db8::`. * * @generated from enum value: IPV6 = 3; */ ⋮---- /** * An IP address in either v4 or v6 format as described by the individual * values defined herein. See the comments on the IPV4 and IPV6 types for * allowed normalizations of each. * * @generated from enum value: IPV4_OR_IPV6 = 4; */ ⋮---- /** * Describes the enum google.api.FieldInfo.Format. */ export const FieldInfo_FormatSchema: GenEnum = /*@__PURE__*/ ⋮---- /** * A reference to a message type, for use in [FieldInfo][google.api.FieldInfo]. * * @generated from message google.api.TypeReference */ export type TypeReference = Message<"google.api.TypeReference"> & { /** * The name of the type that the annotated, generic field may represent. * If the type is in the same protobuf package, the value can be the simple * message name e.g., `"MyMessage"`. Otherwise, the value must be the * fully-qualified message name e.g., `"google.library.v1.Book"`. * * If the type(s) are unknown to the service (e.g. the field accepts generic * user input), use the wildcard `"*"` to denote this behavior. * * See [AIP-202](https://google.aip.dev/202#type-references) for more details. * * @generated from field: string type_name = 1; */ typeName: string; }; ⋮---- /** * The name of the type that the annotated, generic field may represent. * If the type is in the same protobuf package, the value can be the simple * message name e.g., `"MyMessage"`. Otherwise, the value must be the * fully-qualified message name e.g., `"google.library.v1.Book"`. * * If the type(s) are unknown to the service (e.g. the field accepts generic * user input), use the wildcard `"*"` to denote this behavior. * * See [AIP-202](https://google.aip.dev/202#type-references) for more details. * * @generated from field: string type_name = 1; */ ⋮---- /** * Describes the message google.api.TypeReference. * Use `create(TypeReferenceSchema)` to create a new message. */ export const TypeReferenceSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Rich semantic descriptor of an API field beyond the basic typing. * * Examples: * * string request_id = 1 [(google.api.field_info).format = UUID4]; * string old_ip_address = 2 [(google.api.field_info).format = IPV4]; * string new_ip_address = 3 [(google.api.field_info).format = IPV6]; * string actual_ip_address = 4 [ * (google.api.field_info).format = IPV4_OR_IPV6 * ]; * google.protobuf.Any generic_field = 5 [ * (google.api.field_info).referenced_types = {type_name: "ActualType"}, * (google.api.field_info).referenced_types = {type_name: "OtherType"}, * ]; * google.protobuf.Any generic_user_input = 5 [ * (google.api.field_info).referenced_types = {type_name: "*"}, * ]; * * @generated from extension: google.api.FieldInfo field_info = 291403980; */ export const field_info: GenExtension = /*@__PURE__*/ ```` ## File: src/gen/google/api/http_pb.ts ````typescript // Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. ⋮---- // @generated by protoc-gen-es v2.6.3 with parameter "target=ts" // @generated from file google/api/http.proto (package google.api, syntax proto3) /* eslint-disable */ ⋮---- import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; import type { Message } from "@bufbuild/protobuf"; ⋮---- /** * Describes the file google/api/http.proto. */ export const file_google_api_http: GenFile = /*@__PURE__*/ ⋮---- /** * Defines the HTTP configuration for an API service. It contains a list of * [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method * to one or more HTTP REST API methods. * * @generated from message google.api.Http */ export type Http = Message<"google.api.Http"> & { /** * A list of HTTP configuration rules that apply to individual API methods. * * **NOTE:** All service configuration rules follow "last one wins" order. * * @generated from field: repeated google.api.HttpRule rules = 1; */ rules: HttpRule[]; /** * When set to true, URL path parameters will be fully URI-decoded except in * cases of single segment matches in reserved expansion, where "%2F" will be * left encoded. * * The default behavior is to not decode RFC 6570 reserved characters in multi * segment matches. * * @generated from field: bool fully_decode_reserved_expansion = 2; */ fullyDecodeReservedExpansion: boolean; }; ⋮---- /** * A list of HTTP configuration rules that apply to individual API methods. * * **NOTE:** All service configuration rules follow "last one wins" order. * * @generated from field: repeated google.api.HttpRule rules = 1; */ ⋮---- /** * When set to true, URL path parameters will be fully URI-decoded except in * cases of single segment matches in reserved expansion, where "%2F" will be * left encoded. * * The default behavior is to not decode RFC 6570 reserved characters in multi * segment matches. * * @generated from field: bool fully_decode_reserved_expansion = 2; */ ⋮---- /** * Describes the message google.api.Http. * Use `create(HttpSchema)` to create a new message. */ export const HttpSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * gRPC Transcoding * * gRPC Transcoding is a feature for mapping between a gRPC method and one or * more HTTP REST endpoints. It allows developers to build a single API service * that supports both gRPC APIs and REST APIs. Many systems, including [Google * APIs](https://github.com/googleapis/googleapis), * [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC * Gateway](https://github.com/grpc-ecosystem/grpc-gateway), * and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature * and use it for large scale production services. * * `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies * how different portions of the gRPC request message are mapped to the URL * path, URL query parameters, and HTTP request body. It also controls how the * gRPC response message is mapped to the HTTP response body. `HttpRule` is * typically specified as an `google.api.http` annotation on the gRPC method. * * Each mapping specifies a URL path template and an HTTP method. The path * template may refer to one or more fields in the gRPC request message, as long * as each field is a non-repeated field with a primitive (non-message) type. * The path template controls how fields of the request message are mapped to * the URL path. * * Example: * * service Messaging { * rpc GetMessage(GetMessageRequest) returns (Message) { * option (google.api.http) = { * get: "/v1/{name=messages/*}" * }; * } * } * message GetMessageRequest { * string name = 1; // Mapped to URL path. * } * message Message { * string text = 1; // The resource content. * } * * This enables an HTTP REST to gRPC mapping as below: * * - HTTP: `GET /v1/messages/123456` * - gRPC: `GetMessage(name: "messages/123456")` * * Any fields in the request message which are not bound by the path template * automatically become HTTP query parameters if there is no HTTP request body. * For example: * * service Messaging { * rpc GetMessage(GetMessageRequest) returns (Message) { * option (google.api.http) = { * get:"/v1/messages/{message_id}" * }; * } * } * message GetMessageRequest { * message SubMessage { * string subfield = 1; * } * string message_id = 1; // Mapped to URL path. * int64 revision = 2; // Mapped to URL query parameter `revision`. * SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`. * } * * This enables a HTTP JSON to RPC mapping as below: * * - HTTP: `GET /v1/messages/123456?revision=2&sub.subfield=foo` * - gRPC: `GetMessage(message_id: "123456" revision: 2 sub: * SubMessage(subfield: "foo"))` * * Note that fields which are mapped to URL query parameters must have a * primitive type or a repeated primitive type or a non-repeated message type. * In the case of a repeated type, the parameter can be repeated in the URL * as `...?param=A¶m=B`. In the case of a message type, each field of the * message is mapped to a separate parameter, such as * `...?foo.a=A&foo.b=B&foo.c=C`. * * For HTTP methods that allow a request body, the `body` field * specifies the mapping. Consider a REST update method on the * message resource collection: * * service Messaging { * rpc UpdateMessage(UpdateMessageRequest) returns (Message) { * option (google.api.http) = { * patch: "/v1/messages/{message_id}" * body: "message" * }; * } * } * message UpdateMessageRequest { * string message_id = 1; // mapped to the URL * Message message = 2; // mapped to the body * } * * The following HTTP JSON to RPC mapping is enabled, where the * representation of the JSON in the request body is determined by * protos JSON encoding: * * - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }` * - gRPC: `UpdateMessage(message_id: "123456" message { text: "Hi!" })` * * The special name `*` can be used in the body mapping to define that * every field not bound by the path template should be mapped to the * request body. This enables the following alternative definition of * the update method: * * service Messaging { * rpc UpdateMessage(Message) returns (Message) { * option (google.api.http) = { * patch: "/v1/messages/{message_id}" * body: "*" * }; * } * } * message Message { * string message_id = 1; * string text = 2; * } * * * The following HTTP JSON to RPC mapping is enabled: * * - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }` * - gRPC: `UpdateMessage(message_id: "123456" text: "Hi!")` * * Note that when using `*` in the body mapping, it is not possible to * have HTTP parameters, as all fields not bound by the path end in * the body. This makes this option more rarely used in practice when * defining REST APIs. The common usage of `*` is in custom methods * which don't use the URL at all for transferring data. * * It is possible to define multiple HTTP methods for one RPC by using * the `additional_bindings` option. Example: * * service Messaging { * rpc GetMessage(GetMessageRequest) returns (Message) { * option (google.api.http) = { * get: "/v1/messages/{message_id}" * additional_bindings { * get: "/v1/users/{user_id}/messages/{message_id}" * } * }; * } * } * message GetMessageRequest { * string message_id = 1; * string user_id = 2; * } * * This enables the following two alternative HTTP JSON to RPC mappings: * * - HTTP: `GET /v1/messages/123456` * - gRPC: `GetMessage(message_id: "123456")` * * - HTTP: `GET /v1/users/me/messages/123456` * - gRPC: `GetMessage(user_id: "me" message_id: "123456")` * * Rules for HTTP mapping * * 1. Leaf request fields (recursive expansion nested messages in the request * message) are classified into three categories: * - Fields referred by the path template. They are passed via the URL path. * - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They * are passed via the HTTP * request body. * - All other fields are passed via the URL query parameters, and the * parameter name is the field path in the request message. A repeated * field can be represented as multiple query parameters under the same * name. * 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL * query parameter, all fields * are passed via URL path and HTTP request body. * 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP * request body, all * fields are passed via URL path and URL query parameters. * * Path template syntax * * Template = "/" Segments [ Verb ] ; * Segments = Segment { "/" Segment } ; * Segment = "*" | "**" | LITERAL | Variable ; * Variable = "{" FieldPath [ "=" Segments ] "}" ; * FieldPath = IDENT { "." IDENT } ; * Verb = ":" LITERAL ; * * The syntax `*` matches a single URL path segment. The syntax `**` matches * zero or more URL path segments, which must be the last part of the URL path * except the `Verb`. * * The syntax `Variable` matches part of the URL path as specified by its * template. A variable template must not contain other variables. If a variable * matches a single path segment, its template may be omitted, e.g. `{var}` * is equivalent to `{var=*}`. * * The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL` * contains any reserved character, such characters should be percent-encoded * before the matching. * * If a variable contains exactly one path segment, such as `"{var}"` or * `"{var=*}"`, when such a variable is expanded into a URL path on the client * side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The * server side does the reverse decoding. Such variables show up in the * [Discovery * Document](https://developers.google.com/discovery/v1/reference/apis) as * `{var}`. * * If a variable contains multiple path segments, such as `"{var=foo/*}"` * or `"{var=**}"`, when such a variable is expanded into a URL path on the * client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. * The server side does the reverse decoding, except "%2F" and "%2f" are left * unchanged. Such variables show up in the * [Discovery * Document](https://developers.google.com/discovery/v1/reference/apis) as * `{+var}`. * * Using gRPC API Service Configuration * * gRPC API Service Configuration (service config) is a configuration language * for configuring a gRPC service to become a user-facing product. The * service config is simply the YAML representation of the `google.api.Service` * proto message. * * As an alternative to annotating your proto file, you can configure gRPC * transcoding in your service config YAML files. You do this by specifying a * `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same * effect as the proto annotation. This can be particularly useful if you * have a proto that is reused in multiple services. Note that any transcoding * specified in the service config will override any matching transcoding * configuration in the proto. * * The following example selects a gRPC method and applies an `HttpRule` to it: * * http: * rules: * - selector: example.v1.Messaging.GetMessage * get: /v1/messages/{message_id}/{sub.subfield} * * Special notes * * When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the * proto to JSON conversion must follow the [proto3 * specification](https://developers.google.com/protocol-buffers/docs/proto3#json). * * While the single segment variable follows the semantics of * [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String * Expansion, the multi segment variable **does not** follow RFC 6570 Section * 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion * does not expand special characters like `?` and `#`, which would lead * to invalid URLs. As the result, gRPC Transcoding uses a custom encoding * for multi segment variables. * * The path variables **must not** refer to any repeated or mapped field, * because client libraries are not capable of handling such variable expansion. * * The path variables **must not** capture the leading "/" character. The reason * is that the most common use case "{var}" does not capture the leading "/" * character. For consistency, all path variables must share the same behavior. * * Repeated message fields must not be mapped to URL query parameters, because * no client library can support such complicated mapping. * * If an API needs to use a JSON array for request or response body, it can map * the request or response body to a repeated field. However, some gRPC * Transcoding implementations may not support this feature. * * @generated from message google.api.HttpRule */ export type HttpRule = Message<"google.api.HttpRule"> & { /** * Selects a method to which this rule applies. * * Refer to [selector][google.api.DocumentationRule.selector] for syntax * details. * * @generated from field: string selector = 1; */ selector: string; /** * Determines the URL pattern is matched by this rules. This pattern can be * used with any of the {get|put|post|delete|patch} methods. A custom method * can be defined using the 'custom' field. * * @generated from oneof google.api.HttpRule.pattern */ pattern: { /** * Maps to HTTP GET. Used for listing and getting information about * resources. * * @generated from field: string get = 2; */ value: string; case: "get"; } | { /** * Maps to HTTP PUT. Used for replacing a resource. * * @generated from field: string put = 3; */ value: string; case: "put"; } | { /** * Maps to HTTP POST. Used for creating a resource or performing an action. * * @generated from field: string post = 4; */ value: string; case: "post"; } | { /** * Maps to HTTP DELETE. Used for deleting a resource. * * @generated from field: string delete = 5; */ value: string; case: "delete"; } | { /** * Maps to HTTP PATCH. Used for updating a resource. * * @generated from field: string patch = 6; */ value: string; case: "patch"; } | { /** * The custom pattern is used for specifying an HTTP method that is not * included in the `pattern` field, such as HEAD, or "*" to leave the * HTTP method unspecified for this rule. The wild-card rule is useful * for services that provide content to Web (HTML) clients. * * @generated from field: google.api.CustomHttpPattern custom = 8; */ value: CustomHttpPattern; case: "custom"; } | { case: undefined; value?: undefined }; /** * The name of the request field whose value is mapped to the HTTP request * body, or `*` for mapping all request fields not captured by the path * pattern to the HTTP body, or omitted for not having any HTTP request body. * * NOTE: the referred field must be present at the top-level of the request * message type. * * @generated from field: string body = 7; */ body: string; /** * Optional. The name of the response field whose value is mapped to the HTTP * response body. When omitted, the entire response message will be used * as the HTTP response body. * * NOTE: The referred field must be present at the top-level of the response * message type. * * @generated from field: string response_body = 12; */ responseBody: string; /** * Additional HTTP bindings for the selector. Nested bindings must * not contain an `additional_bindings` field themselves (that is, * the nesting may only be one level deep). * * @generated from field: repeated google.api.HttpRule additional_bindings = 11; */ additionalBindings: HttpRule[]; }; ⋮---- /** * Selects a method to which this rule applies. * * Refer to [selector][google.api.DocumentationRule.selector] for syntax * details. * * @generated from field: string selector = 1; */ ⋮---- /** * Determines the URL pattern is matched by this rules. This pattern can be * used with any of the {get|put|post|delete|patch} methods. A custom method * can be defined using the 'custom' field. * * @generated from oneof google.api.HttpRule.pattern */ ⋮---- /** * Maps to HTTP GET. Used for listing and getting information about * resources. * * @generated from field: string get = 2; */ ⋮---- /** * Maps to HTTP PUT. Used for replacing a resource. * * @generated from field: string put = 3; */ ⋮---- /** * Maps to HTTP POST. Used for creating a resource or performing an action. * * @generated from field: string post = 4; */ ⋮---- /** * Maps to HTTP DELETE. Used for deleting a resource. * * @generated from field: string delete = 5; */ ⋮---- /** * Maps to HTTP PATCH. Used for updating a resource. * * @generated from field: string patch = 6; */ ⋮---- /** * The custom pattern is used for specifying an HTTP method that is not * included in the `pattern` field, such as HEAD, or "*" to leave the * HTTP method unspecified for this rule. The wild-card rule is useful * for services that provide content to Web (HTML) clients. * * @generated from field: google.api.CustomHttpPattern custom = 8; */ ⋮---- /** * The name of the request field whose value is mapped to the HTTP request * body, or `*` for mapping all request fields not captured by the path * pattern to the HTTP body, or omitted for not having any HTTP request body. * * NOTE: the referred field must be present at the top-level of the request * message type. * * @generated from field: string body = 7; */ ⋮---- /** * Optional. The name of the response field whose value is mapped to the HTTP * response body. When omitted, the entire response message will be used * as the HTTP response body. * * NOTE: The referred field must be present at the top-level of the response * message type. * * @generated from field: string response_body = 12; */ ⋮---- /** * Additional HTTP bindings for the selector. Nested bindings must * not contain an `additional_bindings` field themselves (that is, * the nesting may only be one level deep). * * @generated from field: repeated google.api.HttpRule additional_bindings = 11; */ ⋮---- /** * Describes the message google.api.HttpRule. * Use `create(HttpRuleSchema)` to create a new message. */ export const HttpRuleSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * A custom pattern is used for defining custom HTTP verb. * * @generated from message google.api.CustomHttpPattern */ export type CustomHttpPattern = Message<"google.api.CustomHttpPattern"> & { /** * The name of this custom HTTP verb. * * @generated from field: string kind = 1; */ kind: string; /** * The path matched by this custom verb. * * @generated from field: string path = 2; */ path: string; }; ⋮---- /** * The name of this custom HTTP verb. * * @generated from field: string kind = 1; */ ⋮---- /** * The path matched by this custom verb. * * @generated from field: string path = 2; */ ⋮---- /** * Describes the message google.api.CustomHttpPattern. * Use `create(CustomHttpPatternSchema)` to create a new message. */ export const CustomHttpPatternSchema: GenMessage = /*@__PURE__*/ ```` ## File: src/gen/google/api/httpbody_pb.ts ````typescript // Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. ⋮---- // @generated by protoc-gen-es v2.6.3 with parameter "target=ts" // @generated from file google/api/httpbody.proto (package google.api, syntax proto3) /* eslint-disable */ ⋮---- import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; import type { Any } from "@bufbuild/protobuf/wkt"; import { file_google_protobuf_any } from "@bufbuild/protobuf/wkt"; import type { Message } from "@bufbuild/protobuf"; ⋮---- /** * Describes the file google/api/httpbody.proto. */ export const file_google_api_httpbody: GenFile = /*@__PURE__*/ ⋮---- /** * Message that represents an arbitrary HTTP body. It should only be used for * payload formats that can't be represented as JSON, such as raw binary or * an HTML page. * * * This message can be used both in streaming and non-streaming API methods in * the request as well as the response. * * It can be used as a top-level request field, which is convenient if one * wants to extract parameters from either the URL or HTTP template into the * request fields and also want access to the raw HTTP body. * * Example: * * message GetResourceRequest { * // A unique request id. * string request_id = 1; * * // The raw HTTP body is bound to this field. * google.api.HttpBody http_body = 2; * * } * * service ResourceService { * rpc GetResource(GetResourceRequest) * returns (google.api.HttpBody); * rpc UpdateResource(google.api.HttpBody) * returns (google.protobuf.Empty); * * } * * Example with streaming methods: * * service CaldavService { * rpc GetCalendar(stream google.api.HttpBody) * returns (stream google.api.HttpBody); * rpc UpdateCalendar(stream google.api.HttpBody) * returns (stream google.api.HttpBody); * * } * * Use of this type only changes how the request and response bodies are * handled, all other features will continue to work unchanged. * * @generated from message google.api.HttpBody */ export type HttpBody = Message<"google.api.HttpBody"> & { /** * The HTTP Content-Type header value specifying the content type of the body. * * @generated from field: string content_type = 1; */ contentType: string; /** * The HTTP request/response body as raw binary. * * @generated from field: bytes data = 2; */ data: Uint8Array; /** * Application specific response metadata. Must be set in the first response * for streaming APIs. * * @generated from field: repeated google.protobuf.Any extensions = 3; */ extensions: Any[]; }; ⋮---- /** * The HTTP Content-Type header value specifying the content type of the body. * * @generated from field: string content_type = 1; */ ⋮---- /** * The HTTP request/response body as raw binary. * * @generated from field: bytes data = 2; */ ⋮---- /** * Application specific response metadata. Must be set in the first response * for streaming APIs. * * @generated from field: repeated google.protobuf.Any extensions = 3; */ ⋮---- /** * Describes the message google.api.HttpBody. * Use `create(HttpBodySchema)` to create a new message. */ export const HttpBodySchema: GenMessage = /*@__PURE__*/ ```` ## File: src/gen/google/api/launch_stage_pb.ts ````typescript // Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. ⋮---- // @generated by protoc-gen-es v2.6.3 with parameter "target=ts" // @generated from file google/api/launch_stage.proto (package google.api, syntax proto3) /* eslint-disable */ ⋮---- import type { GenEnum, GenFile } from "@bufbuild/protobuf/codegenv2"; import { enumDesc, fileDesc } from "@bufbuild/protobuf/codegenv2"; ⋮---- /** * Describes the file google/api/launch_stage.proto. */ export const file_google_api_launch_stage: GenFile = /*@__PURE__*/ ⋮---- /** * The launch stage as defined by [Google Cloud Platform * Launch Stages](https://cloud.google.com/terms/launch-stages). * * @generated from enum google.api.LaunchStage */ export enum LaunchStage { /** * Do not use this default value. * * @generated from enum value: LAUNCH_STAGE_UNSPECIFIED = 0; */ LAUNCH_STAGE_UNSPECIFIED = 0, /** * The feature is not yet implemented. Users can not use it. * * @generated from enum value: UNIMPLEMENTED = 6; */ UNIMPLEMENTED = 6, /** * Prelaunch features are hidden from users and are only visible internally. * * @generated from enum value: PRELAUNCH = 7; */ PRELAUNCH = 7, /** * Early Access features are limited to a closed group of testers. To use * these features, you must sign up in advance and sign a Trusted Tester * agreement (which includes confidentiality provisions). These features may * be unstable, changed in backward-incompatible ways, and are not * guaranteed to be released. * * @generated from enum value: EARLY_ACCESS = 1; */ EARLY_ACCESS = 1, /** * Alpha is a limited availability test for releases before they are cleared * for widespread use. By Alpha, all significant design issues are resolved * and we are in the process of verifying functionality. Alpha customers * need to apply for access, agree to applicable terms, and have their * projects allowlisted. Alpha releases don't have to be feature complete, * no SLAs are provided, and there are no technical support obligations, but * they will be far enough along that customers can actually use them in * test environments or for limited-use tests -- just like they would in * normal production cases. * * @generated from enum value: ALPHA = 2; */ ALPHA = 2, /** * Beta is the point at which we are ready to open a release for any * customer to use. There are no SLA or technical support obligations in a * Beta release. Products will be complete from a feature perspective, but * may have some open outstanding issues. Beta releases are suitable for * limited production use cases. * * @generated from enum value: BETA = 3; */ BETA = 3, /** * GA features are open to all developers and are considered stable and * fully qualified for production use. * * @generated from enum value: GA = 4; */ GA = 4, /** * Deprecated features are scheduled to be shut down and removed. For more * information, see the "Deprecation Policy" section of our [Terms of * Service](https://cloud.google.com/terms/) * and the [Google Cloud Platform Subject to the Deprecation * Policy](https://cloud.google.com/terms/deprecation) documentation. * * @generated from enum value: DEPRECATED = 5; */ DEPRECATED = 5, } ⋮---- /** * Do not use this default value. * * @generated from enum value: LAUNCH_STAGE_UNSPECIFIED = 0; */ ⋮---- /** * The feature is not yet implemented. Users can not use it. * * @generated from enum value: UNIMPLEMENTED = 6; */ ⋮---- /** * Prelaunch features are hidden from users and are only visible internally. * * @generated from enum value: PRELAUNCH = 7; */ ⋮---- /** * Early Access features are limited to a closed group of testers. To use * these features, you must sign up in advance and sign a Trusted Tester * agreement (which includes confidentiality provisions). These features may * be unstable, changed in backward-incompatible ways, and are not * guaranteed to be released. * * @generated from enum value: EARLY_ACCESS = 1; */ ⋮---- /** * Alpha is a limited availability test for releases before they are cleared * for widespread use. By Alpha, all significant design issues are resolved * and we are in the process of verifying functionality. Alpha customers * need to apply for access, agree to applicable terms, and have their * projects allowlisted. Alpha releases don't have to be feature complete, * no SLAs are provided, and there are no technical support obligations, but * they will be far enough along that customers can actually use them in * test environments or for limited-use tests -- just like they would in * normal production cases. * * @generated from enum value: ALPHA = 2; */ ⋮---- /** * Beta is the point at which we are ready to open a release for any * customer to use. There are no SLA or technical support obligations in a * Beta release. Products will be complete from a feature perspective, but * may have some open outstanding issues. Beta releases are suitable for * limited production use cases. * * @generated from enum value: BETA = 3; */ ⋮---- /** * GA features are open to all developers and are considered stable and * fully qualified for production use. * * @generated from enum value: GA = 4; */ ⋮---- /** * Deprecated features are scheduled to be shut down and removed. For more * information, see the "Deprecation Policy" section of our [Terms of * Service](https://cloud.google.com/terms/) * and the [Google Cloud Platform Subject to the Deprecation * Policy](https://cloud.google.com/terms/deprecation) documentation. * * @generated from enum value: DEPRECATED = 5; */ ⋮---- /** * Describes the enum google.api.LaunchStage. */ export const LaunchStageSchema: GenEnum = /*@__PURE__*/ ```` ## File: src/gen/google/api/resource_pb.ts ````typescript // Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. ⋮---- // @generated by protoc-gen-es v2.6.3 with parameter "target=ts" // @generated from file google/api/resource.proto (package google.api, syntax proto3) /* eslint-disable */ ⋮---- import type { GenEnum, GenExtension, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; import { enumDesc, extDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; import type { FieldOptions, FileOptions, MessageOptions } from "@bufbuild/protobuf/wkt"; import { file_google_protobuf_descriptor } from "@bufbuild/protobuf/wkt"; import type { Message } from "@bufbuild/protobuf"; ⋮---- /** * Describes the file google/api/resource.proto. */ export const file_google_api_resource: GenFile = /*@__PURE__*/ ⋮---- /** * A simple descriptor of a resource type. * * ResourceDescriptor annotates a resource message (either by means of a * protobuf annotation or use in the service config), and associates the * resource's schema, the resource type, and the pattern of the resource name. * * Example: * * message Topic { * // Indicates this message defines a resource schema. * // Declares the resource type in the format of {service}/{kind}. * // For Kubernetes resources, the format is {api group}/{kind}. * option (google.api.resource) = { * type: "pubsub.googleapis.com/Topic" * pattern: "projects/{project}/topics/{topic}" * }; * } * * The ResourceDescriptor Yaml config will look like: * * resources: * - type: "pubsub.googleapis.com/Topic" * pattern: "projects/{project}/topics/{topic}" * * Sometimes, resources have multiple patterns, typically because they can * live under multiple parents. * * Example: * * message LogEntry { * option (google.api.resource) = { * type: "logging.googleapis.com/LogEntry" * pattern: "projects/{project}/logs/{log}" * pattern: "folders/{folder}/logs/{log}" * pattern: "organizations/{organization}/logs/{log}" * pattern: "billingAccounts/{billing_account}/logs/{log}" * }; * } * * The ResourceDescriptor Yaml config will look like: * * resources: * - type: 'logging.googleapis.com/LogEntry' * pattern: "projects/{project}/logs/{log}" * pattern: "folders/{folder}/logs/{log}" * pattern: "organizations/{organization}/logs/{log}" * pattern: "billingAccounts/{billing_account}/logs/{log}" * * @generated from message google.api.ResourceDescriptor */ export type ResourceDescriptor = Message<"google.api.ResourceDescriptor"> & { /** * The resource type. It must be in the format of * {service_name}/{resource_type_kind}. The `resource_type_kind` must be * singular and must not include version numbers. * * Example: `storage.googleapis.com/Bucket` * * The value of the resource_type_kind must follow the regular expression * /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and * should use PascalCase (UpperCamelCase). The maximum number of * characters allowed for the `resource_type_kind` is 100. * * @generated from field: string type = 1; */ type: string; /** * Optional. The relative resource name pattern associated with this resource * type. The DNS prefix of the full resource name shouldn't be specified here. * * The path pattern must follow the syntax, which aligns with HTTP binding * syntax: * * Template = Segment { "/" Segment } ; * Segment = LITERAL | Variable ; * Variable = "{" LITERAL "}" ; * * Examples: * * - "projects/{project}/topics/{topic}" * - "projects/{project}/knowledgeBases/{knowledge_base}" * * The components in braces correspond to the IDs for each resource in the * hierarchy. It is expected that, if multiple patterns are provided, * the same component name (e.g. "project") refers to IDs of the same * type of resource. * * @generated from field: repeated string pattern = 2; */ pattern: string[]; /** * Optional. The field on the resource that designates the resource name * field. If omitted, this is assumed to be "name". * * @generated from field: string name_field = 3; */ nameField: string; /** * Optional. The historical or future-looking state of the resource pattern. * * Example: * * // The InspectTemplate message originally only supported resource * // names with organization, and project was added later. * message InspectTemplate { * option (google.api.resource) = { * type: "dlp.googleapis.com/InspectTemplate" * pattern: * "organizations/{organization}/inspectTemplates/{inspect_template}" * pattern: "projects/{project}/inspectTemplates/{inspect_template}" * history: ORIGINALLY_SINGLE_PATTERN * }; * } * * @generated from field: google.api.ResourceDescriptor.History history = 4; */ history: ResourceDescriptor_History; /** * The plural name used in the resource name and permission names, such as * 'projects' for the resource name of 'projects/{project}' and the permission * name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception * to this is for Nested Collections that have stuttering names, as defined * in [AIP-122](https://google.aip.dev/122#nested-collections), where the * collection ID in the resource name pattern does not necessarily directly * match the `plural` value. * * It is the same concept of the `plural` field in k8s CRD spec * https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ * * Note: The plural form is required even for singleton resources. See * https://aip.dev/156 * * @generated from field: string plural = 5; */ plural: string; /** * The same concept of the `singular` field in k8s CRD spec * https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ * Such as "project" for the `resourcemanager.googleapis.com/Project` type. * * @generated from field: string singular = 6; */ singular: string; /** * Style flag(s) for this resource. * These indicate that a resource is expected to conform to a given * style. See the specific style flags for additional information. * * @generated from field: repeated google.api.ResourceDescriptor.Style style = 10; */ style: ResourceDescriptor_Style[]; }; ⋮---- /** * The resource type. It must be in the format of * {service_name}/{resource_type_kind}. The `resource_type_kind` must be * singular and must not include version numbers. * * Example: `storage.googleapis.com/Bucket` * * The value of the resource_type_kind must follow the regular expression * /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and * should use PascalCase (UpperCamelCase). The maximum number of * characters allowed for the `resource_type_kind` is 100. * * @generated from field: string type = 1; */ ⋮---- /** * Optional. The relative resource name pattern associated with this resource * type. The DNS prefix of the full resource name shouldn't be specified here. * * The path pattern must follow the syntax, which aligns with HTTP binding * syntax: * * Template = Segment { "/" Segment } ; * Segment = LITERAL | Variable ; * Variable = "{" LITERAL "}" ; * * Examples: * * - "projects/{project}/topics/{topic}" * - "projects/{project}/knowledgeBases/{knowledge_base}" * * The components in braces correspond to the IDs for each resource in the * hierarchy. It is expected that, if multiple patterns are provided, * the same component name (e.g. "project") refers to IDs of the same * type of resource. * * @generated from field: repeated string pattern = 2; */ ⋮---- /** * Optional. The field on the resource that designates the resource name * field. If omitted, this is assumed to be "name". * * @generated from field: string name_field = 3; */ ⋮---- /** * Optional. The historical or future-looking state of the resource pattern. * * Example: * * // The InspectTemplate message originally only supported resource * // names with organization, and project was added later. * message InspectTemplate { * option (google.api.resource) = { * type: "dlp.googleapis.com/InspectTemplate" * pattern: * "organizations/{organization}/inspectTemplates/{inspect_template}" * pattern: "projects/{project}/inspectTemplates/{inspect_template}" * history: ORIGINALLY_SINGLE_PATTERN * }; * } * * @generated from field: google.api.ResourceDescriptor.History history = 4; */ ⋮---- /** * The plural name used in the resource name and permission names, such as * 'projects' for the resource name of 'projects/{project}' and the permission * name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception * to this is for Nested Collections that have stuttering names, as defined * in [AIP-122](https://google.aip.dev/122#nested-collections), where the * collection ID in the resource name pattern does not necessarily directly * match the `plural` value. * * It is the same concept of the `plural` field in k8s CRD spec * https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ * * Note: The plural form is required even for singleton resources. See * https://aip.dev/156 * * @generated from field: string plural = 5; */ ⋮---- /** * The same concept of the `singular` field in k8s CRD spec * https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ * Such as "project" for the `resourcemanager.googleapis.com/Project` type. * * @generated from field: string singular = 6; */ ⋮---- /** * Style flag(s) for this resource. * These indicate that a resource is expected to conform to a given * style. See the specific style flags for additional information. * * @generated from field: repeated google.api.ResourceDescriptor.Style style = 10; */ ⋮---- /** * Describes the message google.api.ResourceDescriptor. * Use `create(ResourceDescriptorSchema)` to create a new message. */ export const ResourceDescriptorSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * A description of the historical or future-looking state of the * resource pattern. * * @generated from enum google.api.ResourceDescriptor.History */ export enum ResourceDescriptor_History { /** * The "unset" value. * * @generated from enum value: HISTORY_UNSPECIFIED = 0; */ HISTORY_UNSPECIFIED = 0, /** * The resource originally had one pattern and launched as such, and * additional patterns were added later. * * @generated from enum value: ORIGINALLY_SINGLE_PATTERN = 1; */ ORIGINALLY_SINGLE_PATTERN = 1, /** * The resource has one pattern, but the API owner expects to add more * later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents * that from being necessary once there are multiple patterns.) * * @generated from enum value: FUTURE_MULTI_PATTERN = 2; */ FUTURE_MULTI_PATTERN = 2, } ⋮---- /** * The "unset" value. * * @generated from enum value: HISTORY_UNSPECIFIED = 0; */ ⋮---- /** * The resource originally had one pattern and launched as such, and * additional patterns were added later. * * @generated from enum value: ORIGINALLY_SINGLE_PATTERN = 1; */ ⋮---- /** * The resource has one pattern, but the API owner expects to add more * later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents * that from being necessary once there are multiple patterns.) * * @generated from enum value: FUTURE_MULTI_PATTERN = 2; */ ⋮---- /** * Describes the enum google.api.ResourceDescriptor.History. */ export const ResourceDescriptor_HistorySchema: GenEnum = /*@__PURE__*/ ⋮---- /** * A flag representing a specific style that a resource claims to conform to. * * @generated from enum google.api.ResourceDescriptor.Style */ export enum ResourceDescriptor_Style { /** * The unspecified value. Do not use. * * @generated from enum value: STYLE_UNSPECIFIED = 0; */ STYLE_UNSPECIFIED = 0, /** * This resource is intended to be "declarative-friendly". * * Declarative-friendly resources must be more strictly consistent, and * setting this to true communicates to tools that this resource should * adhere to declarative-friendly expectations. * * Note: This is used by the API linter (linter.aip.dev) to enable * additional checks. * * @generated from enum value: DECLARATIVE_FRIENDLY = 1; */ DECLARATIVE_FRIENDLY = 1, } ⋮---- /** * The unspecified value. Do not use. * * @generated from enum value: STYLE_UNSPECIFIED = 0; */ ⋮---- /** * This resource is intended to be "declarative-friendly". * * Declarative-friendly resources must be more strictly consistent, and * setting this to true communicates to tools that this resource should * adhere to declarative-friendly expectations. * * Note: This is used by the API linter (linter.aip.dev) to enable * additional checks. * * @generated from enum value: DECLARATIVE_FRIENDLY = 1; */ ⋮---- /** * Describes the enum google.api.ResourceDescriptor.Style. */ export const ResourceDescriptor_StyleSchema: GenEnum = /*@__PURE__*/ ⋮---- /** * Defines a proto annotation that describes a string field that refers to * an API resource. * * @generated from message google.api.ResourceReference */ export type ResourceReference = Message<"google.api.ResourceReference"> & { /** * The resource type that the annotated field references. * * Example: * * message Subscription { * string topic = 2 [(google.api.resource_reference) = { * type: "pubsub.googleapis.com/Topic" * }]; * } * * Occasionally, a field may reference an arbitrary resource. In this case, * APIs use the special value * in their resource reference. * * Example: * * message GetIamPolicyRequest { * string resource = 2 [(google.api.resource_reference) = { * type: "*" * }]; * } * * @generated from field: string type = 1; */ type: string; /** * The resource type of a child collection that the annotated field * references. This is useful for annotating the `parent` field that * doesn't have a fixed resource type. * * Example: * * message ListLogEntriesRequest { * string parent = 1 [(google.api.resource_reference) = { * child_type: "logging.googleapis.com/LogEntry" * }; * } * * @generated from field: string child_type = 2; */ childType: string; }; ⋮---- /** * The resource type that the annotated field references. * * Example: * * message Subscription { * string topic = 2 [(google.api.resource_reference) = { * type: "pubsub.googleapis.com/Topic" * }]; * } * * Occasionally, a field may reference an arbitrary resource. In this case, * APIs use the special value * in their resource reference. * * Example: * * message GetIamPolicyRequest { * string resource = 2 [(google.api.resource_reference) = { * type: "*" * }]; * } * * @generated from field: string type = 1; */ ⋮---- /** * The resource type of a child collection that the annotated field * references. This is useful for annotating the `parent` field that * doesn't have a fixed resource type. * * Example: * * message ListLogEntriesRequest { * string parent = 1 [(google.api.resource_reference) = { * child_type: "logging.googleapis.com/LogEntry" * }; * } * * @generated from field: string child_type = 2; */ ⋮---- /** * Describes the message google.api.ResourceReference. * Use `create(ResourceReferenceSchema)` to create a new message. */ export const ResourceReferenceSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * An annotation that describes a resource reference, see * [ResourceReference][]. * * @generated from extension: google.api.ResourceReference resource_reference = 1055; */ export const resource_reference: GenExtension = /*@__PURE__*/ ⋮---- /** * An annotation that describes a resource definition without a corresponding * message; see [ResourceDescriptor][]. * * @generated from extension: repeated google.api.ResourceDescriptor resource_definition = 1053; */ export const resource_definition: GenExtension = /*@__PURE__*/ ⋮---- /** * An annotation that describes a resource definition, see * [ResourceDescriptor][]. * * @generated from extension: google.api.ResourceDescriptor resource = 1053; */ export const resource: GenExtension = /*@__PURE__*/ ```` ## File: src/gen/google/api/visibility_pb.ts ````typescript // Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. ⋮---- // @generated by protoc-gen-es v2.6.3 with parameter "target=ts" // @generated from file google/api/visibility.proto (package google.api, syntax proto3) /* eslint-disable */ ⋮---- import type { GenExtension, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; import { extDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; import type { EnumOptions, EnumValueOptions, FieldOptions, MessageOptions, MethodOptions, ServiceOptions } from "@bufbuild/protobuf/wkt"; import { file_google_protobuf_descriptor } from "@bufbuild/protobuf/wkt"; import type { Message } from "@bufbuild/protobuf"; ⋮---- /** * Describes the file google/api/visibility.proto. */ export const file_google_api_visibility: GenFile = /*@__PURE__*/ ⋮---- /** * `Visibility` restricts service consumer's access to service elements, * such as whether an application can call a visibility-restricted method. * The restriction is expressed by applying visibility labels on service * elements. The visibility labels are elsewhere linked to service consumers. * * A service can define multiple visibility labels, but a service consumer * should be granted at most one visibility label. Multiple visibility * labels for a single service consumer are not supported. * * If an element and all its parents have no visibility label, its visibility * is unconditionally granted. * * Example: * * visibility: * rules: * - selector: google.calendar.Calendar.EnhancedSearch * restriction: PREVIEW * - selector: google.calendar.Calendar.Delegate * restriction: INTERNAL * * Here, all methods are publicly visible except for the restricted methods * EnhancedSearch and Delegate. * * @generated from message google.api.Visibility */ export type Visibility = Message<"google.api.Visibility"> & { /** * A list of visibility rules that apply to individual API elements. * * **NOTE:** All service configuration rules follow "last one wins" order. * * @generated from field: repeated google.api.VisibilityRule rules = 1; */ rules: VisibilityRule[]; }; ⋮---- /** * A list of visibility rules that apply to individual API elements. * * **NOTE:** All service configuration rules follow "last one wins" order. * * @generated from field: repeated google.api.VisibilityRule rules = 1; */ ⋮---- /** * Describes the message google.api.Visibility. * Use `create(VisibilitySchema)` to create a new message. */ export const VisibilitySchema: GenMessage = /*@__PURE__*/ ⋮---- /** * A visibility rule provides visibility configuration for an individual API * element. * * @generated from message google.api.VisibilityRule */ export type VisibilityRule = Message<"google.api.VisibilityRule"> & { /** * Selects methods, messages, fields, enums, etc. to which this rule applies. * * Refer to [selector][google.api.DocumentationRule.selector] for syntax * details. * * @generated from field: string selector = 1; */ selector: string; /** * A comma-separated list of visibility labels that apply to the `selector`. * Any of the listed labels can be used to grant the visibility. * * If a rule has multiple labels, removing one of the labels but not all of * them can break clients. * * Example: * * visibility: * rules: * - selector: google.calendar.Calendar.EnhancedSearch * restriction: INTERNAL, PREVIEW * * Removing INTERNAL from this restriction will break clients that rely on * this method and only had access to it through INTERNAL. * * @generated from field: string restriction = 2; */ restriction: string; }; ⋮---- /** * Selects methods, messages, fields, enums, etc. to which this rule applies. * * Refer to [selector][google.api.DocumentationRule.selector] for syntax * details. * * @generated from field: string selector = 1; */ ⋮---- /** * A comma-separated list of visibility labels that apply to the `selector`. * Any of the listed labels can be used to grant the visibility. * * If a rule has multiple labels, removing one of the labels but not all of * them can break clients. * * Example: * * visibility: * rules: * - selector: google.calendar.Calendar.EnhancedSearch * restriction: INTERNAL, PREVIEW * * Removing INTERNAL from this restriction will break clients that rely on * this method and only had access to it through INTERNAL. * * @generated from field: string restriction = 2; */ ⋮---- /** * Describes the message google.api.VisibilityRule. * Use `create(VisibilityRuleSchema)` to create a new message. */ export const VisibilityRuleSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * See `VisibilityRule`. * * @generated from extension: google.api.VisibilityRule enum_visibility = 72295727; */ export const enum_visibility: GenExtension = /*@__PURE__*/ ⋮---- /** * See `VisibilityRule`. * * @generated from extension: google.api.VisibilityRule value_visibility = 72295727; */ export const value_visibility: GenExtension = /*@__PURE__*/ ⋮---- /** * See `VisibilityRule`. * * @generated from extension: google.api.VisibilityRule field_visibility = 72295727; */ export const field_visibility: GenExtension = /*@__PURE__*/ ⋮---- /** * See `VisibilityRule`. * * @generated from extension: google.api.VisibilityRule message_visibility = 72295727; */ export const message_visibility: GenExtension = /*@__PURE__*/ ⋮---- /** * See `VisibilityRule`. * * @generated from extension: google.api.VisibilityRule method_visibility = 72295727; */ export const method_visibility: GenExtension = /*@__PURE__*/ ⋮---- /** * See `VisibilityRule`. * * @generated from extension: google.api.VisibilityRule api_visibility = 72295727; */ export const api_visibility: GenExtension = /*@__PURE__*/ ```` ## File: src/gen/google/bytestream/bytestream_pb.ts ````typescript // Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. ⋮---- // @generated by protoc-gen-es v2.6.3 with parameter "target=ts" // @generated from file google/bytestream/bytestream.proto (package google.bytestream, syntax proto3) /* eslint-disable */ ⋮---- import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2"; import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2"; import type { Message } from "@bufbuild/protobuf"; ⋮---- /** * Describes the file google/bytestream/bytestream.proto. */ export const file_google_bytestream_bytestream: GenFile = /*@__PURE__*/ ⋮---- /** * Request object for ByteStream.Read. * * @generated from message google.bytestream.ReadRequest */ export type ReadRequest = Message<"google.bytestream.ReadRequest"> & { /** * The name of the resource to read. * * @generated from field: string resource_name = 1; */ resourceName: string; /** * The offset for the first byte to return in the read, relative to the start * of the resource. * * A `read_offset` that is negative or greater than the size of the resource * will cause an `OUT_OF_RANGE` error. * * @generated from field: int64 read_offset = 2; */ readOffset: bigint; /** * The maximum number of `data` bytes the server is allowed to return in the * sum of all `ReadResponse` messages. A `read_limit` of zero indicates that * there is no limit, and a negative `read_limit` will cause an error. * * If the stream returns fewer bytes than allowed by the `read_limit` and no * error occurred, the stream includes all data from the `read_offset` to the * end of the resource. * * @generated from field: int64 read_limit = 3; */ readLimit: bigint; }; ⋮---- /** * The name of the resource to read. * * @generated from field: string resource_name = 1; */ ⋮---- /** * The offset for the first byte to return in the read, relative to the start * of the resource. * * A `read_offset` that is negative or greater than the size of the resource * will cause an `OUT_OF_RANGE` error. * * @generated from field: int64 read_offset = 2; */ ⋮---- /** * The maximum number of `data` bytes the server is allowed to return in the * sum of all `ReadResponse` messages. A `read_limit` of zero indicates that * there is no limit, and a negative `read_limit` will cause an error. * * If the stream returns fewer bytes than allowed by the `read_limit` and no * error occurred, the stream includes all data from the `read_offset` to the * end of the resource. * * @generated from field: int64 read_limit = 3; */ ⋮---- /** * Describes the message google.bytestream.ReadRequest. * Use `create(ReadRequestSchema)` to create a new message. */ export const ReadRequestSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Response object for ByteStream.Read. * * @generated from message google.bytestream.ReadResponse */ export type ReadResponse = Message<"google.bytestream.ReadResponse"> & { /** * A portion of the data for the resource. The service **may** leave `data` * empty for any given `ReadResponse`. This enables the service to inform the * client that the request is still live while it is running an operation to * generate more data. * * @generated from field: bytes data = 10; */ data: Uint8Array; }; ⋮---- /** * A portion of the data for the resource. The service **may** leave `data` * empty for any given `ReadResponse`. This enables the service to inform the * client that the request is still live while it is running an operation to * generate more data. * * @generated from field: bytes data = 10; */ ⋮---- /** * Describes the message google.bytestream.ReadResponse. * Use `create(ReadResponseSchema)` to create a new message. */ export const ReadResponseSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Request object for ByteStream.Write. * * @generated from message google.bytestream.WriteRequest */ export type WriteRequest = Message<"google.bytestream.WriteRequest"> & { /** * The name of the resource to write. This **must** be set on the first * `WriteRequest` of each `Write()` action. If it is set on subsequent calls, * it **must** match the value of the first request. * * @generated from field: string resource_name = 1; */ resourceName: string; /** * The offset from the beginning of the resource at which the data should be * written. It is required on all `WriteRequest`s. * * In the first `WriteRequest` of a `Write()` action, it indicates * the initial offset for the `Write()` call. The value **must** be equal to * the `committed_size` that a call to `QueryWriteStatus()` would return. * * On subsequent calls, this value **must** be set and **must** be equal to * the sum of the first `write_offset` and the sizes of all `data` bundles * sent previously on this stream. * * An incorrect value will cause an error. * * @generated from field: int64 write_offset = 2; */ writeOffset: bigint; /** * If `true`, this indicates that the write is complete. Sending any * `WriteRequest`s subsequent to one in which `finish_write` is `true` will * cause an error. * * @generated from field: bool finish_write = 3; */ finishWrite: boolean; /** * A portion of the data for the resource. The client **may** leave `data` * empty for any given `WriteRequest`. This enables the client to inform the * service that the request is still live while it is running an operation to * generate more data. * * @generated from field: bytes data = 10; */ data: Uint8Array; }; ⋮---- /** * The name of the resource to write. This **must** be set on the first * `WriteRequest` of each `Write()` action. If it is set on subsequent calls, * it **must** match the value of the first request. * * @generated from field: string resource_name = 1; */ ⋮---- /** * The offset from the beginning of the resource at which the data should be * written. It is required on all `WriteRequest`s. * * In the first `WriteRequest` of a `Write()` action, it indicates * the initial offset for the `Write()` call. The value **must** be equal to * the `committed_size` that a call to `QueryWriteStatus()` would return. * * On subsequent calls, this value **must** be set and **must** be equal to * the sum of the first `write_offset` and the sizes of all `data` bundles * sent previously on this stream. * * An incorrect value will cause an error. * * @generated from field: int64 write_offset = 2; */ ⋮---- /** * If `true`, this indicates that the write is complete. Sending any * `WriteRequest`s subsequent to one in which `finish_write` is `true` will * cause an error. * * @generated from field: bool finish_write = 3; */ ⋮---- /** * A portion of the data for the resource. The client **may** leave `data` * empty for any given `WriteRequest`. This enables the client to inform the * service that the request is still live while it is running an operation to * generate more data. * * @generated from field: bytes data = 10; */ ⋮---- /** * Describes the message google.bytestream.WriteRequest. * Use `create(WriteRequestSchema)` to create a new message. */ export const WriteRequestSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Response object for ByteStream.Write. * * @generated from message google.bytestream.WriteResponse */ export type WriteResponse = Message<"google.bytestream.WriteResponse"> & { /** * The number of bytes that have been processed for the given resource. * * @generated from field: int64 committed_size = 1; */ committedSize: bigint; }; ⋮---- /** * The number of bytes that have been processed for the given resource. * * @generated from field: int64 committed_size = 1; */ ⋮---- /** * Describes the message google.bytestream.WriteResponse. * Use `create(WriteResponseSchema)` to create a new message. */ export const WriteResponseSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Request object for ByteStream.QueryWriteStatus. * * @generated from message google.bytestream.QueryWriteStatusRequest */ export type QueryWriteStatusRequest = Message<"google.bytestream.QueryWriteStatusRequest"> & { /** * The name of the resource whose write status is being requested. * * @generated from field: string resource_name = 1; */ resourceName: string; }; ⋮---- /** * The name of the resource whose write status is being requested. * * @generated from field: string resource_name = 1; */ ⋮---- /** * Describes the message google.bytestream.QueryWriteStatusRequest. * Use `create(QueryWriteStatusRequestSchema)` to create a new message. */ export const QueryWriteStatusRequestSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Response object for ByteStream.QueryWriteStatus. * * @generated from message google.bytestream.QueryWriteStatusResponse */ export type QueryWriteStatusResponse = Message<"google.bytestream.QueryWriteStatusResponse"> & { /** * The number of bytes that have been processed for the given resource. * * @generated from field: int64 committed_size = 1; */ committedSize: bigint; /** * `complete` is `true` only if the client has sent a `WriteRequest` with * `finish_write` set to true, and the server has processed that request. * * @generated from field: bool complete = 2; */ complete: boolean; }; ⋮---- /** * The number of bytes that have been processed for the given resource. * * @generated from field: int64 committed_size = 1; */ ⋮---- /** * `complete` is `true` only if the client has sent a `WriteRequest` with * `finish_write` set to true, and the server has processed that request. * * @generated from field: bool complete = 2; */ ⋮---- /** * Describes the message google.bytestream.QueryWriteStatusResponse. * Use `create(QueryWriteStatusResponseSchema)` to create a new message. */ export const QueryWriteStatusResponseSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * #### Introduction * * The Byte Stream API enables a client to read and write a stream of bytes to * and from a resource. Resources have names, and these names are supplied in * the API calls below to identify the resource that is being read from or * written to. * * All implementations of the Byte Stream API export the interface defined here: * * * `Read()`: Reads the contents of a resource. * * * `Write()`: Writes the contents of a resource. The client can call `Write()` * multiple times with the same resource and can check the status of the write * by calling `QueryWriteStatus()`. * * #### Service parameters and metadata * * The ByteStream API provides no direct way to access/modify any metadata * associated with the resource. * * #### Errors * * The errors returned by the service are in the Google canonical error space. * * @generated from service google.bytestream.ByteStream */ ⋮---- /** * `Read()` is used to retrieve the contents of a resource as a sequence * of bytes. The bytes are returned in a sequence of responses, and the * responses are delivered as the results of a server-side streaming RPC. * * @generated from rpc google.bytestream.ByteStream.Read */ ⋮---- /** * `Write()` is used to send the contents of a resource as a sequence of * bytes. The bytes are sent in a sequence of request protos of a client-side * streaming RPC. * * A `Write()` action is resumable. If there is an error or the connection is * broken during the `Write()`, the client should check the status of the * `Write()` by calling `QueryWriteStatus()` and continue writing from the * returned `committed_size`. This may be less than the amount of data the * client previously sent. * * Calling `Write()` on a resource name that was previously written and * finalized could cause an error, depending on whether the underlying service * allows over-writing of previously written resources. * * When the client closes the request channel, the service will respond with * a `WriteResponse`. The service will not view the resource as `complete` * until the client has sent a `WriteRequest` with `finish_write` set to * `true`. Sending any requests on a stream after sending a request with * `finish_write` set to `true` will cause an error. The client **should** * check the `WriteResponse` it receives to determine how much data the * service was able to commit and whether the service views the resource as * `complete` or not. * * @generated from rpc google.bytestream.ByteStream.Write */ ⋮---- /** * `QueryWriteStatus()` is used to find the `committed_size` for a resource * that is being written, which can then be used as the `write_offset` for * the next `Write()` call. * * If the resource does not exist (i.e., the resource has been deleted, or the * first `Write()` has not yet reached the service), this method returns the * error `NOT_FOUND`. * * The client **may** call `QueryWriteStatus()` at any time to determine how * much data has been processed for this resource. This is useful if the * client is buffering data and needs to know which data can be safely * evicted. For any sequence of `QueryWriteStatus()` calls for a given * resource name, the sequence of returned `committed_size` values will be * non-decreasing. * * @generated from rpc google.bytestream.ByteStream.QueryWriteStatus */ ⋮---- }> = /*@__PURE__*/ ```` ## File: src/gen/google/geo/type/viewport_pb.ts ````typescript // Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // ⋮---- // @generated by protoc-gen-es v2.6.3 with parameter "target=ts" // @generated from file google/geo/type/viewport.proto (package google.geo.type, syntax proto3) /* eslint-disable */ ⋮---- import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; import type { LatLng } from "../../type/latlng_pb"; import { file_google_type_latlng } from "../../type/latlng_pb"; import type { Message } from "@bufbuild/protobuf"; ⋮---- /** * Describes the file google/geo/type/viewport.proto. */ export const file_google_geo_type_viewport: GenFile = /*@__PURE__*/ ⋮---- /** * A latitude-longitude viewport, represented as two diagonally opposite `low` * and `high` points. A viewport is considered a closed region, i.e. it includes * its boundary. The latitude bounds must range between -90 to 90 degrees * inclusive, and the longitude bounds must range between -180 to 180 degrees * inclusive. Various cases include: * * - If `low` = `high`, the viewport consists of that single point. * * - If `low.longitude` > `high.longitude`, the longitude range is inverted * (the viewport crosses the 180 degree longitude line). * * - If `low.longitude` = -180 degrees and `high.longitude` = 180 degrees, * the viewport includes all longitudes. * * - If `low.longitude` = 180 degrees and `high.longitude` = -180 degrees, * the longitude range is empty. * * - If `low.latitude` > `high.latitude`, the latitude range is empty. * * Both `low` and `high` must be populated, and the represented box cannot be * empty (as specified by the definitions above). An empty viewport will result * in an error. * * For example, this viewport fully encloses New York City: * * { * "low": { * "latitude": 40.477398, * "longitude": -74.259087 * }, * "high": { * "latitude": 40.91618, * "longitude": -73.70018 * } * } * * @generated from message google.geo.type.Viewport */ export type Viewport = Message<"google.geo.type.Viewport"> & { /** * Required. The low point of the viewport. * * @generated from field: google.type.LatLng low = 1; */ low?: LatLng; /** * Required. The high point of the viewport. * * @generated from field: google.type.LatLng high = 2; */ high?: LatLng; }; ⋮---- /** * Required. The low point of the viewport. * * @generated from field: google.type.LatLng low = 1; */ ⋮---- /** * Required. The high point of the viewport. * * @generated from field: google.type.LatLng high = 2; */ ⋮---- /** * Describes the message google.geo.type.Viewport. * Use `create(ViewportSchema)` to create a new message. */ export const ViewportSchema: GenMessage = /*@__PURE__*/ ```` ## File: src/gen/google/longrunning/operations_pb.ts ````typescript // Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. ⋮---- // @generated by protoc-gen-es v2.6.3 with parameter "target=ts" // @generated from file google/longrunning/operations.proto (package google.longrunning, syntax proto3) /* eslint-disable */ ⋮---- import type { GenExtension, GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2"; import { extDesc, fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2"; import { file_google_api_annotations } from "../api/annotations_pb"; import { file_google_api_client } from "../api/client_pb"; import { file_google_api_field_behavior } from "../api/field_behavior_pb"; import type { Any, Duration, EmptySchema, MethodOptions } from "@bufbuild/protobuf/wkt"; import { file_google_protobuf_any, file_google_protobuf_descriptor, file_google_protobuf_duration, file_google_protobuf_empty } from "@bufbuild/protobuf/wkt"; import type { Status } from "../rpc/status_pb"; import { file_google_rpc_status } from "../rpc/status_pb"; import type { Message } from "@bufbuild/protobuf"; ⋮---- /** * Describes the file google/longrunning/operations.proto. */ export const file_google_longrunning_operations: GenFile = /*@__PURE__*/ ⋮---- /** * This resource represents a long-running operation that is the result of a * network API call. * * @generated from message google.longrunning.Operation */ export type Operation = Message<"google.longrunning.Operation"> & { /** * The server-assigned name, which is only unique within the same service that * originally returns it. If you use the default HTTP mapping, the * `name` should be a resource name ending with `operations/{unique_id}`. * * @generated from field: string name = 1; */ name: string; /** * Service-specific metadata associated with the operation. It typically * contains progress information and common metadata such as create time. * Some services might not provide such metadata. Any method that returns a * long-running operation should document the metadata type, if any. * * @generated from field: google.protobuf.Any metadata = 2; */ metadata?: Any; /** * If the value is `false`, it means the operation is still in progress. * If `true`, the operation is completed, and either `error` or `response` is * available. * * @generated from field: bool done = 3; */ done: boolean; /** * The operation result, which can be either an `error` or a valid `response`. * If `done` == `false`, neither `error` nor `response` is set. * If `done` == `true`, exactly one of `error` or `response` can be set. * Some services might not provide the result. * * @generated from oneof google.longrunning.Operation.result */ result: { /** * The error result of the operation in case of failure or cancellation. * * @generated from field: google.rpc.Status error = 4; */ value: Status; case: "error"; } | { /** * The normal, successful response of the operation. If the original * method returns no data on success, such as `Delete`, the response is * `google.protobuf.Empty`. If the original method is standard * `Get`/`Create`/`Update`, the response should be the resource. For other * methods, the response should have the type `XxxResponse`, where `Xxx` * is the original method name. For example, if the original method name * is `TakeSnapshot()`, the inferred response type is * `TakeSnapshotResponse`. * * @generated from field: google.protobuf.Any response = 5; */ value: Any; case: "response"; } | { case: undefined; value?: undefined }; }; ⋮---- /** * The server-assigned name, which is only unique within the same service that * originally returns it. If you use the default HTTP mapping, the * `name` should be a resource name ending with `operations/{unique_id}`. * * @generated from field: string name = 1; */ ⋮---- /** * Service-specific metadata associated with the operation. It typically * contains progress information and common metadata such as create time. * Some services might not provide such metadata. Any method that returns a * long-running operation should document the metadata type, if any. * * @generated from field: google.protobuf.Any metadata = 2; */ ⋮---- /** * If the value is `false`, it means the operation is still in progress. * If `true`, the operation is completed, and either `error` or `response` is * available. * * @generated from field: bool done = 3; */ ⋮---- /** * The operation result, which can be either an `error` or a valid `response`. * If `done` == `false`, neither `error` nor `response` is set. * If `done` == `true`, exactly one of `error` or `response` can be set. * Some services might not provide the result. * * @generated from oneof google.longrunning.Operation.result */ ⋮---- /** * The error result of the operation in case of failure or cancellation. * * @generated from field: google.rpc.Status error = 4; */ ⋮---- /** * The normal, successful response of the operation. If the original * method returns no data on success, such as `Delete`, the response is * `google.protobuf.Empty`. If the original method is standard * `Get`/`Create`/`Update`, the response should be the resource. For other * methods, the response should have the type `XxxResponse`, where `Xxx` * is the original method name. For example, if the original method name * is `TakeSnapshot()`, the inferred response type is * `TakeSnapshotResponse`. * * @generated from field: google.protobuf.Any response = 5; */ ⋮---- /** * Describes the message google.longrunning.Operation. * Use `create(OperationSchema)` to create a new message. */ export const OperationSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * The request message for * [Operations.GetOperation][google.longrunning.Operations.GetOperation]. * * @generated from message google.longrunning.GetOperationRequest */ export type GetOperationRequest = Message<"google.longrunning.GetOperationRequest"> & { /** * The name of the operation resource. * * @generated from field: string name = 1; */ name: string; }; ⋮---- /** * The name of the operation resource. * * @generated from field: string name = 1; */ ⋮---- /** * Describes the message google.longrunning.GetOperationRequest. * Use `create(GetOperationRequestSchema)` to create a new message. */ export const GetOperationRequestSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * The request message for * [Operations.ListOperations][google.longrunning.Operations.ListOperations]. * * @generated from message google.longrunning.ListOperationsRequest */ export type ListOperationsRequest = Message<"google.longrunning.ListOperationsRequest"> & { /** * The name of the operation's parent resource. * * @generated from field: string name = 4; */ name: string; /** * The standard list filter. * * @generated from field: string filter = 1; */ filter: string; /** * The standard list page size. * * @generated from field: int32 page_size = 2; */ pageSize: number; /** * The standard list page token. * * @generated from field: string page_token = 3; */ pageToken: string; /** * When set to `true`, operations that are reachable are returned as normal, * and those that are unreachable are returned in the * [ListOperationsResponse.unreachable] field. * * This can only be `true` when reading across collections e.g. when `parent` * is set to `"projects/example/locations/-"`. * * This field is not by default supported and will result in an * `UNIMPLEMENTED` error if set unless explicitly documented otherwise in * service or product specific documentation. * * @generated from field: bool return_partial_success = 5; */ returnPartialSuccess: boolean; }; ⋮---- /** * The name of the operation's parent resource. * * @generated from field: string name = 4; */ ⋮---- /** * The standard list filter. * * @generated from field: string filter = 1; */ ⋮---- /** * The standard list page size. * * @generated from field: int32 page_size = 2; */ ⋮---- /** * The standard list page token. * * @generated from field: string page_token = 3; */ ⋮---- /** * When set to `true`, operations that are reachable are returned as normal, * and those that are unreachable are returned in the * [ListOperationsResponse.unreachable] field. * * This can only be `true` when reading across collections e.g. when `parent` * is set to `"projects/example/locations/-"`. * * This field is not by default supported and will result in an * `UNIMPLEMENTED` error if set unless explicitly documented otherwise in * service or product specific documentation. * * @generated from field: bool return_partial_success = 5; */ ⋮---- /** * Describes the message google.longrunning.ListOperationsRequest. * Use `create(ListOperationsRequestSchema)` to create a new message. */ export const ListOperationsRequestSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * The response message for * [Operations.ListOperations][google.longrunning.Operations.ListOperations]. * * @generated from message google.longrunning.ListOperationsResponse */ export type ListOperationsResponse = Message<"google.longrunning.ListOperationsResponse"> & { /** * A list of operations that matches the specified filter in the request. * * @generated from field: repeated google.longrunning.Operation operations = 1; */ operations: Operation[]; /** * The standard List next-page token. * * @generated from field: string next_page_token = 2; */ nextPageToken: string; /** * Unordered list. Unreachable resources. Populated when the request sets * `ListOperationsRequest.return_partial_success` and reads across * collections e.g. when attempting to list all resources across all supported * locations. * * @generated from field: repeated string unreachable = 3; */ unreachable: string[]; }; ⋮---- /** * A list of operations that matches the specified filter in the request. * * @generated from field: repeated google.longrunning.Operation operations = 1; */ ⋮---- /** * The standard List next-page token. * * @generated from field: string next_page_token = 2; */ ⋮---- /** * Unordered list. Unreachable resources. Populated when the request sets * `ListOperationsRequest.return_partial_success` and reads across * collections e.g. when attempting to list all resources across all supported * locations. * * @generated from field: repeated string unreachable = 3; */ ⋮---- /** * Describes the message google.longrunning.ListOperationsResponse. * Use `create(ListOperationsResponseSchema)` to create a new message. */ export const ListOperationsResponseSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * The request message for * [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]. * * @generated from message google.longrunning.CancelOperationRequest */ export type CancelOperationRequest = Message<"google.longrunning.CancelOperationRequest"> & { /** * The name of the operation resource to be cancelled. * * @generated from field: string name = 1; */ name: string; }; ⋮---- /** * The name of the operation resource to be cancelled. * * @generated from field: string name = 1; */ ⋮---- /** * Describes the message google.longrunning.CancelOperationRequest. * Use `create(CancelOperationRequestSchema)` to create a new message. */ export const CancelOperationRequestSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * The request message for * [Operations.DeleteOperation][google.longrunning.Operations.DeleteOperation]. * * @generated from message google.longrunning.DeleteOperationRequest */ export type DeleteOperationRequest = Message<"google.longrunning.DeleteOperationRequest"> & { /** * The name of the operation resource to be deleted. * * @generated from field: string name = 1; */ name: string; }; ⋮---- /** * The name of the operation resource to be deleted. * * @generated from field: string name = 1; */ ⋮---- /** * Describes the message google.longrunning.DeleteOperationRequest. * Use `create(DeleteOperationRequestSchema)` to create a new message. */ export const DeleteOperationRequestSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * The request message for * [Operations.WaitOperation][google.longrunning.Operations.WaitOperation]. * * @generated from message google.longrunning.WaitOperationRequest */ export type WaitOperationRequest = Message<"google.longrunning.WaitOperationRequest"> & { /** * The name of the operation resource to wait on. * * @generated from field: string name = 1; */ name: string; /** * The maximum duration to wait before timing out. If left blank, the wait * will be at most the time permitted by the underlying HTTP/RPC protocol. * If RPC context deadline is also specified, the shorter one will be used. * * @generated from field: google.protobuf.Duration timeout = 2; */ timeout?: Duration; }; ⋮---- /** * The name of the operation resource to wait on. * * @generated from field: string name = 1; */ ⋮---- /** * The maximum duration to wait before timing out. If left blank, the wait * will be at most the time permitted by the underlying HTTP/RPC protocol. * If RPC context deadline is also specified, the shorter one will be used. * * @generated from field: google.protobuf.Duration timeout = 2; */ ⋮---- /** * Describes the message google.longrunning.WaitOperationRequest. * Use `create(WaitOperationRequestSchema)` to create a new message. */ export const WaitOperationRequestSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * A message representing the message types used by a long-running operation. * * Example: * * rpc Export(ExportRequest) returns (google.longrunning.Operation) { * option (google.longrunning.operation_info) = { * response_type: "ExportResponse" * metadata_type: "ExportMetadata" * }; * } * * @generated from message google.longrunning.OperationInfo */ export type OperationInfo = Message<"google.longrunning.OperationInfo"> & { /** * Required. The message name of the primary return type for this * long-running operation. * This type will be used to deserialize the LRO's response. * * If the response is in a different package from the rpc, a fully-qualified * message name must be used (e.g. `google.protobuf.Struct`). * * Note: Altering this value constitutes a breaking change. * * @generated from field: string response_type = 1; */ responseType: string; /** * Required. The message name of the metadata type for this long-running * operation. * * If the response is in a different package from the rpc, a fully-qualified * message name must be used (e.g. `google.protobuf.Struct`). * * Note: Altering this value constitutes a breaking change. * * @generated from field: string metadata_type = 2; */ metadataType: string; }; ⋮---- /** * Required. The message name of the primary return type for this * long-running operation. * This type will be used to deserialize the LRO's response. * * If the response is in a different package from the rpc, a fully-qualified * message name must be used (e.g. `google.protobuf.Struct`). * * Note: Altering this value constitutes a breaking change. * * @generated from field: string response_type = 1; */ ⋮---- /** * Required. The message name of the metadata type for this long-running * operation. * * If the response is in a different package from the rpc, a fully-qualified * message name must be used (e.g. `google.protobuf.Struct`). * * Note: Altering this value constitutes a breaking change. * * @generated from field: string metadata_type = 2; */ ⋮---- /** * Describes the message google.longrunning.OperationInfo. * Use `create(OperationInfoSchema)` to create a new message. */ export const OperationInfoSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Manages long-running operations with an API service. * * When an API method normally takes long time to complete, it can be designed * to return [Operation][google.longrunning.Operation] to the client, and the * client can use this interface to receive the real response asynchronously by * polling the operation resource, or pass the operation resource to another API * (such as Pub/Sub API) to receive the response. Any API service that returns * long-running operations should implement the `Operations` interface so * developers can have a consistent client experience. * * @generated from service google.longrunning.Operations */ ⋮---- /** * Lists operations that match the specified filter in the request. If the * server doesn't support this method, it returns `UNIMPLEMENTED`. * * @generated from rpc google.longrunning.Operations.ListOperations */ ⋮---- /** * Gets the latest state of a long-running operation. Clients can use this * method to poll the operation result at intervals as recommended by the API * service. * * @generated from rpc google.longrunning.Operations.GetOperation */ ⋮---- /** * Deletes a long-running operation. This method indicates that the client is * no longer interested in the operation result. It does not cancel the * operation. If the server doesn't support this method, it returns * `google.rpc.Code.UNIMPLEMENTED`. * * @generated from rpc google.longrunning.Operations.DeleteOperation */ ⋮---- /** * Starts asynchronous cancellation on a long-running operation. The server * makes a best effort to cancel the operation, but success is not * guaranteed. If the server doesn't support this method, it returns * `google.rpc.Code.UNIMPLEMENTED`. Clients can use * [Operations.GetOperation][google.longrunning.Operations.GetOperation] or * other methods to check whether the cancellation succeeded or whether the * operation completed despite cancellation. On successful cancellation, * the operation is not deleted; instead, it becomes an operation with * an [Operation.error][google.longrunning.Operation.error] value with a * [google.rpc.Status.code][google.rpc.Status.code] of `1`, corresponding to * `Code.CANCELLED`. * * @generated from rpc google.longrunning.Operations.CancelOperation */ ⋮---- /** * Waits until the specified long-running operation is done or reaches at most * a specified timeout, returning the latest state. If the operation is * already done, the latest state is immediately returned. If the timeout * specified is greater than the default HTTP/RPC timeout, the HTTP/RPC * timeout is used. If the server does not support this method, it returns * `google.rpc.Code.UNIMPLEMENTED`. * Note that this method is on a best-effort basis. It may return the latest * state before the specified timeout (including immediately), meaning even an * immediate response is no guarantee that the operation is done. * * @generated from rpc google.longrunning.Operations.WaitOperation */ ⋮---- }> = /*@__PURE__*/ ⋮---- /** * Additional information regarding long-running operations. * In particular, this specifies the types that are returned from * long-running operations. * * Required for methods that return `google.longrunning.Operation`; invalid * otherwise. * * @generated from extension: google.longrunning.OperationInfo operation_info = 1049; */ export const operation_info: GenExtension = /*@__PURE__*/ ```` ## File: src/gen/google/protobuf/compiler/plugin_pb.ts ````typescript // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd ⋮---- // Author: kenton@google.com (Kenton Varda) // // protoc (aka the Protocol Compiler) can be extended via plugins. A plugin is // just a program that reads a CodeGeneratorRequest from stdin and writes a // CodeGeneratorResponse to stdout. // // Plugins written using C++ can use google/protobuf/compiler/plugin.h instead // of dealing with the raw protocol defined here. // // A plugin executable needs only to be placed somewhere in the path. The // plugin should be named "protoc-gen-$NAME", and will then be used when the // flag "--${NAME}_out" is passed to protoc. ⋮---- // @generated by protoc-gen-es v2.6.3 with parameter "target=ts" // @generated from file google/protobuf/compiler/plugin.proto (package google.protobuf.compiler, syntax proto2) /* eslint-disable */ ⋮---- import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; import { enumDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; import type { FileDescriptorProto, GeneratedCodeInfo } from "../descriptor_pb"; import { file_google_protobuf_descriptor } from "../descriptor_pb"; import type { Message } from "@bufbuild/protobuf"; ⋮---- /** * Describes the file google/protobuf/compiler/plugin.proto. */ export const file_google_protobuf_compiler_plugin: GenFile = /*@__PURE__*/ ⋮---- /** * The version number of protocol compiler. * * @generated from message google.protobuf.compiler.Version */ export type Version = Message<"google.protobuf.compiler.Version"> & { /** * @generated from field: optional int32 major = 1; */ major: number; /** * @generated from field: optional int32 minor = 2; */ minor: number; /** * @generated from field: optional int32 patch = 3; */ patch: number; /** * A suffix for alpha, beta or rc release, e.g., "alpha-1", "rc2". It should * be empty for mainline stable releases. * * @generated from field: optional string suffix = 4; */ suffix: string; }; ⋮---- /** * @generated from field: optional int32 major = 1; */ ⋮---- /** * @generated from field: optional int32 minor = 2; */ ⋮---- /** * @generated from field: optional int32 patch = 3; */ ⋮---- /** * A suffix for alpha, beta or rc release, e.g., "alpha-1", "rc2". It should * be empty for mainline stable releases. * * @generated from field: optional string suffix = 4; */ ⋮---- /** * Describes the message google.protobuf.compiler.Version. * Use `create(VersionSchema)` to create a new message. */ export const VersionSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * An encoded CodeGeneratorRequest is written to the plugin's stdin. * * @generated from message google.protobuf.compiler.CodeGeneratorRequest */ export type CodeGeneratorRequest = Message<"google.protobuf.compiler.CodeGeneratorRequest"> & { /** * The .proto files that were explicitly listed on the command-line. The * code generator should generate code only for these files. Each file's * descriptor will be included in proto_file, below. * * @generated from field: repeated string file_to_generate = 1; */ fileToGenerate: string[]; /** * The generator parameter passed on the command-line. * * @generated from field: optional string parameter = 2; */ parameter: string; /** * FileDescriptorProtos for all files in files_to_generate and everything * they import. The files will appear in topological order, so each file * appears before any file that imports it. * * Note: the files listed in files_to_generate will include runtime-retention * options only, but all other files will include source-retention options. * The source_file_descriptors field below is available in case you need * source-retention options for files_to_generate. * * protoc guarantees that all proto_files will be written after * the fields above, even though this is not technically guaranteed by the * protobuf wire format. This theoretically could allow a plugin to stream * in the FileDescriptorProtos and handle them one by one rather than read * the entire set into memory at once. However, as of this writing, this * is not similarly optimized on protoc's end -- it will store all fields in * memory at once before sending them to the plugin. * * Type names of fields and extensions in the FileDescriptorProto are always * fully qualified. * * @generated from field: repeated google.protobuf.FileDescriptorProto proto_file = 15; */ protoFile: FileDescriptorProto[]; /** * File descriptors with all options, including source-retention options. * These descriptors are only provided for the files listed in * files_to_generate. * * @generated from field: repeated google.protobuf.FileDescriptorProto source_file_descriptors = 17; */ sourceFileDescriptors: FileDescriptorProto[]; /** * The version number of protocol compiler. * * @generated from field: optional google.protobuf.compiler.Version compiler_version = 3; */ compilerVersion?: Version; }; ⋮---- /** * The .proto files that were explicitly listed on the command-line. The * code generator should generate code only for these files. Each file's * descriptor will be included in proto_file, below. * * @generated from field: repeated string file_to_generate = 1; */ ⋮---- /** * The generator parameter passed on the command-line. * * @generated from field: optional string parameter = 2; */ ⋮---- /** * FileDescriptorProtos for all files in files_to_generate and everything * they import. The files will appear in topological order, so each file * appears before any file that imports it. * * Note: the files listed in files_to_generate will include runtime-retention * options only, but all other files will include source-retention options. * The source_file_descriptors field below is available in case you need * source-retention options for files_to_generate. * * protoc guarantees that all proto_files will be written after * the fields above, even though this is not technically guaranteed by the * protobuf wire format. This theoretically could allow a plugin to stream * in the FileDescriptorProtos and handle them one by one rather than read * the entire set into memory at once. However, as of this writing, this * is not similarly optimized on protoc's end -- it will store all fields in * memory at once before sending them to the plugin. * * Type names of fields and extensions in the FileDescriptorProto are always * fully qualified. * * @generated from field: repeated google.protobuf.FileDescriptorProto proto_file = 15; */ ⋮---- /** * File descriptors with all options, including source-retention options. * These descriptors are only provided for the files listed in * files_to_generate. * * @generated from field: repeated google.protobuf.FileDescriptorProto source_file_descriptors = 17; */ ⋮---- /** * The version number of protocol compiler. * * @generated from field: optional google.protobuf.compiler.Version compiler_version = 3; */ ⋮---- /** * Describes the message google.protobuf.compiler.CodeGeneratorRequest. * Use `create(CodeGeneratorRequestSchema)` to create a new message. */ export const CodeGeneratorRequestSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * The plugin writes an encoded CodeGeneratorResponse to stdout. * * @generated from message google.protobuf.compiler.CodeGeneratorResponse */ export type CodeGeneratorResponse = Message<"google.protobuf.compiler.CodeGeneratorResponse"> & { /** * Error message. If non-empty, code generation failed. The plugin process * should exit with status code zero even if it reports an error in this way. * * This should be used to indicate errors in .proto files which prevent the * code generator from generating correct code. Errors which indicate a * problem in protoc itself -- such as the input CodeGeneratorRequest being * unparseable -- should be reported by writing a message to stderr and * exiting with a non-zero status code. * * @generated from field: optional string error = 1; */ error: string; /** * A bitmask of supported features that the code generator supports. * This is a bitwise "or" of values from the Feature enum. * * @generated from field: optional uint64 supported_features = 2; */ supportedFeatures: bigint; /** * The minimum edition this plugin supports. This will be treated as an * Edition enum, but we want to allow unknown values. It should be specified * according the edition enum value, *not* the edition number. Only takes * effect for plugins that have FEATURE_SUPPORTS_EDITIONS set. * * @generated from field: optional int32 minimum_edition = 3; */ minimumEdition: number; /** * The maximum edition this plugin supports. This will be treated as an * Edition enum, but we want to allow unknown values. It should be specified * according the edition enum value, *not* the edition number. Only takes * effect for plugins that have FEATURE_SUPPORTS_EDITIONS set. * * @generated from field: optional int32 maximum_edition = 4; */ maximumEdition: number; /** * @generated from field: repeated google.protobuf.compiler.CodeGeneratorResponse.File file = 15; */ file: CodeGeneratorResponse_File[]; }; ⋮---- /** * Error message. If non-empty, code generation failed. The plugin process * should exit with status code zero even if it reports an error in this way. * * This should be used to indicate errors in .proto files which prevent the * code generator from generating correct code. Errors which indicate a * problem in protoc itself -- such as the input CodeGeneratorRequest being * unparseable -- should be reported by writing a message to stderr and * exiting with a non-zero status code. * * @generated from field: optional string error = 1; */ ⋮---- /** * A bitmask of supported features that the code generator supports. * This is a bitwise "or" of values from the Feature enum. * * @generated from field: optional uint64 supported_features = 2; */ ⋮---- /** * The minimum edition this plugin supports. This will be treated as an * Edition enum, but we want to allow unknown values. It should be specified * according the edition enum value, *not* the edition number. Only takes * effect for plugins that have FEATURE_SUPPORTS_EDITIONS set. * * @generated from field: optional int32 minimum_edition = 3; */ ⋮---- /** * The maximum edition this plugin supports. This will be treated as an * Edition enum, but we want to allow unknown values. It should be specified * according the edition enum value, *not* the edition number. Only takes * effect for plugins that have FEATURE_SUPPORTS_EDITIONS set. * * @generated from field: optional int32 maximum_edition = 4; */ ⋮---- /** * @generated from field: repeated google.protobuf.compiler.CodeGeneratorResponse.File file = 15; */ ⋮---- /** * Describes the message google.protobuf.compiler.CodeGeneratorResponse. * Use `create(CodeGeneratorResponseSchema)` to create a new message. */ export const CodeGeneratorResponseSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Represents a single generated file. * * @generated from message google.protobuf.compiler.CodeGeneratorResponse.File */ export type CodeGeneratorResponse_File = Message<"google.protobuf.compiler.CodeGeneratorResponse.File"> & { /** * The file name, relative to the output directory. The name must not * contain "." or ".." components and must be relative, not be absolute (so, * the file cannot lie outside the output directory). "/" must be used as * the path separator, not "\". * * If the name is omitted, the content will be appended to the previous * file. This allows the generator to break large files into small chunks, * and allows the generated text to be streamed back to protoc so that large * files need not reside completely in memory at one time. Note that as of * this writing protoc does not optimize for this -- it will read the entire * CodeGeneratorResponse before writing files to disk. * * @generated from field: optional string name = 1; */ name: string; /** * If non-empty, indicates that the named file should already exist, and the * content here is to be inserted into that file at a defined insertion * point. This feature allows a code generator to extend the output * produced by another code generator. The original generator may provide * insertion points by placing special annotations in the file that look * like: * @@protoc_insertion_point(NAME) * The annotation can have arbitrary text before and after it on the line, * which allows it to be placed in a comment. NAME should be replaced with * an identifier naming the point -- this is what other generators will use * as the insertion_point. Code inserted at this point will be placed * immediately above the line containing the insertion point (thus multiple * insertions to the same point will come out in the order they were added). * The double-@ is intended to make it unlikely that the generated code * could contain things that look like insertion points by accident. * * For example, the C++ code generator places the following line in the * .pb.h files that it generates: * // @@protoc_insertion_point(namespace_scope) * This line appears within the scope of the file's package namespace, but * outside of any particular class. Another plugin can then specify the * insertion_point "namespace_scope" to generate additional classes or * other declarations that should be placed in this scope. * * Note that if the line containing the insertion point begins with * whitespace, the same whitespace will be added to every line of the * inserted text. This is useful for languages like Python, where * indentation matters. In these languages, the insertion point comment * should be indented the same amount as any inserted code will need to be * in order to work correctly in that context. * * The code generator that generates the initial file and the one which * inserts into it must both run as part of a single invocation of protoc. * Code generators are executed in the order in which they appear on the * command line. * * If |insertion_point| is present, |name| must also be present. * * @generated from field: optional string insertion_point = 2; */ insertionPoint: string; /** * The file contents. * * @generated from field: optional string content = 15; */ content: string; /** * Information describing the file content being inserted. If an insertion * point is used, this information will be appropriately offset and inserted * into the code generation metadata for the generated files. * * @generated from field: optional google.protobuf.GeneratedCodeInfo generated_code_info = 16; */ generatedCodeInfo?: GeneratedCodeInfo; }; ⋮---- /** * The file name, relative to the output directory. The name must not * contain "." or ".." components and must be relative, not be absolute (so, * the file cannot lie outside the output directory). "/" must be used as * the path separator, not "\". * * If the name is omitted, the content will be appended to the previous * file. This allows the generator to break large files into small chunks, * and allows the generated text to be streamed back to protoc so that large * files need not reside completely in memory at one time. Note that as of * this writing protoc does not optimize for this -- it will read the entire * CodeGeneratorResponse before writing files to disk. * * @generated from field: optional string name = 1; */ ⋮---- /** * If non-empty, indicates that the named file should already exist, and the * content here is to be inserted into that file at a defined insertion * point. This feature allows a code generator to extend the output * produced by another code generator. The original generator may provide * insertion points by placing special annotations in the file that look * like: * @@protoc_insertion_point(NAME) * The annotation can have arbitrary text before and after it on the line, * which allows it to be placed in a comment. NAME should be replaced with * an identifier naming the point -- this is what other generators will use * as the insertion_point. Code inserted at this point will be placed * immediately above the line containing the insertion point (thus multiple * insertions to the same point will come out in the order they were added). * The double-@ is intended to make it unlikely that the generated code * could contain things that look like insertion points by accident. * * For example, the C++ code generator places the following line in the * .pb.h files that it generates: * // @@protoc_insertion_point(namespace_scope) * This line appears within the scope of the file's package namespace, but * outside of any particular class. Another plugin can then specify the * insertion_point "namespace_scope" to generate additional classes or * other declarations that should be placed in this scope. * * Note that if the line containing the insertion point begins with * whitespace, the same whitespace will be added to every line of the * inserted text. This is useful for languages like Python, where * indentation matters. In these languages, the insertion point comment * should be indented the same amount as any inserted code will need to be * in order to work correctly in that context. * * The code generator that generates the initial file and the one which * inserts into it must both run as part of a single invocation of protoc. * Code generators are executed in the order in which they appear on the * command line. * * If |insertion_point| is present, |name| must also be present. * * @generated from field: optional string insertion_point = 2; */ ⋮---- /** * The file contents. * * @generated from field: optional string content = 15; */ ⋮---- /** * Information describing the file content being inserted. If an insertion * point is used, this information will be appropriately offset and inserted * into the code generation metadata for the generated files. * * @generated from field: optional google.protobuf.GeneratedCodeInfo generated_code_info = 16; */ ⋮---- /** * Describes the message google.protobuf.compiler.CodeGeneratorResponse.File. * Use `create(CodeGeneratorResponse_FileSchema)` to create a new message. */ export const CodeGeneratorResponse_FileSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Sync with code_generator.h. * * @generated from enum google.protobuf.compiler.CodeGeneratorResponse.Feature */ export enum CodeGeneratorResponse_Feature { /** * @generated from enum value: FEATURE_NONE = 0; */ NONE = 0, /** * @generated from enum value: FEATURE_PROTO3_OPTIONAL = 1; */ PROTO3_OPTIONAL = 1, /** * @generated from enum value: FEATURE_SUPPORTS_EDITIONS = 2; */ SUPPORTS_EDITIONS = 2, } ⋮---- /** * @generated from enum value: FEATURE_NONE = 0; */ ⋮---- /** * @generated from enum value: FEATURE_PROTO3_OPTIONAL = 1; */ ⋮---- /** * @generated from enum value: FEATURE_SUPPORTS_EDITIONS = 2; */ ⋮---- /** * Describes the enum google.protobuf.compiler.CodeGeneratorResponse.Feature. */ export const CodeGeneratorResponse_FeatureSchema: GenEnum = /*@__PURE__*/ ```` ## File: src/gen/google/protobuf/any_pb.ts ````typescript // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ⋮---- // @generated by protoc-gen-es v2.6.3 with parameter "target=ts" // @generated from file google/protobuf/any.proto (package google.protobuf, syntax proto3) /* eslint-disable */ ⋮---- import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; import type { Message } from "@bufbuild/protobuf"; ⋮---- /** * Describes the file google/protobuf/any.proto. */ export const file_google_protobuf_any: GenFile = /*@__PURE__*/ ⋮---- /** * `Any` contains an arbitrary serialized protocol buffer message along with a * URL that describes the type of the serialized message. * * Protobuf library provides support to pack/unpack Any values in the form * of utility functions or additional generated methods of the Any type. * * Example 1: Pack and unpack a message in C++. * * Foo foo = ...; * Any any; * any.PackFrom(foo); * ... * if (any.UnpackTo(&foo)) { * ... * } * * Example 2: Pack and unpack a message in Java. * * Foo foo = ...; * Any any = Any.pack(foo); * ... * if (any.is(Foo.class)) { * foo = any.unpack(Foo.class); * } * // or ... * if (any.isSameTypeAs(Foo.getDefaultInstance())) { * foo = any.unpack(Foo.getDefaultInstance()); * } * * Example 3: Pack and unpack a message in Python. * * foo = Foo(...) * any = Any() * any.Pack(foo) * ... * if any.Is(Foo.DESCRIPTOR): * any.Unpack(foo) * ... * * Example 4: Pack and unpack a message in Go * * foo := &pb.Foo{...} * any, err := anypb.New(foo) * if err != nil { * ... * } * ... * foo := &pb.Foo{} * if err := any.UnmarshalTo(foo); err != nil { * ... * } * * The pack methods provided by protobuf library will by default use * 'type.googleapis.com/full.type.name' as the type URL and the unpack * methods only use the fully qualified type name after the last '/' * in the type URL, for example "foo.bar.com/x/y.z" will yield type * name "y.z". * * JSON * ==== * The JSON representation of an `Any` value uses the regular * representation of the deserialized, embedded message, with an * additional field `@type` which contains the type URL. Example: * * package google.profile; * message Person { * string first_name = 1; * string last_name = 2; * } * * { * "@type": "type.googleapis.com/google.profile.Person", * "firstName": , * "lastName": * } * * If the embedded message type is well-known and has a custom JSON * representation, that representation will be embedded adding a field * `value` which holds the custom JSON in addition to the `@type` * field. Example (for message [google.protobuf.Duration][]): * * { * "@type": "type.googleapis.com/google.protobuf.Duration", * "value": "1.212s" * } * * * @generated from message google.protobuf.Any */ export type Any = Message<"google.protobuf.Any"> & { /** * A URL/resource name that uniquely identifies the type of the serialized * protocol buffer message. This string must contain at least * one "/" character. The last segment of the URL's path must represent * the fully qualified name of the type (as in * `path/google.protobuf.Duration`). The name should be in a canonical form * (e.g., leading "." is not accepted). * * In practice, teams usually precompile into the binary all types that they * expect it to use in the context of Any. However, for URLs which use the * scheme `http`, `https`, or no scheme, one can optionally set up a type * server that maps type URLs to message definitions as follows: * * * If no scheme is provided, `https` is assumed. * * An HTTP GET on the URL must yield a [google.protobuf.Type][] * value in binary format, or produce an error. * * Applications are allowed to cache lookup results based on the * URL, or have them precompiled into a binary to avoid any * lookup. Therefore, binary compatibility needs to be preserved * on changes to types. (Use versioned type names to manage * breaking changes.) * * Note: this functionality is not currently available in the official * protobuf release, and it is not used for type URLs beginning with * type.googleapis.com. As of May 2023, there are no widely used type server * implementations and no plans to implement one. * * Schemes other than `http`, `https` (or the empty scheme) might be * used with implementation specific semantics. * * * @generated from field: string type_url = 1; */ typeUrl: string; /** * Must be a valid serialized protocol buffer of the above specified type. * * @generated from field: bytes value = 2; */ value: Uint8Array; }; ⋮---- /** * A URL/resource name that uniquely identifies the type of the serialized * protocol buffer message. This string must contain at least * one "/" character. The last segment of the URL's path must represent * the fully qualified name of the type (as in * `path/google.protobuf.Duration`). The name should be in a canonical form * (e.g., leading "." is not accepted). * * In practice, teams usually precompile into the binary all types that they * expect it to use in the context of Any. However, for URLs which use the * scheme `http`, `https`, or no scheme, one can optionally set up a type * server that maps type URLs to message definitions as follows: * * * If no scheme is provided, `https` is assumed. * * An HTTP GET on the URL must yield a [google.protobuf.Type][] * value in binary format, or produce an error. * * Applications are allowed to cache lookup results based on the * URL, or have them precompiled into a binary to avoid any * lookup. Therefore, binary compatibility needs to be preserved * on changes to types. (Use versioned type names to manage * breaking changes.) * * Note: this functionality is not currently available in the official * protobuf release, and it is not used for type URLs beginning with * type.googleapis.com. As of May 2023, there are no widely used type server * implementations and no plans to implement one. * * Schemes other than `http`, `https` (or the empty scheme) might be * used with implementation specific semantics. * * * @generated from field: string type_url = 1; */ ⋮---- /** * Must be a valid serialized protocol buffer of the above specified type. * * @generated from field: bytes value = 2; */ ⋮---- /** * Describes the message google.protobuf.Any. * Use `create(AnySchema)` to create a new message. */ export const AnySchema: GenMessage = /*@__PURE__*/ ```` ## File: src/gen/google/protobuf/api_pb.ts ````typescript // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ⋮---- // @generated by protoc-gen-es v2.6.3 with parameter "target=ts" // @generated from file google/protobuf/api.proto (package google.protobuf, syntax proto3) /* eslint-disable */ ⋮---- import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; import type { SourceContext } from "./source_context_pb"; import { file_google_protobuf_source_context } from "./source_context_pb"; import type { Option, Syntax } from "./type_pb"; import { file_google_protobuf_type } from "./type_pb"; import type { Message } from "@bufbuild/protobuf"; ⋮---- /** * Describes the file google/protobuf/api.proto. */ export const file_google_protobuf_api: GenFile = /*@__PURE__*/ ⋮---- /** * Api is a light-weight descriptor for an API Interface. * * Interfaces are also described as "protocol buffer services" in some contexts, * such as by the "service" keyword in a .proto file, but they are different * from API Services, which represent a concrete implementation of an interface * as opposed to simply a description of methods and bindings. They are also * sometimes simply referred to as "APIs" in other contexts, such as the name of * this message itself. See https://cloud.google.com/apis/design/glossary for * detailed terminology. * * New usages of this message as an alternative to ServiceDescriptorProto are * strongly discouraged. This message does not reliability preserve all * information necessary to model the schema and preserve semantics. Instead * make use of FileDescriptorSet which preserves the necessary information. * * @generated from message google.protobuf.Api */ export type Api = Message<"google.protobuf.Api"> & { /** * The fully qualified name of this interface, including package name * followed by the interface's simple name. * * @generated from field: string name = 1; */ name: string; /** * The methods of this interface, in unspecified order. * * @generated from field: repeated google.protobuf.Method methods = 2; */ methods: Method[]; /** * Any metadata attached to the interface. * * @generated from field: repeated google.protobuf.Option options = 3; */ options: Option[]; /** * A version string for this interface. If specified, must have the form * `major-version.minor-version`, as in `1.10`. If the minor version is * omitted, it defaults to zero. If the entire version field is empty, the * major version is derived from the package name, as outlined below. If the * field is not empty, the version in the package name will be verified to be * consistent with what is provided here. * * The versioning schema uses [semantic * versioning](http://semver.org) where the major version number * indicates a breaking change and the minor version an additive, * non-breaking change. Both version numbers are signals to users * what to expect from different versions, and should be carefully * chosen based on the product plan. * * The major version is also reflected in the package name of the * interface, which must end in `v`, as in * `google.feature.v1`. For major versions 0 and 1, the suffix can * be omitted. Zero major versions must only be used for * experimental, non-GA interfaces. * * * @generated from field: string version = 4; */ version: string; /** * Source context for the protocol buffer service represented by this * message. * * @generated from field: google.protobuf.SourceContext source_context = 5; */ sourceContext?: SourceContext; /** * Included interfaces. See [Mixin][]. * * @generated from field: repeated google.protobuf.Mixin mixins = 6; */ mixins: Mixin[]; /** * The source syntax of the service. * * @generated from field: google.protobuf.Syntax syntax = 7; */ syntax: Syntax; /** * The source edition string, only valid when syntax is SYNTAX_EDITIONS. * * @generated from field: string edition = 8; */ edition: string; }; ⋮---- /** * The fully qualified name of this interface, including package name * followed by the interface's simple name. * * @generated from field: string name = 1; */ ⋮---- /** * The methods of this interface, in unspecified order. * * @generated from field: repeated google.protobuf.Method methods = 2; */ ⋮---- /** * Any metadata attached to the interface. * * @generated from field: repeated google.protobuf.Option options = 3; */ ⋮---- /** * A version string for this interface. If specified, must have the form * `major-version.minor-version`, as in `1.10`. If the minor version is * omitted, it defaults to zero. If the entire version field is empty, the * major version is derived from the package name, as outlined below. If the * field is not empty, the version in the package name will be verified to be * consistent with what is provided here. * * The versioning schema uses [semantic * versioning](http://semver.org) where the major version number * indicates a breaking change and the minor version an additive, * non-breaking change. Both version numbers are signals to users * what to expect from different versions, and should be carefully * chosen based on the product plan. * * The major version is also reflected in the package name of the * interface, which must end in `v`, as in * `google.feature.v1`. For major versions 0 and 1, the suffix can * be omitted. Zero major versions must only be used for * experimental, non-GA interfaces. * * * @generated from field: string version = 4; */ ⋮---- /** * Source context for the protocol buffer service represented by this * message. * * @generated from field: google.protobuf.SourceContext source_context = 5; */ ⋮---- /** * Included interfaces. See [Mixin][]. * * @generated from field: repeated google.protobuf.Mixin mixins = 6; */ ⋮---- /** * The source syntax of the service. * * @generated from field: google.protobuf.Syntax syntax = 7; */ ⋮---- /** * The source edition string, only valid when syntax is SYNTAX_EDITIONS. * * @generated from field: string edition = 8; */ ⋮---- /** * Describes the message google.protobuf.Api. * Use `create(ApiSchema)` to create a new message. */ export const ApiSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Method represents a method of an API interface. * * New usages of this message as an alternative to MethodDescriptorProto are * strongly discouraged. This message does not reliability preserve all * information necessary to model the schema and preserve semantics. Instead * make use of FileDescriptorSet which preserves the necessary information. * * @generated from message google.protobuf.Method */ export type Method = Message<"google.protobuf.Method"> & { /** * The simple name of this method. * * @generated from field: string name = 1; */ name: string; /** * A URL of the input message type. * * @generated from field: string request_type_url = 2; */ requestTypeUrl: string; /** * If true, the request is streamed. * * @generated from field: bool request_streaming = 3; */ requestStreaming: boolean; /** * The URL of the output message type. * * @generated from field: string response_type_url = 4; */ responseTypeUrl: string; /** * If true, the response is streamed. * * @generated from field: bool response_streaming = 5; */ responseStreaming: boolean; /** * Any metadata attached to the method. * * @generated from field: repeated google.protobuf.Option options = 6; */ options: Option[]; /** * The source syntax of this method. * * This field should be ignored, instead the syntax should be inherited from * Api. This is similar to Field and EnumValue. * * @generated from field: google.protobuf.Syntax syntax = 7 [deprecated = true]; * @deprecated */ syntax: Syntax; /** * The source edition string, only valid when syntax is SYNTAX_EDITIONS. * * This field should be ignored, instead the edition should be inherited from * Api. This is similar to Field and EnumValue. * * @generated from field: string edition = 8 [deprecated = true]; * @deprecated */ edition: string; }; ⋮---- /** * The simple name of this method. * * @generated from field: string name = 1; */ ⋮---- /** * A URL of the input message type. * * @generated from field: string request_type_url = 2; */ ⋮---- /** * If true, the request is streamed. * * @generated from field: bool request_streaming = 3; */ ⋮---- /** * The URL of the output message type. * * @generated from field: string response_type_url = 4; */ ⋮---- /** * If true, the response is streamed. * * @generated from field: bool response_streaming = 5; */ ⋮---- /** * Any metadata attached to the method. * * @generated from field: repeated google.protobuf.Option options = 6; */ ⋮---- /** * The source syntax of this method. * * This field should be ignored, instead the syntax should be inherited from * Api. This is similar to Field and EnumValue. * * @generated from field: google.protobuf.Syntax syntax = 7 [deprecated = true]; * @deprecated */ ⋮---- /** * The source edition string, only valid when syntax is SYNTAX_EDITIONS. * * This field should be ignored, instead the edition should be inherited from * Api. This is similar to Field and EnumValue. * * @generated from field: string edition = 8 [deprecated = true]; * @deprecated */ ⋮---- /** * Describes the message google.protobuf.Method. * Use `create(MethodSchema)` to create a new message. */ export const MethodSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Declares an API Interface to be included in this interface. The including * interface must redeclare all the methods from the included interface, but * documentation and options are inherited as follows: * * - If after comment and whitespace stripping, the documentation * string of the redeclared method is empty, it will be inherited * from the original method. * * - Each annotation belonging to the service config (http, * visibility) which is not set in the redeclared method will be * inherited. * * - If an http annotation is inherited, the path pattern will be * modified as follows. Any version prefix will be replaced by the * version of the including interface plus the [root][] path if * specified. * * Example of a simple mixin: * * package google.acl.v1; * service AccessControl { * // Get the underlying ACL object. * rpc GetAcl(GetAclRequest) returns (Acl) { * option (google.api.http).get = "/v1/{resource=**}:getAcl"; * } * } * * package google.storage.v2; * service Storage { * rpc GetAcl(GetAclRequest) returns (Acl); * * // Get a data record. * rpc GetData(GetDataRequest) returns (Data) { * option (google.api.http).get = "/v2/{resource=**}"; * } * } * * Example of a mixin configuration: * * apis: * - name: google.storage.v2.Storage * mixins: * - name: google.acl.v1.AccessControl * * The mixin construct implies that all methods in `AccessControl` are * also declared with same name and request/response types in * `Storage`. A documentation generator or annotation processor will * see the effective `Storage.GetAcl` method after inheriting * documentation and annotations as follows: * * service Storage { * // Get the underlying ACL object. * rpc GetAcl(GetAclRequest) returns (Acl) { * option (google.api.http).get = "/v2/{resource=**}:getAcl"; * } * ... * } * * Note how the version in the path pattern changed from `v1` to `v2`. * * If the `root` field in the mixin is specified, it should be a * relative path under which inherited HTTP paths are placed. Example: * * apis: * - name: google.storage.v2.Storage * mixins: * - name: google.acl.v1.AccessControl * root: acls * * This implies the following inherited HTTP annotation: * * service Storage { * // Get the underlying ACL object. * rpc GetAcl(GetAclRequest) returns (Acl) { * option (google.api.http).get = "/v2/acls/{resource=**}:getAcl"; * } * ... * } * * @generated from message google.protobuf.Mixin */ export type Mixin = Message<"google.protobuf.Mixin"> & { /** * The fully qualified name of the interface which is included. * * @generated from field: string name = 1; */ name: string; /** * If non-empty specifies a path under which inherited HTTP paths * are rooted. * * @generated from field: string root = 2; */ root: string; }; ⋮---- /** * The fully qualified name of the interface which is included. * * @generated from field: string name = 1; */ ⋮---- /** * If non-empty specifies a path under which inherited HTTP paths * are rooted. * * @generated from field: string root = 2; */ ⋮---- /** * Describes the message google.protobuf.Mixin. * Use `create(MixinSchema)` to create a new message. */ export const MixinSchema: GenMessage = /*@__PURE__*/ ```` ## File: src/gen/google/protobuf/cpp_features_pb.ts ````typescript // Protocol Buffers - Google's data interchange format // Copyright 2023 Google Inc. All rights reserved. // // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd ⋮---- // @generated by protoc-gen-es v2.6.3 with parameter "target=ts" // @generated from file google/protobuf/cpp_features.proto (package pb, syntax proto2) /* eslint-disable */ ⋮---- import type { GenEnum, GenExtension, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; import { enumDesc, extDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; import type { FeatureSet } from "./descriptor_pb"; import { file_google_protobuf_descriptor } from "./descriptor_pb"; import type { Message } from "@bufbuild/protobuf"; ⋮---- /** * Describes the file google/protobuf/cpp_features.proto. */ export const file_google_protobuf_cpp_features: GenFile = /*@__PURE__*/ ⋮---- /** * @generated from message pb.CppFeatures */ export type CppFeatures = Message<"pb.CppFeatures"> & { /** * Whether or not to treat an enum field as closed. This option is only * applicable to enum fields, and will be removed in the future. It is * consistent with the legacy behavior of using proto3 enum types for proto2 * fields. * * @generated from field: optional bool legacy_closed_enum = 1; */ legacyClosedEnum: boolean; /** * @generated from field: optional pb.CppFeatures.StringType string_type = 2; */ stringType: CppFeatures_StringType; /** * @generated from field: optional bool enum_name_uses_string_view = 3; */ enumNameUsesStringView: boolean; }; ⋮---- /** * Whether or not to treat an enum field as closed. This option is only * applicable to enum fields, and will be removed in the future. It is * consistent with the legacy behavior of using proto3 enum types for proto2 * fields. * * @generated from field: optional bool legacy_closed_enum = 1; */ ⋮---- /** * @generated from field: optional pb.CppFeatures.StringType string_type = 2; */ ⋮---- /** * @generated from field: optional bool enum_name_uses_string_view = 3; */ ⋮---- /** * Describes the message pb.CppFeatures. * Use `create(CppFeaturesSchema)` to create a new message. */ export const CppFeaturesSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * @generated from enum pb.CppFeatures.StringType */ export enum CppFeatures_StringType { /** * @generated from enum value: STRING_TYPE_UNKNOWN = 0; */ STRING_TYPE_UNKNOWN = 0, /** * @generated from enum value: VIEW = 1; */ VIEW = 1, /** * @generated from enum value: CORD = 2; */ CORD = 2, /** * @generated from enum value: STRING = 3; */ STRING = 3, } ⋮---- /** * @generated from enum value: STRING_TYPE_UNKNOWN = 0; */ ⋮---- /** * @generated from enum value: VIEW = 1; */ ⋮---- /** * @generated from enum value: CORD = 2; */ ⋮---- /** * @generated from enum value: STRING = 3; */ ⋮---- /** * Describes the enum pb.CppFeatures.StringType. */ export const CppFeatures_StringTypeSchema: GenEnum = /*@__PURE__*/ ⋮---- /** * @generated from extension: optional pb.CppFeatures cpp = 1000; */ export const cpp: GenExtension = /*@__PURE__*/ ```` ## File: src/gen/google/protobuf/descriptor_pb.ts ````typescript // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ⋮---- // Author: kenton@google.com (Kenton Varda) // Based on original Protocol Buffers design by // Sanjay Ghemawat, Jeff Dean, and others. // // The messages in this file describe the definitions found in .proto files. // A valid .proto file can be translated directly to a FileDescriptorProto // without any other information (e.g. without reading its imports). ⋮---- // @generated by protoc-gen-es v2.6.3 with parameter "target=ts" // @generated from file google/protobuf/descriptor.proto (package google.protobuf, syntax proto2) /* eslint-disable */ ⋮---- import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; import { enumDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; import type { Message } from "@bufbuild/protobuf"; ⋮---- /** * Describes the file google/protobuf/descriptor.proto. */ export const file_google_protobuf_descriptor: GenFile = /*@__PURE__*/ ⋮---- /** * The protocol compiler can output a FileDescriptorSet containing the .proto * files it parses. * * @generated from message google.protobuf.FileDescriptorSet */ export type FileDescriptorSet = Message<"google.protobuf.FileDescriptorSet"> & { /** * @generated from field: repeated google.protobuf.FileDescriptorProto file = 1; */ file: FileDescriptorProto[]; }; ⋮---- /** * @generated from field: repeated google.protobuf.FileDescriptorProto file = 1; */ ⋮---- /** * Describes the message google.protobuf.FileDescriptorSet. * Use `create(FileDescriptorSetSchema)` to create a new message. */ export const FileDescriptorSetSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Describes a complete .proto file. * * @generated from message google.protobuf.FileDescriptorProto */ export type FileDescriptorProto = Message<"google.protobuf.FileDescriptorProto"> & { /** * file name, relative to root of source tree * * @generated from field: optional string name = 1; */ name: string; /** * e.g. "foo", "foo.bar", etc. * * @generated from field: optional string package = 2; */ package: string; /** * Names of files imported by this file. * * @generated from field: repeated string dependency = 3; */ dependency: string[]; /** * Indexes of the public imported files in the dependency list above. * * @generated from field: repeated int32 public_dependency = 10; */ publicDependency: number[]; /** * Indexes of the weak imported files in the dependency list. * For Google-internal migration only. Do not use. * * @generated from field: repeated int32 weak_dependency = 11; */ weakDependency: number[]; /** * Names of files imported by this file purely for the purpose of providing * option extensions. These are excluded from the dependency list above. * * @generated from field: repeated string option_dependency = 15; */ optionDependency: string[]; /** * All top-level definitions in this file. * * @generated from field: repeated google.protobuf.DescriptorProto message_type = 4; */ messageType: DescriptorProto[]; /** * @generated from field: repeated google.protobuf.EnumDescriptorProto enum_type = 5; */ enumType: EnumDescriptorProto[]; /** * @generated from field: repeated google.protobuf.ServiceDescriptorProto service = 6; */ service: ServiceDescriptorProto[]; /** * @generated from field: repeated google.protobuf.FieldDescriptorProto extension = 7; */ extension: FieldDescriptorProto[]; /** * @generated from field: optional google.protobuf.FileOptions options = 8; */ options?: FileOptions; /** * This field contains optional information about the original source code. * You may safely remove this entire field without harming runtime * functionality of the descriptors -- the information is needed only by * development tools. * * @generated from field: optional google.protobuf.SourceCodeInfo source_code_info = 9; */ sourceCodeInfo?: SourceCodeInfo; /** * The syntax of the proto file. * The supported values are "proto2", "proto3", and "editions". * * If `edition` is present, this value must be "editions". * WARNING: This field should only be used by protobuf plugins or special * cases like the proto compiler. Other uses are discouraged and * developers should rely on the protoreflect APIs for their client language. * * @generated from field: optional string syntax = 12; */ syntax: string; /** * The edition of the proto file. * WARNING: This field should only be used by protobuf plugins or special * cases like the proto compiler. Other uses are discouraged and * developers should rely on the protoreflect APIs for their client language. * * @generated from field: optional google.protobuf.Edition edition = 14; */ edition: Edition; }; ⋮---- /** * file name, relative to root of source tree * * @generated from field: optional string name = 1; */ ⋮---- /** * e.g. "foo", "foo.bar", etc. * * @generated from field: optional string package = 2; */ ⋮---- /** * Names of files imported by this file. * * @generated from field: repeated string dependency = 3; */ ⋮---- /** * Indexes of the public imported files in the dependency list above. * * @generated from field: repeated int32 public_dependency = 10; */ ⋮---- /** * Indexes of the weak imported files in the dependency list. * For Google-internal migration only. Do not use. * * @generated from field: repeated int32 weak_dependency = 11; */ ⋮---- /** * Names of files imported by this file purely for the purpose of providing * option extensions. These are excluded from the dependency list above. * * @generated from field: repeated string option_dependency = 15; */ ⋮---- /** * All top-level definitions in this file. * * @generated from field: repeated google.protobuf.DescriptorProto message_type = 4; */ ⋮---- /** * @generated from field: repeated google.protobuf.EnumDescriptorProto enum_type = 5; */ ⋮---- /** * @generated from field: repeated google.protobuf.ServiceDescriptorProto service = 6; */ ⋮---- /** * @generated from field: repeated google.protobuf.FieldDescriptorProto extension = 7; */ ⋮---- /** * @generated from field: optional google.protobuf.FileOptions options = 8; */ ⋮---- /** * This field contains optional information about the original source code. * You may safely remove this entire field without harming runtime * functionality of the descriptors -- the information is needed only by * development tools. * * @generated from field: optional google.protobuf.SourceCodeInfo source_code_info = 9; */ ⋮---- /** * The syntax of the proto file. * The supported values are "proto2", "proto3", and "editions". * * If `edition` is present, this value must be "editions". * WARNING: This field should only be used by protobuf plugins or special * cases like the proto compiler. Other uses are discouraged and * developers should rely on the protoreflect APIs for their client language. * * @generated from field: optional string syntax = 12; */ ⋮---- /** * The edition of the proto file. * WARNING: This field should only be used by protobuf plugins or special * cases like the proto compiler. Other uses are discouraged and * developers should rely on the protoreflect APIs for their client language. * * @generated from field: optional google.protobuf.Edition edition = 14; */ ⋮---- /** * Describes the message google.protobuf.FileDescriptorProto. * Use `create(FileDescriptorProtoSchema)` to create a new message. */ export const FileDescriptorProtoSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Describes a message type. * * @generated from message google.protobuf.DescriptorProto */ export type DescriptorProto = Message<"google.protobuf.DescriptorProto"> & { /** * @generated from field: optional string name = 1; */ name: string; /** * @generated from field: repeated google.protobuf.FieldDescriptorProto field = 2; */ field: FieldDescriptorProto[]; /** * @generated from field: repeated google.protobuf.FieldDescriptorProto extension = 6; */ extension: FieldDescriptorProto[]; /** * @generated from field: repeated google.protobuf.DescriptorProto nested_type = 3; */ nestedType: DescriptorProto[]; /** * @generated from field: repeated google.protobuf.EnumDescriptorProto enum_type = 4; */ enumType: EnumDescriptorProto[]; /** * @generated from field: repeated google.protobuf.DescriptorProto.ExtensionRange extension_range = 5; */ extensionRange: DescriptorProto_ExtensionRange[]; /** * @generated from field: repeated google.protobuf.OneofDescriptorProto oneof_decl = 8; */ oneofDecl: OneofDescriptorProto[]; /** * @generated from field: optional google.protobuf.MessageOptions options = 7; */ options?: MessageOptions; /** * @generated from field: repeated google.protobuf.DescriptorProto.ReservedRange reserved_range = 9; */ reservedRange: DescriptorProto_ReservedRange[]; /** * Reserved field names, which may not be used by fields in the same message. * A given name may only be reserved once. * * @generated from field: repeated string reserved_name = 10; */ reservedName: string[]; /** * Support for `export` and `local` keywords on enums. * * @generated from field: optional google.protobuf.SymbolVisibility visibility = 11; */ visibility: SymbolVisibility; }; ⋮---- /** * @generated from field: optional string name = 1; */ ⋮---- /** * @generated from field: repeated google.protobuf.FieldDescriptorProto field = 2; */ ⋮---- /** * @generated from field: repeated google.protobuf.FieldDescriptorProto extension = 6; */ ⋮---- /** * @generated from field: repeated google.protobuf.DescriptorProto nested_type = 3; */ ⋮---- /** * @generated from field: repeated google.protobuf.EnumDescriptorProto enum_type = 4; */ ⋮---- /** * @generated from field: repeated google.protobuf.DescriptorProto.ExtensionRange extension_range = 5; */ ⋮---- /** * @generated from field: repeated google.protobuf.OneofDescriptorProto oneof_decl = 8; */ ⋮---- /** * @generated from field: optional google.protobuf.MessageOptions options = 7; */ ⋮---- /** * @generated from field: repeated google.protobuf.DescriptorProto.ReservedRange reserved_range = 9; */ ⋮---- /** * Reserved field names, which may not be used by fields in the same message. * A given name may only be reserved once. * * @generated from field: repeated string reserved_name = 10; */ ⋮---- /** * Support for `export` and `local` keywords on enums. * * @generated from field: optional google.protobuf.SymbolVisibility visibility = 11; */ ⋮---- /** * Describes the message google.protobuf.DescriptorProto. * Use `create(DescriptorProtoSchema)` to create a new message. */ export const DescriptorProtoSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * @generated from message google.protobuf.DescriptorProto.ExtensionRange */ export type DescriptorProto_ExtensionRange = Message<"google.protobuf.DescriptorProto.ExtensionRange"> & { /** * Inclusive. * * @generated from field: optional int32 start = 1; */ start: number; /** * Exclusive. * * @generated from field: optional int32 end = 2; */ end: number; /** * @generated from field: optional google.protobuf.ExtensionRangeOptions options = 3; */ options?: ExtensionRangeOptions; }; ⋮---- /** * Inclusive. * * @generated from field: optional int32 start = 1; */ ⋮---- /** * Exclusive. * * @generated from field: optional int32 end = 2; */ ⋮---- /** * @generated from field: optional google.protobuf.ExtensionRangeOptions options = 3; */ ⋮---- /** * Describes the message google.protobuf.DescriptorProto.ExtensionRange. * Use `create(DescriptorProto_ExtensionRangeSchema)` to create a new message. */ export const DescriptorProto_ExtensionRangeSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Range of reserved tag numbers. Reserved tag numbers may not be used by * fields or extension ranges in the same message. Reserved ranges may * not overlap. * * @generated from message google.protobuf.DescriptorProto.ReservedRange */ export type DescriptorProto_ReservedRange = Message<"google.protobuf.DescriptorProto.ReservedRange"> & { /** * Inclusive. * * @generated from field: optional int32 start = 1; */ start: number; /** * Exclusive. * * @generated from field: optional int32 end = 2; */ end: number; }; ⋮---- /** * Inclusive. * * @generated from field: optional int32 start = 1; */ ⋮---- /** * Exclusive. * * @generated from field: optional int32 end = 2; */ ⋮---- /** * Describes the message google.protobuf.DescriptorProto.ReservedRange. * Use `create(DescriptorProto_ReservedRangeSchema)` to create a new message. */ export const DescriptorProto_ReservedRangeSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * @generated from message google.protobuf.ExtensionRangeOptions */ export type ExtensionRangeOptions = Message<"google.protobuf.ExtensionRangeOptions"> & { /** * The parser stores options it doesn't recognize here. See above. * * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; */ uninterpretedOption: UninterpretedOption[]; /** * For external users: DO NOT USE. We are in the process of open sourcing * extension declaration and executing internal cleanups before it can be * used externally. * * @generated from field: repeated google.protobuf.ExtensionRangeOptions.Declaration declaration = 2; */ declaration: ExtensionRangeOptions_Declaration[]; /** * Any features defined in the specific edition. * * @generated from field: optional google.protobuf.FeatureSet features = 50; */ features?: FeatureSet; /** * The verification state of the range. * TODO: flip the default to DECLARATION once all empty ranges * are marked as UNVERIFIED. * * @generated from field: optional google.protobuf.ExtensionRangeOptions.VerificationState verification = 3 [default = UNVERIFIED]; */ verification: ExtensionRangeOptions_VerificationState; }; ⋮---- /** * The parser stores options it doesn't recognize here. See above. * * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; */ ⋮---- /** * For external users: DO NOT USE. We are in the process of open sourcing * extension declaration and executing internal cleanups before it can be * used externally. * * @generated from field: repeated google.protobuf.ExtensionRangeOptions.Declaration declaration = 2; */ ⋮---- /** * Any features defined in the specific edition. * * @generated from field: optional google.protobuf.FeatureSet features = 50; */ ⋮---- /** * The verification state of the range. * TODO: flip the default to DECLARATION once all empty ranges * are marked as UNVERIFIED. * * @generated from field: optional google.protobuf.ExtensionRangeOptions.VerificationState verification = 3 [default = UNVERIFIED]; */ ⋮---- /** * Describes the message google.protobuf.ExtensionRangeOptions. * Use `create(ExtensionRangeOptionsSchema)` to create a new message. */ export const ExtensionRangeOptionsSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * @generated from message google.protobuf.ExtensionRangeOptions.Declaration */ export type ExtensionRangeOptions_Declaration = Message<"google.protobuf.ExtensionRangeOptions.Declaration"> & { /** * The extension number declared within the extension range. * * @generated from field: optional int32 number = 1; */ number: number; /** * The fully-qualified name of the extension field. There must be a leading * dot in front of the full name. * * @generated from field: optional string full_name = 2; */ fullName: string; /** * The fully-qualified type name of the extension field. Unlike * Metadata.type, Declaration.type must have a leading dot for messages * and enums. * * @generated from field: optional string type = 3; */ type: string; /** * If true, indicates that the number is reserved in the extension range, * and any extension field with the number will fail to compile. Set this * when a declared extension field is deleted. * * @generated from field: optional bool reserved = 5; */ reserved: boolean; /** * If true, indicates that the extension must be defined as repeated. * Otherwise the extension must be defined as optional. * * @generated from field: optional bool repeated = 6; */ repeated: boolean; }; ⋮---- /** * The extension number declared within the extension range. * * @generated from field: optional int32 number = 1; */ ⋮---- /** * The fully-qualified name of the extension field. There must be a leading * dot in front of the full name. * * @generated from field: optional string full_name = 2; */ ⋮---- /** * The fully-qualified type name of the extension field. Unlike * Metadata.type, Declaration.type must have a leading dot for messages * and enums. * * @generated from field: optional string type = 3; */ ⋮---- /** * If true, indicates that the number is reserved in the extension range, * and any extension field with the number will fail to compile. Set this * when a declared extension field is deleted. * * @generated from field: optional bool reserved = 5; */ ⋮---- /** * If true, indicates that the extension must be defined as repeated. * Otherwise the extension must be defined as optional. * * @generated from field: optional bool repeated = 6; */ ⋮---- /** * Describes the message google.protobuf.ExtensionRangeOptions.Declaration. * Use `create(ExtensionRangeOptions_DeclarationSchema)` to create a new message. */ export const ExtensionRangeOptions_DeclarationSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * The verification state of the extension range. * * @generated from enum google.protobuf.ExtensionRangeOptions.VerificationState */ export enum ExtensionRangeOptions_VerificationState { /** * All the extensions of the range must be declared. * * @generated from enum value: DECLARATION = 0; */ DECLARATION = 0, /** * @generated from enum value: UNVERIFIED = 1; */ UNVERIFIED = 1, } ⋮---- /** * All the extensions of the range must be declared. * * @generated from enum value: DECLARATION = 0; */ ⋮---- /** * @generated from enum value: UNVERIFIED = 1; */ ⋮---- /** * Describes the enum google.protobuf.ExtensionRangeOptions.VerificationState. */ export const ExtensionRangeOptions_VerificationStateSchema: GenEnum = /*@__PURE__*/ ⋮---- /** * Describes a field within a message. * * @generated from message google.protobuf.FieldDescriptorProto */ export type FieldDescriptorProto = Message<"google.protobuf.FieldDescriptorProto"> & { /** * @generated from field: optional string name = 1; */ name: string; /** * @generated from field: optional int32 number = 3; */ number: number; /** * @generated from field: optional google.protobuf.FieldDescriptorProto.Label label = 4; */ label: FieldDescriptorProto_Label; /** * If type_name is set, this need not be set. If both this and type_name * are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. * * @generated from field: optional google.protobuf.FieldDescriptorProto.Type type = 5; */ type: FieldDescriptorProto_Type; /** * For message and enum types, this is the name of the type. If the name * starts with a '.', it is fully-qualified. Otherwise, C++-like scoping * rules are used to find the type (i.e. first the nested types within this * message are searched, then within the parent, on up to the root * namespace). * * @generated from field: optional string type_name = 6; */ typeName: string; /** * For extensions, this is the name of the type being extended. It is * resolved in the same manner as type_name. * * @generated from field: optional string extendee = 2; */ extendee: string; /** * For numeric types, contains the original text representation of the value. * For booleans, "true" or "false". * For strings, contains the default text contents (not escaped in any way). * For bytes, contains the C escaped value. All bytes >= 128 are escaped. * * @generated from field: optional string default_value = 7; */ defaultValue: string; /** * If set, gives the index of a oneof in the containing type's oneof_decl * list. This field is a member of that oneof. * * @generated from field: optional int32 oneof_index = 9; */ oneofIndex: number; /** * JSON name of this field. The value is set by protocol compiler. If the * user has set a "json_name" option on this field, that option's value * will be used. Otherwise, it's deduced from the field's name by converting * it to camelCase. * * @generated from field: optional string json_name = 10; */ jsonName: string; /** * @generated from field: optional google.protobuf.FieldOptions options = 8; */ options?: FieldOptions; /** * If true, this is a proto3 "optional". When a proto3 field is optional, it * tracks presence regardless of field type. * * When proto3_optional is true, this field must belong to a oneof to signal * to old proto3 clients that presence is tracked for this field. This oneof * is known as a "synthetic" oneof, and this field must be its sole member * (each proto3 optional field gets its own synthetic oneof). Synthetic oneofs * exist in the descriptor only, and do not generate any API. Synthetic oneofs * must be ordered after all "real" oneofs. * * For message fields, proto3_optional doesn't create any semantic change, * since non-repeated message fields always track presence. However it still * indicates the semantic detail of whether the user wrote "optional" or not. * This can be useful for round-tripping the .proto file. For consistency we * give message fields a synthetic oneof also, even though it is not required * to track presence. This is especially important because the parser can't * tell if a field is a message or an enum, so it must always create a * synthetic oneof. * * Proto2 optional fields do not set this flag, because they already indicate * optional with `LABEL_OPTIONAL`. * * @generated from field: optional bool proto3_optional = 17; */ proto3Optional: boolean; }; ⋮---- /** * @generated from field: optional string name = 1; */ ⋮---- /** * @generated from field: optional int32 number = 3; */ ⋮---- /** * @generated from field: optional google.protobuf.FieldDescriptorProto.Label label = 4; */ ⋮---- /** * If type_name is set, this need not be set. If both this and type_name * are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. * * @generated from field: optional google.protobuf.FieldDescriptorProto.Type type = 5; */ ⋮---- /** * For message and enum types, this is the name of the type. If the name * starts with a '.', it is fully-qualified. Otherwise, C++-like scoping * rules are used to find the type (i.e. first the nested types within this * message are searched, then within the parent, on up to the root * namespace). * * @generated from field: optional string type_name = 6; */ ⋮---- /** * For extensions, this is the name of the type being extended. It is * resolved in the same manner as type_name. * * @generated from field: optional string extendee = 2; */ ⋮---- /** * For numeric types, contains the original text representation of the value. * For booleans, "true" or "false". * For strings, contains the default text contents (not escaped in any way). * For bytes, contains the C escaped value. All bytes >= 128 are escaped. * * @generated from field: optional string default_value = 7; */ ⋮---- /** * If set, gives the index of a oneof in the containing type's oneof_decl * list. This field is a member of that oneof. * * @generated from field: optional int32 oneof_index = 9; */ ⋮---- /** * JSON name of this field. The value is set by protocol compiler. If the * user has set a "json_name" option on this field, that option's value * will be used. Otherwise, it's deduced from the field's name by converting * it to camelCase. * * @generated from field: optional string json_name = 10; */ ⋮---- /** * @generated from field: optional google.protobuf.FieldOptions options = 8; */ ⋮---- /** * If true, this is a proto3 "optional". When a proto3 field is optional, it * tracks presence regardless of field type. * * When proto3_optional is true, this field must belong to a oneof to signal * to old proto3 clients that presence is tracked for this field. This oneof * is known as a "synthetic" oneof, and this field must be its sole member * (each proto3 optional field gets its own synthetic oneof). Synthetic oneofs * exist in the descriptor only, and do not generate any API. Synthetic oneofs * must be ordered after all "real" oneofs. * * For message fields, proto3_optional doesn't create any semantic change, * since non-repeated message fields always track presence. However it still * indicates the semantic detail of whether the user wrote "optional" or not. * This can be useful for round-tripping the .proto file. For consistency we * give message fields a synthetic oneof also, even though it is not required * to track presence. This is especially important because the parser can't * tell if a field is a message or an enum, so it must always create a * synthetic oneof. * * Proto2 optional fields do not set this flag, because they already indicate * optional with `LABEL_OPTIONAL`. * * @generated from field: optional bool proto3_optional = 17; */ ⋮---- /** * Describes the message google.protobuf.FieldDescriptorProto. * Use `create(FieldDescriptorProtoSchema)` to create a new message. */ export const FieldDescriptorProtoSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * @generated from enum google.protobuf.FieldDescriptorProto.Type */ export enum FieldDescriptorProto_Type { /** * 0 is reserved for errors. * Order is weird for historical reasons. * * @generated from enum value: TYPE_DOUBLE = 1; */ DOUBLE = 1, /** * @generated from enum value: TYPE_FLOAT = 2; */ FLOAT = 2, /** * Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if * negative values are likely. * * @generated from enum value: TYPE_INT64 = 3; */ INT64 = 3, /** * @generated from enum value: TYPE_UINT64 = 4; */ UINT64 = 4, /** * Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if * negative values are likely. * * @generated from enum value: TYPE_INT32 = 5; */ INT32 = 5, /** * @generated from enum value: TYPE_FIXED64 = 6; */ FIXED64 = 6, /** * @generated from enum value: TYPE_FIXED32 = 7; */ FIXED32 = 7, /** * @generated from enum value: TYPE_BOOL = 8; */ BOOL = 8, /** * @generated from enum value: TYPE_STRING = 9; */ STRING = 9, /** * Tag-delimited aggregate. * Group type is deprecated and not supported after google.protobuf. However, Proto3 * implementations should still be able to parse the group wire format and * treat group fields as unknown fields. In Editions, the group wire format * can be enabled via the `message_encoding` feature. * * @generated from enum value: TYPE_GROUP = 10; */ GROUP = 10, /** * Length-delimited aggregate. * * @generated from enum value: TYPE_MESSAGE = 11; */ MESSAGE = 11, /** * New in version 2. * * @generated from enum value: TYPE_BYTES = 12; */ BYTES = 12, /** * @generated from enum value: TYPE_UINT32 = 13; */ UINT32 = 13, /** * @generated from enum value: TYPE_ENUM = 14; */ ENUM = 14, /** * @generated from enum value: TYPE_SFIXED32 = 15; */ SFIXED32 = 15, /** * @generated from enum value: TYPE_SFIXED64 = 16; */ SFIXED64 = 16, /** * Uses ZigZag encoding. * * @generated from enum value: TYPE_SINT32 = 17; */ SINT32 = 17, /** * Uses ZigZag encoding. * * @generated from enum value: TYPE_SINT64 = 18; */ SINT64 = 18, } ⋮---- /** * 0 is reserved for errors. * Order is weird for historical reasons. * * @generated from enum value: TYPE_DOUBLE = 1; */ ⋮---- /** * @generated from enum value: TYPE_FLOAT = 2; */ ⋮---- /** * Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if * negative values are likely. * * @generated from enum value: TYPE_INT64 = 3; */ ⋮---- /** * @generated from enum value: TYPE_UINT64 = 4; */ ⋮---- /** * Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if * negative values are likely. * * @generated from enum value: TYPE_INT32 = 5; */ ⋮---- /** * @generated from enum value: TYPE_FIXED64 = 6; */ ⋮---- /** * @generated from enum value: TYPE_FIXED32 = 7; */ ⋮---- /** * @generated from enum value: TYPE_BOOL = 8; */ ⋮---- /** * @generated from enum value: TYPE_STRING = 9; */ ⋮---- /** * Tag-delimited aggregate. * Group type is deprecated and not supported after google.protobuf. However, Proto3 * implementations should still be able to parse the group wire format and * treat group fields as unknown fields. In Editions, the group wire format * can be enabled via the `message_encoding` feature. * * @generated from enum value: TYPE_GROUP = 10; */ ⋮---- /** * Length-delimited aggregate. * * @generated from enum value: TYPE_MESSAGE = 11; */ ⋮---- /** * New in version 2. * * @generated from enum value: TYPE_BYTES = 12; */ ⋮---- /** * @generated from enum value: TYPE_UINT32 = 13; */ ⋮---- /** * @generated from enum value: TYPE_ENUM = 14; */ ⋮---- /** * @generated from enum value: TYPE_SFIXED32 = 15; */ ⋮---- /** * @generated from enum value: TYPE_SFIXED64 = 16; */ ⋮---- /** * Uses ZigZag encoding. * * @generated from enum value: TYPE_SINT32 = 17; */ ⋮---- /** * Uses ZigZag encoding. * * @generated from enum value: TYPE_SINT64 = 18; */ ⋮---- /** * Describes the enum google.protobuf.FieldDescriptorProto.Type. */ export const FieldDescriptorProto_TypeSchema: GenEnum = /*@__PURE__*/ ⋮---- /** * @generated from enum google.protobuf.FieldDescriptorProto.Label */ export enum FieldDescriptorProto_Label { /** * 0 is reserved for errors * * @generated from enum value: LABEL_OPTIONAL = 1; */ OPTIONAL = 1, /** * @generated from enum value: LABEL_REPEATED = 3; */ REPEATED = 3, /** * The required label is only allowed in google.protobuf. In proto3 and Editions * it's explicitly prohibited. In Editions, the `field_presence` feature * can be used to get this behavior. * * @generated from enum value: LABEL_REQUIRED = 2; */ REQUIRED = 2, } ⋮---- /** * 0 is reserved for errors * * @generated from enum value: LABEL_OPTIONAL = 1; */ ⋮---- /** * @generated from enum value: LABEL_REPEATED = 3; */ ⋮---- /** * The required label is only allowed in google.protobuf. In proto3 and Editions * it's explicitly prohibited. In Editions, the `field_presence` feature * can be used to get this behavior. * * @generated from enum value: LABEL_REQUIRED = 2; */ ⋮---- /** * Describes the enum google.protobuf.FieldDescriptorProto.Label. */ export const FieldDescriptorProto_LabelSchema: GenEnum = /*@__PURE__*/ ⋮---- /** * Describes a oneof. * * @generated from message google.protobuf.OneofDescriptorProto */ export type OneofDescriptorProto = Message<"google.protobuf.OneofDescriptorProto"> & { /** * @generated from field: optional string name = 1; */ name: string; /** * @generated from field: optional google.protobuf.OneofOptions options = 2; */ options?: OneofOptions; }; ⋮---- /** * @generated from field: optional string name = 1; */ ⋮---- /** * @generated from field: optional google.protobuf.OneofOptions options = 2; */ ⋮---- /** * Describes the message google.protobuf.OneofDescriptorProto. * Use `create(OneofDescriptorProtoSchema)` to create a new message. */ export const OneofDescriptorProtoSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Describes an enum type. * * @generated from message google.protobuf.EnumDescriptorProto */ export type EnumDescriptorProto = Message<"google.protobuf.EnumDescriptorProto"> & { /** * @generated from field: optional string name = 1; */ name: string; /** * @generated from field: repeated google.protobuf.EnumValueDescriptorProto value = 2; */ value: EnumValueDescriptorProto[]; /** * @generated from field: optional google.protobuf.EnumOptions options = 3; */ options?: EnumOptions; /** * Range of reserved numeric values. Reserved numeric values may not be used * by enum values in the same enum declaration. Reserved ranges may not * overlap. * * @generated from field: repeated google.protobuf.EnumDescriptorProto.EnumReservedRange reserved_range = 4; */ reservedRange: EnumDescriptorProto_EnumReservedRange[]; /** * Reserved enum value names, which may not be reused. A given name may only * be reserved once. * * @generated from field: repeated string reserved_name = 5; */ reservedName: string[]; /** * Support for `export` and `local` keywords on enums. * * @generated from field: optional google.protobuf.SymbolVisibility visibility = 6; */ visibility: SymbolVisibility; }; ⋮---- /** * @generated from field: optional string name = 1; */ ⋮---- /** * @generated from field: repeated google.protobuf.EnumValueDescriptorProto value = 2; */ ⋮---- /** * @generated from field: optional google.protobuf.EnumOptions options = 3; */ ⋮---- /** * Range of reserved numeric values. Reserved numeric values may not be used * by enum values in the same enum declaration. Reserved ranges may not * overlap. * * @generated from field: repeated google.protobuf.EnumDescriptorProto.EnumReservedRange reserved_range = 4; */ ⋮---- /** * Reserved enum value names, which may not be reused. A given name may only * be reserved once. * * @generated from field: repeated string reserved_name = 5; */ ⋮---- /** * Support for `export` and `local` keywords on enums. * * @generated from field: optional google.protobuf.SymbolVisibility visibility = 6; */ ⋮---- /** * Describes the message google.protobuf.EnumDescriptorProto. * Use `create(EnumDescriptorProtoSchema)` to create a new message. */ export const EnumDescriptorProtoSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Range of reserved numeric values. Reserved values may not be used by * entries in the same enum. Reserved ranges may not overlap. * * Note that this is distinct from DescriptorProto.ReservedRange in that it * is inclusive such that it can appropriately represent the entire int32 * domain. * * @generated from message google.protobuf.EnumDescriptorProto.EnumReservedRange */ export type EnumDescriptorProto_EnumReservedRange = Message<"google.protobuf.EnumDescriptorProto.EnumReservedRange"> & { /** * Inclusive. * * @generated from field: optional int32 start = 1; */ start: number; /** * Inclusive. * * @generated from field: optional int32 end = 2; */ end: number; }; ⋮---- /** * Inclusive. * * @generated from field: optional int32 start = 1; */ ⋮---- /** * Inclusive. * * @generated from field: optional int32 end = 2; */ ⋮---- /** * Describes the message google.protobuf.EnumDescriptorProto.EnumReservedRange. * Use `create(EnumDescriptorProto_EnumReservedRangeSchema)` to create a new message. */ export const EnumDescriptorProto_EnumReservedRangeSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Describes a value within an enum. * * @generated from message google.protobuf.EnumValueDescriptorProto */ export type EnumValueDescriptorProto = Message<"google.protobuf.EnumValueDescriptorProto"> & { /** * @generated from field: optional string name = 1; */ name: string; /** * @generated from field: optional int32 number = 2; */ number: number; /** * @generated from field: optional google.protobuf.EnumValueOptions options = 3; */ options?: EnumValueOptions; }; ⋮---- /** * @generated from field: optional string name = 1; */ ⋮---- /** * @generated from field: optional int32 number = 2; */ ⋮---- /** * @generated from field: optional google.protobuf.EnumValueOptions options = 3; */ ⋮---- /** * Describes the message google.protobuf.EnumValueDescriptorProto. * Use `create(EnumValueDescriptorProtoSchema)` to create a new message. */ export const EnumValueDescriptorProtoSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Describes a service. * * @generated from message google.protobuf.ServiceDescriptorProto */ export type ServiceDescriptorProto = Message<"google.protobuf.ServiceDescriptorProto"> & { /** * @generated from field: optional string name = 1; */ name: string; /** * @generated from field: repeated google.protobuf.MethodDescriptorProto method = 2; */ method: MethodDescriptorProto[]; /** * @generated from field: optional google.protobuf.ServiceOptions options = 3; */ options?: ServiceOptions; }; ⋮---- /** * @generated from field: optional string name = 1; */ ⋮---- /** * @generated from field: repeated google.protobuf.MethodDescriptorProto method = 2; */ ⋮---- /** * @generated from field: optional google.protobuf.ServiceOptions options = 3; */ ⋮---- /** * Describes the message google.protobuf.ServiceDescriptorProto. * Use `create(ServiceDescriptorProtoSchema)` to create a new message. */ export const ServiceDescriptorProtoSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Describes a method of a service. * * @generated from message google.protobuf.MethodDescriptorProto */ export type MethodDescriptorProto = Message<"google.protobuf.MethodDescriptorProto"> & { /** * @generated from field: optional string name = 1; */ name: string; /** * Input and output type names. These are resolved in the same way as * FieldDescriptorProto.type_name, but must refer to a message type. * * @generated from field: optional string input_type = 2; */ inputType: string; /** * @generated from field: optional string output_type = 3; */ outputType: string; /** * @generated from field: optional google.protobuf.MethodOptions options = 4; */ options?: MethodOptions; /** * Identifies if client streams multiple client messages * * @generated from field: optional bool client_streaming = 5 [default = false]; */ clientStreaming: boolean; /** * Identifies if server streams multiple server messages * * @generated from field: optional bool server_streaming = 6 [default = false]; */ serverStreaming: boolean; }; ⋮---- /** * @generated from field: optional string name = 1; */ ⋮---- /** * Input and output type names. These are resolved in the same way as * FieldDescriptorProto.type_name, but must refer to a message type. * * @generated from field: optional string input_type = 2; */ ⋮---- /** * @generated from field: optional string output_type = 3; */ ⋮---- /** * @generated from field: optional google.protobuf.MethodOptions options = 4; */ ⋮---- /** * Identifies if client streams multiple client messages * * @generated from field: optional bool client_streaming = 5 [default = false]; */ ⋮---- /** * Identifies if server streams multiple server messages * * @generated from field: optional bool server_streaming = 6 [default = false]; */ ⋮---- /** * Describes the message google.protobuf.MethodDescriptorProto. * Use `create(MethodDescriptorProtoSchema)` to create a new message. */ export const MethodDescriptorProtoSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * @generated from message google.protobuf.FileOptions */ export type FileOptions = Message<"google.protobuf.FileOptions"> & { /** * Sets the Java package where classes generated from this .proto will be * placed. By default, the proto package is used, but this is often * inappropriate because proto packages do not normally start with backwards * domain names. * * @generated from field: optional string java_package = 1; */ javaPackage: string; /** * Controls the name of the wrapper Java class generated for the .proto file. * That class will always contain the .proto file's getDescriptor() method as * well as any top-level extensions defined in the .proto file. * If java_multiple_files is disabled, then all the other classes from the * .proto file will be nested inside the single wrapper outer class. * * @generated from field: optional string java_outer_classname = 8; */ javaOuterClassname: string; /** * If enabled, then the Java code generator will generate a separate .java * file for each top-level message, enum, and service defined in the .proto * file. Thus, these types will *not* be nested inside the wrapper class * named by java_outer_classname. However, the wrapper class will still be * generated to contain the file's getDescriptor() method as well as any * top-level extensions defined in the file. * * @generated from field: optional bool java_multiple_files = 10 [default = false]; */ javaMultipleFiles: boolean; /** * This option does nothing. * * @generated from field: optional bool java_generate_equals_and_hash = 20 [deprecated = true]; * @deprecated */ javaGenerateEqualsAndHash: boolean; /** * A proto2 file can set this to true to opt in to UTF-8 checking for Java, * which will throw an exception if invalid UTF-8 is parsed from the wire or * assigned to a string field. * * TODO: clarify exactly what kinds of field types this option * applies to, and update these docs accordingly. * * Proto3 files already perform these checks. Setting the option explicitly to * false has no effect: it cannot be used to opt proto3 files out of UTF-8 * checks. * * @generated from field: optional bool java_string_check_utf8 = 27 [default = false]; */ javaStringCheckUtf8: boolean; /** * @generated from field: optional google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED]; */ optimizeFor: FileOptions_OptimizeMode; /** * Sets the Go package where structs generated from this .proto will be * placed. If omitted, the Go package will be derived from the following: * - The basename of the package import path, if provided. * - Otherwise, the package statement in the .proto file, if present. * - Otherwise, the basename of the .proto file, without extension. * * @generated from field: optional string go_package = 11; */ goPackage: string; /** * Should generic services be generated in each language? "Generic" services * are not specific to any particular RPC system. They are generated by the * main code generators in each language (without additional plugins). * Generic services were the only kind of service generation supported by * early versions of google.protobuf. * * Generic services are now considered deprecated in favor of using plugins * that generate code specific to your particular RPC system. Therefore, * these default to false. Old code which depends on generic services should * explicitly set them to true. * * @generated from field: optional bool cc_generic_services = 16 [default = false]; */ ccGenericServices: boolean; /** * @generated from field: optional bool java_generic_services = 17 [default = false]; */ javaGenericServices: boolean; /** * @generated from field: optional bool py_generic_services = 18 [default = false]; */ pyGenericServices: boolean; /** * Is this file deprecated? * Depending on the target platform, this can emit Deprecated annotations * for everything in the file, or it will be completely ignored; in the very * least, this is a formalization for deprecating files. * * @generated from field: optional bool deprecated = 23 [default = false]; */ deprecated: boolean; /** * Enables the use of arenas for the proto messages in this file. This applies * only to generated classes for C++. * * @generated from field: optional bool cc_enable_arenas = 31 [default = true]; */ ccEnableArenas: boolean; /** * Sets the objective c class prefix which is prepended to all objective c * generated classes from this .proto. There is no default. * * @generated from field: optional string objc_class_prefix = 36; */ objcClassPrefix: string; /** * Namespace for generated classes; defaults to the package. * * @generated from field: optional string csharp_namespace = 37; */ csharpNamespace: string; /** * By default Swift generators will take the proto package and CamelCase it * replacing '.' with underscore and use that to prefix the types/symbols * defined. When this options is provided, they will use this value instead * to prefix the types/symbols defined. * * @generated from field: optional string swift_prefix = 39; */ swiftPrefix: string; /** * Sets the php class prefix which is prepended to all php generated classes * from this .proto. Default is empty. * * @generated from field: optional string php_class_prefix = 40; */ phpClassPrefix: string; /** * Use this option to change the namespace of php generated classes. Default * is empty. When this option is empty, the package name will be used for * determining the namespace. * * @generated from field: optional string php_namespace = 41; */ phpNamespace: string; /** * Use this option to change the namespace of php generated metadata classes. * Default is empty. When this option is empty, the proto file name will be * used for determining the namespace. * * @generated from field: optional string php_metadata_namespace = 44; */ phpMetadataNamespace: string; /** * Use this option to change the package of ruby generated classes. Default * is empty. When this option is not set, the package name will be used for * determining the ruby package. * * @generated from field: optional string ruby_package = 45; */ rubyPackage: string; /** * Any features defined in the specific edition. * WARNING: This field should only be used by protobuf plugins or special * cases like the proto compiler. Other uses are discouraged and * developers should rely on the protoreflect APIs for their client language. * * @generated from field: optional google.protobuf.FeatureSet features = 50; */ features?: FeatureSet; /** * The parser stores options it doesn't recognize here. * See the documentation for the "Options" section above. * * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; */ uninterpretedOption: UninterpretedOption[]; }; ⋮---- /** * Sets the Java package where classes generated from this .proto will be * placed. By default, the proto package is used, but this is often * inappropriate because proto packages do not normally start with backwards * domain names. * * @generated from field: optional string java_package = 1; */ ⋮---- /** * Controls the name of the wrapper Java class generated for the .proto file. * That class will always contain the .proto file's getDescriptor() method as * well as any top-level extensions defined in the .proto file. * If java_multiple_files is disabled, then all the other classes from the * .proto file will be nested inside the single wrapper outer class. * * @generated from field: optional string java_outer_classname = 8; */ ⋮---- /** * If enabled, then the Java code generator will generate a separate .java * file for each top-level message, enum, and service defined in the .proto * file. Thus, these types will *not* be nested inside the wrapper class * named by java_outer_classname. However, the wrapper class will still be * generated to contain the file's getDescriptor() method as well as any * top-level extensions defined in the file. * * @generated from field: optional bool java_multiple_files = 10 [default = false]; */ ⋮---- /** * This option does nothing. * * @generated from field: optional bool java_generate_equals_and_hash = 20 [deprecated = true]; * @deprecated */ ⋮---- /** * A proto2 file can set this to true to opt in to UTF-8 checking for Java, * which will throw an exception if invalid UTF-8 is parsed from the wire or * assigned to a string field. * * TODO: clarify exactly what kinds of field types this option * applies to, and update these docs accordingly. * * Proto3 files already perform these checks. Setting the option explicitly to * false has no effect: it cannot be used to opt proto3 files out of UTF-8 * checks. * * @generated from field: optional bool java_string_check_utf8 = 27 [default = false]; */ ⋮---- /** * @generated from field: optional google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED]; */ ⋮---- /** * Sets the Go package where structs generated from this .proto will be * placed. If omitted, the Go package will be derived from the following: * - The basename of the package import path, if provided. * - Otherwise, the package statement in the .proto file, if present. * - Otherwise, the basename of the .proto file, without extension. * * @generated from field: optional string go_package = 11; */ ⋮---- /** * Should generic services be generated in each language? "Generic" services * are not specific to any particular RPC system. They are generated by the * main code generators in each language (without additional plugins). * Generic services were the only kind of service generation supported by * early versions of google.protobuf. * * Generic services are now considered deprecated in favor of using plugins * that generate code specific to your particular RPC system. Therefore, * these default to false. Old code which depends on generic services should * explicitly set them to true. * * @generated from field: optional bool cc_generic_services = 16 [default = false]; */ ⋮---- /** * @generated from field: optional bool java_generic_services = 17 [default = false]; */ ⋮---- /** * @generated from field: optional bool py_generic_services = 18 [default = false]; */ ⋮---- /** * Is this file deprecated? * Depending on the target platform, this can emit Deprecated annotations * for everything in the file, or it will be completely ignored; in the very * least, this is a formalization for deprecating files. * * @generated from field: optional bool deprecated = 23 [default = false]; */ ⋮---- /** * Enables the use of arenas for the proto messages in this file. This applies * only to generated classes for C++. * * @generated from field: optional bool cc_enable_arenas = 31 [default = true]; */ ⋮---- /** * Sets the objective c class prefix which is prepended to all objective c * generated classes from this .proto. There is no default. * * @generated from field: optional string objc_class_prefix = 36; */ ⋮---- /** * Namespace for generated classes; defaults to the package. * * @generated from field: optional string csharp_namespace = 37; */ ⋮---- /** * By default Swift generators will take the proto package and CamelCase it * replacing '.' with underscore and use that to prefix the types/symbols * defined. When this options is provided, they will use this value instead * to prefix the types/symbols defined. * * @generated from field: optional string swift_prefix = 39; */ ⋮---- /** * Sets the php class prefix which is prepended to all php generated classes * from this .proto. Default is empty. * * @generated from field: optional string php_class_prefix = 40; */ ⋮---- /** * Use this option to change the namespace of php generated classes. Default * is empty. When this option is empty, the package name will be used for * determining the namespace. * * @generated from field: optional string php_namespace = 41; */ ⋮---- /** * Use this option to change the namespace of php generated metadata classes. * Default is empty. When this option is empty, the proto file name will be * used for determining the namespace. * * @generated from field: optional string php_metadata_namespace = 44; */ ⋮---- /** * Use this option to change the package of ruby generated classes. Default * is empty. When this option is not set, the package name will be used for * determining the ruby package. * * @generated from field: optional string ruby_package = 45; */ ⋮---- /** * Any features defined in the specific edition. * WARNING: This field should only be used by protobuf plugins or special * cases like the proto compiler. Other uses are discouraged and * developers should rely on the protoreflect APIs for their client language. * * @generated from field: optional google.protobuf.FeatureSet features = 50; */ ⋮---- /** * The parser stores options it doesn't recognize here. * See the documentation for the "Options" section above. * * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; */ ⋮---- /** * Describes the message google.protobuf.FileOptions. * Use `create(FileOptionsSchema)` to create a new message. */ export const FileOptionsSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Generated classes can be optimized for speed or code size. * * @generated from enum google.protobuf.FileOptions.OptimizeMode */ export enum FileOptions_OptimizeMode { /** * Generate complete code for parsing, serialization, * * @generated from enum value: SPEED = 1; */ SPEED = 1, /** * etc. * * Use ReflectionOps to implement these methods. * * @generated from enum value: CODE_SIZE = 2; */ CODE_SIZE = 2, /** * Generate code using MessageLite and the lite runtime. * * @generated from enum value: LITE_RUNTIME = 3; */ LITE_RUNTIME = 3, } ⋮---- /** * Generate complete code for parsing, serialization, * * @generated from enum value: SPEED = 1; */ ⋮---- /** * etc. * * Use ReflectionOps to implement these methods. * * @generated from enum value: CODE_SIZE = 2; */ ⋮---- /** * Generate code using MessageLite and the lite runtime. * * @generated from enum value: LITE_RUNTIME = 3; */ ⋮---- /** * Describes the enum google.protobuf.FileOptions.OptimizeMode. */ export const FileOptions_OptimizeModeSchema: GenEnum = /*@__PURE__*/ ⋮---- /** * @generated from message google.protobuf.MessageOptions */ export type MessageOptions = Message<"google.protobuf.MessageOptions"> & { /** * Set true to use the old proto1 MessageSet wire format for extensions. * This is provided for backwards-compatibility with the MessageSet wire * format. You should not use this for any other reason: It's less * efficient, has fewer features, and is more complicated. * * The message must be defined exactly as follows: * message Foo { * option message_set_wire_format = true; * extensions 4 to max; * } * Note that the message cannot have any defined fields; MessageSets only * have extensions. * * All extensions of your type must be singular messages; e.g. they cannot * be int32s, enums, or repeated messages. * * Because this is an option, the above two restrictions are not enforced by * the protocol compiler. * * @generated from field: optional bool message_set_wire_format = 1 [default = false]; */ messageSetWireFormat: boolean; /** * Disables the generation of the standard "descriptor()" accessor, which can * conflict with a field of the same name. This is meant to make migration * from proto1 easier; new code should avoid fields named "descriptor". * * @generated from field: optional bool no_standard_descriptor_accessor = 2 [default = false]; */ noStandardDescriptorAccessor: boolean; /** * Is this message deprecated? * Depending on the target platform, this can emit Deprecated annotations * for the message, or it will be completely ignored; in the very least, * this is a formalization for deprecating messages. * * @generated from field: optional bool deprecated = 3 [default = false]; */ deprecated: boolean; /** * Whether the message is an automatically generated map entry type for the * maps field. * * For maps fields: * map map_field = 1; * The parsed descriptor looks like: * message MapFieldEntry { * option map_entry = true; * optional KeyType key = 1; * optional ValueType value = 2; * } * repeated MapFieldEntry map_field = 1; * * Implementations may choose not to generate the map_entry=true message, but * use a native map in the target language to hold the keys and values. * The reflection APIs in such implementations still need to work as * if the field is a repeated message field. * * NOTE: Do not set the option in .proto files. Always use the maps syntax * instead. The option should only be implicitly set by the proto compiler * parser. * * @generated from field: optional bool map_entry = 7; */ mapEntry: boolean; /** * Enable the legacy handling of JSON field name conflicts. This lowercases * and strips underscored from the fields before comparison in proto3 only. * The new behavior takes `json_name` into account and applies to proto2 as * well. * * This should only be used as a temporary measure against broken builds due * to the change in behavior for JSON field name conflicts. * * TODO This is legacy behavior we plan to remove once downstream * teams have had time to migrate. * * @generated from field: optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true]; * @deprecated */ deprecatedLegacyJsonFieldConflicts: boolean; /** * Any features defined in the specific edition. * WARNING: This field should only be used by protobuf plugins or special * cases like the proto compiler. Other uses are discouraged and * developers should rely on the protoreflect APIs for their client language. * * @generated from field: optional google.protobuf.FeatureSet features = 12; */ features?: FeatureSet; /** * The parser stores options it doesn't recognize here. See above. * * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; */ uninterpretedOption: UninterpretedOption[]; }; ⋮---- /** * Set true to use the old proto1 MessageSet wire format for extensions. * This is provided for backwards-compatibility with the MessageSet wire * format. You should not use this for any other reason: It's less * efficient, has fewer features, and is more complicated. * * The message must be defined exactly as follows: * message Foo { * option message_set_wire_format = true; * extensions 4 to max; * } * Note that the message cannot have any defined fields; MessageSets only * have extensions. * * All extensions of your type must be singular messages; e.g. they cannot * be int32s, enums, or repeated messages. * * Because this is an option, the above two restrictions are not enforced by * the protocol compiler. * * @generated from field: optional bool message_set_wire_format = 1 [default = false]; */ ⋮---- /** * Disables the generation of the standard "descriptor()" accessor, which can * conflict with a field of the same name. This is meant to make migration * from proto1 easier; new code should avoid fields named "descriptor". * * @generated from field: optional bool no_standard_descriptor_accessor = 2 [default = false]; */ ⋮---- /** * Is this message deprecated? * Depending on the target platform, this can emit Deprecated annotations * for the message, or it will be completely ignored; in the very least, * this is a formalization for deprecating messages. * * @generated from field: optional bool deprecated = 3 [default = false]; */ ⋮---- /** * Whether the message is an automatically generated map entry type for the * maps field. * * For maps fields: * map map_field = 1; * The parsed descriptor looks like: * message MapFieldEntry { * option map_entry = true; * optional KeyType key = 1; * optional ValueType value = 2; * } * repeated MapFieldEntry map_field = 1; * * Implementations may choose not to generate the map_entry=true message, but * use a native map in the target language to hold the keys and values. * The reflection APIs in such implementations still need to work as * if the field is a repeated message field. * * NOTE: Do not set the option in .proto files. Always use the maps syntax * instead. The option should only be implicitly set by the proto compiler * parser. * * @generated from field: optional bool map_entry = 7; */ ⋮---- /** * Enable the legacy handling of JSON field name conflicts. This lowercases * and strips underscored from the fields before comparison in proto3 only. * The new behavior takes `json_name` into account and applies to proto2 as * well. * * This should only be used as a temporary measure against broken builds due * to the change in behavior for JSON field name conflicts. * * TODO This is legacy behavior we plan to remove once downstream * teams have had time to migrate. * * @generated from field: optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true]; * @deprecated */ ⋮---- /** * Any features defined in the specific edition. * WARNING: This field should only be used by protobuf plugins or special * cases like the proto compiler. Other uses are discouraged and * developers should rely on the protoreflect APIs for their client language. * * @generated from field: optional google.protobuf.FeatureSet features = 12; */ ⋮---- /** * The parser stores options it doesn't recognize here. See above. * * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; */ ⋮---- /** * Describes the message google.protobuf.MessageOptions. * Use `create(MessageOptionsSchema)` to create a new message. */ export const MessageOptionsSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * @generated from message google.protobuf.FieldOptions */ export type FieldOptions = Message<"google.protobuf.FieldOptions"> & { /** * NOTE: ctype is deprecated. Use `features.(pb.cpp).string_type` instead. * The ctype option instructs the C++ code generator to use a different * representation of the field than it normally would. See the specific * options below. This option is only implemented to support use of * [ctype=CORD] and [ctype=STRING] (the default) on non-repeated fields of * type "bytes" in the open source release. * TODO: make ctype actually deprecated. * * @generated from field: optional google.protobuf.FieldOptions.CType ctype = 1 [default = STRING]; */ ctype: FieldOptions_CType; /** * The packed option can be enabled for repeated primitive fields to enable * a more efficient representation on the wire. Rather than repeatedly * writing the tag and type for each element, the entire array is encoded as * a single length-delimited blob. In proto3, only explicit setting it to * false will avoid using packed encoding. This option is prohibited in * Editions, but the `repeated_field_encoding` feature can be used to control * the behavior. * * @generated from field: optional bool packed = 2; */ packed: boolean; /** * The jstype option determines the JavaScript type used for values of the * field. The option is permitted only for 64 bit integral and fixed types * (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING * is represented as JavaScript string, which avoids loss of precision that * can happen when a large value is converted to a floating point JavaScript. * Specifying JS_NUMBER for the jstype causes the generated JavaScript code to * use the JavaScript "number" type. The behavior of the default option * JS_NORMAL is implementation dependent. * * This option is an enum to permit additional types to be added, e.g. * goog.math.Integer. * * @generated from field: optional google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL]; */ jstype: FieldOptions_JSType; /** * Should this field be parsed lazily? Lazy applies only to message-type * fields. It means that when the outer message is initially parsed, the * inner message's contents will not be parsed but instead stored in encoded * form. The inner message will actually be parsed when it is first accessed. * * This is only a hint. Implementations are free to choose whether to use * eager or lazy parsing regardless of the value of this option. However, * setting this option true suggests that the protocol author believes that * using lazy parsing on this field is worth the additional bookkeeping * overhead typically needed to implement it. * * This option does not affect the public interface of any generated code; * all method signatures remain the same. Furthermore, thread-safety of the * interface is not affected by this option; const methods remain safe to * call from multiple threads concurrently, while non-const methods continue * to require exclusive access. * * Note that lazy message fields are still eagerly verified to check * ill-formed wireformat or missing required fields. Calling IsInitialized() * on the outer message would fail if the inner message has missing required * fields. Failed verification would result in parsing failure (except when * uninitialized messages are acceptable). * * @generated from field: optional bool lazy = 5 [default = false]; */ lazy: boolean; /** * unverified_lazy does no correctness checks on the byte stream. This should * only be used where lazy with verification is prohibitive for performance * reasons. * * @generated from field: optional bool unverified_lazy = 15 [default = false]; */ unverifiedLazy: boolean; /** * Is this field deprecated? * Depending on the target platform, this can emit Deprecated annotations * for accessors, or it will be completely ignored; in the very least, this * is a formalization for deprecating fields. * * @generated from field: optional bool deprecated = 3 [default = false]; */ deprecated: boolean; /** * DEPRECATED. DO NOT USE! * For Google-internal migration only. Do not use. * * @generated from field: optional bool weak = 10 [default = false, deprecated = true]; * @deprecated */ weak: boolean; /** * Indicate that the field value should not be printed out when using debug * formats, e.g. when the field contains sensitive credentials. * * @generated from field: optional bool debug_redact = 16 [default = false]; */ debugRedact: boolean; /** * @generated from field: optional google.protobuf.FieldOptions.OptionRetention retention = 17; */ retention: FieldOptions_OptionRetention; /** * @generated from field: repeated google.protobuf.FieldOptions.OptionTargetType targets = 19; */ targets: FieldOptions_OptionTargetType[]; /** * @generated from field: repeated google.protobuf.FieldOptions.EditionDefault edition_defaults = 20; */ editionDefaults: FieldOptions_EditionDefault[]; /** * Any features defined in the specific edition. * WARNING: This field should only be used by protobuf plugins or special * cases like the proto compiler. Other uses are discouraged and * developers should rely on the protoreflect APIs for their client language. * * @generated from field: optional google.protobuf.FeatureSet features = 21; */ features?: FeatureSet; /** * @generated from field: optional google.protobuf.FieldOptions.FeatureSupport feature_support = 22; */ featureSupport?: FieldOptions_FeatureSupport; /** * The parser stores options it doesn't recognize here. See above. * * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; */ uninterpretedOption: UninterpretedOption[]; }; ⋮---- /** * NOTE: ctype is deprecated. Use `features.(pb.cpp).string_type` instead. * The ctype option instructs the C++ code generator to use a different * representation of the field than it normally would. See the specific * options below. This option is only implemented to support use of * [ctype=CORD] and [ctype=STRING] (the default) on non-repeated fields of * type "bytes" in the open source release. * TODO: make ctype actually deprecated. * * @generated from field: optional google.protobuf.FieldOptions.CType ctype = 1 [default = STRING]; */ ⋮---- /** * The packed option can be enabled for repeated primitive fields to enable * a more efficient representation on the wire. Rather than repeatedly * writing the tag and type for each element, the entire array is encoded as * a single length-delimited blob. In proto3, only explicit setting it to * false will avoid using packed encoding. This option is prohibited in * Editions, but the `repeated_field_encoding` feature can be used to control * the behavior. * * @generated from field: optional bool packed = 2; */ ⋮---- /** * The jstype option determines the JavaScript type used for values of the * field. The option is permitted only for 64 bit integral and fixed types * (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING * is represented as JavaScript string, which avoids loss of precision that * can happen when a large value is converted to a floating point JavaScript. * Specifying JS_NUMBER for the jstype causes the generated JavaScript code to * use the JavaScript "number" type. The behavior of the default option * JS_NORMAL is implementation dependent. * * This option is an enum to permit additional types to be added, e.g. * goog.math.Integer. * * @generated from field: optional google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL]; */ ⋮---- /** * Should this field be parsed lazily? Lazy applies only to message-type * fields. It means that when the outer message is initially parsed, the * inner message's contents will not be parsed but instead stored in encoded * form. The inner message will actually be parsed when it is first accessed. * * This is only a hint. Implementations are free to choose whether to use * eager or lazy parsing regardless of the value of this option. However, * setting this option true suggests that the protocol author believes that * using lazy parsing on this field is worth the additional bookkeeping * overhead typically needed to implement it. * * This option does not affect the public interface of any generated code; * all method signatures remain the same. Furthermore, thread-safety of the * interface is not affected by this option; const methods remain safe to * call from multiple threads concurrently, while non-const methods continue * to require exclusive access. * * Note that lazy message fields are still eagerly verified to check * ill-formed wireformat or missing required fields. Calling IsInitialized() * on the outer message would fail if the inner message has missing required * fields. Failed verification would result in parsing failure (except when * uninitialized messages are acceptable). * * @generated from field: optional bool lazy = 5 [default = false]; */ ⋮---- /** * unverified_lazy does no correctness checks on the byte stream. This should * only be used where lazy with verification is prohibitive for performance * reasons. * * @generated from field: optional bool unverified_lazy = 15 [default = false]; */ ⋮---- /** * Is this field deprecated? * Depending on the target platform, this can emit Deprecated annotations * for accessors, or it will be completely ignored; in the very least, this * is a formalization for deprecating fields. * * @generated from field: optional bool deprecated = 3 [default = false]; */ ⋮---- /** * DEPRECATED. DO NOT USE! * For Google-internal migration only. Do not use. * * @generated from field: optional bool weak = 10 [default = false, deprecated = true]; * @deprecated */ ⋮---- /** * Indicate that the field value should not be printed out when using debug * formats, e.g. when the field contains sensitive credentials. * * @generated from field: optional bool debug_redact = 16 [default = false]; */ ⋮---- /** * @generated from field: optional google.protobuf.FieldOptions.OptionRetention retention = 17; */ ⋮---- /** * @generated from field: repeated google.protobuf.FieldOptions.OptionTargetType targets = 19; */ ⋮---- /** * @generated from field: repeated google.protobuf.FieldOptions.EditionDefault edition_defaults = 20; */ ⋮---- /** * Any features defined in the specific edition. * WARNING: This field should only be used by protobuf plugins or special * cases like the proto compiler. Other uses are discouraged and * developers should rely on the protoreflect APIs for their client language. * * @generated from field: optional google.protobuf.FeatureSet features = 21; */ ⋮---- /** * @generated from field: optional google.protobuf.FieldOptions.FeatureSupport feature_support = 22; */ ⋮---- /** * The parser stores options it doesn't recognize here. See above. * * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; */ ⋮---- /** * Describes the message google.protobuf.FieldOptions. * Use `create(FieldOptionsSchema)` to create a new message. */ export const FieldOptionsSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * @generated from message google.protobuf.FieldOptions.EditionDefault */ export type FieldOptions_EditionDefault = Message<"google.protobuf.FieldOptions.EditionDefault"> & { /** * @generated from field: optional google.protobuf.Edition edition = 3; */ edition: Edition; /** * Textproto value. * * @generated from field: optional string value = 2; */ value: string; }; ⋮---- /** * @generated from field: optional google.protobuf.Edition edition = 3; */ ⋮---- /** * Textproto value. * * @generated from field: optional string value = 2; */ ⋮---- /** * Describes the message google.protobuf.FieldOptions.EditionDefault. * Use `create(FieldOptions_EditionDefaultSchema)` to create a new message. */ export const FieldOptions_EditionDefaultSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Information about the support window of a feature. * * @generated from message google.protobuf.FieldOptions.FeatureSupport */ export type FieldOptions_FeatureSupport = Message<"google.protobuf.FieldOptions.FeatureSupport"> & { /** * The edition that this feature was first available in. In editions * earlier than this one, the default assigned to EDITION_LEGACY will be * used, and proto files will not be able to override it. * * @generated from field: optional google.protobuf.Edition edition_introduced = 1; */ editionIntroduced: Edition; /** * The edition this feature becomes deprecated in. Using this after this * edition may trigger warnings. * * @generated from field: optional google.protobuf.Edition edition_deprecated = 2; */ editionDeprecated: Edition; /** * The deprecation warning text if this feature is used after the edition it * was marked deprecated in. * * @generated from field: optional string deprecation_warning = 3; */ deprecationWarning: string; /** * The edition this feature is no longer available in. In editions after * this one, the last default assigned will be used, and proto files will * not be able to override it. * * @generated from field: optional google.protobuf.Edition edition_removed = 4; */ editionRemoved: Edition; }; ⋮---- /** * The edition that this feature was first available in. In editions * earlier than this one, the default assigned to EDITION_LEGACY will be * used, and proto files will not be able to override it. * * @generated from field: optional google.protobuf.Edition edition_introduced = 1; */ ⋮---- /** * The edition this feature becomes deprecated in. Using this after this * edition may trigger warnings. * * @generated from field: optional google.protobuf.Edition edition_deprecated = 2; */ ⋮---- /** * The deprecation warning text if this feature is used after the edition it * was marked deprecated in. * * @generated from field: optional string deprecation_warning = 3; */ ⋮---- /** * The edition this feature is no longer available in. In editions after * this one, the last default assigned will be used, and proto files will * not be able to override it. * * @generated from field: optional google.protobuf.Edition edition_removed = 4; */ ⋮---- /** * Describes the message google.protobuf.FieldOptions.FeatureSupport. * Use `create(FieldOptions_FeatureSupportSchema)` to create a new message. */ export const FieldOptions_FeatureSupportSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * @generated from enum google.protobuf.FieldOptions.CType */ export enum FieldOptions_CType { /** * Default mode. * * @generated from enum value: STRING = 0; */ STRING = 0, /** * The option [ctype=CORD] may be applied to a non-repeated field of type * "bytes". It indicates that in C++, the data should be stored in a Cord * instead of a string. For very large strings, this may reduce memory * fragmentation. It may also allow better performance when parsing from a * Cord, or when parsing with aliasing enabled, as the parsed Cord may then * alias the original buffer. * * @generated from enum value: CORD = 1; */ CORD = 1, /** * @generated from enum value: STRING_PIECE = 2; */ STRING_PIECE = 2, } ⋮---- /** * Default mode. * * @generated from enum value: STRING = 0; */ ⋮---- /** * The option [ctype=CORD] may be applied to a non-repeated field of type * "bytes". It indicates that in C++, the data should be stored in a Cord * instead of a string. For very large strings, this may reduce memory * fragmentation. It may also allow better performance when parsing from a * Cord, or when parsing with aliasing enabled, as the parsed Cord may then * alias the original buffer. * * @generated from enum value: CORD = 1; */ ⋮---- /** * @generated from enum value: STRING_PIECE = 2; */ ⋮---- /** * Describes the enum google.protobuf.FieldOptions.CType. */ export const FieldOptions_CTypeSchema: GenEnum = /*@__PURE__*/ ⋮---- /** * @generated from enum google.protobuf.FieldOptions.JSType */ export enum FieldOptions_JSType { /** * Use the default type. * * @generated from enum value: JS_NORMAL = 0; */ JS_NORMAL = 0, /** * Use JavaScript strings. * * @generated from enum value: JS_STRING = 1; */ JS_STRING = 1, /** * Use JavaScript numbers. * * @generated from enum value: JS_NUMBER = 2; */ JS_NUMBER = 2, } ⋮---- /** * Use the default type. * * @generated from enum value: JS_NORMAL = 0; */ ⋮---- /** * Use JavaScript strings. * * @generated from enum value: JS_STRING = 1; */ ⋮---- /** * Use JavaScript numbers. * * @generated from enum value: JS_NUMBER = 2; */ ⋮---- /** * Describes the enum google.protobuf.FieldOptions.JSType. */ export const FieldOptions_JSTypeSchema: GenEnum = /*@__PURE__*/ ⋮---- /** * If set to RETENTION_SOURCE, the option will be omitted from the binary. * * @generated from enum google.protobuf.FieldOptions.OptionRetention */ export enum FieldOptions_OptionRetention { /** * @generated from enum value: RETENTION_UNKNOWN = 0; */ RETENTION_UNKNOWN = 0, /** * @generated from enum value: RETENTION_RUNTIME = 1; */ RETENTION_RUNTIME = 1, /** * @generated from enum value: RETENTION_SOURCE = 2; */ RETENTION_SOURCE = 2, } ⋮---- /** * @generated from enum value: RETENTION_UNKNOWN = 0; */ ⋮---- /** * @generated from enum value: RETENTION_RUNTIME = 1; */ ⋮---- /** * @generated from enum value: RETENTION_SOURCE = 2; */ ⋮---- /** * Describes the enum google.protobuf.FieldOptions.OptionRetention. */ export const FieldOptions_OptionRetentionSchema: GenEnum = /*@__PURE__*/ ⋮---- /** * This indicates the types of entities that the field may apply to when used * as an option. If it is unset, then the field may be freely used as an * option on any kind of entity. * * @generated from enum google.protobuf.FieldOptions.OptionTargetType */ export enum FieldOptions_OptionTargetType { /** * @generated from enum value: TARGET_TYPE_UNKNOWN = 0; */ TARGET_TYPE_UNKNOWN = 0, /** * @generated from enum value: TARGET_TYPE_FILE = 1; */ TARGET_TYPE_FILE = 1, /** * @generated from enum value: TARGET_TYPE_EXTENSION_RANGE = 2; */ TARGET_TYPE_EXTENSION_RANGE = 2, /** * @generated from enum value: TARGET_TYPE_MESSAGE = 3; */ TARGET_TYPE_MESSAGE = 3, /** * @generated from enum value: TARGET_TYPE_FIELD = 4; */ TARGET_TYPE_FIELD = 4, /** * @generated from enum value: TARGET_TYPE_ONEOF = 5; */ TARGET_TYPE_ONEOF = 5, /** * @generated from enum value: TARGET_TYPE_ENUM = 6; */ TARGET_TYPE_ENUM = 6, /** * @generated from enum value: TARGET_TYPE_ENUM_ENTRY = 7; */ TARGET_TYPE_ENUM_ENTRY = 7, /** * @generated from enum value: TARGET_TYPE_SERVICE = 8; */ TARGET_TYPE_SERVICE = 8, /** * @generated from enum value: TARGET_TYPE_METHOD = 9; */ TARGET_TYPE_METHOD = 9, } ⋮---- /** * @generated from enum value: TARGET_TYPE_UNKNOWN = 0; */ ⋮---- /** * @generated from enum value: TARGET_TYPE_FILE = 1; */ ⋮---- /** * @generated from enum value: TARGET_TYPE_EXTENSION_RANGE = 2; */ ⋮---- /** * @generated from enum value: TARGET_TYPE_MESSAGE = 3; */ ⋮---- /** * @generated from enum value: TARGET_TYPE_FIELD = 4; */ ⋮---- /** * @generated from enum value: TARGET_TYPE_ONEOF = 5; */ ⋮---- /** * @generated from enum value: TARGET_TYPE_ENUM = 6; */ ⋮---- /** * @generated from enum value: TARGET_TYPE_ENUM_ENTRY = 7; */ ⋮---- /** * @generated from enum value: TARGET_TYPE_SERVICE = 8; */ ⋮---- /** * @generated from enum value: TARGET_TYPE_METHOD = 9; */ ⋮---- /** * Describes the enum google.protobuf.FieldOptions.OptionTargetType. */ export const FieldOptions_OptionTargetTypeSchema: GenEnum = /*@__PURE__*/ ⋮---- /** * @generated from message google.protobuf.OneofOptions */ export type OneofOptions = Message<"google.protobuf.OneofOptions"> & { /** * Any features defined in the specific edition. * WARNING: This field should only be used by protobuf plugins or special * cases like the proto compiler. Other uses are discouraged and * developers should rely on the protoreflect APIs for their client language. * * @generated from field: optional google.protobuf.FeatureSet features = 1; */ features?: FeatureSet; /** * The parser stores options it doesn't recognize here. See above. * * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; */ uninterpretedOption: UninterpretedOption[]; }; ⋮---- /** * Any features defined in the specific edition. * WARNING: This field should only be used by protobuf plugins or special * cases like the proto compiler. Other uses are discouraged and * developers should rely on the protoreflect APIs for their client language. * * @generated from field: optional google.protobuf.FeatureSet features = 1; */ ⋮---- /** * The parser stores options it doesn't recognize here. See above. * * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; */ ⋮---- /** * Describes the message google.protobuf.OneofOptions. * Use `create(OneofOptionsSchema)` to create a new message. */ export const OneofOptionsSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * @generated from message google.protobuf.EnumOptions */ export type EnumOptions = Message<"google.protobuf.EnumOptions"> & { /** * Set this option to true to allow mapping different tag names to the same * value. * * @generated from field: optional bool allow_alias = 2; */ allowAlias: boolean; /** * Is this enum deprecated? * Depending on the target platform, this can emit Deprecated annotations * for the enum, or it will be completely ignored; in the very least, this * is a formalization for deprecating enums. * * @generated from field: optional bool deprecated = 3 [default = false]; */ deprecated: boolean; /** * Enable the legacy handling of JSON field name conflicts. This lowercases * and strips underscored from the fields before comparison in proto3 only. * The new behavior takes `json_name` into account and applies to proto2 as * well. * TODO Remove this legacy behavior once downstream teams have * had time to migrate. * * @generated from field: optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true]; * @deprecated */ deprecatedLegacyJsonFieldConflicts: boolean; /** * Any features defined in the specific edition. * WARNING: This field should only be used by protobuf plugins or special * cases like the proto compiler. Other uses are discouraged and * developers should rely on the protoreflect APIs for their client language. * * @generated from field: optional google.protobuf.FeatureSet features = 7; */ features?: FeatureSet; /** * The parser stores options it doesn't recognize here. See above. * * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; */ uninterpretedOption: UninterpretedOption[]; }; ⋮---- /** * Set this option to true to allow mapping different tag names to the same * value. * * @generated from field: optional bool allow_alias = 2; */ ⋮---- /** * Is this enum deprecated? * Depending on the target platform, this can emit Deprecated annotations * for the enum, or it will be completely ignored; in the very least, this * is a formalization for deprecating enums. * * @generated from field: optional bool deprecated = 3 [default = false]; */ ⋮---- /** * Enable the legacy handling of JSON field name conflicts. This lowercases * and strips underscored from the fields before comparison in proto3 only. * The new behavior takes `json_name` into account and applies to proto2 as * well. * TODO Remove this legacy behavior once downstream teams have * had time to migrate. * * @generated from field: optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true]; * @deprecated */ ⋮---- /** * Any features defined in the specific edition. * WARNING: This field should only be used by protobuf plugins or special * cases like the proto compiler. Other uses are discouraged and * developers should rely on the protoreflect APIs for their client language. * * @generated from field: optional google.protobuf.FeatureSet features = 7; */ ⋮---- /** * The parser stores options it doesn't recognize here. See above. * * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; */ ⋮---- /** * Describes the message google.protobuf.EnumOptions. * Use `create(EnumOptionsSchema)` to create a new message. */ export const EnumOptionsSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * @generated from message google.protobuf.EnumValueOptions */ export type EnumValueOptions = Message<"google.protobuf.EnumValueOptions"> & { /** * Is this enum value deprecated? * Depending on the target platform, this can emit Deprecated annotations * for the enum value, or it will be completely ignored; in the very least, * this is a formalization for deprecating enum values. * * @generated from field: optional bool deprecated = 1 [default = false]; */ deprecated: boolean; /** * Any features defined in the specific edition. * WARNING: This field should only be used by protobuf plugins or special * cases like the proto compiler. Other uses are discouraged and * developers should rely on the protoreflect APIs for their client language. * * @generated from field: optional google.protobuf.FeatureSet features = 2; */ features?: FeatureSet; /** * Indicate that fields annotated with this enum value should not be printed * out when using debug formats, e.g. when the field contains sensitive * credentials. * * @generated from field: optional bool debug_redact = 3 [default = false]; */ debugRedact: boolean; /** * Information about the support window of a feature value. * * @generated from field: optional google.protobuf.FieldOptions.FeatureSupport feature_support = 4; */ featureSupport?: FieldOptions_FeatureSupport; /** * The parser stores options it doesn't recognize here. See above. * * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; */ uninterpretedOption: UninterpretedOption[]; }; ⋮---- /** * Is this enum value deprecated? * Depending on the target platform, this can emit Deprecated annotations * for the enum value, or it will be completely ignored; in the very least, * this is a formalization for deprecating enum values. * * @generated from field: optional bool deprecated = 1 [default = false]; */ ⋮---- /** * Any features defined in the specific edition. * WARNING: This field should only be used by protobuf plugins or special * cases like the proto compiler. Other uses are discouraged and * developers should rely on the protoreflect APIs for their client language. * * @generated from field: optional google.protobuf.FeatureSet features = 2; */ ⋮---- /** * Indicate that fields annotated with this enum value should not be printed * out when using debug formats, e.g. when the field contains sensitive * credentials. * * @generated from field: optional bool debug_redact = 3 [default = false]; */ ⋮---- /** * Information about the support window of a feature value. * * @generated from field: optional google.protobuf.FieldOptions.FeatureSupport feature_support = 4; */ ⋮---- /** * The parser stores options it doesn't recognize here. See above. * * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; */ ⋮---- /** * Describes the message google.protobuf.EnumValueOptions. * Use `create(EnumValueOptionsSchema)` to create a new message. */ export const EnumValueOptionsSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * @generated from message google.protobuf.ServiceOptions */ export type ServiceOptions = Message<"google.protobuf.ServiceOptions"> & { /** * Any features defined in the specific edition. * WARNING: This field should only be used by protobuf plugins or special * cases like the proto compiler. Other uses are discouraged and * developers should rely on the protoreflect APIs for their client language. * * @generated from field: optional google.protobuf.FeatureSet features = 34; */ features?: FeatureSet; /** * Is this service deprecated? * Depending on the target platform, this can emit Deprecated annotations * for the service, or it will be completely ignored; in the very least, * this is a formalization for deprecating services. * * @generated from field: optional bool deprecated = 33 [default = false]; */ deprecated: boolean; /** * The parser stores options it doesn't recognize here. See above. * * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; */ uninterpretedOption: UninterpretedOption[]; }; ⋮---- /** * Any features defined in the specific edition. * WARNING: This field should only be used by protobuf plugins or special * cases like the proto compiler. Other uses are discouraged and * developers should rely on the protoreflect APIs for their client language. * * @generated from field: optional google.protobuf.FeatureSet features = 34; */ ⋮---- /** * Is this service deprecated? * Depending on the target platform, this can emit Deprecated annotations * for the service, or it will be completely ignored; in the very least, * this is a formalization for deprecating services. * * @generated from field: optional bool deprecated = 33 [default = false]; */ ⋮---- /** * The parser stores options it doesn't recognize here. See above. * * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; */ ⋮---- /** * Describes the message google.protobuf.ServiceOptions. * Use `create(ServiceOptionsSchema)` to create a new message. */ export const ServiceOptionsSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * @generated from message google.protobuf.MethodOptions */ export type MethodOptions = Message<"google.protobuf.MethodOptions"> & { /** * Is this method deprecated? * Depending on the target platform, this can emit Deprecated annotations * for the method, or it will be completely ignored; in the very least, * this is a formalization for deprecating methods. * * @generated from field: optional bool deprecated = 33 [default = false]; */ deprecated: boolean; /** * @generated from field: optional google.protobuf.MethodOptions.IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN]; */ idempotencyLevel: MethodOptions_IdempotencyLevel; /** * Any features defined in the specific edition. * WARNING: This field should only be used by protobuf plugins or special * cases like the proto compiler. Other uses are discouraged and * developers should rely on the protoreflect APIs for their client language. * * @generated from field: optional google.protobuf.FeatureSet features = 35; */ features?: FeatureSet; /** * The parser stores options it doesn't recognize here. See above. * * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; */ uninterpretedOption: UninterpretedOption[]; }; ⋮---- /** * Is this method deprecated? * Depending on the target platform, this can emit Deprecated annotations * for the method, or it will be completely ignored; in the very least, * this is a formalization for deprecating methods. * * @generated from field: optional bool deprecated = 33 [default = false]; */ ⋮---- /** * @generated from field: optional google.protobuf.MethodOptions.IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN]; */ ⋮---- /** * Any features defined in the specific edition. * WARNING: This field should only be used by protobuf plugins or special * cases like the proto compiler. Other uses are discouraged and * developers should rely on the protoreflect APIs for their client language. * * @generated from field: optional google.protobuf.FeatureSet features = 35; */ ⋮---- /** * The parser stores options it doesn't recognize here. See above. * * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; */ ⋮---- /** * Describes the message google.protobuf.MethodOptions. * Use `create(MethodOptionsSchema)` to create a new message. */ export const MethodOptionsSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Is this method side-effect-free (or safe in HTTP parlance), or idempotent, * or neither? HTTP based RPC implementation may choose GET verb for safe * methods, and PUT verb for idempotent methods instead of the default POST. * * @generated from enum google.protobuf.MethodOptions.IdempotencyLevel */ export enum MethodOptions_IdempotencyLevel { /** * @generated from enum value: IDEMPOTENCY_UNKNOWN = 0; */ IDEMPOTENCY_UNKNOWN = 0, /** * implies idempotent * * @generated from enum value: NO_SIDE_EFFECTS = 1; */ NO_SIDE_EFFECTS = 1, /** * idempotent, but may have side effects * * @generated from enum value: IDEMPOTENT = 2; */ IDEMPOTENT = 2, } ⋮---- /** * @generated from enum value: IDEMPOTENCY_UNKNOWN = 0; */ ⋮---- /** * implies idempotent * * @generated from enum value: NO_SIDE_EFFECTS = 1; */ ⋮---- /** * idempotent, but may have side effects * * @generated from enum value: IDEMPOTENT = 2; */ ⋮---- /** * Describes the enum google.protobuf.MethodOptions.IdempotencyLevel. */ export const MethodOptions_IdempotencyLevelSchema: GenEnum = /*@__PURE__*/ ⋮---- /** * A message representing a option the parser does not recognize. This only * appears in options protos created by the compiler::Parser class. * DescriptorPool resolves these when building Descriptor objects. Therefore, * options protos in descriptor objects (e.g. returned by Descriptor::options(), * or produced by Descriptor::CopyTo()) will never have UninterpretedOptions * in them. * * @generated from message google.protobuf.UninterpretedOption */ export type UninterpretedOption = Message<"google.protobuf.UninterpretedOption"> & { /** * @generated from field: repeated google.protobuf.UninterpretedOption.NamePart name = 2; */ name: UninterpretedOption_NamePart[]; /** * The value of the uninterpreted option, in whatever type the tokenizer * identified it as during parsing. Exactly one of these should be set. * * @generated from field: optional string identifier_value = 3; */ identifierValue: string; /** * @generated from field: optional uint64 positive_int_value = 4; */ positiveIntValue: bigint; /** * @generated from field: optional int64 negative_int_value = 5; */ negativeIntValue: bigint; /** * @generated from field: optional double double_value = 6; */ doubleValue: number; /** * @generated from field: optional bytes string_value = 7; */ stringValue: Uint8Array; /** * @generated from field: optional string aggregate_value = 8; */ aggregateValue: string; }; ⋮---- /** * @generated from field: repeated google.protobuf.UninterpretedOption.NamePart name = 2; */ ⋮---- /** * The value of the uninterpreted option, in whatever type the tokenizer * identified it as during parsing. Exactly one of these should be set. * * @generated from field: optional string identifier_value = 3; */ ⋮---- /** * @generated from field: optional uint64 positive_int_value = 4; */ ⋮---- /** * @generated from field: optional int64 negative_int_value = 5; */ ⋮---- /** * @generated from field: optional double double_value = 6; */ ⋮---- /** * @generated from field: optional bytes string_value = 7; */ ⋮---- /** * @generated from field: optional string aggregate_value = 8; */ ⋮---- /** * Describes the message google.protobuf.UninterpretedOption. * Use `create(UninterpretedOptionSchema)` to create a new message. */ export const UninterpretedOptionSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * The name of the uninterpreted option. Each string represents a segment in * a dot-separated name. is_extension is true iff a segment represents an * extension (denoted with parentheses in options specs in .proto files). * E.g.,{ ["foo", false], ["bar.baz", true], ["moo", false] } represents * "foo.(bar.baz).moo". * * @generated from message google.protobuf.UninterpretedOption.NamePart */ export type UninterpretedOption_NamePart = Message<"google.protobuf.UninterpretedOption.NamePart"> & { /** * @generated from field: required string name_part = 1; */ namePart: string; /** * @generated from field: required bool is_extension = 2; */ isExtension: boolean; }; ⋮---- /** * @generated from field: required string name_part = 1; */ ⋮---- /** * @generated from field: required bool is_extension = 2; */ ⋮---- /** * Describes the message google.protobuf.UninterpretedOption.NamePart. * Use `create(UninterpretedOption_NamePartSchema)` to create a new message. */ export const UninterpretedOption_NamePartSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * TODO Enums in C++ gencode (and potentially other languages) are * not well scoped. This means that each of the feature enums below can clash * with each other. The short names we've chosen maximize call-site * readability, but leave us very open to this scenario. A future feature will * be designed and implemented to handle this, hopefully before we ever hit a * conflict here. * * @generated from message google.protobuf.FeatureSet */ export type FeatureSet = Message<"google.protobuf.FeatureSet"> & { /** * @generated from field: optional google.protobuf.FeatureSet.FieldPresence field_presence = 1; */ fieldPresence: FeatureSet_FieldPresence; /** * @generated from field: optional google.protobuf.FeatureSet.EnumType enum_type = 2; */ enumType: FeatureSet_EnumType; /** * @generated from field: optional google.protobuf.FeatureSet.RepeatedFieldEncoding repeated_field_encoding = 3; */ repeatedFieldEncoding: FeatureSet_RepeatedFieldEncoding; /** * @generated from field: optional google.protobuf.FeatureSet.Utf8Validation utf8_validation = 4; */ utf8Validation: FeatureSet_Utf8Validation; /** * @generated from field: optional google.protobuf.FeatureSet.MessageEncoding message_encoding = 5; */ messageEncoding: FeatureSet_MessageEncoding; /** * @generated from field: optional google.protobuf.FeatureSet.JsonFormat json_format = 6; */ jsonFormat: FeatureSet_JsonFormat; /** * @generated from field: optional google.protobuf.FeatureSet.EnforceNamingStyle enforce_naming_style = 7; */ enforceNamingStyle: FeatureSet_EnforceNamingStyle; /** * @generated from field: optional google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8; */ defaultSymbolVisibility: FeatureSet_VisibilityFeature_DefaultSymbolVisibility; }; ⋮---- /** * @generated from field: optional google.protobuf.FeatureSet.FieldPresence field_presence = 1; */ ⋮---- /** * @generated from field: optional google.protobuf.FeatureSet.EnumType enum_type = 2; */ ⋮---- /** * @generated from field: optional google.protobuf.FeatureSet.RepeatedFieldEncoding repeated_field_encoding = 3; */ ⋮---- /** * @generated from field: optional google.protobuf.FeatureSet.Utf8Validation utf8_validation = 4; */ ⋮---- /** * @generated from field: optional google.protobuf.FeatureSet.MessageEncoding message_encoding = 5; */ ⋮---- /** * @generated from field: optional google.protobuf.FeatureSet.JsonFormat json_format = 6; */ ⋮---- /** * @generated from field: optional google.protobuf.FeatureSet.EnforceNamingStyle enforce_naming_style = 7; */ ⋮---- /** * @generated from field: optional google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8; */ ⋮---- /** * Describes the message google.protobuf.FeatureSet. * Use `create(FeatureSetSchema)` to create a new message. */ export const FeatureSetSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * @generated from message google.protobuf.FeatureSet.VisibilityFeature */ export type FeatureSet_VisibilityFeature = Message<"google.protobuf.FeatureSet.VisibilityFeature"> & { }; ⋮---- /** * Describes the message google.protobuf.FeatureSet.VisibilityFeature. * Use `create(FeatureSet_VisibilityFeatureSchema)` to create a new message. */ export const FeatureSet_VisibilityFeatureSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * @generated from enum google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility */ export enum FeatureSet_VisibilityFeature_DefaultSymbolVisibility { /** * @generated from enum value: DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0; */ DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0, /** * Default pre-EDITION_2024, all UNSET visibility are export. * * @generated from enum value: EXPORT_ALL = 1; */ EXPORT_ALL = 1, /** * All top-level symbols default to export, nested default to local. * * @generated from enum value: EXPORT_TOP_LEVEL = 2; */ EXPORT_TOP_LEVEL = 2, /** * All symbols default to local. * * @generated from enum value: LOCAL_ALL = 3; */ LOCAL_ALL = 3, /** * All symbols local by default. Nested types cannot be exported. * With special case caveat for message { enum {} reserved 1 to max; } * This is the recommended setting for new protos. * * @generated from enum value: STRICT = 4; */ STRICT = 4, } ⋮---- /** * @generated from enum value: DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0; */ ⋮---- /** * Default pre-EDITION_2024, all UNSET visibility are export. * * @generated from enum value: EXPORT_ALL = 1; */ ⋮---- /** * All top-level symbols default to export, nested default to local. * * @generated from enum value: EXPORT_TOP_LEVEL = 2; */ ⋮---- /** * All symbols default to local. * * @generated from enum value: LOCAL_ALL = 3; */ ⋮---- /** * All symbols local by default. Nested types cannot be exported. * With special case caveat for message { enum {} reserved 1 to max; } * This is the recommended setting for new protos. * * @generated from enum value: STRICT = 4; */ ⋮---- /** * Describes the enum google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility. */ export const FeatureSet_VisibilityFeature_DefaultSymbolVisibilitySchema: GenEnum = /*@__PURE__*/ ⋮---- /** * @generated from enum google.protobuf.FeatureSet.FieldPresence */ export enum FeatureSet_FieldPresence { /** * @generated from enum value: FIELD_PRESENCE_UNKNOWN = 0; */ FIELD_PRESENCE_UNKNOWN = 0, /** * @generated from enum value: EXPLICIT = 1; */ EXPLICIT = 1, /** * @generated from enum value: IMPLICIT = 2; */ IMPLICIT = 2, /** * @generated from enum value: LEGACY_REQUIRED = 3; */ LEGACY_REQUIRED = 3, } ⋮---- /** * @generated from enum value: FIELD_PRESENCE_UNKNOWN = 0; */ ⋮---- /** * @generated from enum value: EXPLICIT = 1; */ ⋮---- /** * @generated from enum value: IMPLICIT = 2; */ ⋮---- /** * @generated from enum value: LEGACY_REQUIRED = 3; */ ⋮---- /** * Describes the enum google.protobuf.FeatureSet.FieldPresence. */ export const FeatureSet_FieldPresenceSchema: GenEnum = /*@__PURE__*/ ⋮---- /** * @generated from enum google.protobuf.FeatureSet.EnumType */ export enum FeatureSet_EnumType { /** * @generated from enum value: ENUM_TYPE_UNKNOWN = 0; */ ENUM_TYPE_UNKNOWN = 0, /** * @generated from enum value: OPEN = 1; */ OPEN = 1, /** * @generated from enum value: CLOSED = 2; */ CLOSED = 2, } ⋮---- /** * @generated from enum value: ENUM_TYPE_UNKNOWN = 0; */ ⋮---- /** * @generated from enum value: OPEN = 1; */ ⋮---- /** * @generated from enum value: CLOSED = 2; */ ⋮---- /** * Describes the enum google.protobuf.FeatureSet.EnumType. */ export const FeatureSet_EnumTypeSchema: GenEnum = /*@__PURE__*/ ⋮---- /** * @generated from enum google.protobuf.FeatureSet.RepeatedFieldEncoding */ export enum FeatureSet_RepeatedFieldEncoding { /** * @generated from enum value: REPEATED_FIELD_ENCODING_UNKNOWN = 0; */ REPEATED_FIELD_ENCODING_UNKNOWN = 0, /** * @generated from enum value: PACKED = 1; */ PACKED = 1, /** * @generated from enum value: EXPANDED = 2; */ EXPANDED = 2, } ⋮---- /** * @generated from enum value: REPEATED_FIELD_ENCODING_UNKNOWN = 0; */ ⋮---- /** * @generated from enum value: PACKED = 1; */ ⋮---- /** * @generated from enum value: EXPANDED = 2; */ ⋮---- /** * Describes the enum google.protobuf.FeatureSet.RepeatedFieldEncoding. */ export const FeatureSet_RepeatedFieldEncodingSchema: GenEnum = /*@__PURE__*/ ⋮---- /** * @generated from enum google.protobuf.FeatureSet.Utf8Validation */ export enum FeatureSet_Utf8Validation { /** * @generated from enum value: UTF8_VALIDATION_UNKNOWN = 0; */ UTF8_VALIDATION_UNKNOWN = 0, /** * @generated from enum value: VERIFY = 2; */ VERIFY = 2, /** * @generated from enum value: NONE = 3; */ NONE = 3, } ⋮---- /** * @generated from enum value: UTF8_VALIDATION_UNKNOWN = 0; */ ⋮---- /** * @generated from enum value: VERIFY = 2; */ ⋮---- /** * @generated from enum value: NONE = 3; */ ⋮---- /** * Describes the enum google.protobuf.FeatureSet.Utf8Validation. */ export const FeatureSet_Utf8ValidationSchema: GenEnum = /*@__PURE__*/ ⋮---- /** * @generated from enum google.protobuf.FeatureSet.MessageEncoding */ export enum FeatureSet_MessageEncoding { /** * @generated from enum value: MESSAGE_ENCODING_UNKNOWN = 0; */ MESSAGE_ENCODING_UNKNOWN = 0, /** * @generated from enum value: LENGTH_PREFIXED = 1; */ LENGTH_PREFIXED = 1, /** * @generated from enum value: DELIMITED = 2; */ DELIMITED = 2, } ⋮---- /** * @generated from enum value: MESSAGE_ENCODING_UNKNOWN = 0; */ ⋮---- /** * @generated from enum value: LENGTH_PREFIXED = 1; */ ⋮---- /** * @generated from enum value: DELIMITED = 2; */ ⋮---- /** * Describes the enum google.protobuf.FeatureSet.MessageEncoding. */ export const FeatureSet_MessageEncodingSchema: GenEnum = /*@__PURE__*/ ⋮---- /** * @generated from enum google.protobuf.FeatureSet.JsonFormat */ export enum FeatureSet_JsonFormat { /** * @generated from enum value: JSON_FORMAT_UNKNOWN = 0; */ JSON_FORMAT_UNKNOWN = 0, /** * @generated from enum value: ALLOW = 1; */ ALLOW = 1, /** * @generated from enum value: LEGACY_BEST_EFFORT = 2; */ LEGACY_BEST_EFFORT = 2, } ⋮---- /** * @generated from enum value: JSON_FORMAT_UNKNOWN = 0; */ ⋮---- /** * @generated from enum value: ALLOW = 1; */ ⋮---- /** * @generated from enum value: LEGACY_BEST_EFFORT = 2; */ ⋮---- /** * Describes the enum google.protobuf.FeatureSet.JsonFormat. */ export const FeatureSet_JsonFormatSchema: GenEnum = /*@__PURE__*/ ⋮---- /** * @generated from enum google.protobuf.FeatureSet.EnforceNamingStyle */ export enum FeatureSet_EnforceNamingStyle { /** * @generated from enum value: ENFORCE_NAMING_STYLE_UNKNOWN = 0; */ ENFORCE_NAMING_STYLE_UNKNOWN = 0, /** * @generated from enum value: STYLE2024 = 1; */ STYLE2024 = 1, /** * @generated from enum value: STYLE_LEGACY = 2; */ STYLE_LEGACY = 2, } ⋮---- /** * @generated from enum value: ENFORCE_NAMING_STYLE_UNKNOWN = 0; */ ⋮---- /** * @generated from enum value: STYLE2024 = 1; */ ⋮---- /** * @generated from enum value: STYLE_LEGACY = 2; */ ⋮---- /** * Describes the enum google.protobuf.FeatureSet.EnforceNamingStyle. */ export const FeatureSet_EnforceNamingStyleSchema: GenEnum = /*@__PURE__*/ ⋮---- /** * A compiled specification for the defaults of a set of features. These * messages are generated from FeatureSet extensions and can be used to seed * feature resolution. The resolution with this object becomes a simple search * for the closest matching edition, followed by proto merges. * * @generated from message google.protobuf.FeatureSetDefaults */ export type FeatureSetDefaults = Message<"google.protobuf.FeatureSetDefaults"> & { /** * @generated from field: repeated google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault defaults = 1; */ defaults: FeatureSetDefaults_FeatureSetEditionDefault[]; /** * The minimum supported edition (inclusive) when this was constructed. * Editions before this will not have defaults. * * @generated from field: optional google.protobuf.Edition minimum_edition = 4; */ minimumEdition: Edition; /** * The maximum known edition (inclusive) when this was constructed. Editions * after this will not have reliable defaults. * * @generated from field: optional google.protobuf.Edition maximum_edition = 5; */ maximumEdition: Edition; }; ⋮---- /** * @generated from field: repeated google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault defaults = 1; */ ⋮---- /** * The minimum supported edition (inclusive) when this was constructed. * Editions before this will not have defaults. * * @generated from field: optional google.protobuf.Edition minimum_edition = 4; */ ⋮---- /** * The maximum known edition (inclusive) when this was constructed. Editions * after this will not have reliable defaults. * * @generated from field: optional google.protobuf.Edition maximum_edition = 5; */ ⋮---- /** * Describes the message google.protobuf.FeatureSetDefaults. * Use `create(FeatureSetDefaultsSchema)` to create a new message. */ export const FeatureSetDefaultsSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * A map from every known edition with a unique set of defaults to its * defaults. Not all editions may be contained here. For a given edition, * the defaults at the closest matching edition ordered at or before it should * be used. This field must be in strict ascending order by edition. * * @generated from message google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault */ export type FeatureSetDefaults_FeatureSetEditionDefault = Message<"google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"> & { /** * @generated from field: optional google.protobuf.Edition edition = 3; */ edition: Edition; /** * Defaults of features that can be overridden in this edition. * * @generated from field: optional google.protobuf.FeatureSet overridable_features = 4; */ overridableFeatures?: FeatureSet; /** * Defaults of features that can't be overridden in this edition. * * @generated from field: optional google.protobuf.FeatureSet fixed_features = 5; */ fixedFeatures?: FeatureSet; }; ⋮---- /** * @generated from field: optional google.protobuf.Edition edition = 3; */ ⋮---- /** * Defaults of features that can be overridden in this edition. * * @generated from field: optional google.protobuf.FeatureSet overridable_features = 4; */ ⋮---- /** * Defaults of features that can't be overridden in this edition. * * @generated from field: optional google.protobuf.FeatureSet fixed_features = 5; */ ⋮---- /** * Describes the message google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault. * Use `create(FeatureSetDefaults_FeatureSetEditionDefaultSchema)` to create a new message. */ export const FeatureSetDefaults_FeatureSetEditionDefaultSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Encapsulates information about the original source file from which a * FileDescriptorProto was generated. * * @generated from message google.protobuf.SourceCodeInfo */ export type SourceCodeInfo = Message<"google.protobuf.SourceCodeInfo"> & { /** * A Location identifies a piece of source code in a .proto file which * corresponds to a particular definition. This information is intended * to be useful to IDEs, code indexers, documentation generators, and similar * tools. * * For example, say we have a file like: * message Foo { * optional string foo = 1; * } * Let's look at just the field definition: * optional string foo = 1; * ^ ^^ ^^ ^ ^^^ * a bc de f ghi * We have the following locations: * span path represents * [a,i) [ 4, 0, 2, 0 ] The whole field definition. * [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). * [c,d) [ 4, 0, 2, 0, 5 ] The type (string). * [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). * [g,h) [ 4, 0, 2, 0, 3 ] The number (1). * * Notes: * - A location may refer to a repeated field itself (i.e. not to any * particular index within it). This is used whenever a set of elements are * logically enclosed in a single code segment. For example, an entire * extend block (possibly containing multiple extension definitions) will * have an outer location whose path refers to the "extensions" repeated * field without an index. * - Multiple locations may have the same path. This happens when a single * logical declaration is spread out across multiple places. The most * obvious example is the "extend" block again -- there may be multiple * extend blocks in the same scope, each of which will have the same path. * - A location's span is not always a subset of its parent's span. For * example, the "extendee" of an extension declaration appears at the * beginning of the "extend" block and is shared by all extensions within * the block. * - Just because a location's span is a subset of some other location's span * does not mean that it is a descendant. For example, a "group" defines * both a type and a field in a single declaration. Thus, the locations * corresponding to the type and field and their components will overlap. * - Code which tries to interpret locations should probably be designed to * ignore those that it doesn't understand, as more types of locations could * be recorded in the future. * * @generated from field: repeated google.protobuf.SourceCodeInfo.Location location = 1; */ location: SourceCodeInfo_Location[]; }; ⋮---- /** * A Location identifies a piece of source code in a .proto file which * corresponds to a particular definition. This information is intended * to be useful to IDEs, code indexers, documentation generators, and similar * tools. * * For example, say we have a file like: * message Foo { * optional string foo = 1; * } * Let's look at just the field definition: * optional string foo = 1; * ^ ^^ ^^ ^ ^^^ * a bc de f ghi * We have the following locations: * span path represents * [a,i) [ 4, 0, 2, 0 ] The whole field definition. * [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). * [c,d) [ 4, 0, 2, 0, 5 ] The type (string). * [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). * [g,h) [ 4, 0, 2, 0, 3 ] The number (1). * * Notes: * - A location may refer to a repeated field itself (i.e. not to any * particular index within it). This is used whenever a set of elements are * logically enclosed in a single code segment. For example, an entire * extend block (possibly containing multiple extension definitions) will * have an outer location whose path refers to the "extensions" repeated * field without an index. * - Multiple locations may have the same path. This happens when a single * logical declaration is spread out across multiple places. The most * obvious example is the "extend" block again -- there may be multiple * extend blocks in the same scope, each of which will have the same path. * - A location's span is not always a subset of its parent's span. For * example, the "extendee" of an extension declaration appears at the * beginning of the "extend" block and is shared by all extensions within * the block. * - Just because a location's span is a subset of some other location's span * does not mean that it is a descendant. For example, a "group" defines * both a type and a field in a single declaration. Thus, the locations * corresponding to the type and field and their components will overlap. * - Code which tries to interpret locations should probably be designed to * ignore those that it doesn't understand, as more types of locations could * be recorded in the future. * * @generated from field: repeated google.protobuf.SourceCodeInfo.Location location = 1; */ ⋮---- /** * Describes the message google.protobuf.SourceCodeInfo. * Use `create(SourceCodeInfoSchema)` to create a new message. */ export const SourceCodeInfoSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * @generated from message google.protobuf.SourceCodeInfo.Location */ export type SourceCodeInfo_Location = Message<"google.protobuf.SourceCodeInfo.Location"> & { /** * Identifies which part of the FileDescriptorProto was defined at this * location. * * Each element is a field number or an index. They form a path from * the root FileDescriptorProto to the place where the definition appears. * For example, this path: * [ 4, 3, 2, 7, 1 ] * refers to: * file.message_type(3) // 4, 3 * .field(7) // 2, 7 * .name() // 1 * This is because FileDescriptorProto.message_type has field number 4: * repeated DescriptorProto message_type = 4; * and DescriptorProto.field has field number 2: * repeated FieldDescriptorProto field = 2; * and FieldDescriptorProto.name has field number 1: * optional string name = 1; * * Thus, the above path gives the location of a field name. If we removed * the last element: * [ 4, 3, 2, 7 ] * this path refers to the whole field declaration (from the beginning * of the label to the terminating semicolon). * * @generated from field: repeated int32 path = 1 [packed = true]; */ path: number[]; /** * Always has exactly three or four elements: start line, start column, * end line (optional, otherwise assumed same as start line), end column. * These are packed into a single field for efficiency. Note that line * and column numbers are zero-based -- typically you will want to add * 1 to each before displaying to a user. * * @generated from field: repeated int32 span = 2 [packed = true]; */ span: number[]; /** * If this SourceCodeInfo represents a complete declaration, these are any * comments appearing before and after the declaration which appear to be * attached to the declaration. * * A series of line comments appearing on consecutive lines, with no other * tokens appearing on those lines, will be treated as a single comment. * * leading_detached_comments will keep paragraphs of comments that appear * before (but not connected to) the current element. Each paragraph, * separated by empty lines, will be one comment element in the repeated * field. * * Only the comment content is provided; comment markers (e.g. //) are * stripped out. For block comments, leading whitespace and an asterisk * will be stripped from the beginning of each line other than the first. * Newlines are included in the output. * * Examples: * * optional int32 foo = 1; // Comment attached to foo. * // Comment attached to bar. * optional int32 bar = 2; * * optional string baz = 3; * // Comment attached to baz. * // Another line attached to baz. * * // Comment attached to moo. * // * // Another line attached to moo. * optional double moo = 4; * * // Detached comment for corge. This is not leading or trailing comments * // to moo or corge because there are blank lines separating it from * // both. * * // Detached comment for corge paragraph 2. * * optional string corge = 5; * /* Block comment attached * * to corge. Leading asterisks * * will be removed. *\/ * /* Block comment attached to * * grault. *\/ * optional int32 grault = 6; * * // ignored detached comments. * * @generated from field: optional string leading_comments = 3; */ leadingComments: string; /** * @generated from field: optional string trailing_comments = 4; */ trailingComments: string; /** * @generated from field: repeated string leading_detached_comments = 6; */ leadingDetachedComments: string[]; }; ⋮---- /** * Identifies which part of the FileDescriptorProto was defined at this * location. * * Each element is a field number or an index. They form a path from * the root FileDescriptorProto to the place where the definition appears. * For example, this path: * [ 4, 3, 2, 7, 1 ] * refers to: * file.message_type(3) // 4, 3 * .field(7) // 2, 7 * .name() // 1 * This is because FileDescriptorProto.message_type has field number 4: * repeated DescriptorProto message_type = 4; * and DescriptorProto.field has field number 2: * repeated FieldDescriptorProto field = 2; * and FieldDescriptorProto.name has field number 1: * optional string name = 1; * * Thus, the above path gives the location of a field name. If we removed * the last element: * [ 4, 3, 2, 7 ] * this path refers to the whole field declaration (from the beginning * of the label to the terminating semicolon). * * @generated from field: repeated int32 path = 1 [packed = true]; */ ⋮---- /** * Always has exactly three or four elements: start line, start column, * end line (optional, otherwise assumed same as start line), end column. * These are packed into a single field for efficiency. Note that line * and column numbers are zero-based -- typically you will want to add * 1 to each before displaying to a user. * * @generated from field: repeated int32 span = 2 [packed = true]; */ ⋮---- /** * If this SourceCodeInfo represents a complete declaration, these are any * comments appearing before and after the declaration which appear to be * attached to the declaration. * * A series of line comments appearing on consecutive lines, with no other * tokens appearing on those lines, will be treated as a single comment. * * leading_detached_comments will keep paragraphs of comments that appear * before (but not connected to) the current element. Each paragraph, * separated by empty lines, will be one comment element in the repeated * field. * * Only the comment content is provided; comment markers (e.g. //) are * stripped out. For block comments, leading whitespace and an asterisk * will be stripped from the beginning of each line other than the first. * Newlines are included in the output. * * Examples: * * optional int32 foo = 1; // Comment attached to foo. * // Comment attached to bar. * optional int32 bar = 2; * * optional string baz = 3; * // Comment attached to baz. * // Another line attached to baz. * * // Comment attached to moo. * // * // Another line attached to moo. * optional double moo = 4; * * // Detached comment for corge. This is not leading or trailing comments * // to moo or corge because there are blank lines separating it from * // both. * * // Detached comment for corge paragraph 2. * * optional string corge = 5; * /* Block comment attached * * to corge. Leading asterisks * * will be removed. *\/ * /* Block comment attached to * * grault. *\/ * optional int32 grault = 6; * * // ignored detached comments. * * @generated from field: optional string leading_comments = 3; */ ⋮---- /** * @generated from field: optional string trailing_comments = 4; */ ⋮---- /** * @generated from field: repeated string leading_detached_comments = 6; */ ⋮---- /** * Describes the message google.protobuf.SourceCodeInfo.Location. * Use `create(SourceCodeInfo_LocationSchema)` to create a new message. */ export const SourceCodeInfo_LocationSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Describes the relationship between generated code and its original source * file. A GeneratedCodeInfo message is associated with only one generated * source file, but may contain references to different source .proto files. * * @generated from message google.protobuf.GeneratedCodeInfo */ export type GeneratedCodeInfo = Message<"google.protobuf.GeneratedCodeInfo"> & { /** * An Annotation connects some span of text in generated code to an element * of its generating .proto file. * * @generated from field: repeated google.protobuf.GeneratedCodeInfo.Annotation annotation = 1; */ annotation: GeneratedCodeInfo_Annotation[]; }; ⋮---- /** * An Annotation connects some span of text in generated code to an element * of its generating .proto file. * * @generated from field: repeated google.protobuf.GeneratedCodeInfo.Annotation annotation = 1; */ ⋮---- /** * Describes the message google.protobuf.GeneratedCodeInfo. * Use `create(GeneratedCodeInfoSchema)` to create a new message. */ export const GeneratedCodeInfoSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * @generated from message google.protobuf.GeneratedCodeInfo.Annotation */ export type GeneratedCodeInfo_Annotation = Message<"google.protobuf.GeneratedCodeInfo.Annotation"> & { /** * Identifies the element in the original source .proto file. This field * is formatted the same as SourceCodeInfo.Location.path. * * @generated from field: repeated int32 path = 1 [packed = true]; */ path: number[]; /** * Identifies the filesystem path to the original source .proto. * * @generated from field: optional string source_file = 2; */ sourceFile: string; /** * Identifies the starting offset in bytes in the generated code * that relates to the identified object. * * @generated from field: optional int32 begin = 3; */ begin: number; /** * Identifies the ending offset in bytes in the generated code that * relates to the identified object. The end offset should be one past * the last relevant byte (so the length of the text = end - begin). * * @generated from field: optional int32 end = 4; */ end: number; /** * @generated from field: optional google.protobuf.GeneratedCodeInfo.Annotation.Semantic semantic = 5; */ semantic: GeneratedCodeInfo_Annotation_Semantic; }; ⋮---- /** * Identifies the element in the original source .proto file. This field * is formatted the same as SourceCodeInfo.Location.path. * * @generated from field: repeated int32 path = 1 [packed = true]; */ ⋮---- /** * Identifies the filesystem path to the original source .proto. * * @generated from field: optional string source_file = 2; */ ⋮---- /** * Identifies the starting offset in bytes in the generated code * that relates to the identified object. * * @generated from field: optional int32 begin = 3; */ ⋮---- /** * Identifies the ending offset in bytes in the generated code that * relates to the identified object. The end offset should be one past * the last relevant byte (so the length of the text = end - begin). * * @generated from field: optional int32 end = 4; */ ⋮---- /** * @generated from field: optional google.protobuf.GeneratedCodeInfo.Annotation.Semantic semantic = 5; */ ⋮---- /** * Describes the message google.protobuf.GeneratedCodeInfo.Annotation. * Use `create(GeneratedCodeInfo_AnnotationSchema)` to create a new message. */ export const GeneratedCodeInfo_AnnotationSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Represents the identified object's effect on the element in the original * .proto file. * * @generated from enum google.protobuf.GeneratedCodeInfo.Annotation.Semantic */ export enum GeneratedCodeInfo_Annotation_Semantic { /** * There is no effect or the effect is indescribable. * * @generated from enum value: NONE = 0; */ NONE = 0, /** * The element is set or otherwise mutated. * * @generated from enum value: SET = 1; */ SET = 1, /** * An alias to the element is returned. * * @generated from enum value: ALIAS = 2; */ ALIAS = 2, } ⋮---- /** * There is no effect or the effect is indescribable. * * @generated from enum value: NONE = 0; */ ⋮---- /** * The element is set or otherwise mutated. * * @generated from enum value: SET = 1; */ ⋮---- /** * An alias to the element is returned. * * @generated from enum value: ALIAS = 2; */ ⋮---- /** * Describes the enum google.protobuf.GeneratedCodeInfo.Annotation.Semantic. */ export const GeneratedCodeInfo_Annotation_SemanticSchema: GenEnum = /*@__PURE__*/ ⋮---- /** * The full set of known editions. * * @generated from enum google.protobuf.Edition */ export enum Edition { /** * A placeholder for an unknown edition value. * * @generated from enum value: EDITION_UNKNOWN = 0; */ EDITION_UNKNOWN = 0, /** * A placeholder edition for specifying default behaviors *before* a feature * was first introduced. This is effectively an "infinite past". * * @generated from enum value: EDITION_LEGACY = 900; */ EDITION_LEGACY = 900, /** * Legacy syntax "editions". These pre-date editions, but behave much like * distinct editions. These can't be used to specify the edition of proto * files, but feature definitions must supply proto2/proto3 defaults for * backwards compatibility. * * @generated from enum value: EDITION_PROTO2 = 998; */ EDITION_PROTO2 = 998, /** * @generated from enum value: EDITION_PROTO3 = 999; */ EDITION_PROTO3 = 999, /** * Editions that have been released. The specific values are arbitrary and * should not be depended on, but they will always be time-ordered for easy * comparison. * * @generated from enum value: EDITION_2023 = 1000; */ EDITION_2023 = 1000, /** * @generated from enum value: EDITION_2024 = 1001; */ EDITION_2024 = 1001, /** * Placeholder editions for testing feature resolution. These should not be * used or relied on outside of tests. * * @generated from enum value: EDITION_1_TEST_ONLY = 1; */ EDITION_1_TEST_ONLY = 1, /** * @generated from enum value: EDITION_2_TEST_ONLY = 2; */ EDITION_2_TEST_ONLY = 2, /** * @generated from enum value: EDITION_99997_TEST_ONLY = 99997; */ EDITION_99997_TEST_ONLY = 99997, /** * @generated from enum value: EDITION_99998_TEST_ONLY = 99998; */ EDITION_99998_TEST_ONLY = 99998, /** * @generated from enum value: EDITION_99999_TEST_ONLY = 99999; */ EDITION_99999_TEST_ONLY = 99999, /** * Placeholder for specifying unbounded edition support. This should only * ever be used by plugins that can expect to never require any changes to * support a new edition. * * @generated from enum value: EDITION_MAX = 2147483647; */ EDITION_MAX = 2147483647, } ⋮---- /** * A placeholder for an unknown edition value. * * @generated from enum value: EDITION_UNKNOWN = 0; */ ⋮---- /** * A placeholder edition for specifying default behaviors *before* a feature * was first introduced. This is effectively an "infinite past". * * @generated from enum value: EDITION_LEGACY = 900; */ ⋮---- /** * Legacy syntax "editions". These pre-date editions, but behave much like * distinct editions. These can't be used to specify the edition of proto * files, but feature definitions must supply proto2/proto3 defaults for * backwards compatibility. * * @generated from enum value: EDITION_PROTO2 = 998; */ ⋮---- /** * @generated from enum value: EDITION_PROTO3 = 999; */ ⋮---- /** * Editions that have been released. The specific values are arbitrary and * should not be depended on, but they will always be time-ordered for easy * comparison. * * @generated from enum value: EDITION_2023 = 1000; */ ⋮---- /** * @generated from enum value: EDITION_2024 = 1001; */ ⋮---- /** * Placeholder editions for testing feature resolution. These should not be * used or relied on outside of tests. * * @generated from enum value: EDITION_1_TEST_ONLY = 1; */ ⋮---- /** * @generated from enum value: EDITION_2_TEST_ONLY = 2; */ ⋮---- /** * @generated from enum value: EDITION_99997_TEST_ONLY = 99997; */ ⋮---- /** * @generated from enum value: EDITION_99998_TEST_ONLY = 99998; */ ⋮---- /** * @generated from enum value: EDITION_99999_TEST_ONLY = 99999; */ ⋮---- /** * Placeholder for specifying unbounded edition support. This should only * ever be used by plugins that can expect to never require any changes to * support a new edition. * * @generated from enum value: EDITION_MAX = 2147483647; */ ⋮---- /** * Describes the enum google.protobuf.Edition. */ export const EditionSchema: GenEnum = /*@__PURE__*/ ⋮---- /** * Describes the 'visibility' of a symbol with respect to the proto import * system. Symbols can only be imported when the visibility rules do not prevent * it (ex: local symbols cannot be imported). Visibility modifiers can only set * on `message` and `enum` as they are the only types available to be referenced * from other files. * * @generated from enum google.protobuf.SymbolVisibility */ export enum SymbolVisibility { /** * @generated from enum value: VISIBILITY_UNSET = 0; */ VISIBILITY_UNSET = 0, /** * @generated from enum value: VISIBILITY_LOCAL = 1; */ VISIBILITY_LOCAL = 1, /** * @generated from enum value: VISIBILITY_EXPORT = 2; */ VISIBILITY_EXPORT = 2, } ⋮---- /** * @generated from enum value: VISIBILITY_UNSET = 0; */ ⋮---- /** * @generated from enum value: VISIBILITY_LOCAL = 1; */ ⋮---- /** * @generated from enum value: VISIBILITY_EXPORT = 2; */ ⋮---- /** * Describes the enum google.protobuf.SymbolVisibility. */ export const SymbolVisibilitySchema: GenEnum = /*@__PURE__*/ ```` ## File: src/gen/google/protobuf/duration_pb.ts ````typescript // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ⋮---- // @generated by protoc-gen-es v2.6.3 with parameter "target=ts" // @generated from file google/protobuf/duration.proto (package google.protobuf, syntax proto3) /* eslint-disable */ ⋮---- import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; import type { Message } from "@bufbuild/protobuf"; ⋮---- /** * Describes the file google/protobuf/duration.proto. */ export const file_google_protobuf_duration: GenFile = /*@__PURE__*/ ⋮---- /** * A Duration represents a signed, fixed-length span of time represented * as a count of seconds and fractions of seconds at nanosecond * resolution. It is independent of any calendar and concepts like "day" * or "month". It is related to Timestamp in that the difference between * two Timestamp values is a Duration and it can be added or subtracted * from a Timestamp. Range is approximately +-10,000 years. * * # Examples * * Example 1: Compute Duration from two Timestamps in pseudo code. * * Timestamp start = ...; * Timestamp end = ...; * Duration duration = ...; * * duration.seconds = end.seconds - start.seconds; * duration.nanos = end.nanos - start.nanos; * * if (duration.seconds < 0 && duration.nanos > 0) { * duration.seconds += 1; * duration.nanos -= 1000000000; * } else if (duration.seconds > 0 && duration.nanos < 0) { * duration.seconds -= 1; * duration.nanos += 1000000000; * } * * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. * * Timestamp start = ...; * Duration duration = ...; * Timestamp end = ...; * * end.seconds = start.seconds + duration.seconds; * end.nanos = start.nanos + duration.nanos; * * if (end.nanos < 0) { * end.seconds -= 1; * end.nanos += 1000000000; * } else if (end.nanos >= 1000000000) { * end.seconds += 1; * end.nanos -= 1000000000; * } * * Example 3: Compute Duration from datetime.timedelta in Python. * * td = datetime.timedelta(days=3, minutes=10) * duration = Duration() * duration.FromTimedelta(td) * * # JSON Mapping * * In JSON format, the Duration type is encoded as a string rather than an * object, where the string ends in the suffix "s" (indicating seconds) and * is preceded by the number of seconds, with nanoseconds expressed as * fractional seconds. For example, 3 seconds with 0 nanoseconds should be * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should * be expressed in JSON format as "3.000000001s", and 3 seconds and 1 * microsecond should be expressed in JSON format as "3.000001s". * * * @generated from message google.protobuf.Duration */ export type Duration = Message<"google.protobuf.Duration"> & { /** * Signed seconds of the span of time. Must be from -315,576,000,000 * to +315,576,000,000 inclusive. Note: these bounds are computed from: * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years * * @generated from field: int64 seconds = 1; */ seconds: bigint; /** * Signed fractions of a second at nanosecond resolution of the span * of time. Durations less than one second are represented with a 0 * `seconds` field and a positive or negative `nanos` field. For durations * of one second or more, a non-zero value for the `nanos` field must be * of the same sign as the `seconds` field. Must be from -999,999,999 * to +999,999,999 inclusive. * * @generated from field: int32 nanos = 2; */ nanos: number; }; ⋮---- /** * Signed seconds of the span of time. Must be from -315,576,000,000 * to +315,576,000,000 inclusive. Note: these bounds are computed from: * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years * * @generated from field: int64 seconds = 1; */ ⋮---- /** * Signed fractions of a second at nanosecond resolution of the span * of time. Durations less than one second are represented with a 0 * `seconds` field and a positive or negative `nanos` field. For durations * of one second or more, a non-zero value for the `nanos` field must be * of the same sign as the `seconds` field. Must be from -999,999,999 * to +999,999,999 inclusive. * * @generated from field: int32 nanos = 2; */ ⋮---- /** * Describes the message google.protobuf.Duration. * Use `create(DurationSchema)` to create a new message. */ export const DurationSchema: GenMessage = /*@__PURE__*/ ```` ## File: src/gen/google/protobuf/empty_pb.ts ````typescript // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ⋮---- // @generated by protoc-gen-es v2.6.3 with parameter "target=ts" // @generated from file google/protobuf/empty.proto (package google.protobuf, syntax proto3) /* eslint-disable */ ⋮---- import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; import type { Message } from "@bufbuild/protobuf"; ⋮---- /** * Describes the file google/protobuf/empty.proto. */ export const file_google_protobuf_empty: GenFile = /*@__PURE__*/ ⋮---- /** * A generic empty message that you can re-use to avoid defining duplicated * empty messages in your APIs. A typical example is to use it as the request * or the response type of an API method. For instance: * * service Foo { * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); * } * * * @generated from message google.protobuf.Empty */ export type Empty = Message<"google.protobuf.Empty"> & { }; ⋮---- /** * Describes the message google.protobuf.Empty. * Use `create(EmptySchema)` to create a new message. */ export const EmptySchema: GenMessage = /*@__PURE__*/ ```` ## File: src/gen/google/protobuf/field_mask_pb.ts ````typescript // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ⋮---- // @generated by protoc-gen-es v2.6.3 with parameter "target=ts" // @generated from file google/protobuf/field_mask.proto (package google.protobuf, syntax proto3) /* eslint-disable */ ⋮---- import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; import type { Message } from "@bufbuild/protobuf"; ⋮---- /** * Describes the file google/protobuf/field_mask.proto. */ export const file_google_protobuf_field_mask: GenFile = /*@__PURE__*/ ⋮---- /** * `FieldMask` represents a set of symbolic field paths, for example: * * paths: "f.a" * paths: "f.b.d" * * Here `f` represents a field in some root message, `a` and `b` * fields in the message found in `f`, and `d` a field found in the * message in `f.b`. * * Field masks are used to specify a subset of fields that should be * returned by a get operation or modified by an update operation. * Field masks also have a custom JSON encoding (see below). * * # Field Masks in Projections * * When used in the context of a projection, a response message or * sub-message is filtered by the API to only contain those fields as * specified in the mask. For example, if the mask in the previous * example is applied to a response message as follows: * * f { * a : 22 * b { * d : 1 * x : 2 * } * y : 13 * } * z: 8 * * The result will not contain specific values for fields x,y and z * (their value will be set to the default, and omitted in proto text * output): * * * f { * a : 22 * b { * d : 1 * } * } * * A repeated field is not allowed except at the last position of a * paths string. * * If a FieldMask object is not present in a get operation, the * operation applies to all fields (as if a FieldMask of all fields * had been specified). * * Note that a field mask does not necessarily apply to the * top-level response message. In case of a REST get operation, the * field mask applies directly to the response, but in case of a REST * list operation, the mask instead applies to each individual message * in the returned resource list. In case of a REST custom method, * other definitions may be used. Where the mask applies will be * clearly documented together with its declaration in the API. In * any case, the effect on the returned resource/resources is required * behavior for APIs. * * # Field Masks in Update Operations * * A field mask in update operations specifies which fields of the * targeted resource are going to be updated. The API is required * to only change the values of the fields as specified in the mask * and leave the others untouched. If a resource is passed in to * describe the updated values, the API ignores the values of all * fields not covered by the mask. * * If a repeated field is specified for an update operation, new values will * be appended to the existing repeated field in the target resource. Note that * a repeated field is only allowed in the last position of a `paths` string. * * If a sub-message is specified in the last position of the field mask for an * update operation, then new value will be merged into the existing sub-message * in the target resource. * * For example, given the target message: * * f { * b { * d: 1 * x: 2 * } * c: [1] * } * * And an update message: * * f { * b { * d: 10 * } * c: [2] * } * * then if the field mask is: * * paths: ["f.b", "f.c"] * * then the result will be: * * f { * b { * d: 10 * x: 2 * } * c: [1, 2] * } * * An implementation may provide options to override this default behavior for * repeated and message fields. * * In order to reset a field's value to the default, the field must * be in the mask and set to the default value in the provided resource. * Hence, in order to reset all fields of a resource, provide a default * instance of the resource and set all fields in the mask, or do * not provide a mask as described below. * * If a field mask is not present on update, the operation applies to * all fields (as if a field mask of all fields has been specified). * Note that in the presence of schema evolution, this may mean that * fields the client does not know and has therefore not filled into * the request will be reset to their default. If this is unwanted * behavior, a specific service may require a client to always specify * a field mask, producing an error if not. * * As with get operations, the location of the resource which * describes the updated values in the request message depends on the * operation kind. In any case, the effect of the field mask is * required to be honored by the API. * * ## Considerations for HTTP REST * * The HTTP kind of an update operation which uses a field mask must * be set to PATCH instead of PUT in order to satisfy HTTP semantics * (PUT must only be used for full updates). * * # JSON Encoding of Field Masks * * In JSON, a field mask is encoded as a single string where paths are * separated by a comma. Fields name in each path are converted * to/from lower-camel naming conventions. * * As an example, consider the following message declarations: * * message Profile { * User user = 1; * Photo photo = 2; * } * message User { * string display_name = 1; * string address = 2; * } * * In proto a field mask for `Profile` may look as such: * * mask { * paths: "user.display_name" * paths: "photo" * } * * In JSON, the same mask is represented as below: * * { * mask: "user.displayName,photo" * } * * # Field Masks and Oneof Fields * * Field masks treat fields in oneofs just as regular fields. Consider the * following message: * * message SampleMessage { * oneof test_oneof { * string name = 4; * SubMessage sub_message = 9; * } * } * * The field mask can be: * * mask { * paths: "name" * } * * Or: * * mask { * paths: "sub_message" * } * * Note that oneof type names ("test_oneof" in this case) cannot be used in * paths. * * ## Field Mask Verification * * The implementation of any API method which has a FieldMask type field in the * request should verify the included field paths, and return an * `INVALID_ARGUMENT` error if any path is unmappable. * * @generated from message google.protobuf.FieldMask */ export type FieldMask = Message<"google.protobuf.FieldMask"> & { /** * The set of field mask paths. * * @generated from field: repeated string paths = 1; */ paths: string[]; }; ⋮---- /** * The set of field mask paths. * * @generated from field: repeated string paths = 1; */ ⋮---- /** * Describes the message google.protobuf.FieldMask. * Use `create(FieldMaskSchema)` to create a new message. */ export const FieldMaskSchema: GenMessage = /*@__PURE__*/ ```` ## File: src/gen/google/protobuf/go_features_pb.ts ````typescript // Protocol Buffers - Google's data interchange format // Copyright 2023 Google Inc. All rights reserved. // // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd ⋮---- // @generated by protoc-gen-es v2.6.3 with parameter "target=ts" // @generated from file google/protobuf/go_features.proto (package pb, syntax proto2) /* eslint-disable */ ⋮---- import type { GenEnum, GenExtension, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; import { enumDesc, extDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; import type { FeatureSet } from "./descriptor_pb"; import { file_google_protobuf_descriptor } from "./descriptor_pb"; import type { Message } from "@bufbuild/protobuf"; ⋮---- /** * Describes the file google/protobuf/go_features.proto. */ export const file_google_protobuf_go_features: GenFile = /*@__PURE__*/ ⋮---- /** * @generated from message pb.GoFeatures */ export type GoFeatures = Message<"pb.GoFeatures"> & { /** * Whether or not to generate the deprecated UnmarshalJSON method for enums. * Can only be true for proto using the Open Struct api. * * @generated from field: optional bool legacy_unmarshal_json_enum = 1; */ legacyUnmarshalJsonEnum: boolean; /** * One of OPEN, HYBRID or OPAQUE. * * @generated from field: optional pb.GoFeatures.APILevel api_level = 2; */ apiLevel: GoFeatures_APILevel; /** * @generated from field: optional pb.GoFeatures.StripEnumPrefix strip_enum_prefix = 3; */ stripEnumPrefix: GoFeatures_StripEnumPrefix; }; ⋮---- /** * Whether or not to generate the deprecated UnmarshalJSON method for enums. * Can only be true for proto using the Open Struct api. * * @generated from field: optional bool legacy_unmarshal_json_enum = 1; */ ⋮---- /** * One of OPEN, HYBRID or OPAQUE. * * @generated from field: optional pb.GoFeatures.APILevel api_level = 2; */ ⋮---- /** * @generated from field: optional pb.GoFeatures.StripEnumPrefix strip_enum_prefix = 3; */ ⋮---- /** * Describes the message pb.GoFeatures. * Use `create(GoFeaturesSchema)` to create a new message. */ export const GoFeaturesSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * @generated from enum pb.GoFeatures.APILevel */ export enum GoFeatures_APILevel { /** * API_LEVEL_UNSPECIFIED results in selecting the OPEN API, * but needs to be a separate value to distinguish between * an explicitly set api level or a missing api level. * * @generated from enum value: API_LEVEL_UNSPECIFIED = 0; */ API_LEVEL_UNSPECIFIED = 0, /** * @generated from enum value: API_OPEN = 1; */ API_OPEN = 1, /** * @generated from enum value: API_HYBRID = 2; */ API_HYBRID = 2, /** * @generated from enum value: API_OPAQUE = 3; */ API_OPAQUE = 3, } ⋮---- /** * API_LEVEL_UNSPECIFIED results in selecting the OPEN API, * but needs to be a separate value to distinguish between * an explicitly set api level or a missing api level. * * @generated from enum value: API_LEVEL_UNSPECIFIED = 0; */ ⋮---- /** * @generated from enum value: API_OPEN = 1; */ ⋮---- /** * @generated from enum value: API_HYBRID = 2; */ ⋮---- /** * @generated from enum value: API_OPAQUE = 3; */ ⋮---- /** * Describes the enum pb.GoFeatures.APILevel. */ export const GoFeatures_APILevelSchema: GenEnum = /*@__PURE__*/ ⋮---- /** * @generated from enum pb.GoFeatures.StripEnumPrefix */ export enum GoFeatures_StripEnumPrefix { /** * @generated from enum value: STRIP_ENUM_PREFIX_UNSPECIFIED = 0; */ UNSPECIFIED = 0, /** * @generated from enum value: STRIP_ENUM_PREFIX_KEEP = 1; */ KEEP = 1, /** * @generated from enum value: STRIP_ENUM_PREFIX_GENERATE_BOTH = 2; */ GENERATE_BOTH = 2, /** * @generated from enum value: STRIP_ENUM_PREFIX_STRIP = 3; */ STRIP = 3, } ⋮---- /** * @generated from enum value: STRIP_ENUM_PREFIX_UNSPECIFIED = 0; */ ⋮---- /** * @generated from enum value: STRIP_ENUM_PREFIX_KEEP = 1; */ ⋮---- /** * @generated from enum value: STRIP_ENUM_PREFIX_GENERATE_BOTH = 2; */ ⋮---- /** * @generated from enum value: STRIP_ENUM_PREFIX_STRIP = 3; */ ⋮---- /** * Describes the enum pb.GoFeatures.StripEnumPrefix. */ export const GoFeatures_StripEnumPrefixSchema: GenEnum = /*@__PURE__*/ ⋮---- /** * @generated from extension: optional pb.GoFeatures go = 1002; */ export const go: GenExtension = /*@__PURE__*/ ```` ## File: src/gen/google/protobuf/java_features_pb.ts ````typescript // Protocol Buffers - Google's data interchange format // Copyright 2023 Google Inc. All rights reserved. // // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd ⋮---- // @generated by protoc-gen-es v2.6.3 with parameter "target=ts" // @generated from file google/protobuf/java_features.proto (package pb, syntax proto2) /* eslint-disable */ ⋮---- import type { GenEnum, GenExtension, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; import { enumDesc, extDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; import type { FeatureSet } from "./descriptor_pb"; import { file_google_protobuf_descriptor } from "./descriptor_pb"; import type { Message } from "@bufbuild/protobuf"; ⋮---- /** * Describes the file google/protobuf/java_features.proto. */ export const file_google_protobuf_java_features: GenFile = /*@__PURE__*/ ⋮---- /** * @generated from message pb.JavaFeatures */ export type JavaFeatures = Message<"pb.JavaFeatures"> & { /** * Whether or not to treat an enum field as closed. This option is only * applicable to enum fields, and will be removed in the future. It is * consistent with the legacy behavior of using proto3 enum types for proto2 * fields. * * @generated from field: optional bool legacy_closed_enum = 1; */ legacyClosedEnum: boolean; /** * @generated from field: optional pb.JavaFeatures.Utf8Validation utf8_validation = 2; */ utf8Validation: JavaFeatures_Utf8Validation; /** * Allows creation of large Java enums, extending beyond the standard * constant limits imposed by the Java language. * * @generated from field: optional bool large_enum = 3; */ largeEnum: boolean; /** * Whether to use the old default outer class name scheme, or the new feature * which adds a "Proto" suffix to the outer class name. * * Users will not be able to set this option, because we removed it in the * same edition that it was introduced. But we use it to determine which * naming scheme to use for outer class name defaults. * * @generated from field: optional bool use_old_outer_classname_default = 4; */ useOldOuterClassnameDefault: boolean; /** * Whether to nest the generated class in the generated file class. This is * only applicable to *top-level* messages, enums, and services. * * @generated from field: optional pb.JavaFeatures.NestInFileClassFeature.NestInFileClass nest_in_file_class = 5; */ nestInFileClass: JavaFeatures_NestInFileClassFeature_NestInFileClass; }; ⋮---- /** * Whether or not to treat an enum field as closed. This option is only * applicable to enum fields, and will be removed in the future. It is * consistent with the legacy behavior of using proto3 enum types for proto2 * fields. * * @generated from field: optional bool legacy_closed_enum = 1; */ ⋮---- /** * @generated from field: optional pb.JavaFeatures.Utf8Validation utf8_validation = 2; */ ⋮---- /** * Allows creation of large Java enums, extending beyond the standard * constant limits imposed by the Java language. * * @generated from field: optional bool large_enum = 3; */ ⋮---- /** * Whether to use the old default outer class name scheme, or the new feature * which adds a "Proto" suffix to the outer class name. * * Users will not be able to set this option, because we removed it in the * same edition that it was introduced. But we use it to determine which * naming scheme to use for outer class name defaults. * * @generated from field: optional bool use_old_outer_classname_default = 4; */ ⋮---- /** * Whether to nest the generated class in the generated file class. This is * only applicable to *top-level* messages, enums, and services. * * @generated from field: optional pb.JavaFeatures.NestInFileClassFeature.NestInFileClass nest_in_file_class = 5; */ ⋮---- /** * Describes the message pb.JavaFeatures. * Use `create(JavaFeaturesSchema)` to create a new message. */ export const JavaFeaturesSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * @generated from message pb.JavaFeatures.NestInFileClassFeature */ export type JavaFeatures_NestInFileClassFeature = Message<"pb.JavaFeatures.NestInFileClassFeature"> & { }; ⋮---- /** * Describes the message pb.JavaFeatures.NestInFileClassFeature. * Use `create(JavaFeatures_NestInFileClassFeatureSchema)` to create a new message. */ export const JavaFeatures_NestInFileClassFeatureSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * @generated from enum pb.JavaFeatures.NestInFileClassFeature.NestInFileClass */ export enum JavaFeatures_NestInFileClassFeature_NestInFileClass { /** * Invalid default, which should never be used. * * @generated from enum value: NEST_IN_FILE_CLASS_UNKNOWN = 0; */ NEST_IN_FILE_CLASS_UNKNOWN = 0, /** * Do not nest the generated class in the file class. * * @generated from enum value: NO = 1; */ NO = 1, /** * Nest the generated class in the file class. * * @generated from enum value: YES = 2; */ YES = 2, /** * Fall back to the `java_multiple_files` option. Users won't be able to * set this option. * * @generated from enum value: LEGACY = 3; */ LEGACY = 3, } ⋮---- /** * Invalid default, which should never be used. * * @generated from enum value: NEST_IN_FILE_CLASS_UNKNOWN = 0; */ ⋮---- /** * Do not nest the generated class in the file class. * * @generated from enum value: NO = 1; */ ⋮---- /** * Nest the generated class in the file class. * * @generated from enum value: YES = 2; */ ⋮---- /** * Fall back to the `java_multiple_files` option. Users won't be able to * set this option. * * @generated from enum value: LEGACY = 3; */ ⋮---- /** * Describes the enum pb.JavaFeatures.NestInFileClassFeature.NestInFileClass. */ export const JavaFeatures_NestInFileClassFeature_NestInFileClassSchema: GenEnum = /*@__PURE__*/ ⋮---- /** * The UTF8 validation strategy to use. * * @generated from enum pb.JavaFeatures.Utf8Validation */ export enum JavaFeatures_Utf8Validation { /** * Invalid default, which should never be used. * * @generated from enum value: UTF8_VALIDATION_UNKNOWN = 0; */ UTF8_VALIDATION_UNKNOWN = 0, /** * Respect the UTF8 validation behavior specified by the global * utf8_validation feature. * * @generated from enum value: DEFAULT = 1; */ DEFAULT = 1, /** * Verifies UTF8 validity overriding the global utf8_validation * feature. This represents the legacy java_string_check_utf8 option. * * @generated from enum value: VERIFY = 2; */ VERIFY = 2, } ⋮---- /** * Invalid default, which should never be used. * * @generated from enum value: UTF8_VALIDATION_UNKNOWN = 0; */ ⋮---- /** * Respect the UTF8 validation behavior specified by the global * utf8_validation feature. * * @generated from enum value: DEFAULT = 1; */ ⋮---- /** * Verifies UTF8 validity overriding the global utf8_validation * feature. This represents the legacy java_string_check_utf8 option. * * @generated from enum value: VERIFY = 2; */ ⋮---- /** * Describes the enum pb.JavaFeatures.Utf8Validation. */ export const JavaFeatures_Utf8ValidationSchema: GenEnum = /*@__PURE__*/ ⋮---- /** * @generated from extension: optional pb.JavaFeatures java = 1001; */ export const java: GenExtension = /*@__PURE__*/ ```` ## File: src/gen/google/protobuf/source_context_pb.ts ````typescript // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ⋮---- // @generated by protoc-gen-es v2.6.3 with parameter "target=ts" // @generated from file google/protobuf/source_context.proto (package google.protobuf, syntax proto3) /* eslint-disable */ ⋮---- import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; import type { Message } from "@bufbuild/protobuf"; ⋮---- /** * Describes the file google/protobuf/source_context.proto. */ export const file_google_protobuf_source_context: GenFile = /*@__PURE__*/ ⋮---- /** * `SourceContext` represents information about the source of a * protobuf element, like the file in which it is defined. * * @generated from message google.protobuf.SourceContext */ export type SourceContext = Message<"google.protobuf.SourceContext"> & { /** * The path-qualified name of the .proto file that contained the associated * protobuf element. For example: `"google/protobuf/source_context.proto"`. * * @generated from field: string file_name = 1; */ fileName: string; }; ⋮---- /** * The path-qualified name of the .proto file that contained the associated * protobuf element. For example: `"google/protobuf/source_context.proto"`. * * @generated from field: string file_name = 1; */ ⋮---- /** * Describes the message google.protobuf.SourceContext. * Use `create(SourceContextSchema)` to create a new message. */ export const SourceContextSchema: GenMessage = /*@__PURE__*/ ```` ## File: src/gen/google/protobuf/struct_pb.ts ````typescript // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ⋮---- // @generated by protoc-gen-es v2.6.3 with parameter "target=ts" // @generated from file google/protobuf/struct.proto (package google.protobuf, syntax proto3) /* eslint-disable */ ⋮---- import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; import { enumDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; import type { Message } from "@bufbuild/protobuf"; ⋮---- /** * Describes the file google/protobuf/struct.proto. */ export const file_google_protobuf_struct: GenFile = /*@__PURE__*/ ⋮---- /** * `Struct` represents a structured data value, consisting of fields * which map to dynamically typed values. In some languages, `Struct` * might be supported by a native representation. For example, in * scripting languages like JS a struct is represented as an * object. The details of that representation are described together * with the proto support for the language. * * The JSON representation for `Struct` is JSON object. * * @generated from message google.protobuf.Struct */ export type Struct = Message<"google.protobuf.Struct"> & { /** * Unordered map of dynamically typed values. * * @generated from field: map fields = 1; */ fields: { [key: string]: Value }; }; ⋮---- /** * Unordered map of dynamically typed values. * * @generated from field: map fields = 1; */ ⋮---- /** * Describes the message google.protobuf.Struct. * Use `create(StructSchema)` to create a new message. */ export const StructSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * `Value` represents a dynamically typed value which can be either * null, a number, a string, a boolean, a recursive struct value, or a * list of values. A producer of value is expected to set one of these * variants. Absence of any variant indicates an error. * * The JSON representation for `Value` is JSON value. * * @generated from message google.protobuf.Value */ export type Value = Message<"google.protobuf.Value"> & { /** * The kind of value. * * @generated from oneof google.protobuf.Value.kind */ kind: { /** * Represents a null value. * * @generated from field: google.protobuf.NullValue null_value = 1; */ value: NullValue; case: "nullValue"; } | { /** * Represents a double value. * * @generated from field: double number_value = 2; */ value: number; case: "numberValue"; } | { /** * Represents a string value. * * @generated from field: string string_value = 3; */ value: string; case: "stringValue"; } | { /** * Represents a boolean value. * * @generated from field: bool bool_value = 4; */ value: boolean; case: "boolValue"; } | { /** * Represents a structured value. * * @generated from field: google.protobuf.Struct struct_value = 5; */ value: Struct; case: "structValue"; } | { /** * Represents a repeated `Value`. * * @generated from field: google.protobuf.ListValue list_value = 6; */ value: ListValue; case: "listValue"; } | { case: undefined; value?: undefined }; }; ⋮---- /** * The kind of value. * * @generated from oneof google.protobuf.Value.kind */ ⋮---- /** * Represents a null value. * * @generated from field: google.protobuf.NullValue null_value = 1; */ ⋮---- /** * Represents a double value. * * @generated from field: double number_value = 2; */ ⋮---- /** * Represents a string value. * * @generated from field: string string_value = 3; */ ⋮---- /** * Represents a boolean value. * * @generated from field: bool bool_value = 4; */ ⋮---- /** * Represents a structured value. * * @generated from field: google.protobuf.Struct struct_value = 5; */ ⋮---- /** * Represents a repeated `Value`. * * @generated from field: google.protobuf.ListValue list_value = 6; */ ⋮---- /** * Describes the message google.protobuf.Value. * Use `create(ValueSchema)` to create a new message. */ export const ValueSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * `ListValue` is a wrapper around a repeated field of values. * * The JSON representation for `ListValue` is JSON array. * * @generated from message google.protobuf.ListValue */ export type ListValue = Message<"google.protobuf.ListValue"> & { /** * Repeated field of dynamically typed values. * * @generated from field: repeated google.protobuf.Value values = 1; */ values: Value[]; }; ⋮---- /** * Repeated field of dynamically typed values. * * @generated from field: repeated google.protobuf.Value values = 1; */ ⋮---- /** * Describes the message google.protobuf.ListValue. * Use `create(ListValueSchema)` to create a new message. */ export const ListValueSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * `NullValue` is a singleton enumeration to represent the null value for the * `Value` type union. * * The JSON representation for `NullValue` is JSON `null`. * * @generated from enum google.protobuf.NullValue */ export enum NullValue { /** * Null value. * * @generated from enum value: NULL_VALUE = 0; */ NULL_VALUE = 0, } ⋮---- /** * Null value. * * @generated from enum value: NULL_VALUE = 0; */ ⋮---- /** * Describes the enum google.protobuf.NullValue. */ export const NullValueSchema: GenEnum = /*@__PURE__*/ ```` ## File: src/gen/google/protobuf/timestamp_pb.ts ````typescript // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ⋮---- // @generated by protoc-gen-es v2.6.3 with parameter "target=ts" // @generated from file google/protobuf/timestamp.proto (package google.protobuf, syntax proto3) /* eslint-disable */ ⋮---- import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; import type { Message } from "@bufbuild/protobuf"; ⋮---- /** * Describes the file google/protobuf/timestamp.proto. */ export const file_google_protobuf_timestamp: GenFile = /*@__PURE__*/ ⋮---- /** * A Timestamp represents a point in time independent of any time zone or local * calendar, encoded as a count of seconds and fractions of seconds at * nanosecond resolution. The count is relative to an epoch at UTC midnight on * January 1, 1970, in the proleptic Gregorian calendar which extends the * Gregorian calendar backwards to year one. * * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap * second table is needed for interpretation, using a [24-hour linear * smear](https://developers.google.com/time/smear). * * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By * restricting to that range, we ensure that we can convert to and from [RFC * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. * * # Examples * * Example 1: Compute Timestamp from POSIX `time()`. * * Timestamp timestamp; * timestamp.set_seconds(time(NULL)); * timestamp.set_nanos(0); * * Example 2: Compute Timestamp from POSIX `gettimeofday()`. * * struct timeval tv; * gettimeofday(&tv, NULL); * * Timestamp timestamp; * timestamp.set_seconds(tv.tv_sec); * timestamp.set_nanos(tv.tv_usec * 1000); * * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. * * FILETIME ft; * GetSystemTimeAsFileTime(&ft); * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; * * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. * Timestamp timestamp; * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); * * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. * * long millis = System.currentTimeMillis(); * * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) * .setNanos((int) ((millis % 1000) * 1000000)).build(); * * Example 5: Compute Timestamp from Java `Instant.now()`. * * Instant now = Instant.now(); * * Timestamp timestamp = * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) * .setNanos(now.getNano()).build(); * * Example 6: Compute Timestamp from current time in Python. * * timestamp = Timestamp() * timestamp.GetCurrentTime() * * # JSON Mapping * * In JSON format, the Timestamp type is encoded as a string in the * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" * where {year} is always expressed using four digits while {month}, {day}, * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone * is required. A proto3 JSON serializer should always use UTC (as indicated by * "Z") when printing the Timestamp type and a proto3 JSON parser should be * able to accept both UTC and other timezones (as indicated by an offset). * * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past * 01:30 UTC on January 15, 2017. * * In JavaScript, one can convert a Date object to this format using the * standard * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) * method. In Python, a standard `datetime.datetime` object can be converted * to this format using * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use * the Joda Time's [`ISODateTimeFormat.dateTime()`]( * http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() * ) to obtain a formatter capable of generating timestamps in this format. * * * @generated from message google.protobuf.Timestamp */ export type Timestamp = Message<"google.protobuf.Timestamp"> & { /** * Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must * be between -315576000000 and 315576000000 inclusive (which corresponds to * 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z). * * @generated from field: int64 seconds = 1; */ seconds: bigint; /** * Non-negative fractions of a second at nanosecond resolution. This field is * the nanosecond portion of the duration, not an alternative to seconds. * Negative second values with fractions must still have non-negative nanos * values that count forward in time. Must be between 0 and 999,999,999 * inclusive. * * @generated from field: int32 nanos = 2; */ nanos: number; }; ⋮---- /** * Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must * be between -315576000000 and 315576000000 inclusive (which corresponds to * 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z). * * @generated from field: int64 seconds = 1; */ ⋮---- /** * Non-negative fractions of a second at nanosecond resolution. This field is * the nanosecond portion of the duration, not an alternative to seconds. * Negative second values with fractions must still have non-negative nanos * values that count forward in time. Must be between 0 and 999,999,999 * inclusive. * * @generated from field: int32 nanos = 2; */ ⋮---- /** * Describes the message google.protobuf.Timestamp. * Use `create(TimestampSchema)` to create a new message. */ export const TimestampSchema: GenMessage = /*@__PURE__*/ ```` ## File: src/gen/google/protobuf/type_pb.ts ````typescript // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ⋮---- // @generated by protoc-gen-es v2.6.3 with parameter "target=ts" // @generated from file google/protobuf/type.proto (package google.protobuf, syntax proto3) /* eslint-disable */ ⋮---- import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; import { enumDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; import type { Any } from "./any_pb"; import { file_google_protobuf_any } from "./any_pb"; import type { SourceContext } from "./source_context_pb"; import { file_google_protobuf_source_context } from "./source_context_pb"; import type { Message } from "@bufbuild/protobuf"; ⋮---- /** * Describes the file google/protobuf/type.proto. */ export const file_google_protobuf_type: GenFile = /*@__PURE__*/ ⋮---- /** * A protocol buffer message type. * * New usages of this message as an alternative to DescriptorProto are strongly * discouraged. This message does not reliability preserve all information * necessary to model the schema and preserve semantics. Instead make use of * FileDescriptorSet which preserves the necessary information. * * @generated from message google.protobuf.Type */ export type Type = Message<"google.protobuf.Type"> & { /** * The fully qualified message name. * * @generated from field: string name = 1; */ name: string; /** * The list of fields. * * @generated from field: repeated google.protobuf.Field fields = 2; */ fields: Field[]; /** * The list of types appearing in `oneof` definitions in this type. * * @generated from field: repeated string oneofs = 3; */ oneofs: string[]; /** * The protocol buffer options. * * @generated from field: repeated google.protobuf.Option options = 4; */ options: Option[]; /** * The source context. * * @generated from field: google.protobuf.SourceContext source_context = 5; */ sourceContext?: SourceContext; /** * The source syntax. * * @generated from field: google.protobuf.Syntax syntax = 6; */ syntax: Syntax; /** * The source edition string, only valid when syntax is SYNTAX_EDITIONS. * * @generated from field: string edition = 7; */ edition: string; }; ⋮---- /** * The fully qualified message name. * * @generated from field: string name = 1; */ ⋮---- /** * The list of fields. * * @generated from field: repeated google.protobuf.Field fields = 2; */ ⋮---- /** * The list of types appearing in `oneof` definitions in this type. * * @generated from field: repeated string oneofs = 3; */ ⋮---- /** * The protocol buffer options. * * @generated from field: repeated google.protobuf.Option options = 4; */ ⋮---- /** * The source context. * * @generated from field: google.protobuf.SourceContext source_context = 5; */ ⋮---- /** * The source syntax. * * @generated from field: google.protobuf.Syntax syntax = 6; */ ⋮---- /** * The source edition string, only valid when syntax is SYNTAX_EDITIONS. * * @generated from field: string edition = 7; */ ⋮---- /** * Describes the message google.protobuf.Type. * Use `create(TypeSchema)` to create a new message. */ export const TypeSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * A single field of a message type. * * New usages of this message as an alternative to FieldDescriptorProto are * strongly discouraged. This message does not reliability preserve all * information necessary to model the schema and preserve semantics. Instead * make use of FileDescriptorSet which preserves the necessary information. * * @generated from message google.protobuf.Field */ export type Field = Message<"google.protobuf.Field"> & { /** * The field type. * * @generated from field: google.protobuf.Field.Kind kind = 1; */ kind: Field_Kind; /** * The field cardinality. * * @generated from field: google.protobuf.Field.Cardinality cardinality = 2; */ cardinality: Field_Cardinality; /** * The field number. * * @generated from field: int32 number = 3; */ number: number; /** * The field name. * * @generated from field: string name = 4; */ name: string; /** * The field type URL, without the scheme, for message or enumeration * types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. * * @generated from field: string type_url = 6; */ typeUrl: string; /** * The index of the field type in `Type.oneofs`, for message or enumeration * types. The first type has index 1; zero means the type is not in the list. * * @generated from field: int32 oneof_index = 7; */ oneofIndex: number; /** * Whether to use alternative packed wire representation. * * @generated from field: bool packed = 8; */ packed: boolean; /** * The protocol buffer options. * * @generated from field: repeated google.protobuf.Option options = 9; */ options: Option[]; /** * The field JSON name. * * @generated from field: string json_name = 10; */ jsonName: string; /** * The string value of the default value of this field. Proto2 syntax only. * * @generated from field: string default_value = 11; */ defaultValue: string; }; ⋮---- /** * The field type. * * @generated from field: google.protobuf.Field.Kind kind = 1; */ ⋮---- /** * The field cardinality. * * @generated from field: google.protobuf.Field.Cardinality cardinality = 2; */ ⋮---- /** * The field number. * * @generated from field: int32 number = 3; */ ⋮---- /** * The field name. * * @generated from field: string name = 4; */ ⋮---- /** * The field type URL, without the scheme, for message or enumeration * types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. * * @generated from field: string type_url = 6; */ ⋮---- /** * The index of the field type in `Type.oneofs`, for message or enumeration * types. The first type has index 1; zero means the type is not in the list. * * @generated from field: int32 oneof_index = 7; */ ⋮---- /** * Whether to use alternative packed wire representation. * * @generated from field: bool packed = 8; */ ⋮---- /** * The protocol buffer options. * * @generated from field: repeated google.protobuf.Option options = 9; */ ⋮---- /** * The field JSON name. * * @generated from field: string json_name = 10; */ ⋮---- /** * The string value of the default value of this field. Proto2 syntax only. * * @generated from field: string default_value = 11; */ ⋮---- /** * Describes the message google.protobuf.Field. * Use `create(FieldSchema)` to create a new message. */ export const FieldSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Basic field types. * * @generated from enum google.protobuf.Field.Kind */ export enum Field_Kind { /** * Field type unknown. * * @generated from enum value: TYPE_UNKNOWN = 0; */ TYPE_UNKNOWN = 0, /** * Field type double. * * @generated from enum value: TYPE_DOUBLE = 1; */ TYPE_DOUBLE = 1, /** * Field type float. * * @generated from enum value: TYPE_FLOAT = 2; */ TYPE_FLOAT = 2, /** * Field type int64. * * @generated from enum value: TYPE_INT64 = 3; */ TYPE_INT64 = 3, /** * Field type uint64. * * @generated from enum value: TYPE_UINT64 = 4; */ TYPE_UINT64 = 4, /** * Field type int32. * * @generated from enum value: TYPE_INT32 = 5; */ TYPE_INT32 = 5, /** * Field type fixed64. * * @generated from enum value: TYPE_FIXED64 = 6; */ TYPE_FIXED64 = 6, /** * Field type fixed32. * * @generated from enum value: TYPE_FIXED32 = 7; */ TYPE_FIXED32 = 7, /** * Field type bool. * * @generated from enum value: TYPE_BOOL = 8; */ TYPE_BOOL = 8, /** * Field type string. * * @generated from enum value: TYPE_STRING = 9; */ TYPE_STRING = 9, /** * Field type group. Proto2 syntax only, and deprecated. * * @generated from enum value: TYPE_GROUP = 10; */ TYPE_GROUP = 10, /** * Field type message. * * @generated from enum value: TYPE_MESSAGE = 11; */ TYPE_MESSAGE = 11, /** * Field type bytes. * * @generated from enum value: TYPE_BYTES = 12; */ TYPE_BYTES = 12, /** * Field type uint32. * * @generated from enum value: TYPE_UINT32 = 13; */ TYPE_UINT32 = 13, /** * Field type enum. * * @generated from enum value: TYPE_ENUM = 14; */ TYPE_ENUM = 14, /** * Field type sfixed32. * * @generated from enum value: TYPE_SFIXED32 = 15; */ TYPE_SFIXED32 = 15, /** * Field type sfixed64. * * @generated from enum value: TYPE_SFIXED64 = 16; */ TYPE_SFIXED64 = 16, /** * Field type sint32. * * @generated from enum value: TYPE_SINT32 = 17; */ TYPE_SINT32 = 17, /** * Field type sint64. * * @generated from enum value: TYPE_SINT64 = 18; */ TYPE_SINT64 = 18, } ⋮---- /** * Field type unknown. * * @generated from enum value: TYPE_UNKNOWN = 0; */ ⋮---- /** * Field type double. * * @generated from enum value: TYPE_DOUBLE = 1; */ ⋮---- /** * Field type float. * * @generated from enum value: TYPE_FLOAT = 2; */ ⋮---- /** * Field type int64. * * @generated from enum value: TYPE_INT64 = 3; */ ⋮---- /** * Field type uint64. * * @generated from enum value: TYPE_UINT64 = 4; */ ⋮---- /** * Field type int32. * * @generated from enum value: TYPE_INT32 = 5; */ ⋮---- /** * Field type fixed64. * * @generated from enum value: TYPE_FIXED64 = 6; */ ⋮---- /** * Field type fixed32. * * @generated from enum value: TYPE_FIXED32 = 7; */ ⋮---- /** * Field type bool. * * @generated from enum value: TYPE_BOOL = 8; */ ⋮---- /** * Field type string. * * @generated from enum value: TYPE_STRING = 9; */ ⋮---- /** * Field type group. Proto2 syntax only, and deprecated. * * @generated from enum value: TYPE_GROUP = 10; */ ⋮---- /** * Field type message. * * @generated from enum value: TYPE_MESSAGE = 11; */ ⋮---- /** * Field type bytes. * * @generated from enum value: TYPE_BYTES = 12; */ ⋮---- /** * Field type uint32. * * @generated from enum value: TYPE_UINT32 = 13; */ ⋮---- /** * Field type enum. * * @generated from enum value: TYPE_ENUM = 14; */ ⋮---- /** * Field type sfixed32. * * @generated from enum value: TYPE_SFIXED32 = 15; */ ⋮---- /** * Field type sfixed64. * * @generated from enum value: TYPE_SFIXED64 = 16; */ ⋮---- /** * Field type sint32. * * @generated from enum value: TYPE_SINT32 = 17; */ ⋮---- /** * Field type sint64. * * @generated from enum value: TYPE_SINT64 = 18; */ ⋮---- /** * Describes the enum google.protobuf.Field.Kind. */ export const Field_KindSchema: GenEnum = /*@__PURE__*/ ⋮---- /** * Whether a field is optional, required, or repeated. * * @generated from enum google.protobuf.Field.Cardinality */ export enum Field_Cardinality { /** * For fields with unknown cardinality. * * @generated from enum value: CARDINALITY_UNKNOWN = 0; */ UNKNOWN = 0, /** * For optional fields. * * @generated from enum value: CARDINALITY_OPTIONAL = 1; */ OPTIONAL = 1, /** * For required fields. Proto2 syntax only. * * @generated from enum value: CARDINALITY_REQUIRED = 2; */ REQUIRED = 2, /** * For repeated fields. * * @generated from enum value: CARDINALITY_REPEATED = 3; */ REPEATED = 3, } ⋮---- /** * For fields with unknown cardinality. * * @generated from enum value: CARDINALITY_UNKNOWN = 0; */ ⋮---- /** * For optional fields. * * @generated from enum value: CARDINALITY_OPTIONAL = 1; */ ⋮---- /** * For required fields. Proto2 syntax only. * * @generated from enum value: CARDINALITY_REQUIRED = 2; */ ⋮---- /** * For repeated fields. * * @generated from enum value: CARDINALITY_REPEATED = 3; */ ⋮---- /** * Describes the enum google.protobuf.Field.Cardinality. */ export const Field_CardinalitySchema: GenEnum = /*@__PURE__*/ ⋮---- /** * Enum type definition. * * New usages of this message as an alternative to EnumDescriptorProto are * strongly discouraged. This message does not reliability preserve all * information necessary to model the schema and preserve semantics. Instead * make use of FileDescriptorSet which preserves the necessary information. * * @generated from message google.protobuf.Enum */ export type Enum = Message<"google.protobuf.Enum"> & { /** * Enum type name. * * @generated from field: string name = 1; */ name: string; /** * Enum value definitions. * * @generated from field: repeated google.protobuf.EnumValue enumvalue = 2; */ enumvalue: EnumValue[]; /** * Protocol buffer options. * * @generated from field: repeated google.protobuf.Option options = 3; */ options: Option[]; /** * The source context. * * @generated from field: google.protobuf.SourceContext source_context = 4; */ sourceContext?: SourceContext; /** * The source syntax. * * @generated from field: google.protobuf.Syntax syntax = 5; */ syntax: Syntax; /** * The source edition string, only valid when syntax is SYNTAX_EDITIONS. * * @generated from field: string edition = 6; */ edition: string; }; ⋮---- /** * Enum type name. * * @generated from field: string name = 1; */ ⋮---- /** * Enum value definitions. * * @generated from field: repeated google.protobuf.EnumValue enumvalue = 2; */ ⋮---- /** * Protocol buffer options. * * @generated from field: repeated google.protobuf.Option options = 3; */ ⋮---- /** * The source context. * * @generated from field: google.protobuf.SourceContext source_context = 4; */ ⋮---- /** * The source syntax. * * @generated from field: google.protobuf.Syntax syntax = 5; */ ⋮---- /** * The source edition string, only valid when syntax is SYNTAX_EDITIONS. * * @generated from field: string edition = 6; */ ⋮---- /** * Describes the message google.protobuf.Enum. * Use `create(EnumSchema)` to create a new message. */ export const EnumSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * Enum value definition. * * New usages of this message as an alternative to EnumValueDescriptorProto are * strongly discouraged. This message does not reliability preserve all * information necessary to model the schema and preserve semantics. Instead * make use of FileDescriptorSet which preserves the necessary information. * * @generated from message google.protobuf.EnumValue */ export type EnumValue = Message<"google.protobuf.EnumValue"> & { /** * Enum value name. * * @generated from field: string name = 1; */ name: string; /** * Enum value number. * * @generated from field: int32 number = 2; */ number: number; /** * Protocol buffer options. * * @generated from field: repeated google.protobuf.Option options = 3; */ options: Option[]; }; ⋮---- /** * Enum value name. * * @generated from field: string name = 1; */ ⋮---- /** * Enum value number. * * @generated from field: int32 number = 2; */ ⋮---- /** * Protocol buffer options. * * @generated from field: repeated google.protobuf.Option options = 3; */ ⋮---- /** * Describes the message google.protobuf.EnumValue. * Use `create(EnumValueSchema)` to create a new message. */ export const EnumValueSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * A protocol buffer option, which can be attached to a message, field, * enumeration, etc. * * New usages of this message as an alternative to FileOptions, MessageOptions, * FieldOptions, EnumOptions, EnumValueOptions, ServiceOptions, or MethodOptions * are strongly discouraged. * * @generated from message google.protobuf.Option */ export type Option = Message<"google.protobuf.Option"> & { /** * The option's name. For protobuf built-in options (options defined in * descriptor.proto), this is the short name. For example, `"map_entry"`. * For custom options, it should be the fully-qualified name. For example, * `"google.api.http"`. * * @generated from field: string name = 1; */ name: string; /** * The option's value packed in an Any message. If the value is a primitive, * the corresponding wrapper type defined in google/protobuf/wrappers.proto * should be used. If the value is an enum, it should be stored as an int32 * value using the google.protobuf.Int32Value type. * * @generated from field: google.protobuf.Any value = 2; */ value?: Any; }; ⋮---- /** * The option's name. For protobuf built-in options (options defined in * descriptor.proto), this is the short name. For example, `"map_entry"`. * For custom options, it should be the fully-qualified name. For example, * `"google.api.http"`. * * @generated from field: string name = 1; */ ⋮---- /** * The option's value packed in an Any message. If the value is a primitive, * the corresponding wrapper type defined in google/protobuf/wrappers.proto * should be used. If the value is an enum, it should be stored as an int32 * value using the google.protobuf.Int32Value type. * * @generated from field: google.protobuf.Any value = 2; */ ⋮---- /** * Describes the message google.protobuf.Option. * Use `create(OptionSchema)` to create a new message. */ export const OptionSchema: GenMessageWGS84 * standard. Values must be within normalized ranges. * * @generated from message google.type.LatLng */ export type LatLng = Message<"google.type.LatLng"> & { /** * The latitude in degrees. It must be in the range [-90.0, +90.0]. * * @generated from field: double latitude = 1; */ latitude: number; /** * The longitude in degrees. It must be in the range [-180.0, +180.0]. * * @generated from field: double longitude = 2; */ longitude: number; }; ⋮---- /** * The latitude in degrees. It must be in the range [-90.0, +90.0]. * * @generated from field: double latitude = 1; */ ⋮---- /** * The longitude in degrees. It must be in the range [-180.0, +180.0]. * * @generated from field: double longitude = 2; */ ⋮---- /** * Describes the message google.type.LatLng. * Use `create(LatLngSchema)` to create a new message. */ export const LatLngSchema: GenMessage = /*@__PURE__*/ ```` ## File: src/gen/google/type/localized_text_pb.ts ````typescript // Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. ⋮---- // @generated by protoc-gen-es v2.6.3 with parameter "target=ts" // @generated from file google/type/localized_text.proto (package google.type, syntax proto3) /* eslint-disable */ ⋮---- import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; import type { Message } from "@bufbuild/protobuf"; ⋮---- /** * Describes the file google/type/localized_text.proto. */ export const file_google_type_localized_text: GenFile = /*@__PURE__*/ ⋮---- /** * Localized variant of a text in a particular language. * * @generated from message google.type.LocalizedText */ export type LocalizedText = Message<"google.type.LocalizedText"> & { /** * Localized string in the language corresponding to `language_code' below. * * @generated from field: string text = 1; */ text: string; /** * The text's BCP-47 language code, such as "en-US" or "sr-Latn". * * For more information, see * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. * * @generated from field: string language_code = 2; */ languageCode: string; }; ⋮---- /** * Localized string in the language corresponding to `language_code' below. * * @generated from field: string text = 1; */ ⋮---- /** * The text's BCP-47 language code, such as "en-US" or "sr-Latn". * * For more information, see * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. * * @generated from field: string language_code = 2; */ ⋮---- /** * Describes the message google.type.LocalizedText. * Use `create(LocalizedTextSchema)` to create a new message. */ export const LocalizedTextSchema: GenMessage = /*@__PURE__*/ ```` ## File: src/gen/google/type/money_pb.ts ````typescript // Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. ⋮---- // @generated by protoc-gen-es v2.6.3 with parameter "target=ts" // @generated from file google/type/money.proto (package google.type, syntax proto3) /* eslint-disable */ ⋮---- import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; import type { Message } from "@bufbuild/protobuf"; ⋮---- /** * Describes the file google/type/money.proto. */ export const file_google_type_money: GenFile = /*@__PURE__*/ ⋮---- /** * Represents an amount of money with its currency type. * * @generated from message google.type.Money */ export type Money = Message<"google.type.Money"> & { /** * The three-letter currency code defined in ISO 4217. * * @generated from field: string currency_code = 1; */ currencyCode: string; /** * The whole units of the amount. * For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. * * @generated from field: int64 units = 2; */ units: bigint; /** * Number of nano (10^-9) units of the amount. * The value must be between -999,999,999 and +999,999,999 inclusive. * If `units` is positive, `nanos` must be positive or zero. * If `units` is zero, `nanos` can be positive, zero, or negative. * If `units` is negative, `nanos` must be negative or zero. * For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. * * @generated from field: int32 nanos = 3; */ nanos: number; }; ⋮---- /** * The three-letter currency code defined in ISO 4217. * * @generated from field: string currency_code = 1; */ ⋮---- /** * The whole units of the amount. * For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. * * @generated from field: int64 units = 2; */ ⋮---- /** * Number of nano (10^-9) units of the amount. * The value must be between -999,999,999 and +999,999,999 inclusive. * If `units` is positive, `nanos` must be positive or zero. * If `units` is zero, `nanos` can be positive, zero, or negative. * If `units` is negative, `nanos` must be negative or zero. * For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. * * @generated from field: int32 nanos = 3; */ ⋮---- /** * Describes the message google.type.Money. * Use `create(MoneySchema)` to create a new message. */ export const MoneySchema: GenMessage = /*@__PURE__*/ ```` ## File: src/gen/google/type/month_pb.ts ````typescript // Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. ⋮---- // @generated by protoc-gen-es v2.6.3 with parameter "target=ts" // @generated from file google/type/month.proto (package google.type, syntax proto3) /* eslint-disable */ ⋮---- import type { GenEnum, GenFile } from "@bufbuild/protobuf/codegenv2"; import { enumDesc, fileDesc } from "@bufbuild/protobuf/codegenv2"; ⋮---- /** * Describes the file google/type/month.proto. */ export const file_google_type_month: GenFile = /*@__PURE__*/ ⋮---- /** * Represents a month in the Gregorian calendar. * * @generated from enum google.type.Month */ export enum Month { /** * The unspecified month. * * @generated from enum value: MONTH_UNSPECIFIED = 0; */ MONTH_UNSPECIFIED = 0, /** * The month of January. * * @generated from enum value: JANUARY = 1; */ JANUARY = 1, /** * The month of February. * * @generated from enum value: FEBRUARY = 2; */ FEBRUARY = 2, /** * The month of March. * * @generated from enum value: MARCH = 3; */ MARCH = 3, /** * The month of April. * * @generated from enum value: APRIL = 4; */ APRIL = 4, /** * The month of May. * * @generated from enum value: MAY = 5; */ MAY = 5, /** * The month of June. * * @generated from enum value: JUNE = 6; */ JUNE = 6, /** * The month of July. * * @generated from enum value: JULY = 7; */ JULY = 7, /** * The month of August. * * @generated from enum value: AUGUST = 8; */ AUGUST = 8, /** * The month of September. * * @generated from enum value: SEPTEMBER = 9; */ SEPTEMBER = 9, /** * The month of October. * * @generated from enum value: OCTOBER = 10; */ OCTOBER = 10, /** * The month of November. * * @generated from enum value: NOVEMBER = 11; */ NOVEMBER = 11, /** * The month of December. * * @generated from enum value: DECEMBER = 12; */ DECEMBER = 12, } ⋮---- /** * The unspecified month. * * @generated from enum value: MONTH_UNSPECIFIED = 0; */ ⋮---- /** * The month of January. * * @generated from enum value: JANUARY = 1; */ ⋮---- /** * The month of February. * * @generated from enum value: FEBRUARY = 2; */ ⋮---- /** * The month of March. * * @generated from enum value: MARCH = 3; */ ⋮---- /** * The month of April. * * @generated from enum value: APRIL = 4; */ ⋮---- /** * The month of May. * * @generated from enum value: MAY = 5; */ ⋮---- /** * The month of June. * * @generated from enum value: JUNE = 6; */ ⋮---- /** * The month of July. * * @generated from enum value: JULY = 7; */ ⋮---- /** * The month of August. * * @generated from enum value: AUGUST = 8; */ ⋮---- /** * The month of September. * * @generated from enum value: SEPTEMBER = 9; */ ⋮---- /** * The month of October. * * @generated from enum value: OCTOBER = 10; */ ⋮---- /** * The month of November. * * @generated from enum value: NOVEMBER = 11; */ ⋮---- /** * The month of December. * * @generated from enum value: DECEMBER = 12; */ ⋮---- /** * Describes the enum google.type.Month. */ export const MonthSchema: GenEnum = /*@__PURE__*/ ```` ## File: src/gen/google/type/phone_number_pb.ts ````typescript // Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. ⋮---- // @generated by protoc-gen-es v2.6.3 with parameter "target=ts" // @generated from file google/type/phone_number.proto (package google.type, syntax proto3) /* eslint-disable */ ⋮---- import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; import type { Message } from "@bufbuild/protobuf"; ⋮---- /** * Describes the file google/type/phone_number.proto. */ export const file_google_type_phone_number: GenFile = /*@__PURE__*/ ⋮---- /** * An object representing a phone number, suitable as an API wire format. * * This representation: * * - should not be used for locale-specific formatting of a phone number, such * as "+1 (650) 253-0000 ext. 123" * * - is not designed for efficient storage * - may not be suitable for dialing - specialized libraries (see references) * should be used to parse the number for that purpose * * To do something meaningful with this number, such as format it for various * use-cases, convert it to an `i18n.phonenumbers.PhoneNumber` object first. * * For instance, in Java this would be: * * com.google.type.PhoneNumber wireProto = * com.google.type.PhoneNumber.newBuilder().build(); * com.google.i18n.phonenumbers.Phonenumber.PhoneNumber phoneNumber = * PhoneNumberUtil.getInstance().parse(wireProto.getE164Number(), "ZZ"); * if (!wireProto.getExtension().isEmpty()) { * phoneNumber.setExtension(wireProto.getExtension()); * } * * Reference(s): * - https://github.com/google/libphonenumber * * @generated from message google.type.PhoneNumber */ export type PhoneNumber = Message<"google.type.PhoneNumber"> & { /** * Required. Either a regular number, or a short code. New fields may be * added to the oneof below in the future, so clients should ignore phone * numbers for which none of the fields they coded against are set. * * @generated from oneof google.type.PhoneNumber.kind */ kind: { /** * The phone number, represented as a leading plus sign ('+'), followed by a * phone number that uses a relaxed ITU E.164 format consisting of the * country calling code (1 to 3 digits) and the subscriber number, with no * additional spaces or formatting, e.g.: * - correct: "+15552220123" * - incorrect: "+1 (555) 222-01234 x123". * * The ITU E.164 format limits the latter to 12 digits, but in practice not * all countries respect that, so we relax that restriction here. * National-only numbers are not allowed. * * References: * - https://www.itu.int/rec/T-REC-E.164-201011-I * - https://en.wikipedia.org/wiki/E.164. * - https://en.wikipedia.org/wiki/List_of_country_calling_codes * * @generated from field: string e164_number = 1; */ value: string; case: "e164Number"; } | { /** * A short code. * * Reference(s): * - https://en.wikipedia.org/wiki/Short_code * * @generated from field: google.type.PhoneNumber.ShortCode short_code = 2; */ value: PhoneNumber_ShortCode; case: "shortCode"; } | { case: undefined; value?: undefined }; /** * The phone number's extension. The extension is not standardized in ITU * recommendations, except for being defined as a series of numbers with a * maximum length of 40 digits. Other than digits, some other dialing * characters such as ',' (indicating a wait) or '#' may be stored here. * * Note that no regions currently use extensions with short codes, so this * field is normally only set in conjunction with an E.164 number. It is held * separately from the E.164 number to allow for short code extensions in the * future. * * @generated from field: string extension = 3; */ extension: string; }; ⋮---- /** * Required. Either a regular number, or a short code. New fields may be * added to the oneof below in the future, so clients should ignore phone * numbers for which none of the fields they coded against are set. * * @generated from oneof google.type.PhoneNumber.kind */ ⋮---- /** * The phone number, represented as a leading plus sign ('+'), followed by a * phone number that uses a relaxed ITU E.164 format consisting of the * country calling code (1 to 3 digits) and the subscriber number, with no * additional spaces or formatting, e.g.: * - correct: "+15552220123" * - incorrect: "+1 (555) 222-01234 x123". * * The ITU E.164 format limits the latter to 12 digits, but in practice not * all countries respect that, so we relax that restriction here. * National-only numbers are not allowed. * * References: * - https://www.itu.int/rec/T-REC-E.164-201011-I * - https://en.wikipedia.org/wiki/E.164. * - https://en.wikipedia.org/wiki/List_of_country_calling_codes * * @generated from field: string e164_number = 1; */ ⋮---- /** * A short code. * * Reference(s): * - https://en.wikipedia.org/wiki/Short_code * * @generated from field: google.type.PhoneNumber.ShortCode short_code = 2; */ ⋮---- /** * The phone number's extension. The extension is not standardized in ITU * recommendations, except for being defined as a series of numbers with a * maximum length of 40 digits. Other than digits, some other dialing * characters such as ',' (indicating a wait) or '#' may be stored here. * * Note that no regions currently use extensions with short codes, so this * field is normally only set in conjunction with an E.164 number. It is held * separately from the E.164 number to allow for short code extensions in the * future. * * @generated from field: string extension = 3; */ ⋮---- /** * Describes the message google.type.PhoneNumber. * Use `create(PhoneNumberSchema)` to create a new message. */ export const PhoneNumberSchema: GenMessage = /*@__PURE__*/ ⋮---- /** * An object representing a short code, which is a phone number that is * typically much shorter than regular phone numbers and can be used to * address messages in MMS and SMS systems, as well as for abbreviated dialing * (e.g. "Text 611 to see how many minutes you have remaining on your plan."). * * Short codes are restricted to a region and are not internationally * dialable, which means the same short code can exist in different regions, * with different usage and pricing, even if those regions share the same * country calling code (e.g. US and CA). * * @generated from message google.type.PhoneNumber.ShortCode */ export type PhoneNumber_ShortCode = Message<"google.type.PhoneNumber.ShortCode"> & { /** * Required. The BCP-47 region code of the location where calls to this * short code can be made, such as "US" and "BB". * * Reference(s): * - http://www.unicode.org/reports/tr35/#unicode_region_subtag * * @generated from field: string region_code = 1; */ regionCode: string; /** * Required. The short code digits, without a leading plus ('+') or country * calling code, e.g. "611". * * @generated from field: string number = 2; */ number: string; }; ⋮---- /** * Required. The BCP-47 region code of the location where calls to this * short code can be made, such as "US" and "BB". * * Reference(s): * - http://www.unicode.org/reports/tr35/#unicode_region_subtag * * @generated from field: string region_code = 1; */ ⋮---- /** * Required. The short code digits, without a leading plus ('+') or country * calling code, e.g. "611". * * @generated from field: string number = 2; */ ⋮---- /** * Describes the message google.type.PhoneNumber.ShortCode. * Use `create(PhoneNumber_ShortCodeSchema)` to create a new message. */ export const PhoneNumber_ShortCodeSchema: GenMessage = /*@__PURE__*/ ```` ## File: src/gen/google/type/postal_address_pb.ts ````typescript // Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. ⋮---- // @generated by protoc-gen-es v2.6.3 with parameter "target=ts" // @generated from file google/type/postal_address.proto (package google.type, syntax proto3) /* eslint-disable */ ⋮---- import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; import type { Message } from "@bufbuild/protobuf"; ⋮---- /** * Describes the file google/type/postal_address.proto. */ export const file_google_type_postal_address: GenFile = /*@__PURE__*/ ⋮---- /** * Represents a postal address, e.g. for postal delivery or payments addresses. * Given a postal address, a postal service can deliver items to a premise, P.O. * Box or similar. * It is not intended to model geographical locations (roads, towns, * mountains). * * In typical usage an address would be created via user input or from importing * existing data, depending on the type of process. * * Advice on address input / editing: * - Use an i18n-ready address widget such as * https://github.com/google/libaddressinput) * - Users should not be presented with UI elements for input or editing of * fields outside countries where that field is used. * * For more guidance on how to use this schema, please see: * https://support.google.com/business/answer/6397478 * * @generated from message google.type.PostalAddress */ export type PostalAddress = Message<"google.type.PostalAddress"> & { /** * The schema revision of the `PostalAddress`. This must be set to 0, which is * the latest revision. * * All new revisions **must** be backward compatible with old revisions. * * @generated from field: int32 revision = 1; */ revision: number; /** * Required. CLDR region code of the country/region of the address. This * is never inferred and it is up to the user to ensure the value is * correct. See http://cldr.unicode.org/ and * http://www.unicode.org/cldr/charts/30/supplemental/territory_information.html * for details. Example: "CH" for Switzerland. * * @generated from field: string region_code = 2; */ regionCode: string; /** * Optional. BCP-47 language code of the contents of this address (if * known). This is often the UI language of the input form or is expected * to match one of the languages used in the address' country/region, or their * transliterated equivalents. * This can affect formatting in certain countries, but is not critical * to the correctness of the data and will never affect any validation or * other non-formatting related operations. * * If this value is not known, it should be omitted (rather than specifying a * possibly incorrect default). * * Examples: "zh-Hant", "ja", "ja-Latn", "en". * * @generated from field: string language_code = 3; */ languageCode: string; /** * Optional. Postal code of the address. Not all countries use or require * postal codes to be present, but where they are used, they may trigger * additional validation with other parts of the address (e.g. state/zip * validation in the U.S.A.). * * @generated from field: string postal_code = 4; */ postalCode: string; /** * Optional. Additional, country-specific, sorting code. This is not used * in most regions. Where it is used, the value is either a string like * "CEDEX", optionally followed by a number (e.g. "CEDEX 7"), or just a number * alone, representing the "sector code" (Jamaica), "delivery area indicator" * (Malawi) or "post office indicator" (e.g. Côte d'Ivoire). * * @generated from field: string sorting_code = 5; */ sortingCode: string; /** * Optional. Highest administrative subdivision which is used for postal * addresses of a country or region. * For example, this can be a state, a province, an oblast, or a prefecture. * Specifically, for Spain this is the province and not the autonomous * community (e.g. "Barcelona" and not "Catalonia"). * Many countries don't use an administrative area in postal addresses. E.g. * in Switzerland this should be left unpopulated. * * @generated from field: string administrative_area = 6; */ administrativeArea: string; /** * Optional. Generally refers to the city/town portion of the address. * Examples: US city, IT comune, UK post town. * In regions of the world where localities are not well defined or do not fit * into this structure well, leave locality empty and use address_lines. * * @generated from field: string locality = 7; */ locality: string; /** * Optional. Sublocality of the address. * For example, this can be neighborhoods, boroughs, districts. * * @generated from field: string sublocality = 8; */ sublocality: string; /** * Unstructured address lines describing the lower levels of an address. * * Because values in address_lines do not have type information and may * sometimes contain multiple values in a single field (e.g. * "Austin, TX"), it is important that the line order is clear. The order of * address lines should be "envelope order" for the country/region of the * address. In places where this can vary (e.g. Japan), address_language is * used to make it explicit (e.g. "ja" for large-to-small ordering and * "ja-Latn" or "en" for small-to-large). This way, the most specific line of * an address can be selected based on the language. * * The minimum permitted structural representation of an address consists * of a region_code with all remaining information placed in the * address_lines. It would be possible to format such an address very * approximately without geocoding, but no semantic reasoning could be * made about any of the address components until it was at least * partially resolved. * * Creating an address only containing a region_code and address_lines, and * then geocoding is the recommended way to handle completely unstructured * addresses (as opposed to guessing which parts of the address should be * localities or administrative areas). * * @generated from field: repeated string address_lines = 9; */ addressLines: string[]; /** * Optional. The recipient at the address. * This field may, under certain circumstances, contain multiline information. * For example, it might contain "care of" information. * * @generated from field: repeated string recipients = 10; */ recipients: string[]; /** * Optional. The name of the organization at the address. * * @generated from field: string organization = 11; */ organization: string; }; ⋮---- /** * The schema revision of the `PostalAddress`. This must be set to 0, which is * the latest revision. * * All new revisions **must** be backward compatible with old revisions. * * @generated from field: int32 revision = 1; */ ⋮---- /** * Required. CLDR region code of the country/region of the address. This * is never inferred and it is up to the user to ensure the value is * correct. See http://cldr.unicode.org/ and * http://www.unicode.org/cldr/charts/30/supplemental/territory_information.html * for details. Example: "CH" for Switzerland. * * @generated from field: string region_code = 2; */ ⋮---- /** * Optional. BCP-47 language code of the contents of this address (if * known). This is often the UI language of the input form or is expected * to match one of the languages used in the address' country/region, or their * transliterated equivalents. * This can affect formatting in certain countries, but is not critical * to the correctness of the data and will never affect any validation or * other non-formatting related operations. * * If this value is not known, it should be omitted (rather than specifying a * possibly incorrect default). * * Examples: "zh-Hant", "ja", "ja-Latn", "en". * * @generated from field: string language_code = 3; */ ⋮---- /** * Optional. Postal code of the address. Not all countries use or require * postal codes to be present, but where they are used, they may trigger * additional validation with other parts of the address (e.g. state/zip * validation in the U.S.A.). * * @generated from field: string postal_code = 4; */ ⋮---- /** * Optional. Additional, country-specific, sorting code. This is not used * in most regions. Where it is used, the value is either a string like * "CEDEX", optionally followed by a number (e.g. "CEDEX 7"), or just a number * alone, representing the "sector code" (Jamaica), "delivery area indicator" * (Malawi) or "post office indicator" (e.g. Côte d'Ivoire). * * @generated from field: string sorting_code = 5; */ ⋮---- /** * Optional. Highest administrative subdivision which is used for postal * addresses of a country or region. * For example, this can be a state, a province, an oblast, or a prefecture. * Specifically, for Spain this is the province and not the autonomous * community (e.g. "Barcelona" and not "Catalonia"). * Many countries don't use an administrative area in postal addresses. E.g. * in Switzerland this should be left unpopulated. * * @generated from field: string administrative_area = 6; */ ⋮---- /** * Optional. Generally refers to the city/town portion of the address. * Examples: US city, IT comune, UK post town. * In regions of the world where localities are not well defined or do not fit * into this structure well, leave locality empty and use address_lines. * * @generated from field: string locality = 7; */ ⋮---- /** * Optional. Sublocality of the address. * For example, this can be neighborhoods, boroughs, districts. * * @generated from field: string sublocality = 8; */ ⋮---- /** * Unstructured address lines describing the lower levels of an address. * * Because values in address_lines do not have type information and may * sometimes contain multiple values in a single field (e.g. * "Austin, TX"), it is important that the line order is clear. The order of * address lines should be "envelope order" for the country/region of the * address. In places where this can vary (e.g. Japan), address_language is * used to make it explicit (e.g. "ja" for large-to-small ordering and * "ja-Latn" or "en" for small-to-large). This way, the most specific line of * an address can be selected based on the language. * * The minimum permitted structural representation of an address consists * of a region_code with all remaining information placed in the * address_lines. It would be possible to format such an address very * approximately without geocoding, but no semantic reasoning could be * made about any of the address components until it was at least * partially resolved. * * Creating an address only containing a region_code and address_lines, and * then geocoding is the recommended way to handle completely unstructured * addresses (as opposed to guessing which parts of the address should be * localities or administrative areas). * * @generated from field: repeated string address_lines = 9; */ ⋮---- /** * Optional. The recipient at the address. * This field may, under certain circumstances, contain multiline information. * For example, it might contain "care of" information. * * @generated from field: repeated string recipients = 10; */ ⋮---- /** * Optional. The name of the organization at the address. * * @generated from field: string organization = 11; */ ⋮---- /** * Describes the message google.type.PostalAddress. * Use `create(PostalAddressSchema)` to create a new message. */ export const PostalAddressSchema: GenMessage = /*@__PURE__*/ ```` ## File: src/gen/google/type/quaternion_pb.ts ````typescript // Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. ⋮---- // @generated by protoc-gen-es v2.6.3 with parameter "target=ts" // @generated from file google/type/quaternion.proto (package google.type, syntax proto3) /* eslint-disable */ ⋮---- import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; import type { Message } from "@bufbuild/protobuf"; ⋮---- /** * Describes the file google/type/quaternion.proto. */ export const file_google_type_quaternion: GenFile = /*@__PURE__*/ ⋮---- /** * A quaternion is defined as the quotient of two directed lines in a * three-dimensional space or equivalently as the quotient of two Euclidean * vectors (https://en.wikipedia.org/wiki/Quaternion). * * Quaternions are often used in calculations involving three-dimensional * rotations (https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation), * as they provide greater mathematical robustness by avoiding the gimbal lock * problems that can be encountered when using Euler angles * (https://en.wikipedia.org/wiki/Gimbal_lock). * * Quaternions are generally represented in this form: * * w + xi + yj + zk * * where x, y, z, and w are real numbers, and i, j, and k are three imaginary * numbers. * * Our naming choice `(x, y, z, w)` comes from the desire to avoid confusion for * those interested in the geometric properties of the quaternion in the 3D * Cartesian space. Other texts often use alternative names or subscripts, such * as `(a, b, c, d)`, `(1, i, j, k)`, or `(0, 1, 2, 3)`, which are perhaps * better suited for mathematical interpretations. * * To avoid any confusion, as well as to maintain compatibility with a large * number of software libraries, the quaternions represented using the protocol * buffer below *must* follow the Hamilton convention, which defines `ij = k` * (i.e. a right-handed algebra), and therefore: * * i^2 = j^2 = k^2 = ijk = −1 * ij = −ji = k * jk = −kj = i * ki = −ik = j * * Please DO NOT use this to represent quaternions that follow the JPL * convention, or any of the other quaternion flavors out there. * * Definitions: * * - Quaternion norm (or magnitude): `sqrt(x^2 + y^2 + z^2 + w^2)`. * - Unit (or normalized) quaternion: a quaternion whose norm is 1. * - Pure quaternion: a quaternion whose scalar component (`w`) is 0. * - Rotation quaternion: a unit quaternion used to represent rotation. * - Orientation quaternion: a unit quaternion used to represent orientation. * * A quaternion can be normalized by dividing it by its norm. The resulting * quaternion maintains the same direction, but has a norm of 1, i.e. it moves * on the unit sphere. This is generally necessary for rotation and orientation * quaternions, to avoid rounding errors: * https://en.wikipedia.org/wiki/Rotation_formalisms_in_three_dimensions * * Note that `(x, y, z, w)` and `(-x, -y, -z, -w)` represent the same rotation, * but normalization would be even more useful, e.g. for comparison purposes, if * it would produce a unique representation. It is thus recommended that `w` be * kept positive, which can be achieved by changing all the signs when `w` is * negative. * * * @generated from message google.type.Quaternion */ export type Quaternion = Message<"google.type.Quaternion"> & { /** * The x component. * * @generated from field: double x = 1; */ x: number; /** * The y component. * * @generated from field: double y = 2; */ y: number; /** * The z component. * * @generated from field: double z = 3; */ z: number; /** * The scalar component. * * @generated from field: double w = 4; */ w: number; }; ⋮---- /** * The x component. * * @generated from field: double x = 1; */ ⋮---- /** * The y component. * * @generated from field: double y = 2; */ ⋮---- /** * The z component. * * @generated from field: double z = 3; */ ⋮---- /** * The scalar component. * * @generated from field: double w = 4; */ ⋮---- /** * Describes the message google.type.Quaternion. * Use `create(QuaternionSchema)` to create a new message. */ export const QuaternionSchema: GenMessage = /*@__PURE__*/ ```` ## File: src/gen/google/type/timeofday_pb.ts ````typescript // Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. ⋮---- // @generated by protoc-gen-es v2.6.3 with parameter "target=ts" // @generated from file google/type/timeofday.proto (package google.type, syntax proto3) /* eslint-disable */ ⋮---- import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; import type { Message } from "@bufbuild/protobuf"; ⋮---- /** * Describes the file google/type/timeofday.proto. */ export const file_google_type_timeofday: GenFile = /*@__PURE__*/ ⋮---- /** * Represents a time of day. The date and time zone are either not significant * or are specified elsewhere. An API may choose to allow leap seconds. Related * types are [google.type.Date][google.type.Date] and * `google.protobuf.Timestamp`. * * @generated from message google.type.TimeOfDay */ export type TimeOfDay = Message<"google.type.TimeOfDay"> & { /** * Hours of day in 24 hour format. Should be from 0 to 23. An API may choose * to allow the value "24:00:00" for scenarios like business closing time. * * @generated from field: int32 hours = 1; */ hours: number; /** * Minutes of hour of day. Must be from 0 to 59. * * @generated from field: int32 minutes = 2; */ minutes: number; /** * Seconds of minutes of the time. Must normally be from 0 to 59. An API may * allow the value 60 if it allows leap-seconds. * * @generated from field: int32 seconds = 3; */ seconds: number; /** * Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. * * @generated from field: int32 nanos = 4; */ nanos: number; }; ⋮---- /** * Hours of day in 24 hour format. Should be from 0 to 23. An API may choose * to allow the value "24:00:00" for scenarios like business closing time. * * @generated from field: int32 hours = 1; */ ⋮---- /** * Minutes of hour of day. Must be from 0 to 59. * * @generated from field: int32 minutes = 2; */ ⋮---- /** * Seconds of minutes of the time. Must normally be from 0 to 59. An API may * allow the value 60 if it allows leap-seconds. * * @generated from field: int32 seconds = 3; */ ⋮---- /** * Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. * * @generated from field: int32 nanos = 4; */ ⋮---- /** * Describes the message google.type.TimeOfDay. * Use `create(TimeOfDaySchema)` to create a new message. */ export const TimeOfDaySchema: GenMessage = /*@__PURE__*/ ```` ## File: src/index.ts ````typescript ```` ## File: .gitignore ```` node_modules dist /api .DS_Store .idea ```` ## File: .npmignore ```` # Source files are included via "files" field in package.json # This file provides additional exclusions for security and cleanliness # Development files .eslintrc.json tsconfig.json buf.gen.yaml # Scripts and examples (already in separate packages) scripts/ examples/ # CI/CD and development .github/ .npmrc # OS files .DS_Store Thumbs.db # Editor files .vscode/ .idea/ *.swp *.swo # Logs *.log npm-debug.log* # Temporary files *.tmp *.temp ```` ## File: .npmrc ```` engine-strict=true package-lock=true fund=false audit=false //registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN} ```` ## File: buf.gen.yaml ````yaml version: v2 inputs: - directory: . - module: buf.build/googleapis/googleapis - module: buf.build/protocolbuffers/wellknowntypes managed: enabled: true plugins: - remote: buf.build/bufbuild/es:v2.6.3 out: src/gen opt: - target=ts ```` ## File: buf.lock ```` # Generated by buf. DO NOT EDIT. version: v2 deps: - name: buf.build/googleapis/googleapis commit: 72c8614f3bd0466ea67931ef2c43d608 digest: b5:13efeea24e633fd45327390bdee941207a8727e96cf01affb84c1e4100fd8f48a42bbd508df11930cd2884629bafad685df1ac3111bc78cdaefcd38c9371c6b1 ```` ## File: buf.yaml ````yaml version: v2 modules: - path: . deps: - buf.build/googleapis/googleapis ```` ## File: eslint.config.js ````javascript ```` ## File: LICENSE ```` MIT License Copyright (c) 2025 Symbiotic Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ```` ## File: package.json ````json { "name": "@symbioticfi/relay-client-ts", "version": "0.2.0", "description": "TypeScript client for Symbiotic Relay", "keywords": [ "symbiotic", "relay", "typescript", "client", "blockchain", "grpc" ], "homepage": "https://github.com/symbioticfi/relay-client-ts#readme", "bugs": { "url": "https://github.com/symbioticfi/relay-client-ts/issues" }, "author": "Symbiotic Team", "type": "module", "main": "dist/index.js", "module": "dist/index.js", "types": "dist/index.d.ts", "files": [ "dist", "src" ], "scripts": { "update:proto": "bash ./scripts/update-proto.sh", "generate": "buf generate", "build": "tsc -p tsconfig.json", "lint": "eslint . --ext .ts", "prepublishOnly": "npm run build" }, "dependencies": { "@bufbuild/protobuf": "^2.0.0" }, "devDependencies": { "@eslint/js": "^9.33.0", "@types/node": "^20.12.0", "@typescript-eslint/eslint-plugin": "^8.40.0", "@typescript-eslint/parser": "^8.40.0", "eslint": "^9.0.0", "typescript": "^5.5.0" }, "publishConfig": { "access": "public" }, "repository": { "type": "git", "url": "git+https://github.com/symbioticfi/relay-client-ts.git" }, "license": "MIT", "engines": { "node": ">=20" } } ```` ## File: README.md ````markdown # Relay Client (TypeScript) TypeScript client for the Symbiotic Relay built with Connect RPC and @bufbuild/protobuf. ## Usage Create a transport with @connectrpc/connect-node and instantiate the SymbioticAPIService client with that transport. See [examples/](./examples/) directory for comprehensive usage examples including: - Basic client setup and connection - Message signing and aggregation - Streaming operations - Error handling patterns To get started with the examples: ```bash cd examples/ npm install npm run basic-usage ``` ## Development Run scripts/update-proto.sh to fetch upstream proto and regenerate; run npm run build to compile to dist. ```` ## File: tsconfig.json ````json { "compilerOptions": { "target": "ES2020", "module": "ES2020", "moduleResolution": "bundler", "declaration": true, "outDir": "dist", "rootDir": "src", "strict": true, "resolveJsonModule": true, "skipLibCheck": true }, "include": [ "src/**/*.ts" ], "exclude": [ "node_modules", "dist" ] } ```` --- ## Relay Rust Client This file is a merged representation of the entire codebase, combined into a single document by Repomix. The content has been processed where content has been compressed (code blocks are separated by ⋮---- delimiter). # File Summary ## Purpose This file contains a packed representation of the entire repository's contents. It is designed to be easily consumable by AI systems for analysis, code review, or other automated processes. ## File Format The content is organized as follows: 1. This summary section 2. Repository information 3. Directory structure 4. Repository files (if enabled) 5. Multiple file entries, each consisting of: a. A header with the file path (## File: path/to/file) b. The full contents of the file in a code block ## Usage Guidelines - This file should be treated as read-only. Any changes should be made to the original repository files, not this packed version. - When processing this file, use the file path to distinguish between different files in the repository. - Be aware that this file may contain sensitive information. Handle it with the same level of security as you would the original repository. ## Notes - Some files may have been excluded based on .gitignore rules and Repomix's configuration - Binary files are not included in this packed representation. Please refer to the Repository Structure section for a complete list of file paths, including binary files - Files matching patterns in .gitignore are excluded - Files matching default ignore patterns are excluded - Content has been compressed - code blocks are separated by ⋮---- delimiter - Files are sorted by Git change count (files with more changes are at the bottom) # Directory Structure ``` .github/ workflows/ generate.yml release.yml examples/ basic_usage.rs Cargo.toml README.md scripts/ update-proto.sh src/ generated/ api.proto.v1.rs api.proto.v1.serde.rs api.proto.v1.tonic.rs mod.rs lib.rs .gitignore buf.gen.yaml buf.lock buf.yaml Cargo.toml LICENSE README.md ``` # Files ## File: .github/workflows/generate.yml ````yaml name: Generate Rust Client on: schedule: - cron: "0 4 * * *" # daily at 04:00 UTC workflow_dispatch: {} jobs: generate: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Install buf uses: bufbuild/buf-setup-action@v1 - name: Generate run: | chmod +x ./scripts/update-proto.sh ./scripts/update-proto.sh - name: Setup Rust uses: dtolnay/rust-toolchain@stable - name: Build run: cargo build --release - name: Check for changes id: verify-changed-files run: | if [ -n "$(git status --porcelain)" ]; then echo "changed=true" >> $GITHUB_OUTPUT echo "Files have changed:" git status --porcelain else echo "changed=false" >> $GITHUB_OUTPUT echo "No changes detected" fi - name: Commit changes if: steps.verify-changed-files.outputs.changed == 'true' uses: stefanzweifel/git-auto-commit-action@v5 with: commit_message: "chore: update client from upstream proto" ```` ## File: .github/workflows/release.yml ````yaml name: Release on: # Trigger for stable releases push: tags: - 'v*.*.*' # Manual trigger for stable releases workflow_dispatch: inputs: version: description: 'Version (e.g., 1.2.3)' required: true type: string jobs: release: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 - name: Setup Rust uses: dtolnay/rust-toolchain@stable with: toolchain: stable - name: Setup Rust cache uses: Swatinem/rust-cache@v2 with: cache-on-failure: true - name: Build project run: cargo build --release - name: Determine version id: version_info run: | if [[ "${{ github.event_name }}" == "push" && "${{ github.ref }}" == refs/tags/* ]]; then # Extract version from tag (remove 'v' prefix) VERSION="${GITHUB_REF#refs/tags/v}" echo "version=$VERSION" >> $GITHUB_OUTPUT echo "Release version from tag: $VERSION" elif [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then VERSION="${{ github.event.inputs.version }}" echo "version=$VERSION" >> $GITHUB_OUTPUT echo "Release version from manual input: $VERSION" else echo "Error: Unknown trigger event" exit 1 fi - name: Update Cargo.toml version run: | VERSION="${{ steps.version_info.outputs.version }}" # Update Cargo.toml sed -i "s/^version = \".*\"/version = \"$VERSION\"/" Cargo.toml echo "Updated Cargo.toml to version: $VERSION" - name: Verify package can be built run: | cargo check cargo publish --dry-run --allow-dirty - name: Publish to crates.io run: | cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }} --allow-dirty env: CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} ```` ## File: examples/basic_usage.rs ````rust //! Basic usage example for the Symbiotic Relay Rust client. //! ⋮---- //! //! This example demonstrates how to: ⋮---- //! This example demonstrates how to: //! 1. Connect to a Symbiotic Relay server ⋮---- //! 1. Connect to a Symbiotic Relay server //! 2. Get the current epoch and last committed epochs ⋮---- //! 2. Get the current epoch and last committed epochs //! 3. Get validator set information ⋮---- //! 3. Get validator set information //! 4. Sign a message ⋮---- //! 4. Sign a message //! 5. Retrieve aggregation proofs by request ID ⋮---- //! 5. Retrieve aggregation proofs by request ID //! 6. Get individual signatures by request ID ⋮---- //! 6. Get individual signatures by request ID //! 7. Get aggregation proofs by epoch ⋮---- //! 7. Get aggregation proofs by epoch //! 8. Get signatures by epoch ⋮---- //! 8. Get signatures by epoch //! 9. Get validator by key ⋮---- //! 9. Get validator by key //! 10. Get local validator information ⋮---- //! 10. Get local validator information //! 11. Get signature request IDs by epoch ⋮---- //! 11. Get signature request IDs by epoch //! 12. Get signature requests by epoch ⋮---- //! 12. Get signature requests by epoch //! 13. Stream signatures in real-time ⋮---- //! 13. Stream signatures in real-time //! 14. Stream aggregation proofs in real-time ⋮---- //! 14. Stream aggregation proofs in real-time //! 15. Stream validator set changes in real-time ⋮---- //! 15. Stream validator set changes in real-time use std::env; ⋮---- use tokio_stream::StreamExt; use tonic::transport::Channel; ⋮---- /// Simple wrapper around the generated gRPC client. pub struct RelayClient { ⋮---- pub struct RelayClient { ⋮---- impl RelayClient { /// Create a new client connected to the specified server URL. pub async fn new(server_url: &str) -> Result> { ⋮---- pub async fn new(server_url: &str) -> Result> { let endpoint = tonic::transport::Endpoint::from_shared(server_url.to_string())?; let channel = endpoint.connect().await?; ⋮---- println!("Connected to Symbiotic Relay at {}", server_url); ⋮---- Ok(Self { client }) ⋮---- /// Get the current epoch information. pub async fn get_current_epoch( ⋮---- pub async fn get_current_epoch( ⋮---- self.client.get_current_epoch(request).await ⋮---- /// Get the last all committed epochs for all chains. pub async fn get_last_all_committed( ⋮---- pub async fn get_last_all_committed( ⋮---- self.client.get_last_all_committed(request).await ⋮---- /// Sign a message using the specified key tag. pub async fn sign_message( ⋮---- pub async fn sign_message( ⋮---- message: message.into(), ⋮---- self.client.sign_message(request).await ⋮---- /// Get aggregation proof for a specific request. pub async fn get_aggregation_proof( ⋮---- pub async fn get_aggregation_proof( ⋮---- self.client.get_aggregation_proof(request).await ⋮---- /// Get individual signatures for a request. pub async fn get_signatures( ⋮---- pub async fn get_signatures( ⋮---- self.client.get_signatures(request).await ⋮---- /// Get validator set information. pub async fn get_validator_set( ⋮---- pub async fn get_validator_set( ⋮---- self.client.get_validator_set(request).await ⋮---- /// Get aggregation proofs by epoch. pub async fn get_aggregation_proofs_by_epoch( ⋮---- pub async fn get_aggregation_proofs_by_epoch( ⋮---- self.client.get_aggregation_proofs_by_epoch(request).await ⋮---- /// Get signatures by epoch. pub async fn get_signatures_by_epoch( ⋮---- pub async fn get_signatures_by_epoch( ⋮---- self.client.get_signatures_by_epoch(request).await ⋮---- /// Get all signature request IDs by epoch. pub async fn get_signature_request_ids_by_epoch( ⋮---- pub async fn get_signature_request_ids_by_epoch( ⋮---- .get_signature_request_i_ds_by_epoch(request) ⋮---- /// Get all signature requests by epoch. pub async fn get_signature_requests_by_epoch( ⋮---- pub async fn get_signature_requests_by_epoch( ⋮---- self.client.get_signature_requests_by_epoch(request).await ⋮---- /// Get validator by key. pub async fn get_validator_by_key( ⋮---- pub async fn get_validator_by_key( ⋮---- on_chain_key: on_chain_key.into(), ⋮---- self.client.get_validator_by_key(request).await ⋮---- /// Get local validator information. pub async fn get_local_validator( ⋮---- pub async fn get_local_validator( ⋮---- self.client.get_local_validator(request).await ⋮---- /// Listen to signatures stream in real-time. pub async fn listen_signatures( ⋮---- pub async fn listen_signatures( ⋮---- let response = self.client.listen_signatures(request).await?; Ok(response.into_inner()) ⋮---- /// Listen to aggregation proofs stream in real-time. pub async fn listen_proofs( ⋮---- pub async fn listen_proofs( ⋮---- let response = self.client.listen_proofs(request).await?; ⋮---- /// Listen to validator set changes stream in real-time. pub async fn listen_validator_set( ⋮---- pub async fn listen_validator_set( ⋮---- let response = self.client.listen_validator_set(request).await?; ⋮---- /// Main example function demonstrating client usage. #[tokio::main] async fn main() -> Result<(), Box> { // Initialize client let server_url = env::var("RELAY_SERVER_URL").unwrap_or_else(|_| "localhost:8080".to_string()); ⋮---- // Example 1: Get current epoch println!("=== Getting Current Epoch ==="); let epoch_response = client.get_current_epoch().await?; let epoch_data = epoch_response.into_inner(); println!("Current epoch: {}", epoch_data.epoch); ⋮---- println!("Start time: {:?}", start_time); ⋮---- // Example 2: Get suggested epoch println!("\n=== Calculate Last Committed Epoch ==="); ⋮---- let epoch_infos_response = client.get_last_all_committed().await?; let epoch_infos_data = epoch_infos_response.into_inner(); ⋮---- for (_, info) in epoch_infos_data.epoch_infos.iter() { ⋮---- println!("Last committed epoch: {}", suggested_epoch); ⋮---- // Example 3: Get validator set println!("\n=== Getting Validator Set ==="); let validator_set = client.get_validator_set(None).await?; let validator_set_data = validator_set.into_inner(); ⋮---- println!("Validator set version: {}", vs.version); println!("Epoch: {}", vs.epoch); println!("Status: {:?}", vs.status()); println!("Number of validators: {}", vs.validators.len()); println!("Quorum threshold: {}", vs.quorum_threshold); ⋮---- // Display some validator details ⋮---- if let Some(first_validator) = vs.validators.first() { println!("First validator operator: {}", first_validator.operator); println!( ⋮---- println!("First validator is active: {}", first_validator.is_active); println!("First validator keys count: {}", first_validator.keys.len()); ⋮---- // Example 4: Sign a message println!("\n=== Signing a Message ==="); let message_to_sign = "Hello, Symbiotic!".as_bytes().to_vec(); ⋮---- let sign_response = client.sign_message(key_tag, message_to_sign, None).await?; let sign_data = sign_response.into_inner(); println!("Request ID: {}", sign_data.request_id); println!("Epoch: {}", sign_data.epoch); ⋮---- // Example 5: Get aggregation proof (this might fail if signing is not complete) println!("\n=== Getting Aggregation Proof ==="); ⋮---- .get_aggregation_proof(sign_data.request_id.clone()) ⋮---- let proof_data = proof_response.into_inner(); ⋮---- println!("Request ID: {}", proof.request_id); println!("Proof length: {} bytes", proof.proof.len()); println!("Message hash length: {} bytes", proof.message_hash.len()); ⋮---- println!("Could not get aggregation proof yet: {}", e.message()); ⋮---- // Example 6: Get individual signatures println!("\n=== Getting Individual Signatures ==="); match client.get_signatures(sign_data.request_id.clone()).await { ⋮---- let signatures_data = signatures_response.into_inner(); println!("Number of signatures: {}", signatures_data.signatures.len()); ⋮---- for (index, signature) in signatures_data.signatures.iter().enumerate() { println!("Signature {}:", index + 1); println!(" - Request ID: {}", signature.request_id); println!(" - Signature length: {} bytes", signature.signature.len()); ⋮---- println!("Could not get signatures yet: {}", e.message()); ⋮---- // Example 7: Get aggregation proofs by epoch println!("\n=== Getting Aggregation Proofs by Epoch ==="); ⋮---- match client.get_aggregation_proofs_by_epoch(current_epoch).await { ⋮---- let proofs_data = proofs_response.into_inner(); ⋮---- for (index, proof) in proofs_data.aggregation_proofs.iter().take(3).enumerate() { println!("Proof {}:", index + 1); println!(" - Request ID: {}", proof.request_id); println!(" - Proof length: {} bytes", proof.proof.len()); println!(" - Message hash length: {} bytes", proof.message_hash.len()); ⋮---- println!("Could not get aggregation proofs: {}", e.message()); ⋮---- // Example 8: Get signatures by epoch println!("\n=== Getting Signatures by Epoch ==="); match client.get_signatures_by_epoch(current_epoch).await { ⋮---- println!("Could not get signatures by epoch: {}", e.message()); ⋮---- // Example 9: Get validator by key println!("\n=== Getting Validator by Key ==="); ⋮---- if let Some(first_key) = first_validator.keys.first() { ⋮---- .get_validator_by_key(None, first_key.tag, first_key.payload.to_vec()) ⋮---- let validator = validator_response.into_inner().validator; ⋮---- println!("Found validator operator: {}", val.operator); println!("Voting power: {}", val.voting_power); println!("Is active: {}", val.is_active); ⋮---- println!("Could not get validator by key: {}", e.message()); ⋮---- // Example 10: Get local validator println!("\n=== Getting Local Validator ==="); match client.get_local_validator(None).await { ⋮---- let local_validator = local_validator_response.into_inner().validator; ⋮---- println!("Local validator operator: {}", val.operator); ⋮---- println!("Number of keys: {}", val.keys.len()); ⋮---- println!("Could not get local validator: {}", e.message()); ⋮---- // Example 11: Get signature request IDs by epoch println!("\n=== Getting Signature Request IDs by Epoch ==="); ⋮---- .get_signature_request_ids_by_epoch(current_epoch) ⋮---- let ids_data = ids_response.into_inner(); ⋮---- for (index, request_id) in ids_data.request_ids.iter().take(5).enumerate() { println!(" {}: {}", index + 1, request_id); ⋮---- println!("Could not get signature request IDs: {}", e.message()); ⋮---- // Example 12: Get signature requests by epoch println!("\n=== Getting Signature Requests by Epoch ==="); match client.get_signature_requests_by_epoch(current_epoch).await { ⋮---- let requests_data = requests_response.into_inner(); ⋮---- for (index, request) in requests_data.signature_requests.iter().take(3).enumerate() { println!("Signature Request {}:", index + 1); println!(" - Request ID: {}", request.request_id); println!(" - Key tag: {}", request.key_tag); println!(" - Message length: {} bytes", request.message.len()); println!(" - Required epoch: {}", request.required_epoch); ⋮---- println!("Could not get signature requests: {}", e.message()); ⋮---- // Example 13: Listen to signatures stream println!("\n=== Listening to Signatures Stream ==="); println!("Starting signature stream (will show first 3 signatures)..."); match client.listen_signatures(Some(current_epoch)).await { ⋮---- while let Some(signature_response) = stream.next().await { ⋮---- println!("Received signature:"); println!(" - Request ID: {}", sig_data.request_id); println!(" - Epoch: {}", sig_data.epoch); ⋮---- println!(" - Signature request ID: {}", signature.request_id); ⋮---- println!("Stream error: {}", e.message()); ⋮---- println!("Could not start signatures stream: {}", e.message()); ⋮---- // Example 14: Listen to proofs stream println!("\n=== Listening to Proofs Stream ==="); println!("Starting proofs stream (will show first 3 proofs)..."); match client.listen_proofs(Some(current_epoch)).await { ⋮---- while let Some(proof_response) = stream.next().await { ⋮---- println!("Received proof:"); println!(" - Request ID: {}", proof_data.request_id); println!(" - Epoch: {}", proof_data.epoch); ⋮---- println!(" - Proof request ID: {}", proof.request_id); ⋮---- println!("Could not start proofs stream: {}", e.message()); ⋮---- // Example 15: Listen to validator set changes stream println!("\n=== Listening to Validator Set Changes Stream ==="); println!("Starting validator set stream (will show first 2 updates)..."); match client.listen_validator_set(Some(current_epoch)).await { ⋮---- while let Some(validator_set_response) = stream.next().await { ⋮---- println!("Received validator set update:"); println!(" - Epoch: {}", vs.epoch); println!(" - Number of validators: {}", vs.validators.len()); println!(" - Status: {:?}", vs.status()); ⋮---- println!("Could not start validator set stream: {}", e.message()); ⋮---- println!("\nExample completed"); Ok(()) ```` ## File: examples/Cargo.toml ````toml [package] name = "symbiotic-relay-client-examples" version = "0.1.0" edition = "2024" publish = false [[bin]] name = "basic_usage" path = "basic_usage.rs" [dependencies] symbiotic-relay-client = { path = "..", package = "symbiotic-relay-client" } tokio = { version = "1", features = ["macros", "rt-multi-thread"] } tokio-stream = "0.1" tonic = { version = "0.12", features = ["transport"] } ```` ## File: examples/README.md ````markdown # Symbiotic Relay Client Examples This directory contains examples demonstrating how to use the `symbiotic-relay-client` library to interact with Symbiotic Relay servers. ## Basic Usage Example The `basic_usage.rs` example shows how to: 1. Connect to a Symbiotic Relay server 2. Get current epoch information 3. Sign messages 4. Retrieve aggregation proofs and signatures 5. Get validator set information 6. Use streaming responses for real-time updates ## Running the Example ```bash cd examples cargo run --bin basic_usage ``` By default, the example will try to connect to `localhost:8080`. You can specify a different server URL by setting the `RELAY_SERVER_URL` environment variable: ```bash RELAY_SERVER_URL=my-relay-server:8080 cargo run --bin basic_usage ``` NOTE: for the signature/proof generation to work you need to run the script for all active relay servers to get the majority consensus to generate proof. ## Creating a Client To use the relay client in your own project: 1. Add the dependency to your `Cargo.toml`: ```toml [dependencies] relay-client-rs = { path = "../path/to/relay-client-rs" } tonic = "0.12" tokio = { version = "1", features = ["macros", "rt-multi-thread"] } ``` 2. Create a client in your code: ```rust use relay_client::gen::api::proto::v1::symbiotic_api_service_client::SymbioticApiServiceClient; use tonic::transport::Endpoint; #[tokio::main] async fn main() -> Result<(), Box> { // Create transport channel let endpoint = Endpoint::from_shared("localhost:8080")?; let channel = endpoint.connect().await?; // Create the gRPC client let mut client = SymbioticApiServiceClient::new(channel); // Use the client for API calls let response = client.get_current_epoch( tonic::Request::new(relay_client::GetCurrentEpochRequest {}) ).await?; println!("Current epoch: {}", response.into_inner().epoch); Ok(()) } ``` ## Configuration Options You can configure the transport connection with various options: ```rust use tonic::transport::Endpoint; use std::time::Duration; let endpoint = Endpoint::from_shared("localhost:8080")? .timeout(Duration::from_secs(30)) .connect_timeout(Duration::from_secs(10)) .tcp_keepalive(Some(Duration::from_secs(60))); let channel = endpoint.connect().await?; ``` For more advanced configuration options, see the [tonic documentation](https://docs.rs/tonic/). ```` ## File: scripts/update-proto.sh ````bash #!/usr/bin/env bash set -euo pipefail ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")"/.. && pwd)" PROTO_DIR="$ROOT_DIR/api/proto/v1" rm -rf "$ROOT_DIR/api" "$ROOT_DIR/src/generated" mkdir -p "$PROTO_DIR" curl -sfL https://raw.githubusercontent.com/symbioticfi/relay/dev/api/proto/v1/api.proto -o "$PROTO_DIR/api.proto" cd "$ROOT_DIR" buf format -w buf lint buf generate # Ensure mod.rs exists for stable imports if plugins didn't create it if [ ! -f src/generated/mod.rs ]; then mkdir -p src/generated cat > src/generated/mod.rs << 'EOF' //! Generated gRPC client code from protocol buffer definitions. //! //! This module contains the auto-generated Rust code from the protocol buffer //! definitions for the Symbiotic Relay API. pub mod api { pub mod proto { pub mod v1 { // Include the generated prost types and client code include!("api.proto.v1.rs"); } } } EOF fi ```` ## File: src/generated/api.proto.v1.rs ````rust // @generated // This file is @generated by prost-build. /// Request message for signing a message #[allow(clippy::derive_partial_eq_without_eq)] ⋮---- pub struct SignMessageRequest { /// Key tag identifier (0-127) #[prost(uint32, tag="1")] ⋮---- /// Message to be signed #[prost(bytes="bytes", tag="2")] ⋮---- /// Required epoch (optional, if not provided latest committed epoch will be used) #[prost(uint64, optional, tag="3")] ⋮---- fn full_name() -> ::prost::alloc::string::String { "api.proto.v1.SignMessageRequest".into() }fn type_url() -> ::prost::alloc::string::String { "/api.proto.v1.SignMessageRequest".into() }} /// Response message for sign message request #[allow(clippy::derive_partial_eq_without_eq)] ⋮---- pub struct SignMessageResponse { /// Hash of the signature request #[prost(string, tag="1")] ⋮---- /// Epoch number #[prost(uint64, tag="2")] ⋮---- fn full_name() -> ::prost::alloc::string::String { "api.proto.v1.SignMessageResponse".into() }fn type_url() -> ::prost::alloc::string::String { "/api.proto.v1.SignMessageResponse".into() }} /// Request message for listening to signatures stream #[allow(clippy::derive_partial_eq_without_eq)] ⋮---- pub struct ListenSignaturesRequest { /// Optional: start epoch. If provided, stream will first send all historical signatures starting from this epoch, then continue with real-time updates /// If not provided, only signatures generated after stream creation will be sent ⋮---- /// If not provided, only signatures generated after stream creation will be sent #[prost(uint64, optional, tag="1")] ⋮---- fn full_name() -> ::prost::alloc::string::String { "api.proto.v1.ListenSignaturesRequest".into() }fn type_url() -> ::prost::alloc::string::String { "/api.proto.v1.ListenSignaturesRequest".into() }} /// Response message for signatures stream #[allow(clippy::derive_partial_eq_without_eq)] ⋮---- pub struct ListenSignaturesResponse { /// Id of the signature request #[prost(string, tag="1")] ⋮---- /// Signature data #[prost(message, optional, tag="3")] ⋮---- fn full_name() -> ::prost::alloc::string::String { "api.proto.v1.ListenSignaturesResponse".into() }fn type_url() -> ::prost::alloc::string::String { "/api.proto.v1.ListenSignaturesResponse".into() }} /// Request message for listening to aggregation proofs stream #[allow(clippy::derive_partial_eq_without_eq)] ⋮---- pub struct ListenProofsRequest { /// Optional: start epoch. If provided, stream will first send all historical proofs starting from this epoch, then continue with real-time updates /// If not provided, only proofs generated after stream creation will be sent ⋮---- /// If not provided, only proofs generated after stream creation will be sent #[prost(uint64, optional, tag="1")] ⋮---- fn full_name() -> ::prost::alloc::string::String { "api.proto.v1.ListenProofsRequest".into() }fn type_url() -> ::prost::alloc::string::String { "/api.proto.v1.ListenProofsRequest".into() }} /// Response message for aggregation proofs stream #[allow(clippy::derive_partial_eq_without_eq)] ⋮---- pub struct ListenProofsResponse { /// Id of the request #[prost(string, tag="1")] ⋮---- /// Final aggregation proof #[prost(message, optional, tag="3")] ⋮---- fn full_name() -> ::prost::alloc::string::String { "api.proto.v1.ListenProofsResponse".into() }fn type_url() -> ::prost::alloc::string::String { "/api.proto.v1.ListenProofsResponse".into() }} /// Request message for listening to validator set changes stream #[allow(clippy::derive_partial_eq_without_eq)] ⋮---- pub struct ListenValidatorSetRequest { /// Optional: start epoch. If provided, stream will first send all historical validator sets starting from this epoch, then continue with real-time updates /// If not provided, only validator sets generated after stream creation will be sent ⋮---- /// If not provided, only validator sets generated after stream creation will be sent #[prost(uint64, optional, tag="1")] ⋮---- fn full_name() -> ::prost::alloc::string::String { "api.proto.v1.ListenValidatorSetRequest".into() }fn type_url() -> ::prost::alloc::string::String { "/api.proto.v1.ListenValidatorSetRequest".into() }} /// Response message for validator set changes stream #[allow(clippy::derive_partial_eq_without_eq)] ⋮---- pub struct ListenValidatorSetResponse { /// The validator set #[prost(message, optional, tag="1")] ⋮---- fn full_name() -> ::prost::alloc::string::String { "api.proto.v1.ListenValidatorSetResponse".into() }fn type_url() -> ::prost::alloc::string::String { "/api.proto.v1.ListenValidatorSetResponse".into() }} /// Request message for getting aggregation proof #[allow(clippy::derive_partial_eq_without_eq)] ⋮---- pub struct GetAggregationProofRequest { ⋮---- fn full_name() -> ::prost::alloc::string::String { "api.proto.v1.GetAggregationProofRequest".into() }fn type_url() -> ::prost::alloc::string::String { "/api.proto.v1.GetAggregationProofRequest".into() }} ⋮---- pub struct GetAggregationProofsByEpochRequest { /// Epoch number #[prost(uint64, tag="1")] ⋮---- fn full_name() -> ::prost::alloc::string::String { "api.proto.v1.GetAggregationProofsByEpochRequest".into() }fn type_url() -> ::prost::alloc::string::String { "/api.proto.v1.GetAggregationProofsByEpochRequest".into() }} /// Request message for getting current epoch #[allow(clippy::derive_partial_eq_without_eq)] ⋮---- pub struct GetCurrentEpochRequest { ⋮---- fn full_name() -> ::prost::alloc::string::String { "api.proto.v1.GetCurrentEpochRequest".into() }fn type_url() -> ::prost::alloc::string::String { "/api.proto.v1.GetCurrentEpochRequest".into() }} /// Request message for getting signatures #[allow(clippy::derive_partial_eq_without_eq)] ⋮---- pub struct GetSignaturesRequest { ⋮---- fn full_name() -> ::prost::alloc::string::String { "api.proto.v1.GetSignaturesRequest".into() }fn type_url() -> ::prost::alloc::string::String { "/api.proto.v1.GetSignaturesRequest".into() }} /// Request message for getting signatures by epoch #[allow(clippy::derive_partial_eq_without_eq)] ⋮---- pub struct GetSignaturesByEpochRequest { ⋮---- fn full_name() -> ::prost::alloc::string::String { "api.proto.v1.GetSignaturesByEpochRequest".into() }fn type_url() -> ::prost::alloc::string::String { "/api.proto.v1.GetSignaturesByEpochRequest".into() }} /// Response message for getting signatures #[allow(clippy::derive_partial_eq_without_eq)] ⋮---- pub struct GetSignaturesResponse { /// List of signatures #[prost(message, repeated, tag="1")] ⋮---- fn full_name() -> ::prost::alloc::string::String { "api.proto.v1.GetSignaturesResponse".into() }fn type_url() -> ::prost::alloc::string::String { "/api.proto.v1.GetSignaturesResponse".into() }} /// Response message for getting signatures by epoch #[allow(clippy::derive_partial_eq_without_eq)] ⋮---- pub struct GetSignaturesByEpochResponse { ⋮---- fn full_name() -> ::prost::alloc::string::String { "api.proto.v1.GetSignaturesByEpochResponse".into() }fn type_url() -> ::prost::alloc::string::String { "/api.proto.v1.GetSignaturesByEpochResponse".into() }} /// Request message for getting all signature request IDs by epoch #[allow(clippy::derive_partial_eq_without_eq)] ⋮---- pub struct GetSignatureRequestIDsByEpochRequest { ⋮---- fn full_name() -> ::prost::alloc::string::String { "api.proto.v1.GetSignatureRequestIDsByEpochRequest".into() }fn type_url() -> ::prost::alloc::string::String { "/api.proto.v1.GetSignatureRequestIDsByEpochRequest".into() }} /// Response message for getting all signature request IDs by epoch #[allow(clippy::derive_partial_eq_without_eq)] ⋮---- pub struct GetSignatureRequestIDsByEpochResponse { /// List of all signature request IDs for the epoch #[prost(string, repeated, tag="1")] ⋮---- fn full_name() -> ::prost::alloc::string::String { "api.proto.v1.GetSignatureRequestIDsByEpochResponse".into() }fn type_url() -> ::prost::alloc::string::String { "/api.proto.v1.GetSignatureRequestIDsByEpochResponse".into() }} /// Request message for getting all signature requests by epoch #[allow(clippy::derive_partial_eq_without_eq)] ⋮---- pub struct GetSignatureRequestsByEpochRequest { ⋮---- fn full_name() -> ::prost::alloc::string::String { "api.proto.v1.GetSignatureRequestsByEpochRequest".into() }fn type_url() -> ::prost::alloc::string::String { "/api.proto.v1.GetSignatureRequestsByEpochRequest".into() }} /// Response message for getting all signature requests by epoch #[allow(clippy::derive_partial_eq_without_eq)] ⋮---- pub struct GetSignatureRequestsByEpochResponse { /// List of all signature requests for the epoch #[prost(message, repeated, tag="1")] ⋮---- fn full_name() -> ::prost::alloc::string::String { "api.proto.v1.GetSignatureRequestsByEpochResponse".into() }fn type_url() -> ::prost::alloc::string::String { "/api.proto.v1.GetSignatureRequestsByEpochResponse".into() }} /// Request message for getting signature request #[allow(clippy::derive_partial_eq_without_eq)] ⋮---- pub struct GetSignatureRequestRequest { ⋮---- fn full_name() -> ::prost::alloc::string::String { "api.proto.v1.GetSignatureRequestRequest".into() }fn type_url() -> ::prost::alloc::string::String { "/api.proto.v1.GetSignatureRequestRequest".into() }} /// Request message for getting aggregation status #[allow(clippy::derive_partial_eq_without_eq)] ⋮---- pub struct GetAggregationStatusRequest { ⋮---- fn full_name() -> ::prost::alloc::string::String { "api.proto.v1.GetAggregationStatusRequest".into() }fn type_url() -> ::prost::alloc::string::String { "/api.proto.v1.GetAggregationStatusRequest".into() }} /// Request message for getting validator set #[allow(clippy::derive_partial_eq_without_eq)] ⋮---- pub struct GetValidatorSetRequest { /// Epoch number (optional, if not provided current epoch will be used) #[prost(uint64, optional, tag="1")] ⋮---- fn full_name() -> ::prost::alloc::string::String { "api.proto.v1.GetValidatorSetRequest".into() }fn type_url() -> ::prost::alloc::string::String { "/api.proto.v1.GetValidatorSetRequest".into() }} /// Request message for getting validator by address #[allow(clippy::derive_partial_eq_without_eq)] ⋮---- pub struct GetValidatorByAddressRequest { ⋮---- /// Validator address (required) #[prost(string, tag="2")] ⋮---- fn full_name() -> ::prost::alloc::string::String { "api.proto.v1.GetValidatorByAddressRequest".into() }fn type_url() -> ::prost::alloc::string::String { "/api.proto.v1.GetValidatorByAddressRequest".into() }} /// Request message for getting validator by key #[allow(clippy::derive_partial_eq_without_eq)] ⋮---- pub struct GetValidatorByKeyRequest { ⋮---- /// Validator key tag (required) #[prost(uint32, tag="2")] ⋮---- /// Validator on chain (public) key (required) #[prost(bytes="bytes", tag="3")] ⋮---- fn full_name() -> ::prost::alloc::string::String { "api.proto.v1.GetValidatorByKeyRequest".into() }fn type_url() -> ::prost::alloc::string::String { "/api.proto.v1.GetValidatorByKeyRequest".into() }} /// Request message for getting local validator #[allow(clippy::derive_partial_eq_without_eq)] ⋮---- pub struct GetLocalValidatorRequest { ⋮---- fn full_name() -> ::prost::alloc::string::String { "api.proto.v1.GetLocalValidatorRequest".into() }fn type_url() -> ::prost::alloc::string::String { "/api.proto.v1.GetLocalValidatorRequest".into() }} /// Request message for getting validator set header #[allow(clippy::derive_partial_eq_without_eq)] ⋮---- pub struct GetValidatorSetHeaderRequest { ⋮---- fn full_name() -> ::prost::alloc::string::String { "api.proto.v1.GetValidatorSetHeaderRequest".into() }fn type_url() -> ::prost::alloc::string::String { "/api.proto.v1.GetValidatorSetHeaderRequest".into() }} /// Request message for getting validator set metadata #[allow(clippy::derive_partial_eq_without_eq)] ⋮---- pub struct GetValidatorSetMetadataRequest { ⋮---- fn full_name() -> ::prost::alloc::string::String { "api.proto.v1.GetValidatorSetMetadataRequest".into() }fn type_url() -> ::prost::alloc::string::String { "/api.proto.v1.GetValidatorSetMetadataRequest".into() }} /// Response message for getting current epoch #[allow(clippy::derive_partial_eq_without_eq)] ⋮---- pub struct GetCurrentEpochResponse { ⋮---- /// Epoch start time #[prost(message, optional, tag="2")] ⋮---- fn full_name() -> ::prost::alloc::string::String { "api.proto.v1.GetCurrentEpochResponse".into() }fn type_url() -> ::prost::alloc::string::String { "/api.proto.v1.GetCurrentEpochResponse".into() }} /// SignatureRequest represents a signature request #[allow(clippy::derive_partial_eq_without_eq)] ⋮---- pub struct SignatureRequest { /// Request ID #[prost(string, tag="1")] ⋮---- /// Key tag identifier (0-127) #[prost(uint32, tag="2")] ⋮---- /// Message to be signed #[prost(bytes="bytes", tag="3")] ⋮---- /// Required epoch #[prost(uint64, tag="4")] ⋮---- fn full_name() -> ::prost::alloc::string::String { "api.proto.v1.SignatureRequest".into() }fn type_url() -> ::prost::alloc::string::String { "/api.proto.v1.SignatureRequest".into() }} /// Response message for getting signature request #[allow(clippy::derive_partial_eq_without_eq)] ⋮---- pub struct GetSignatureRequestResponse { ⋮---- fn full_name() -> ::prost::alloc::string::String { "api.proto.v1.GetSignatureRequestResponse".into() }fn type_url() -> ::prost::alloc::string::String { "/api.proto.v1.GetSignatureRequestResponse".into() }} /// Response message for getting aggregation proof #[allow(clippy::derive_partial_eq_without_eq)] ⋮---- pub struct GetAggregationProofResponse { ⋮---- fn full_name() -> ::prost::alloc::string::String { "api.proto.v1.GetAggregationProofResponse".into() }fn type_url() -> ::prost::alloc::string::String { "/api.proto.v1.GetAggregationProofResponse".into() }} ⋮---- pub struct GetAggregationProofsByEpochResponse { ⋮---- fn full_name() -> ::prost::alloc::string::String { "api.proto.v1.GetAggregationProofsByEpochResponse".into() }fn type_url() -> ::prost::alloc::string::String { "/api.proto.v1.GetAggregationProofsByEpochResponse".into() }} ⋮---- pub struct AggregationProof { /// Message hash #[prost(bytes="bytes", tag="2")] ⋮---- /// Proof data #[prost(bytes="bytes", tag="3")] ⋮---- /// Request ID #[prost(string, tag="4")] ⋮---- fn full_name() -> ::prost::alloc::string::String { "api.proto.v1.AggregationProof".into() }fn type_url() -> ::prost::alloc::string::String { "/api.proto.v1.AggregationProof".into() }} /// Response message for getting aggregation status #[allow(clippy::derive_partial_eq_without_eq)] ⋮---- pub struct GetAggregationStatusResponse { /// Current voting power of the aggregator (big integer as string) #[prost(string, tag="1")] ⋮---- /// List of operator addresses that signed the request #[prost(string, repeated, tag="2")] ⋮---- fn full_name() -> ::prost::alloc::string::String { "api.proto.v1.GetAggregationStatusResponse".into() }fn type_url() -> ::prost::alloc::string::String { "/api.proto.v1.GetAggregationStatusResponse".into() }} /// Digital signature #[allow(clippy::derive_partial_eq_without_eq)] ⋮---- pub struct Signature { /// Signature data #[prost(bytes="bytes", tag="1")] ⋮---- /// Public key #[prost(bytes="bytes", tag="3")] ⋮---- fn full_name() -> ::prost::alloc::string::String { "api.proto.v1.Signature".into() }fn type_url() -> ::prost::alloc::string::String { "/api.proto.v1.Signature".into() }} /// Response message for getting validator set #[allow(clippy::derive_partial_eq_without_eq)] ⋮---- pub struct GetValidatorSetResponse { ⋮---- fn full_name() -> ::prost::alloc::string::String { "api.proto.v1.GetValidatorSetResponse".into() }fn type_url() -> ::prost::alloc::string::String { "/api.proto.v1.GetValidatorSetResponse".into() }} /// Response message for getting validator by address #[allow(clippy::derive_partial_eq_without_eq)] ⋮---- pub struct GetValidatorByAddressResponse { /// The validator #[prost(message, optional, tag="1")] ⋮---- fn full_name() -> ::prost::alloc::string::String { "api.proto.v1.GetValidatorByAddressResponse".into() }fn type_url() -> ::prost::alloc::string::String { "/api.proto.v1.GetValidatorByAddressResponse".into() }} /// Response message for getting validator by key #[allow(clippy::derive_partial_eq_without_eq)] ⋮---- pub struct GetValidatorByKeyResponse { ⋮---- fn full_name() -> ::prost::alloc::string::String { "api.proto.v1.GetValidatorByKeyResponse".into() }fn type_url() -> ::prost::alloc::string::String { "/api.proto.v1.GetValidatorByKeyResponse".into() }} /// Response message for getting local validator #[allow(clippy::derive_partial_eq_without_eq)] ⋮---- pub struct GetLocalValidatorResponse { ⋮---- fn full_name() -> ::prost::alloc::string::String { "api.proto.v1.GetLocalValidatorResponse".into() }fn type_url() -> ::prost::alloc::string::String { "/api.proto.v1.GetLocalValidatorResponse".into() }} ⋮---- pub struct ExtraData { ⋮---- fn full_name() -> ::prost::alloc::string::String { "api.proto.v1.ExtraData".into() }fn type_url() -> ::prost::alloc::string::String { "/api.proto.v1.ExtraData".into() }} /// Response message for getting validator set header #[allow(clippy::derive_partial_eq_without_eq)] ⋮---- pub struct GetValidatorSetMetadataResponse { ⋮---- fn full_name() -> ::prost::alloc::string::String { "api.proto.v1.GetValidatorSetMetadataResponse".into() }fn type_url() -> ::prost::alloc::string::String { "/api.proto.v1.GetValidatorSetMetadataResponse".into() }} ⋮---- pub struct GetValidatorSetHeaderResponse { /// Version of the validator set #[prost(uint32, tag="1")] ⋮---- /// Key tag required to commit next validator set #[prost(uint32, tag="2")] ⋮---- /// Validator set epoch #[prost(uint64, tag="3")] ⋮---- /// Epoch capture timestamp #[prost(message, optional, tag="4")] ⋮---- /// Quorum threshold (big integer as string) #[prost(string, tag="5")] ⋮---- /// Total voting power (big integer as string) #[prost(string, tag="6")] ⋮---- /// Validators SSZ Merkle root (hex string) #[prost(string, tag="7")] ⋮---- fn full_name() -> ::prost::alloc::string::String { "api.proto.v1.GetValidatorSetHeaderResponse".into() }fn type_url() -> ::prost::alloc::string::String { "/api.proto.v1.GetValidatorSetHeaderResponse".into() }} /// Validator information #[allow(clippy::derive_partial_eq_without_eq)] ⋮---- pub struct Validator { /// Operator address (hex string) #[prost(string, tag="1")] ⋮---- /// Voting power of the validator (big integer as string) #[prost(string, tag="2")] ⋮---- /// Indicates if the validator is active #[prost(bool, tag="3")] ⋮---- /// List of cryptographic keys #[prost(message, repeated, tag="4")] ⋮---- /// List of validator vaults #[prost(message, repeated, tag="5")] ⋮---- fn full_name() -> ::prost::alloc::string::String { "api.proto.v1.Validator".into() }fn type_url() -> ::prost::alloc::string::String { "/api.proto.v1.Validator".into() }} /// Cryptographic key #[allow(clippy::derive_partial_eq_without_eq)] ⋮---- pub struct Key { ⋮---- /// Key payload #[prost(bytes="bytes", tag="2")] ⋮---- fn full_name() -> ::prost::alloc::string::String { "api.proto.v1.Key".into() }fn type_url() -> ::prost::alloc::string::String { "/api.proto.v1.Key".into() }} /// Validator vault information #[allow(clippy::derive_partial_eq_without_eq)] ⋮---- pub struct ValidatorVault { /// Chain identifier #[prost(uint64, tag="1")] ⋮---- /// Vault address #[prost(string, tag="2")] ⋮---- /// Voting power for this vault (big integer as string) #[prost(string, tag="3")] ⋮---- fn full_name() -> ::prost::alloc::string::String { "api.proto.v1.ValidatorVault".into() }fn type_url() -> ::prost::alloc::string::String { "/api.proto.v1.ValidatorVault".into() }} /// Request message for getting last committed epoch for a specific settlement chain #[allow(clippy::derive_partial_eq_without_eq)] ⋮---- pub struct GetLastCommittedRequest { /// Settlement chain ID #[prost(uint64, tag="1")] ⋮---- fn full_name() -> ::prost::alloc::string::String { "api.proto.v1.GetLastCommittedRequest".into() }fn type_url() -> ::prost::alloc::string::String { "/api.proto.v1.GetLastCommittedRequest".into() }} /// Response message for getting last committed epoch #[allow(clippy::derive_partial_eq_without_eq)] ⋮---- pub struct GetLastCommittedResponse { ⋮---- fn full_name() -> ::prost::alloc::string::String { "api.proto.v1.GetLastCommittedResponse".into() }fn type_url() -> ::prost::alloc::string::String { "/api.proto.v1.GetLastCommittedResponse".into() }} /// Request message for getting last committed epochs for all chains /// ⋮---- /// /// No parameters needed ⋮---- /// No parameters needed #[allow(clippy::derive_partial_eq_without_eq)] ⋮---- pub struct GetLastAllCommittedRequest { ⋮---- fn full_name() -> ::prost::alloc::string::String { "api.proto.v1.GetLastAllCommittedRequest".into() }fn type_url() -> ::prost::alloc::string::String { "/api.proto.v1.GetLastAllCommittedRequest".into() }} /// Response message for getting all last committed epochs #[allow(clippy::derive_partial_eq_without_eq)] ⋮---- pub struct GetLastAllCommittedResponse { /// List of settlement chains with their last committed epochs #[prost(map="uint64, message", tag="1")] ⋮---- /// Suggested epoch info for signatures, it is the minimum commited epoch among all chains #[prost(message, optional, tag="2")] ⋮---- fn full_name() -> ::prost::alloc::string::String { "api.proto.v1.GetLastAllCommittedResponse".into() }fn type_url() -> ::prost::alloc::string::String { "/api.proto.v1.GetLastAllCommittedResponse".into() }} /// Settlement chain with its last committed epoch #[allow(clippy::derive_partial_eq_without_eq)] ⋮---- pub struct ChainEpochInfo { /// Last committed epoch for this chain #[prost(uint64, tag="1")] ⋮---- fn full_name() -> ::prost::alloc::string::String { "api.proto.v1.ChainEpochInfo".into() }fn type_url() -> ::prost::alloc::string::String { "/api.proto.v1.ChainEpochInfo".into() }} ⋮---- pub struct ValidatorSet { ⋮---- /// Status of validator set header #[prost(enumeration="ValidatorSetStatus", tag="6")] ⋮---- /// List of validators #[prost(message, repeated, tag="7")] ⋮---- fn full_name() -> ::prost::alloc::string::String { "api.proto.v1.ValidatorSet".into() }fn type_url() -> ::prost::alloc::string::String { "/api.proto.v1.ValidatorSet".into() }} /// Validator set status enumeration #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] ⋮---- pub enum ValidatorSetStatus { /// Default/unknown status Unspecified = 0, /// Derived status Derived = 1, /// Aggregated status Aggregated = 2, /// Committed status Committed = 3, /// Missed status Missed = 4, ⋮---- impl ValidatorSetStatus { /// String value of the enum field names used in the ProtoBuf definition. /// ⋮---- /// /// The values are not transformed in any way and thus are considered stable ⋮---- /// The values are not transformed in any way and thus are considered stable /// (if the ProtoBuf definition does not change) and safe for programmatic use. ⋮---- /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { ⋮---- pub fn as_str_name(&self) -> &'static str { ⋮---- /// Creates an enum from field names used in the ProtoBuf definition. pub fn from_str_name(value: &str) -> ::core::option::Option { ⋮---- pub fn from_str_name(value: &str) -> ::core::option::Option { ⋮---- "VALIDATOR_SET_STATUS_UNSPECIFIED" => Some(Self::Unspecified), "VALIDATOR_SET_STATUS_DERIVED" => Some(Self::Derived), "VALIDATOR_SET_STATUS_AGGREGATED" => Some(Self::Aggregated), "VALIDATOR_SET_STATUS_COMMITTED" => Some(Self::Committed), "VALIDATOR_SET_STATUS_MISSED" => Some(Self::Missed), ⋮---- /// Signing process status enumeration #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] ⋮---- pub enum SigningStatus { ⋮---- /// Request has been created and is waiting for signatures Pending = 1, /// Signing process completed successfully with proof Completed = 2, /// Signing process failed Failed = 3, /// Signing request timed out Timeout = 4, ⋮---- impl SigningStatus { ⋮---- "SIGNING_STATUS_UNSPECIFIED" => Some(Self::Unspecified), "SIGNING_STATUS_PENDING" => Some(Self::Pending), "SIGNING_STATUS_COMPLETED" => Some(Self::Completed), "SIGNING_STATUS_FAILED" => Some(Self::Failed), "SIGNING_STATUS_TIMEOUT" => Some(Self::Timeout), ⋮---- /// Error code enumeration #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] ⋮---- pub enum ErrorCode { /// Default/unknown error Unspecified = 0, /// No data found NoData = 1, /// Internal server error Internal = 2, /// Not an aggregator node NotAggregator = 3, ⋮---- impl ErrorCode { ⋮---- "ERROR_CODE_UNSPECIFIED" => Some(Self::Unspecified), "ERROR_CODE_NO_DATA" => Some(Self::NoData), "ERROR_CODE_INTERNAL" => Some(Self::Internal), "ERROR_CODE_NOT_AGGREGATOR" => Some(Self::NotAggregator), ⋮---- /// Encoded file descriptor set for the `api.proto.v1` package pub const FILE_DESCRIPTOR_SET: &[u8] = &[ ⋮---- include!("api.proto.v1.tonic.rs"); include!("api.proto.v1.serde.rs"); // @@protoc_insertion_point(module) ```` ## File: src/generated/api.proto.v1.serde.rs ````rust // @generated ⋮---- fn serialize(&self, serializer: S) -> std::result::Result ⋮---- use serde::ser::SerializeStruct; ⋮---- if !self.message_hash.is_empty() { ⋮---- if !self.proof.is_empty() { ⋮---- if !self.request_id.is_empty() { ⋮---- let mut struct_ser = serializer.serialize_struct("api.proto.v1.AggregationProof", len)?; ⋮---- struct_ser.serialize_field("messageHash", pbjson::private::base64::encode(&self.message_hash).as_str())?; ⋮---- struct_ser.serialize_field("proof", pbjson::private::base64::encode(&self.proof).as_str())?; ⋮---- struct_ser.serialize_field("requestId", &self.request_id)?; ⋮---- struct_ser.end() ⋮---- fn deserialize(deserializer: D) -> std::result::Result ⋮---- enum GeneratedField { ⋮---- fn deserialize(deserializer: D) -> std::result::Result ⋮---- struct GeneratedVisitor; ⋮---- type Value = GeneratedField; ⋮---- fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(formatter, "expected one of: {:?}", &FIELDS) ⋮---- fn visit_str(self, value: &str) -> std::result::Result ⋮---- "messageHash" | "message_hash" => Ok(GeneratedField::MessageHash), "proof" => Ok(GeneratedField::Proof), "requestId" | "request_id" => Ok(GeneratedField::RequestId), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), ⋮---- deserializer.deserialize_identifier(GeneratedVisitor) ⋮---- type Value = AggregationProof; ⋮---- formatter.write_str("struct api.proto.v1.AggregationProof") ⋮---- fn visit_map(self, mut map_: V) -> std::result::Result ⋮---- while let Some(k) = map_.next_key()? { ⋮---- if message_hash__.is_some() { return Err(serde::de::Error::duplicate_field("messageHash")); ⋮---- Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) ⋮---- if proof__.is_some() { return Err(serde::de::Error::duplicate_field("proof")); ⋮---- if request_id__.is_some() { return Err(serde::de::Error::duplicate_field("requestId")); ⋮---- request_id__ = Some(map_.next_value()?); ⋮---- Ok(AggregationProof { message_hash: message_hash__.unwrap_or_default(), proof: proof__.unwrap_or_default(), request_id: request_id__.unwrap_or_default(), ⋮---- deserializer.deserialize_struct("api.proto.v1.AggregationProof", FIELDS, GeneratedVisitor) ⋮---- if self.start_time.is_some() { ⋮---- let mut struct_ser = serializer.serialize_struct("api.proto.v1.ChainEpochInfo", len)?; ⋮---- struct_ser.serialize_field("lastCommittedEpoch", ToString::to_string(&self.last_committed_epoch).as_str())?; ⋮---- if let Some(v) = self.start_time.as_ref() { struct_ser.serialize_field("startTime", v)?; ⋮---- "lastCommittedEpoch" | "last_committed_epoch" => Ok(GeneratedField::LastCommittedEpoch), "startTime" | "start_time" => Ok(GeneratedField::StartTime), ⋮---- type Value = ChainEpochInfo; ⋮---- formatter.write_str("struct api.proto.v1.ChainEpochInfo") ⋮---- fn visit_map(self, mut map_: V) -> std::result::Result ⋮---- if last_committed_epoch__.is_some() { return Err(serde::de::Error::duplicate_field("lastCommittedEpoch")); ⋮---- Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ⋮---- if start_time__.is_some() { return Err(serde::de::Error::duplicate_field("startTime")); ⋮---- start_time__ = map_.next_value()?; ⋮---- Ok(ChainEpochInfo { last_committed_epoch: last_committed_epoch__.unwrap_or_default(), ⋮---- deserializer.deserialize_struct("api.proto.v1.ChainEpochInfo", FIELDS, GeneratedVisitor) ⋮---- serializer.serialize_str(variant) ⋮---- type Value = ErrorCode; ⋮---- fn visit_i64(self, v: i64) -> std::result::Result ⋮---- .ok() .and_then(|x| x.try_into().ok()) .ok_or_else(|| { ⋮---- fn visit_u64(self, v: u64) -> std::result::Result ⋮---- fn visit_str(self, value: &str) -> std::result::Result ⋮---- "ERROR_CODE_UNSPECIFIED" => Ok(ErrorCode::Unspecified), "ERROR_CODE_NO_DATA" => Ok(ErrorCode::NoData), "ERROR_CODE_INTERNAL" => Ok(ErrorCode::Internal), "ERROR_CODE_NOT_AGGREGATOR" => Ok(ErrorCode::NotAggregator), _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), ⋮---- deserializer.deserialize_any(GeneratedVisitor) ⋮---- if !self.key.is_empty() { ⋮---- if !self.value.is_empty() { ⋮---- let mut struct_ser = serializer.serialize_struct("api.proto.v1.ExtraData", len)?; ⋮---- struct_ser.serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; ⋮---- struct_ser.serialize_field("value", pbjson::private::base64::encode(&self.value).as_str())?; ⋮---- "key" => Ok(GeneratedField::Key), "value" => Ok(GeneratedField::Value), ⋮---- type Value = ExtraData; ⋮---- formatter.write_str("struct api.proto.v1.ExtraData") ⋮---- fn visit_map(self, mut map_: V) -> std::result::Result ⋮---- if key__.is_some() { return Err(serde::de::Error::duplicate_field("key")); ⋮---- if value__.is_some() { return Err(serde::de::Error::duplicate_field("value")); ⋮---- Ok(ExtraData { key: key__.unwrap_or_default(), value: value__.unwrap_or_default(), ⋮---- deserializer.deserialize_struct("api.proto.v1.ExtraData", FIELDS, GeneratedVisitor) ⋮---- let mut struct_ser = serializer.serialize_struct("api.proto.v1.GetAggregationProofRequest", len)?; ⋮---- type Value = GetAggregationProofRequest; ⋮---- formatter.write_str("struct api.proto.v1.GetAggregationProofRequest") ⋮---- fn visit_map(self, mut map_: V) -> std::result::Result ⋮---- Ok(GetAggregationProofRequest { ⋮---- deserializer.deserialize_struct("api.proto.v1.GetAggregationProofRequest", FIELDS, GeneratedVisitor) ⋮---- if self.aggregation_proof.is_some() { ⋮---- let mut struct_ser = serializer.serialize_struct("api.proto.v1.GetAggregationProofResponse", len)?; if let Some(v) = self.aggregation_proof.as_ref() { struct_ser.serialize_field("aggregationProof", v)?; ⋮---- "aggregationProof" | "aggregation_proof" => Ok(GeneratedField::AggregationProof), ⋮---- type Value = GetAggregationProofResponse; ⋮---- formatter.write_str("struct api.proto.v1.GetAggregationProofResponse") ⋮---- fn visit_map(self, mut map_: V) -> std::result::Result ⋮---- if aggregation_proof__.is_some() { return Err(serde::de::Error::duplicate_field("aggregationProof")); ⋮---- aggregation_proof__ = map_.next_value()?; ⋮---- Ok(GetAggregationProofResponse { ⋮---- deserializer.deserialize_struct("api.proto.v1.GetAggregationProofResponse", FIELDS, GeneratedVisitor) ⋮---- let mut struct_ser = serializer.serialize_struct("api.proto.v1.GetAggregationProofsByEpochRequest", len)?; ⋮---- struct_ser.serialize_field("epoch", ToString::to_string(&self.epoch).as_str())?; ⋮---- "epoch" => Ok(GeneratedField::Epoch), ⋮---- type Value = GetAggregationProofsByEpochRequest; ⋮---- formatter.write_str("struct api.proto.v1.GetAggregationProofsByEpochRequest") ⋮---- fn visit_map(self, mut map_: V) -> std::result::Result ⋮---- if epoch__.is_some() { return Err(serde::de::Error::duplicate_field("epoch")); ⋮---- Ok(GetAggregationProofsByEpochRequest { epoch: epoch__.unwrap_or_default(), ⋮---- deserializer.deserialize_struct("api.proto.v1.GetAggregationProofsByEpochRequest", FIELDS, GeneratedVisitor) ⋮---- if !self.aggregation_proofs.is_empty() { ⋮---- let mut struct_ser = serializer.serialize_struct("api.proto.v1.GetAggregationProofsByEpochResponse", len)?; ⋮---- struct_ser.serialize_field("aggregationProofs", &self.aggregation_proofs)?; ⋮---- "aggregationProofs" | "aggregation_proofs" => Ok(GeneratedField::AggregationProofs), ⋮---- type Value = GetAggregationProofsByEpochResponse; ⋮---- formatter.write_str("struct api.proto.v1.GetAggregationProofsByEpochResponse") ⋮---- fn visit_map(self, mut map_: V) -> std::result::Result ⋮---- if aggregation_proofs__.is_some() { return Err(serde::de::Error::duplicate_field("aggregationProofs")); ⋮---- aggregation_proofs__ = Some(map_.next_value()?); ⋮---- Ok(GetAggregationProofsByEpochResponse { aggregation_proofs: aggregation_proofs__.unwrap_or_default(), ⋮---- deserializer.deserialize_struct("api.proto.v1.GetAggregationProofsByEpochResponse", FIELDS, GeneratedVisitor) ⋮---- let mut struct_ser = serializer.serialize_struct("api.proto.v1.GetAggregationStatusRequest", len)?; ⋮---- type Value = GetAggregationStatusRequest; ⋮---- formatter.write_str("struct api.proto.v1.GetAggregationStatusRequest") ⋮---- fn visit_map(self, mut map_: V) -> std::result::Result ⋮---- Ok(GetAggregationStatusRequest { ⋮---- deserializer.deserialize_struct("api.proto.v1.GetAggregationStatusRequest", FIELDS, GeneratedVisitor) ⋮---- if !self.current_voting_power.is_empty() { ⋮---- if !self.signer_operators.is_empty() { ⋮---- let mut struct_ser = serializer.serialize_struct("api.proto.v1.GetAggregationStatusResponse", len)?; ⋮---- struct_ser.serialize_field("currentVotingPower", &self.current_voting_power)?; ⋮---- struct_ser.serialize_field("signerOperators", &self.signer_operators)?; ⋮---- "currentVotingPower" | "current_voting_power" => Ok(GeneratedField::CurrentVotingPower), "signerOperators" | "signer_operators" => Ok(GeneratedField::SignerOperators), ⋮---- type Value = GetAggregationStatusResponse; ⋮---- formatter.write_str("struct api.proto.v1.GetAggregationStatusResponse") ⋮---- fn visit_map(self, mut map_: V) -> std::result::Result ⋮---- if current_voting_power__.is_some() { return Err(serde::de::Error::duplicate_field("currentVotingPower")); ⋮---- current_voting_power__ = Some(map_.next_value()?); ⋮---- if signer_operators__.is_some() { return Err(serde::de::Error::duplicate_field("signerOperators")); ⋮---- signer_operators__ = Some(map_.next_value()?); ⋮---- Ok(GetAggregationStatusResponse { current_voting_power: current_voting_power__.unwrap_or_default(), signer_operators: signer_operators__.unwrap_or_default(), ⋮---- deserializer.deserialize_struct("api.proto.v1.GetAggregationStatusResponse", FIELDS, GeneratedVisitor) ⋮---- let struct_ser = serializer.serialize_struct("api.proto.v1.GetCurrentEpochRequest", len)?; ⋮---- Err(serde::de::Error::unknown_field(value, FIELDS)) ⋮---- type Value = GetCurrentEpochRequest; ⋮---- formatter.write_str("struct api.proto.v1.GetCurrentEpochRequest") ⋮---- fn visit_map(self, mut map_: V) -> std::result::Result ⋮---- while map_.next_key::()?.is_some() { ⋮---- Ok(GetCurrentEpochRequest { ⋮---- deserializer.deserialize_struct("api.proto.v1.GetCurrentEpochRequest", FIELDS, GeneratedVisitor) ⋮---- let mut struct_ser = serializer.serialize_struct("api.proto.v1.GetCurrentEpochResponse", len)?; ⋮---- type Value = GetCurrentEpochResponse; ⋮---- formatter.write_str("struct api.proto.v1.GetCurrentEpochResponse") ⋮---- fn visit_map(self, mut map_: V) -> std::result::Result ⋮---- Ok(GetCurrentEpochResponse { ⋮---- deserializer.deserialize_struct("api.proto.v1.GetCurrentEpochResponse", FIELDS, GeneratedVisitor) ⋮---- let struct_ser = serializer.serialize_struct("api.proto.v1.GetLastAllCommittedRequest", len)?; ⋮---- type Value = GetLastAllCommittedRequest; ⋮---- formatter.write_str("struct api.proto.v1.GetLastAllCommittedRequest") ⋮---- fn visit_map(self, mut map_: V) -> std::result::Result ⋮---- Ok(GetLastAllCommittedRequest { ⋮---- deserializer.deserialize_struct("api.proto.v1.GetLastAllCommittedRequest", FIELDS, GeneratedVisitor) ⋮---- if !self.epoch_infos.is_empty() { ⋮---- if self.suggested_epoch_info.is_some() { ⋮---- let mut struct_ser = serializer.serialize_struct("api.proto.v1.GetLastAllCommittedResponse", len)?; ⋮---- struct_ser.serialize_field("epochInfos", &self.epoch_infos)?; ⋮---- if let Some(v) = self.suggested_epoch_info.as_ref() { struct_ser.serialize_field("suggestedEpochInfo", v)?; ⋮---- "epochInfos" | "epoch_infos" => Ok(GeneratedField::EpochInfos), "suggestedEpochInfo" | "suggested_epoch_info" => Ok(GeneratedField::SuggestedEpochInfo), ⋮---- type Value = GetLastAllCommittedResponse; ⋮---- formatter.write_str("struct api.proto.v1.GetLastAllCommittedResponse") ⋮---- fn visit_map(self, mut map_: V) -> std::result::Result ⋮---- if epoch_infos__.is_some() { return Err(serde::de::Error::duplicate_field("epochInfos")); ⋮---- epoch_infos__ = Some( ⋮---- .into_iter().map(|(k,v)| (k.0, v)).collect() ⋮---- if suggested_epoch_info__.is_some() { return Err(serde::de::Error::duplicate_field("suggestedEpochInfo")); ⋮---- suggested_epoch_info__ = map_.next_value()?; ⋮---- Ok(GetLastAllCommittedResponse { epoch_infos: epoch_infos__.unwrap_or_default(), ⋮---- deserializer.deserialize_struct("api.proto.v1.GetLastAllCommittedResponse", FIELDS, GeneratedVisitor) ⋮---- let mut struct_ser = serializer.serialize_struct("api.proto.v1.GetLastCommittedRequest", len)?; ⋮---- struct_ser.serialize_field("settlementChainId", ToString::to_string(&self.settlement_chain_id).as_str())?; ⋮---- "settlementChainId" | "settlement_chain_id" => Ok(GeneratedField::SettlementChainId), ⋮---- type Value = GetLastCommittedRequest; ⋮---- formatter.write_str("struct api.proto.v1.GetLastCommittedRequest") ⋮---- fn visit_map(self, mut map_: V) -> std::result::Result ⋮---- if settlement_chain_id__.is_some() { return Err(serde::de::Error::duplicate_field("settlementChainId")); ⋮---- Ok(GetLastCommittedRequest { settlement_chain_id: settlement_chain_id__.unwrap_or_default(), ⋮---- deserializer.deserialize_struct("api.proto.v1.GetLastCommittedRequest", FIELDS, GeneratedVisitor) ⋮---- if self.epoch_info.is_some() { ⋮---- let mut struct_ser = serializer.serialize_struct("api.proto.v1.GetLastCommittedResponse", len)?; ⋮---- if let Some(v) = self.epoch_info.as_ref() { struct_ser.serialize_field("epochInfo", v)?; ⋮---- "epochInfo" | "epoch_info" => Ok(GeneratedField::EpochInfo), ⋮---- type Value = GetLastCommittedResponse; ⋮---- formatter.write_str("struct api.proto.v1.GetLastCommittedResponse") ⋮---- fn visit_map(self, mut map_: V) -> std::result::Result ⋮---- if epoch_info__.is_some() { return Err(serde::de::Error::duplicate_field("epochInfo")); ⋮---- epoch_info__ = map_.next_value()?; ⋮---- Ok(GetLastCommittedResponse { ⋮---- deserializer.deserialize_struct("api.proto.v1.GetLastCommittedResponse", FIELDS, GeneratedVisitor) ⋮---- if self.epoch.is_some() { ⋮---- let mut struct_ser = serializer.serialize_struct("api.proto.v1.GetLocalValidatorRequest", len)?; if let Some(v) = self.epoch.as_ref() { ⋮---- struct_ser.serialize_field("epoch", ToString::to_string(&v).as_str())?; ⋮---- type Value = GetLocalValidatorRequest; ⋮---- formatter.write_str("struct api.proto.v1.GetLocalValidatorRequest") ⋮---- fn visit_map(self, mut map_: V) -> std::result::Result ⋮---- map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0) ⋮---- Ok(GetLocalValidatorRequest { ⋮---- deserializer.deserialize_struct("api.proto.v1.GetLocalValidatorRequest", FIELDS, GeneratedVisitor) ⋮---- if self.validator.is_some() { ⋮---- let mut struct_ser = serializer.serialize_struct("api.proto.v1.GetLocalValidatorResponse", len)?; if let Some(v) = self.validator.as_ref() { struct_ser.serialize_field("validator", v)?; ⋮---- "validator" => Ok(GeneratedField::Validator), ⋮---- type Value = GetLocalValidatorResponse; ⋮---- formatter.write_str("struct api.proto.v1.GetLocalValidatorResponse") ⋮---- fn visit_map(self, mut map_: V) -> std::result::Result ⋮---- if validator__.is_some() { return Err(serde::de::Error::duplicate_field("validator")); ⋮---- validator__ = map_.next_value()?; ⋮---- Ok(GetLocalValidatorResponse { ⋮---- deserializer.deserialize_struct("api.proto.v1.GetLocalValidatorResponse", FIELDS, GeneratedVisitor) ⋮---- let mut struct_ser = serializer.serialize_struct("api.proto.v1.GetSignatureRequestIDsByEpochRequest", len)?; ⋮---- type Value = GetSignatureRequestIDsByEpochRequest; ⋮---- formatter.write_str("struct api.proto.v1.GetSignatureRequestIDsByEpochRequest") ⋮---- fn visit_map(self, mut map_: V) -> std::result::Result ⋮---- Ok(GetSignatureRequestIDsByEpochRequest { ⋮---- deserializer.deserialize_struct("api.proto.v1.GetSignatureRequestIDsByEpochRequest", FIELDS, GeneratedVisitor) ⋮---- if !self.request_ids.is_empty() { ⋮---- let mut struct_ser = serializer.serialize_struct("api.proto.v1.GetSignatureRequestIDsByEpochResponse", len)?; ⋮---- struct_ser.serialize_field("requestIds", &self.request_ids)?; ⋮---- "requestIds" | "request_ids" => Ok(GeneratedField::RequestIds), ⋮---- type Value = GetSignatureRequestIDsByEpochResponse; ⋮---- formatter.write_str("struct api.proto.v1.GetSignatureRequestIDsByEpochResponse") ⋮---- fn visit_map(self, mut map_: V) -> std::result::Result ⋮---- if request_ids__.is_some() { return Err(serde::de::Error::duplicate_field("requestIds")); ⋮---- request_ids__ = Some(map_.next_value()?); ⋮---- Ok(GetSignatureRequestIDsByEpochResponse { request_ids: request_ids__.unwrap_or_default(), ⋮---- deserializer.deserialize_struct("api.proto.v1.GetSignatureRequestIDsByEpochResponse", FIELDS, GeneratedVisitor) ⋮---- let mut struct_ser = serializer.serialize_struct("api.proto.v1.GetSignatureRequestRequest", len)?; ⋮---- type Value = GetSignatureRequestRequest; ⋮---- formatter.write_str("struct api.proto.v1.GetSignatureRequestRequest") ⋮---- fn visit_map(self, mut map_: V) -> std::result::Result ⋮---- Ok(GetSignatureRequestRequest { ⋮---- deserializer.deserialize_struct("api.proto.v1.GetSignatureRequestRequest", FIELDS, GeneratedVisitor) ⋮---- if self.signature_request.is_some() { ⋮---- let mut struct_ser = serializer.serialize_struct("api.proto.v1.GetSignatureRequestResponse", len)?; if let Some(v) = self.signature_request.as_ref() { struct_ser.serialize_field("signatureRequest", v)?; ⋮---- "signatureRequest" | "signature_request" => Ok(GeneratedField::SignatureRequest), ⋮---- type Value = GetSignatureRequestResponse; ⋮---- formatter.write_str("struct api.proto.v1.GetSignatureRequestResponse") ⋮---- fn visit_map(self, mut map_: V) -> std::result::Result ⋮---- if signature_request__.is_some() { return Err(serde::de::Error::duplicate_field("signatureRequest")); ⋮---- signature_request__ = map_.next_value()?; ⋮---- Ok(GetSignatureRequestResponse { ⋮---- deserializer.deserialize_struct("api.proto.v1.GetSignatureRequestResponse", FIELDS, GeneratedVisitor) ⋮---- let mut struct_ser = serializer.serialize_struct("api.proto.v1.GetSignatureRequestsByEpochRequest", len)?; ⋮---- type Value = GetSignatureRequestsByEpochRequest; ⋮---- formatter.write_str("struct api.proto.v1.GetSignatureRequestsByEpochRequest") ⋮---- fn visit_map(self, mut map_: V) -> std::result::Result ⋮---- Ok(GetSignatureRequestsByEpochRequest { ⋮---- deserializer.deserialize_struct("api.proto.v1.GetSignatureRequestsByEpochRequest", FIELDS, GeneratedVisitor) ⋮---- if !self.signature_requests.is_empty() { ⋮---- let mut struct_ser = serializer.serialize_struct("api.proto.v1.GetSignatureRequestsByEpochResponse", len)?; ⋮---- struct_ser.serialize_field("signatureRequests", &self.signature_requests)?; ⋮---- "signatureRequests" | "signature_requests" => Ok(GeneratedField::SignatureRequests), ⋮---- type Value = GetSignatureRequestsByEpochResponse; ⋮---- formatter.write_str("struct api.proto.v1.GetSignatureRequestsByEpochResponse") ⋮---- fn visit_map(self, mut map_: V) -> std::result::Result ⋮---- if signature_requests__.is_some() { return Err(serde::de::Error::duplicate_field("signatureRequests")); ⋮---- signature_requests__ = Some(map_.next_value()?); ⋮---- Ok(GetSignatureRequestsByEpochResponse { signature_requests: signature_requests__.unwrap_or_default(), ⋮---- deserializer.deserialize_struct("api.proto.v1.GetSignatureRequestsByEpochResponse", FIELDS, GeneratedVisitor) ⋮---- let mut struct_ser = serializer.serialize_struct("api.proto.v1.GetSignaturesByEpochRequest", len)?; ⋮---- type Value = GetSignaturesByEpochRequest; ⋮---- formatter.write_str("struct api.proto.v1.GetSignaturesByEpochRequest") ⋮---- fn visit_map(self, mut map_: V) -> std::result::Result ⋮---- Ok(GetSignaturesByEpochRequest { ⋮---- deserializer.deserialize_struct("api.proto.v1.GetSignaturesByEpochRequest", FIELDS, GeneratedVisitor) ⋮---- if !self.signatures.is_empty() { ⋮---- let mut struct_ser = serializer.serialize_struct("api.proto.v1.GetSignaturesByEpochResponse", len)?; ⋮---- struct_ser.serialize_field("signatures", &self.signatures)?; ⋮---- "signatures" => Ok(GeneratedField::Signatures), ⋮---- type Value = GetSignaturesByEpochResponse; ⋮---- formatter.write_str("struct api.proto.v1.GetSignaturesByEpochResponse") ⋮---- fn visit_map(self, mut map_: V) -> std::result::Result ⋮---- if signatures__.is_some() { return Err(serde::de::Error::duplicate_field("signatures")); ⋮---- signatures__ = Some(map_.next_value()?); ⋮---- Ok(GetSignaturesByEpochResponse { signatures: signatures__.unwrap_or_default(), ⋮---- deserializer.deserialize_struct("api.proto.v1.GetSignaturesByEpochResponse", FIELDS, GeneratedVisitor) ⋮---- let mut struct_ser = serializer.serialize_struct("api.proto.v1.GetSignaturesRequest", len)?; ⋮---- type Value = GetSignaturesRequest; ⋮---- formatter.write_str("struct api.proto.v1.GetSignaturesRequest") ⋮---- fn visit_map(self, mut map_: V) -> std::result::Result ⋮---- Ok(GetSignaturesRequest { ⋮---- deserializer.deserialize_struct("api.proto.v1.GetSignaturesRequest", FIELDS, GeneratedVisitor) ⋮---- let mut struct_ser = serializer.serialize_struct("api.proto.v1.GetSignaturesResponse", len)?; ⋮---- type Value = GetSignaturesResponse; ⋮---- formatter.write_str("struct api.proto.v1.GetSignaturesResponse") ⋮---- fn visit_map(self, mut map_: V) -> std::result::Result ⋮---- Ok(GetSignaturesResponse { ⋮---- deserializer.deserialize_struct("api.proto.v1.GetSignaturesResponse", FIELDS, GeneratedVisitor) ⋮---- if !self.address.is_empty() { ⋮---- let mut struct_ser = serializer.serialize_struct("api.proto.v1.GetValidatorByAddressRequest", len)?; ⋮---- struct_ser.serialize_field("address", &self.address)?; ⋮---- "address" => Ok(GeneratedField::Address), ⋮---- type Value = GetValidatorByAddressRequest; ⋮---- formatter.write_str("struct api.proto.v1.GetValidatorByAddressRequest") ⋮---- fn visit_map(self, mut map_: V) -> std::result::Result ⋮---- if address__.is_some() { return Err(serde::de::Error::duplicate_field("address")); ⋮---- address__ = Some(map_.next_value()?); ⋮---- Ok(GetValidatorByAddressRequest { ⋮---- address: address__.unwrap_or_default(), ⋮---- deserializer.deserialize_struct("api.proto.v1.GetValidatorByAddressRequest", FIELDS, GeneratedVisitor) ⋮---- let mut struct_ser = serializer.serialize_struct("api.proto.v1.GetValidatorByAddressResponse", len)?; ⋮---- type Value = GetValidatorByAddressResponse; ⋮---- formatter.write_str("struct api.proto.v1.GetValidatorByAddressResponse") ⋮---- fn visit_map(self, mut map_: V) -> std::result::Result ⋮---- Ok(GetValidatorByAddressResponse { ⋮---- deserializer.deserialize_struct("api.proto.v1.GetValidatorByAddressResponse", FIELDS, GeneratedVisitor) ⋮---- if !self.on_chain_key.is_empty() { ⋮---- let mut struct_ser = serializer.serialize_struct("api.proto.v1.GetValidatorByKeyRequest", len)?; ⋮---- struct_ser.serialize_field("keyTag", &self.key_tag)?; ⋮---- struct_ser.serialize_field("onChainKey", pbjson::private::base64::encode(&self.on_chain_key).as_str())?; ⋮---- "keyTag" | "key_tag" => Ok(GeneratedField::KeyTag), "onChainKey" | "on_chain_key" => Ok(GeneratedField::OnChainKey), ⋮---- type Value = GetValidatorByKeyRequest; ⋮---- formatter.write_str("struct api.proto.v1.GetValidatorByKeyRequest") ⋮---- fn visit_map(self, mut map_: V) -> std::result::Result ⋮---- if key_tag__.is_some() { return Err(serde::de::Error::duplicate_field("keyTag")); ⋮---- if on_chain_key__.is_some() { return Err(serde::de::Error::duplicate_field("onChainKey")); ⋮---- Ok(GetValidatorByKeyRequest { ⋮---- key_tag: key_tag__.unwrap_or_default(), on_chain_key: on_chain_key__.unwrap_or_default(), ⋮---- deserializer.deserialize_struct("api.proto.v1.GetValidatorByKeyRequest", FIELDS, GeneratedVisitor) ⋮---- let mut struct_ser = serializer.serialize_struct("api.proto.v1.GetValidatorByKeyResponse", len)?; ⋮---- type Value = GetValidatorByKeyResponse; ⋮---- formatter.write_str("struct api.proto.v1.GetValidatorByKeyResponse") ⋮---- fn visit_map(self, mut map_: V) -> std::result::Result ⋮---- Ok(GetValidatorByKeyResponse { ⋮---- deserializer.deserialize_struct("api.proto.v1.GetValidatorByKeyResponse", FIELDS, GeneratedVisitor) ⋮---- let mut struct_ser = serializer.serialize_struct("api.proto.v1.GetValidatorSetHeaderRequest", len)?; ⋮---- type Value = GetValidatorSetHeaderRequest; ⋮---- formatter.write_str("struct api.proto.v1.GetValidatorSetHeaderRequest") ⋮---- fn visit_map(self, mut map_: V) -> std::result::Result ⋮---- Ok(GetValidatorSetHeaderRequest { ⋮---- deserializer.deserialize_struct("api.proto.v1.GetValidatorSetHeaderRequest", FIELDS, GeneratedVisitor) ⋮---- if self.capture_timestamp.is_some() { ⋮---- if !self.quorum_threshold.is_empty() { ⋮---- if !self.total_voting_power.is_empty() { ⋮---- if !self.validators_ssz_mroot.is_empty() { ⋮---- let mut struct_ser = serializer.serialize_struct("api.proto.v1.GetValidatorSetHeaderResponse", len)?; ⋮---- struct_ser.serialize_field("version", &self.version)?; ⋮---- struct_ser.serialize_field("requiredKeyTag", &self.required_key_tag)?; ⋮---- if let Some(v) = self.capture_timestamp.as_ref() { struct_ser.serialize_field("captureTimestamp", v)?; ⋮---- struct_ser.serialize_field("quorumThreshold", &self.quorum_threshold)?; ⋮---- struct_ser.serialize_field("totalVotingPower", &self.total_voting_power)?; ⋮---- struct_ser.serialize_field("validatorsSszMroot", &self.validators_ssz_mroot)?; ⋮---- "version" => Ok(GeneratedField::Version), "requiredKeyTag" | "required_key_tag" => Ok(GeneratedField::RequiredKeyTag), ⋮---- "captureTimestamp" | "capture_timestamp" => Ok(GeneratedField::CaptureTimestamp), "quorumThreshold" | "quorum_threshold" => Ok(GeneratedField::QuorumThreshold), "totalVotingPower" | "total_voting_power" => Ok(GeneratedField::TotalVotingPower), "validatorsSszMroot" | "validators_ssz_mroot" => Ok(GeneratedField::ValidatorsSszMroot), ⋮---- type Value = GetValidatorSetHeaderResponse; ⋮---- formatter.write_str("struct api.proto.v1.GetValidatorSetHeaderResponse") ⋮---- fn visit_map(self, mut map_: V) -> std::result::Result ⋮---- if version__.is_some() { return Err(serde::de::Error::duplicate_field("version")); ⋮---- if required_key_tag__.is_some() { return Err(serde::de::Error::duplicate_field("requiredKeyTag")); ⋮---- if capture_timestamp__.is_some() { return Err(serde::de::Error::duplicate_field("captureTimestamp")); ⋮---- capture_timestamp__ = map_.next_value()?; ⋮---- if quorum_threshold__.is_some() { return Err(serde::de::Error::duplicate_field("quorumThreshold")); ⋮---- quorum_threshold__ = Some(map_.next_value()?); ⋮---- if total_voting_power__.is_some() { return Err(serde::de::Error::duplicate_field("totalVotingPower")); ⋮---- total_voting_power__ = Some(map_.next_value()?); ⋮---- if validators_ssz_mroot__.is_some() { return Err(serde::de::Error::duplicate_field("validatorsSszMroot")); ⋮---- validators_ssz_mroot__ = Some(map_.next_value()?); ⋮---- Ok(GetValidatorSetHeaderResponse { version: version__.unwrap_or_default(), required_key_tag: required_key_tag__.unwrap_or_default(), ⋮---- quorum_threshold: quorum_threshold__.unwrap_or_default(), total_voting_power: total_voting_power__.unwrap_or_default(), validators_ssz_mroot: validators_ssz_mroot__.unwrap_or_default(), ⋮---- deserializer.deserialize_struct("api.proto.v1.GetValidatorSetHeaderResponse", FIELDS, GeneratedVisitor) ⋮---- let mut struct_ser = serializer.serialize_struct("api.proto.v1.GetValidatorSetMetadataRequest", len)?; ⋮---- type Value = GetValidatorSetMetadataRequest; ⋮---- formatter.write_str("struct api.proto.v1.GetValidatorSetMetadataRequest") ⋮---- fn visit_map(self, mut map_: V) -> std::result::Result ⋮---- Ok(GetValidatorSetMetadataRequest { ⋮---- deserializer.deserialize_struct("api.proto.v1.GetValidatorSetMetadataRequest", FIELDS, GeneratedVisitor) ⋮---- if !self.extra_data.is_empty() { ⋮---- if !self.commitment_data.is_empty() { ⋮---- let mut struct_ser = serializer.serialize_struct("api.proto.v1.GetValidatorSetMetadataResponse", len)?; ⋮---- struct_ser.serialize_field("extraData", &self.extra_data)?; ⋮---- struct_ser.serialize_field("commitmentData", pbjson::private::base64::encode(&self.commitment_data).as_str())?; ⋮---- "extraData" | "extra_data" => Ok(GeneratedField::ExtraData), "commitmentData" | "commitment_data" => Ok(GeneratedField::CommitmentData), ⋮---- type Value = GetValidatorSetMetadataResponse; ⋮---- formatter.write_str("struct api.proto.v1.GetValidatorSetMetadataResponse") ⋮---- fn visit_map(self, mut map_: V) -> std::result::Result ⋮---- if extra_data__.is_some() { return Err(serde::de::Error::duplicate_field("extraData")); ⋮---- extra_data__ = Some(map_.next_value()?); ⋮---- if commitment_data__.is_some() { return Err(serde::de::Error::duplicate_field("commitmentData")); ⋮---- Ok(GetValidatorSetMetadataResponse { extra_data: extra_data__.unwrap_or_default(), commitment_data: commitment_data__.unwrap_or_default(), ⋮---- deserializer.deserialize_struct("api.proto.v1.GetValidatorSetMetadataResponse", FIELDS, GeneratedVisitor) ⋮---- let mut struct_ser = serializer.serialize_struct("api.proto.v1.GetValidatorSetRequest", len)?; ⋮---- type Value = GetValidatorSetRequest; ⋮---- formatter.write_str("struct api.proto.v1.GetValidatorSetRequest") ⋮---- fn visit_map(self, mut map_: V) -> std::result::Result ⋮---- Ok(GetValidatorSetRequest { ⋮---- deserializer.deserialize_struct("api.proto.v1.GetValidatorSetRequest", FIELDS, GeneratedVisitor) ⋮---- if self.validator_set.is_some() { ⋮---- let mut struct_ser = serializer.serialize_struct("api.proto.v1.GetValidatorSetResponse", len)?; if let Some(v) = self.validator_set.as_ref() { struct_ser.serialize_field("validatorSet", v)?; ⋮---- "validatorSet" | "validator_set" => Ok(GeneratedField::ValidatorSet), ⋮---- type Value = GetValidatorSetResponse; ⋮---- formatter.write_str("struct api.proto.v1.GetValidatorSetResponse") ⋮---- fn visit_map(self, mut map_: V) -> std::result::Result ⋮---- if validator_set__.is_some() { return Err(serde::de::Error::duplicate_field("validatorSet")); ⋮---- validator_set__ = map_.next_value()?; ⋮---- Ok(GetValidatorSetResponse { ⋮---- deserializer.deserialize_struct("api.proto.v1.GetValidatorSetResponse", FIELDS, GeneratedVisitor) ⋮---- if !self.payload.is_empty() { ⋮---- let mut struct_ser = serializer.serialize_struct("api.proto.v1.Key", len)?; ⋮---- struct_ser.serialize_field("tag", &self.tag)?; ⋮---- struct_ser.serialize_field("payload", pbjson::private::base64::encode(&self.payload).as_str())?; ⋮---- "tag" => Ok(GeneratedField::Tag), "payload" => Ok(GeneratedField::Payload), ⋮---- type Value = Key; ⋮---- formatter.write_str("struct api.proto.v1.Key") ⋮---- fn visit_map(self, mut map_: V) -> std::result::Result ⋮---- if tag__.is_some() { return Err(serde::de::Error::duplicate_field("tag")); ⋮---- if payload__.is_some() { return Err(serde::de::Error::duplicate_field("payload")); ⋮---- Ok(Key { tag: tag__.unwrap_or_default(), payload: payload__.unwrap_or_default(), ⋮---- deserializer.deserialize_struct("api.proto.v1.Key", FIELDS, GeneratedVisitor) ⋮---- if self.start_epoch.is_some() { ⋮---- let mut struct_ser = serializer.serialize_struct("api.proto.v1.ListenProofsRequest", len)?; if let Some(v) = self.start_epoch.as_ref() { ⋮---- struct_ser.serialize_field("startEpoch", ToString::to_string(&v).as_str())?; ⋮---- "startEpoch" | "start_epoch" => Ok(GeneratedField::StartEpoch), ⋮---- type Value = ListenProofsRequest; ⋮---- formatter.write_str("struct api.proto.v1.ListenProofsRequest") ⋮---- fn visit_map(self, mut map_: V) -> std::result::Result ⋮---- if start_epoch__.is_some() { return Err(serde::de::Error::duplicate_field("startEpoch")); ⋮---- Ok(ListenProofsRequest { ⋮---- deserializer.deserialize_struct("api.proto.v1.ListenProofsRequest", FIELDS, GeneratedVisitor) ⋮---- let mut struct_ser = serializer.serialize_struct("api.proto.v1.ListenProofsResponse", len)?; ⋮---- type Value = ListenProofsResponse; ⋮---- formatter.write_str("struct api.proto.v1.ListenProofsResponse") ⋮---- fn visit_map(self, mut map_: V) -> std::result::Result ⋮---- Ok(ListenProofsResponse { ⋮---- deserializer.deserialize_struct("api.proto.v1.ListenProofsResponse", FIELDS, GeneratedVisitor) ⋮---- let mut struct_ser = serializer.serialize_struct("api.proto.v1.ListenSignaturesRequest", len)?; ⋮---- type Value = ListenSignaturesRequest; ⋮---- formatter.write_str("struct api.proto.v1.ListenSignaturesRequest") ⋮---- fn visit_map(self, mut map_: V) -> std::result::Result ⋮---- Ok(ListenSignaturesRequest { ⋮---- deserializer.deserialize_struct("api.proto.v1.ListenSignaturesRequest", FIELDS, GeneratedVisitor) ⋮---- if self.signature.is_some() { ⋮---- let mut struct_ser = serializer.serialize_struct("api.proto.v1.ListenSignaturesResponse", len)?; ⋮---- if let Some(v) = self.signature.as_ref() { struct_ser.serialize_field("signature", v)?; ⋮---- "signature" => Ok(GeneratedField::Signature), ⋮---- type Value = ListenSignaturesResponse; ⋮---- formatter.write_str("struct api.proto.v1.ListenSignaturesResponse") ⋮---- fn visit_map(self, mut map_: V) -> std::result::Result ⋮---- if signature__.is_some() { return Err(serde::de::Error::duplicate_field("signature")); ⋮---- signature__ = map_.next_value()?; ⋮---- Ok(ListenSignaturesResponse { ⋮---- deserializer.deserialize_struct("api.proto.v1.ListenSignaturesResponse", FIELDS, GeneratedVisitor) ⋮---- let mut struct_ser = serializer.serialize_struct("api.proto.v1.ListenValidatorSetRequest", len)?; ⋮---- type Value = ListenValidatorSetRequest; ⋮---- formatter.write_str("struct api.proto.v1.ListenValidatorSetRequest") ⋮---- fn visit_map(self, mut map_: V) -> std::result::Result ⋮---- Ok(ListenValidatorSetRequest { ⋮---- deserializer.deserialize_struct("api.proto.v1.ListenValidatorSetRequest", FIELDS, GeneratedVisitor) ⋮---- let mut struct_ser = serializer.serialize_struct("api.proto.v1.ListenValidatorSetResponse", len)?; ⋮---- type Value = ListenValidatorSetResponse; ⋮---- formatter.write_str("struct api.proto.v1.ListenValidatorSetResponse") ⋮---- fn visit_map(self, mut map_: V) -> std::result::Result ⋮---- Ok(ListenValidatorSetResponse { ⋮---- deserializer.deserialize_struct("api.proto.v1.ListenValidatorSetResponse", FIELDS, GeneratedVisitor) ⋮---- if !self.message.is_empty() { ⋮---- if self.required_epoch.is_some() { ⋮---- let mut struct_ser = serializer.serialize_struct("api.proto.v1.SignMessageRequest", len)?; ⋮---- struct_ser.serialize_field("message", pbjson::private::base64::encode(&self.message).as_str())?; ⋮---- if let Some(v) = self.required_epoch.as_ref() { ⋮---- struct_ser.serialize_field("requiredEpoch", ToString::to_string(&v).as_str())?; ⋮---- "message" => Ok(GeneratedField::Message), "requiredEpoch" | "required_epoch" => Ok(GeneratedField::RequiredEpoch), ⋮---- type Value = SignMessageRequest; ⋮---- formatter.write_str("struct api.proto.v1.SignMessageRequest") ⋮---- fn visit_map(self, mut map_: V) -> std::result::Result ⋮---- if message__.is_some() { return Err(serde::de::Error::duplicate_field("message")); ⋮---- if required_epoch__.is_some() { return Err(serde::de::Error::duplicate_field("requiredEpoch")); ⋮---- Ok(SignMessageRequest { ⋮---- message: message__.unwrap_or_default(), ⋮---- deserializer.deserialize_struct("api.proto.v1.SignMessageRequest", FIELDS, GeneratedVisitor) ⋮---- let mut struct_ser = serializer.serialize_struct("api.proto.v1.SignMessageResponse", len)?; ⋮---- type Value = SignMessageResponse; ⋮---- formatter.write_str("struct api.proto.v1.SignMessageResponse") ⋮---- fn visit_map(self, mut map_: V) -> std::result::Result ⋮---- Ok(SignMessageResponse { ⋮---- deserializer.deserialize_struct("api.proto.v1.SignMessageResponse", FIELDS, GeneratedVisitor) ⋮---- if !self.signature.is_empty() { ⋮---- if !self.public_key.is_empty() { ⋮---- let mut struct_ser = serializer.serialize_struct("api.proto.v1.Signature", len)?; ⋮---- struct_ser.serialize_field("signature", pbjson::private::base64::encode(&self.signature).as_str())?; ⋮---- struct_ser.serialize_field("publicKey", pbjson::private::base64::encode(&self.public_key).as_str())?; ⋮---- "publicKey" | "public_key" => Ok(GeneratedField::PublicKey), ⋮---- type Value = Signature; ⋮---- formatter.write_str("struct api.proto.v1.Signature") ⋮---- fn visit_map(self, mut map_: V) -> std::result::Result ⋮---- if public_key__.is_some() { return Err(serde::de::Error::duplicate_field("publicKey")); ⋮---- Ok(Signature { signature: signature__.unwrap_or_default(), ⋮---- public_key: public_key__.unwrap_or_default(), ⋮---- deserializer.deserialize_struct("api.proto.v1.Signature", FIELDS, GeneratedVisitor) ⋮---- let mut struct_ser = serializer.serialize_struct("api.proto.v1.SignatureRequest", len)?; ⋮---- struct_ser.serialize_field("requiredEpoch", ToString::to_string(&self.required_epoch).as_str())?; ⋮---- type Value = SignatureRequest; ⋮---- formatter.write_str("struct api.proto.v1.SignatureRequest") ⋮---- fn visit_map(self, mut map_: V) -> std::result::Result ⋮---- Ok(SignatureRequest { ⋮---- required_epoch: required_epoch__.unwrap_or_default(), ⋮---- deserializer.deserialize_struct("api.proto.v1.SignatureRequest", FIELDS, GeneratedVisitor) ⋮---- type Value = SigningStatus; ⋮---- "SIGNING_STATUS_UNSPECIFIED" => Ok(SigningStatus::Unspecified), "SIGNING_STATUS_PENDING" => Ok(SigningStatus::Pending), "SIGNING_STATUS_COMPLETED" => Ok(SigningStatus::Completed), "SIGNING_STATUS_FAILED" => Ok(SigningStatus::Failed), "SIGNING_STATUS_TIMEOUT" => Ok(SigningStatus::Timeout), ⋮---- if !self.operator.is_empty() { ⋮---- if !self.voting_power.is_empty() { ⋮---- if !self.keys.is_empty() { ⋮---- if !self.vaults.is_empty() { ⋮---- let mut struct_ser = serializer.serialize_struct("api.proto.v1.Validator", len)?; ⋮---- struct_ser.serialize_field("operator", &self.operator)?; ⋮---- struct_ser.serialize_field("votingPower", &self.voting_power)?; ⋮---- struct_ser.serialize_field("isActive", &self.is_active)?; ⋮---- struct_ser.serialize_field("keys", &self.keys)?; ⋮---- struct_ser.serialize_field("vaults", &self.vaults)?; ⋮---- "operator" => Ok(GeneratedField::Operator), "votingPower" | "voting_power" => Ok(GeneratedField::VotingPower), "isActive" | "is_active" => Ok(GeneratedField::IsActive), "keys" => Ok(GeneratedField::Keys), "vaults" => Ok(GeneratedField::Vaults), ⋮---- type Value = Validator; ⋮---- formatter.write_str("struct api.proto.v1.Validator") ⋮---- fn visit_map(self, mut map_: V) -> std::result::Result ⋮---- if operator__.is_some() { return Err(serde::de::Error::duplicate_field("operator")); ⋮---- operator__ = Some(map_.next_value()?); ⋮---- if voting_power__.is_some() { return Err(serde::de::Error::duplicate_field("votingPower")); ⋮---- voting_power__ = Some(map_.next_value()?); ⋮---- if is_active__.is_some() { return Err(serde::de::Error::duplicate_field("isActive")); ⋮---- is_active__ = Some(map_.next_value()?); ⋮---- if keys__.is_some() { return Err(serde::de::Error::duplicate_field("keys")); ⋮---- keys__ = Some(map_.next_value()?); ⋮---- if vaults__.is_some() { return Err(serde::de::Error::duplicate_field("vaults")); ⋮---- vaults__ = Some(map_.next_value()?); ⋮---- Ok(Validator { operator: operator__.unwrap_or_default(), voting_power: voting_power__.unwrap_or_default(), is_active: is_active__.unwrap_or_default(), keys: keys__.unwrap_or_default(), vaults: vaults__.unwrap_or_default(), ⋮---- deserializer.deserialize_struct("api.proto.v1.Validator", FIELDS, GeneratedVisitor) ⋮---- if !self.validators.is_empty() { ⋮---- let mut struct_ser = serializer.serialize_struct("api.proto.v1.ValidatorSet", len)?; ⋮---- .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.status)))?; struct_ser.serialize_field("status", &v)?; ⋮---- struct_ser.serialize_field("validators", &self.validators)?; ⋮---- "status" => Ok(GeneratedField::Status), "validators" => Ok(GeneratedField::Validators), ⋮---- type Value = ValidatorSet; ⋮---- formatter.write_str("struct api.proto.v1.ValidatorSet") ⋮---- fn visit_map(self, mut map_: V) -> std::result::Result ⋮---- if status__.is_some() { return Err(serde::de::Error::duplicate_field("status")); ⋮---- status__ = Some(map_.next_value::()? as i32); ⋮---- if validators__.is_some() { return Err(serde::de::Error::duplicate_field("validators")); ⋮---- validators__ = Some(map_.next_value()?); ⋮---- Ok(ValidatorSet { ⋮---- status: status__.unwrap_or_default(), validators: validators__.unwrap_or_default(), ⋮---- deserializer.deserialize_struct("api.proto.v1.ValidatorSet", FIELDS, GeneratedVisitor) ⋮---- type Value = ValidatorSetStatus; ⋮---- "VALIDATOR_SET_STATUS_UNSPECIFIED" => Ok(ValidatorSetStatus::Unspecified), "VALIDATOR_SET_STATUS_DERIVED" => Ok(ValidatorSetStatus::Derived), "VALIDATOR_SET_STATUS_AGGREGATED" => Ok(ValidatorSetStatus::Aggregated), "VALIDATOR_SET_STATUS_COMMITTED" => Ok(ValidatorSetStatus::Committed), "VALIDATOR_SET_STATUS_MISSED" => Ok(ValidatorSetStatus::Missed), ⋮---- if !self.vault.is_empty() { ⋮---- let mut struct_ser = serializer.serialize_struct("api.proto.v1.ValidatorVault", len)?; ⋮---- struct_ser.serialize_field("chainId", ToString::to_string(&self.chain_id).as_str())?; ⋮---- struct_ser.serialize_field("vault", &self.vault)?; ⋮---- "chainId" | "chain_id" => Ok(GeneratedField::ChainId), "vault" => Ok(GeneratedField::Vault), ⋮---- type Value = ValidatorVault; ⋮---- formatter.write_str("struct api.proto.v1.ValidatorVault") ⋮---- fn visit_map(self, mut map_: V) -> std::result::Result ⋮---- if chain_id__.is_some() { return Err(serde::de::Error::duplicate_field("chainId")); ⋮---- if vault__.is_some() { return Err(serde::de::Error::duplicate_field("vault")); ⋮---- vault__ = Some(map_.next_value()?); ⋮---- Ok(ValidatorVault { chain_id: chain_id__.unwrap_or_default(), vault: vault__.unwrap_or_default(), ⋮---- deserializer.deserialize_struct("api.proto.v1.ValidatorVault", FIELDS, GeneratedVisitor) ```` ## File: src/generated/api.proto.v1.tonic.rs ````rust // @generated /// Generated client implementations. pub mod symbiotic_api_service_client { ⋮---- pub mod symbiotic_api_service_client { ⋮---- use tonic::codegen::http::Uri; ⋮---- pub struct SymbioticApiServiceClient { ⋮---- /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result ⋮---- pub async fn connect(dst: D) -> Result ⋮---- let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; Ok(Self::new(conn)) ⋮---- pub fn new(inner: T) -> Self { ⋮---- pub fn with_origin(inner: T, origin: Uri) -> Self { ⋮---- pub fn with_interceptor( ⋮---- /// Compress requests with the given encoding. /// ⋮---- /// /// This requires the server to support it otherwise it might respond with an ⋮---- /// This requires the server to support it otherwise it might respond with an /// error. ⋮---- /// error. #[must_use] pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { self.inner = self.inner.send_compressed(encoding); ⋮---- /// Enable decompressing responses. #[must_use] pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { self.inner = self.inner.accept_compressed(encoding); ⋮---- /// Limits the maximum size of a decoded message. /// ⋮---- /// /// Default: `4MB` ⋮---- /// Default: `4MB` #[must_use] pub fn max_decoding_message_size(mut self, limit: usize) -> Self { self.inner = self.inner.max_decoding_message_size(limit); ⋮---- /// Limits the maximum size of an encoded message. /// ⋮---- /// /// Default: `usize::MAX` ⋮---- /// Default: `usize::MAX` #[must_use] pub fn max_encoding_message_size(mut self, limit: usize) -> Self { self.inner = self.inner.max_encoding_message_size(limit); ⋮---- pub async fn sign_message( ⋮---- .ready() ⋮---- .map_err(|e| { ⋮---- format!("Service was not ready: {}", e.into()), ⋮---- let mut req = request.into_request(); req.extensions_mut() .insert( ⋮---- self.inner.unary(req, path, codec).await ⋮---- pub async fn get_aggregation_proof( ⋮---- pub async fn get_aggregation_proofs_by_epoch( ⋮---- pub async fn get_current_epoch( ⋮---- pub async fn get_signatures( ⋮---- pub async fn get_signatures_by_epoch( ⋮---- pub async fn get_signature_request_i_ds_by_epoch( ⋮---- pub async fn get_signature_requests_by_epoch( ⋮---- pub async fn get_signature_request( ⋮---- pub async fn get_aggregation_status( ⋮---- pub async fn get_validator_set( ⋮---- pub async fn get_validator_by_address( ⋮---- pub async fn get_validator_by_key( ⋮---- pub async fn get_local_validator( ⋮---- pub async fn get_validator_set_header( ⋮---- pub async fn get_last_committed( ⋮---- pub async fn get_last_all_committed( ⋮---- pub async fn get_validator_set_metadata( ⋮---- pub async fn listen_signatures( ⋮---- self.inner.server_streaming(req, path, codec).await ⋮---- pub async fn listen_proofs( ⋮---- pub async fn listen_validator_set( ```` ## File: src/generated/mod.rs ````rust //! Generated gRPC client code from protocol buffer definitions. //! ⋮---- //! //! This module contains the auto-generated Rust code from the protocol buffer ⋮---- //! This module contains the auto-generated Rust code from the protocol buffer //! definitions for the Symbiotic Relay API. ⋮---- //! definitions for the Symbiotic Relay API. pub mod api { pub mod proto { pub mod v1 { // Include the generated prost types and client code include!("api.proto.v1.rs"); ```` ## File: src/lib.rs ````rust //! Rust gRPC client library for Symbiotic Relay //! ⋮---- //! //! This library provides a client interface to communicate with Symbiotic Relay servers ⋮---- //! This library provides a client interface to communicate with Symbiotic Relay servers //! using gRPC. It includes auto-generated client code from protocol buffer definitions. ⋮---- //! using gRPC. It includes auto-generated client code from protocol buffer definitions. //! ⋮---- //! //! # Usage ⋮---- //! # Usage //! ⋮---- //! //! ```rust,no_run ⋮---- //! ```rust,no_run //! use symbiotic_relay_client::generated::api::proto::v1::symbiotic_api_service_client::SymbioticApiServiceClient; ⋮---- //! use symbiotic_relay_client::generated::api::proto::v1::symbiotic_api_service_client::SymbioticApiServiceClient; //! use tonic::transport::Endpoint; ⋮---- //! use tonic::transport::Endpoint; //! ⋮---- //! //! #[tokio::main] ⋮---- //! #[tokio::main] //! async fn main() -> Result<(), Box> { ⋮---- //! async fn main() -> Result<(), Box> { //! let endpoint = Endpoint::from_shared("http://localhost:8080")?; ⋮---- //! let endpoint = Endpoint::from_shared("http://localhost:8080")?; //! let channel = endpoint.connect().await?; ⋮---- //! let channel = endpoint.connect().await?; //! let client = SymbioticApiServiceClient::new(channel); ⋮---- //! let client = SymbioticApiServiceClient::new(channel); //! // Use the client... ⋮---- //! // Use the client... //! Ok(()) ⋮---- //! Ok(()) //! } ⋮---- //! } //! ``` ⋮---- //! ``` pub mod generated; ⋮---- // Re-export commonly used types for convenience ```` ## File: .gitignore ```` target api Cargo.lock .DS_Store .idea ```` ## File: buf.gen.yaml ````yaml version: v2 inputs: - directory: . managed: enabled: true plugins: - remote: buf.build/community/neoeinstein-prost:v0.4.0 out: src/generated opt: - compile_well_known_types - extern_path=.google.protobuf=::pbjson_types - file_descriptor_set - enable_type_names - bytes=. - remote: buf.build/community/neoeinstein-tonic:v0.4.1 out: src/generated opt: - no_server - compile_well_known_types - extern_path=.google.protobuf=::pbjson_types - remote: buf.build/community/neoeinstein-prost-serde:v0.3.1 out: src/generated ```` ## File: buf.lock ```` # Generated by buf. DO NOT EDIT. version: v2 deps: - name: buf.build/googleapis/googleapis commit: 72c8614f3bd0466ea67931ef2c43d608 digest: b5:13efeea24e633fd45327390bdee941207a8727e96cf01affb84c1e4100fd8f48a42bbd508df11930cd2884629bafad685df1ac3111bc78cdaefcd38c9371c6b1 ```` ## File: buf.yaml ````yaml version: v2 modules: - path: . deps: - buf.build/googleapis/googleapis ```` ## File: Cargo.toml ````toml [package] name = "symbiotic-relay-client" version = "0.2.0" edition = "2024" authors = ["Symbiotic Team "] description = "Rust gRPC client for Symbiotic Relay" license = "MIT" repository = "https://github.com/symbioticfi/relay-client-rs" homepage = "https://github.com/symbioticfi/relay-client-rs" documentation = "https://docs.rs/symbiotic-relay-client" readme = "README.md" keywords = ["grpc", "symbiotic", "relay", "client", "blockchain"] categories = [ "api-bindings", "network-programming", "cryptography::cryptocurrencies", ] exclude = ["examples/"] [lib] path = "src/lib.rs" [dependencies] tonic = { version = "0.12", features = ["transport"] } prost = "0.13" prost-types = "0.13" tokio = { version = "1", features = ["macros", "rt-multi-thread"] } http = "1.3.1" serde = { version = "1.0", features = ["derive"] } pbjson = "0.7" pbjson-types = "0.7" ```` ## File: LICENSE ```` MIT License Copyright (c) 2025 Symbiotic Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ```` ## File: README.md ````markdown # Symbiotic Relay Client (Rust) Rust gRPC client for the Symbiotic Relay. Code is generated with buf using prost + tonic. Generated modules live under `crate::generated`. # Installation Add this to your `Cargo.toml`: ```toml [dependencies] symbiotic-relay-client = "0.3.0" ``` ## Using Development/Nightly Versions If you want to use the latest development version instead of a stable release, you can use a git dependency: ```toml [dependencies] symbiotic-relay-client = { git = "https://github.com/symbioticfi/relay-client-rs", rev = "9f35b8e" } ``` Replace `9f35b8e` with the specific commit hash you want to use. You can also use: - `branch = "main"` for the latest main branch - `tag = "v0.3.0"` for a specific release tag # Usage ```rust use symbiotic_relay_client::generated::api::proto::v1::symbiotic_api_service_client::SymbioticApiServiceClient; use tonic::transport::Endpoint; #[tokio::main] async fn main() -> Result<(), Box> { let channel = Endpoint::from_shared("http://localhost:8080")?.connect().await?; let mut client = SymbioticApiServiceClient::new(channel); // Use the client; e.g. see examples for requests and streaming usage Ok(()) } ``` For more usage (requests, streaming, helpers), see `examples/basic_usage.rs` in the [examples](./examples) directory. # Development Run scripts/update-proto.sh to fetch upstream proto and regenerate; run cargo build to compile. ```` --- ## Symbiotic Super Sum This file is a merged representation of the entire codebase, combined into a single document by Repomix. The content has been processed where content has been compressed (code blocks are separated by ⋮---- delimiter). # File Summary ## Purpose This file contains a packed representation of the entire repository's contents. It is designed to be easily consumable by AI systems for analysis, code review, or other automated processes. ## File Format The content is organized as follows: 1. This summary section 2. Repository information 3. Directory structure 4. Repository files (if enabled) 5. Multiple file entries, each consisting of: a. A header with the file path (## File: path/to/file) b. The full contents of the file in a code block ## Usage Guidelines - This file should be treated as read-only. Any changes should be made to the original repository files, not this packed version. - When processing this file, use the file path to distinguish between different files in the repository. - Be aware that this file may contain sensitive information. Handle it with the same level of security as you would the original repository. ## Notes - Some files may have been excluded based on .gitignore rules and Repomix's configuration - Binary files are not included in this packed representation. Please refer to the Repository Structure section for a complete list of file paths, including binary files - Files matching patterns in .gitignore are excluded - Files matching default ignore patterns are excluded - Content has been compressed - code blocks are separated by ⋮---- delimiter - Files are sorted by Git change count (files with more changes are at the bottom) # Directory Structure ``` .github/ ISSUE_TEMPLATE/ BUG_REPORT.yaml FEATURE_IMPROVEMENT.yaml workflows/ pre-commit.yaml test.yaml trufflehog.yml CODEOWNERS PULL_REQUEST_TEMPLATE.md network-scripts/ deploy.sh deployer.Dockerfile genesis-generator.sh sidecar-start.sh sum-node-start.sh off-chain/ abis/ SumTask.abi.json cmd/ benchmark/ main.go node/ main.go internal/ contracts/ sumTask.go utils/ util.go .dockerignore Dockerfile go.mod script/ mocks/ MockERC20.sol utils/ BN254G2.sol sort_errors.py sort_imports.py my-relay-deploy.toml MyRelayDeploy.sol snapshots/ gas.txt sizes.txt src/ symbiotic/ Driver.sol KeyRegistry.sol Settlement.sol VotingPowers.sol SumTask.sol test/ mock/ SettlementMock.sol SumTask.t.sol .gitignore .gitmodules .pre-commit-config.yaml .prettierignore .prettierrc CONTRIBUTING.md foundry.lock foundry.toml generate_network.sh package.json README.md remappings.txt ``` # Files ## File: .github/ISSUE_TEMPLATE/BUG_REPORT.yaml ````yaml name: Bug report description: File a bug report to help us improve the code title: "[Bug]: " labels: ["bug"] body: - type: markdown attributes: value: | Please check that the bug is not already being tracked. - type: textarea attributes: label: Describe the bug description: Provide a clear and concise description of what the bug is and which contracts it affects. validations: required: true - type: textarea attributes: label: Expected Behavior description: Provide a clear and concise description of the desired fix. validations: required: true - type: textarea attributes: label: To Reproduce description: If you have written tests to showcase the bug, what can we run to reproduce the issue? placeholder: "git checkout / forge test --isolate --mt " - type: textarea attributes: label: Additional context description: If there is any additional context needed like a dependency or integrating contract that is affected please describe it below. ```` ## File: .github/ISSUE_TEMPLATE/FEATURE_IMPROVEMENT.yaml ````yaml name: Feature Improvement description: Suggest an improvement. labels: ["triage"] body: - type: markdown attributes: value: | Please ensure that the feature has not already been requested. - type: dropdown attributes: label: Component description: Which area of code does your idea improve? multiple: true options: - Gas Optimization - General design optimization (improving efficiency, cleanliness, or developer experience) - Testing - Documentation - type: textarea attributes: label: Describe the suggested feature and problem it solves. description: Provide a clear and concise description of what feature you would like to see, and what problems it solves. validations: required: true - type: textarea attributes: label: Describe the desired implementation. description: If possible, provide a suggested architecture change or implementation. - type: textarea attributes: label: Describe alternatives. description: If possible, describe the alternatives you've considered, or describe the current functionality and how it may be sub-optimal. - type: textarea attributes: label: Additional context. description: Please list any additional dependencies or integrating contacts that are affected. ```` ## File: .github/workflows/pre-commit.yaml ````yaml # checks that pre-commit hooks pass before allowing to merge a PR name: pre-commit on: pull_request: branches: [main, master, staging, dev, feat/**, fix/**] concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true env: FOUNDRY_PROFILE: ${{ github.event_name == 'push' && 'ci' || 'pr' }} ETH_RPC_URL: ${{ secrets.ETH_RPC_URL }} jobs: pre-commit: runs-on: ubuntu-latest timeout-minutes: 45 steps: - uses: bullfrogsec/bullfrog@1831f79cce8ad602eef14d2163873f27081ebfb3 # v0.8.4 - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: submodules: recursive - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: "3.11" - name: Install Foundry uses: foundry-rs/foundry-toolchain@82dee4ba654bd2146511f85f0d013af94670c4de # v1.4.0 with: version: stable - name: Install dependencies run: npm install - name: Install pre-commit run: python -m pip install --upgrade pip pre-commit - name: Run pre-commit run: pre-commit run --all-files --color always --show-diff-on-failure env: SKIP: forge-snapshots ```` ## File: .github/workflows/test.yaml ````yaml name: test on: pull_request: branches: [main, master, staging, dev, feat/**, fix/**] push: branches: [main, master, staging, dev] concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true env: FOUNDRY_PROFILE: ${{ github.event_name == 'push' && 'ci' || 'pr' }} ETH_RPC_URL: ${{ secrets.ETH_RPC_URL }} jobs: forge-test: name: Foundry project runs-on: ubuntu-latest timeout-minutes: 45 steps: - uses: bullfrogsec/bullfrog@1831f79cce8ad602eef14d2163873f27081ebfb3 # v0.8.4 - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: submodules: recursive - name: Install Foundry uses: foundry-rs/foundry-toolchain@82dee4ba654bd2146511f85f0d013af94670c4de # v1.4.0 with: version: stable - name: Install npm dependencies run: npm install - name: Run Forge fmt check run: forge fmt --check - name: Run Forge tests run: forge test --isolate ```` ## File: .github/workflows/trufflehog.yml ````yaml name: TruffleHog on: pull_request: types: [opened, synchronize, reopened] permissions: contents: read pull-requests: write id-token: write issues: write concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: scan: runs-on: ubuntu-latest timeout-minutes: 15 steps: - uses: bullfrogsec/bullfrog@1831f79cce8ad602eef14d2163873f27081ebfb3 # v0.8.4 - name: Checkout code uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: fetch-depth: 0 - name: TruffleHog OSS id: trufflehog uses: trufflesecurity/trufflehog@0f58ae7c5036094a1e3e750d18772af92821b503 # v3.90.5 with: path: . base: ${{ github.event.pull_request.base.sha }} head: ${{ github.event.pull_request.head.sha }} extra_args: --results=verified,unknown ```` ## File: .github/CODEOWNERS ```` * @symbioticfi/contracts * @symbioticfi/relay ```` ## File: .github/PULL_REQUEST_TEMPLATE.md ````markdown # Pull Request ## Description Please include a summary of the change and which feature was implemented or which issue was fixed. Also, include relevant motivation and context. List any dependencies that are required for this change. Fixes # (issue) ### How Has This Been Tested? Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration. # Checklist: - [ ] 100% test and branch coverage - [ ] check slither or other analyzer for severe issues - [ ] fuzz and invariant tests (when applicable) --- ### Considerations - I have followed the [contributing guidelines](../CONTRIBUTING.md). - My code follows the style guidelines of this project and I have run `forge fmt` and prettier to ensure the code style is valid - I have performed a self-review of my own code - I have commented my code, particularly in hard-to-understand areas - I have made corresponding changes to the documentation - I have added tests that prove my fix is effective or that my feature works - New and existing unit tests pass locally with my changes ### Additional context Add any other context about the pull request here. ```` ## File: network-scripts/deploy.sh ````bash #!/bin/sh set -e ANVIL_RPC_URL=${ANVIL_RPC_URL:-http://anvil:8545} SETTLEMENT_RPC_URL=${SETTLEMENT_RPC_URL:-http://anvil-settlement:8546} MULTICALL_ADDRESS=0x05f32b3cc3888453ff71b01135b34ff8e41263f2 MULTICALL_BALANCE_HEX=0xde0b6b3a7640000 # 1 ether echo "Waiting for anvil to be ready..." until cast client --rpc-url "$ANVIL_RPC_URL" > /dev/null 2>&1; do sleep 1; done until cast client --rpc-url "$SETTLEMENT_RPC_URL" > /dev/null 2>&1; do sleep 1; done echo "Deploying Multicall3 contracts..." cast rpc --rpc-url "$ANVIL_RPC_URL" anvil_setBalance "$MULTICALL_ADDRESS" "$MULTICALL_BALANCE_HEX" cast rpc --rpc-url "$ANVIL_RPC_URL" anvil_setNonce "$MULTICALL_ADDRESS" 0x0 cast publish 0xf90f538085174876e800830f42408080b90f00608060405234801561001057600080fd5b50610ee0806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e1461025a578063bce38bd714610275578063c3077fa914610288578063ee82ac5e1461029b57600080fd5b80634d2301cc146101ec57806372425d9d1461022157806382ad56cb1461023457806386d516e81461024757600080fd5b80633408e470116100c65780633408e47014610191578063399542e9146101a45780633e64a696146101c657806342cbb15c146101d957600080fd5b80630f28c97d146100f8578063174dea711461011a578063252dba421461013a57806327e86d6e1461015b575b600080fd5b34801561010457600080fd5b50425b6040519081526020015b60405180910390f35b61012d610128366004610a85565b6102ba565b6040516101119190610bbe565b61014d610148366004610a85565b6104ef565b604051610111929190610bd8565b34801561016757600080fd5b50437fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0140610107565b34801561019d57600080fd5b5046610107565b6101b76101b2366004610c60565b610690565b60405161011193929190610cba565b3480156101d257600080fd5b5048610107565b3480156101e557600080fd5b5043610107565b3480156101f857600080fd5b50610107610207366004610ce2565b73ffffffffffffffffffffffffffffffffffffffff163190565b34801561022d57600080fd5b5044610107565b61012d610242366004610a85565b6106ab565b34801561025357600080fd5b5045610107565b34801561026657600080fd5b50604051418152602001610111565b61012d610283366004610c60565b61085a565b6101b7610296366004610a85565b610a1a565b3480156102a757600080fd5b506101076102b6366004610d18565b4090565b60606000828067ffffffffffffffff8111156102d8576102d8610d31565b60405190808252806020026020018201604052801561031e57816020015b6040805180820190915260008152606060208201528152602001906001900390816102f65790505b5092503660005b8281101561047757600085828151811061034157610341610d60565b6020026020010151905087878381811061035d5761035d610d60565b905060200281019061036f9190610d8f565b6040810135958601959093506103886020850185610ce2565b73ffffffffffffffffffffffffffffffffffffffff16816103ac6060870187610dcd565b6040516103ba929190610e32565b60006040518083038185875af1925050503d80600081146103f7576040519150601f19603f3d011682016040523d82523d6000602084013e6103fc565b606091505b50602080850191909152901515808452908501351761046d577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b5050600101610325565b508234146104e6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f4d756c746963616c6c333a2076616c7565206d69736d6174636800000000000060448201526064015b60405180910390fd5b50505092915050565b436060828067ffffffffffffffff81111561050c5761050c610d31565b60405190808252806020026020018201604052801561053f57816020015b606081526020019060019003908161052a5790505b5091503660005b8281101561068657600087878381811061056257610562610d60565b90506020028101906105749190610e42565b92506105836020840184610ce2565b73ffffffffffffffffffffffffffffffffffffffff166105a66020850185610dcd565b6040516105b4929190610e32565b6000604051808303816000865af19150503d80600081146105f1576040519150601f19603f3d011682016040523d82523d6000602084013e6105f6565b606091505b5086848151811061060957610609610d60565b602090810291909101015290508061067d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060448201526064016104dd565b50600101610546565b5050509250929050565b43804060606106a086868661085a565b905093509350939050565b6060818067ffffffffffffffff8111156106c7576106c7610d31565b60405190808252806020026020018201604052801561070d57816020015b6040805180820190915260008152606060208201528152602001906001900390816106e55790505b5091503660005b828110156104e657600084828151811061073057610730610d60565b6020026020010151905086868381811061074c5761074c610d60565b905060200281019061075e9190610e76565b925061076d6020840184610ce2565b73ffffffffffffffffffffffffffffffffffffffff166107906040850185610dcd565b60405161079e929190610e32565b6000604051808303816000865af19150503d80600081146107db576040519150601f19603f3d011682016040523d82523d6000602084013e6107e0565b606091505b506020808401919091529015158083529084013517610851577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b50600101610714565b6060818067ffffffffffffffff81111561087657610876610d31565b6040519080825280602002602001820160405280156108bc57816020015b6040805180820190915260008152606060208201528152602001906001900390816108945790505b5091503660005b82811015610a105760008482815181106108df576108df610d60565b602002602001015190508686838181106108fb576108fb610d60565b905060200281019061090d9190610e42565b925061091c6020840184610ce2565b73ffffffffffffffffffffffffffffffffffffffff1661093f6020850185610dcd565b60405161094d929190610e32565b6000604051808303816000865af19150503d806000811461098a576040519150601f19603f3d011682016040523d82523d6000602084013e61098f565b606091505b506020830152151581528715610a07578051610a07576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060448201526064016104dd565b506001016108c3565b5050509392505050565b6000806060610a2b60018686610690565b919790965090945092505050565b60008083601f840112610a4b57600080fd5b50813567ffffffffffffffff811115610a6357600080fd5b6020830191508360208260051b8501011115610a7e57600080fd5b9250929050565b60008060208385031215610a9857600080fd5b823567ffffffffffffffff811115610aaf57600080fd5b610abb85828601610a39565b90969095509350505050565b6000815180845260005b81811015610aed57602081850181015186830182015201610ad1565b81811115610aff576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015610bb1578583037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001895281518051151584528401516040858501819052610b9d81860183610ac7565b9a86019a9450505090830190600101610b4f565b5090979650505050505050565b602081526000610bd16020830184610b32565b9392505050565b600060408201848352602060408185015281855180845260608601915060608160051b870101935082870160005b82811015610c52577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa0888703018452610c40868351610ac7565b95509284019290840190600101610c06565b509398975050505050505050565b600080600060408486031215610c7557600080fd5b83358015158114610c8557600080fd5b9250602084013567ffffffffffffffff811115610ca157600080fd5b610cad86828701610a39565b9497909650939450505050565b838152826020820152606060408201526000610cd96060830184610b32565b95945050505050565b600060208284031215610cf457600080fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114610bd157600080fd5b600060208284031215610d2a57600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81833603018112610dc357600080fd5b9190910192915050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112610e0257600080fd5b83018035915067ffffffffffffffff821115610e1d57600080fd5b602001915036819003821315610a7e57600080fd5b8183823760009101908152919050565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc1833603018112610dc357600080fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa1833603018112610dc357600080fdfea2646970667358221220bb2b5c71a328032f97c676ae39a1ec2148d3e5d6f73d95e9b17910152d61f16264736f6c634300080c00331ca0edce47092c0f398cebf3ffc267f05c8e7076e3b89445e0fe50f6332273d4569ba01b0b9d000e19b24c5869b0fc3b22b0d6fa47cd63316875cbbd577d76e6fde086 --rpc-url "$ANVIL_RPC_URL" cast rpc --rpc-url "$SETTLEMENT_RPC_URL" anvil_setBalance "$MULTICALL_ADDRESS" "$MULTICALL_BALANCE_HEX" cast rpc --rpc-url "$SETTLEMENT_RPC_URL" anvil_setNonce "$MULTICALL_ADDRESS" 0x0 cast publish 0xf90f538085174876e800830f42408080b90f00608060405234801561001057600080fd5b50610ee0806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e1461025a578063bce38bd714610275578063c3077fa914610288578063ee82ac5e1461029b57600080fd5b80634d2301cc146101ec57806372425d9d1461022157806382ad56cb1461023457806386d516e81461024757600080fd5b80633408e470116100c65780633408e47014610191578063399542e9146101a45780633e64a696146101c657806342cbb15c146101d957600080fd5b80630f28c97d146100f8578063174dea711461011a578063252dba421461013a57806327e86d6e1461015b575b600080fd5b34801561010457600080fd5b50425b6040519081526020015b60405180910390f35b61012d610128366004610a85565b6102ba565b6040516101119190610bbe565b61014d610148366004610a85565b6104ef565b604051610111929190610bd8565b34801561016757600080fd5b50437fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0140610107565b34801561019d57600080fd5b5046610107565b6101b76101b2366004610c60565b610690565b60405161011193929190610cba565b3480156101d257600080fd5b5048610107565b3480156101e557600080fd5b5043610107565b3480156101f857600080fd5b50610107610207366004610ce2565b73ffffffffffffffffffffffffffffffffffffffff163190565b34801561022d57600080fd5b5044610107565b61012d610242366004610a85565b6106ab565b34801561025357600080fd5b5045610107565b34801561026657600080fd5b50604051418152602001610111565b61012d610283366004610c60565b61085a565b6101b7610296366004610a85565b610a1a565b3480156102a757600080fd5b506101076102b6366004610d18565b4090565b60606000828067ffffffffffffffff8111156102d8576102d8610d31565b60405190808252806020026020018201604052801561031e57816020015b6040805180820190915260008152606060208201528152602001906001900390816102f65790505b5092503660005b8281101561047757600085828151811061034157610341610d60565b6020026020010151905087878381811061035d5761035d610d60565b905060200281019061036f9190610d8f565b6040810135958601959093506103886020850185610ce2565b73ffffffffffffffffffffffffffffffffffffffff16816103ac6060870187610dcd565b6040516103ba929190610e32565b60006040518083038185875af1925050503d80600081146103f7576040519150601f19603f3d011682016040523d82523d6000602084013e6103fc565b606091505b50602080850191909152901515808452908501351761046d577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b5050600101610325565b508234146104e6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f4d756c746963616c6c333a2076616c7565206d69736d6174636800000000000060448201526064015b60405180910390fd5b50505092915050565b436060828067ffffffffffffffff81111561050c5761050c610d31565b60405190808252806020026020018201604052801561053f57816020015b606081526020019060019003908161052a5790505b5091503660005b8281101561068657600087878381811061056257610562610d60565b90506020028101906105749190610e42565b92506105836020840184610ce2565b73ffffffffffffffffffffffffffffffffffffffff166105a66020850185610dcd565b6040516105b4929190610e32565b6000604051808303816000865af19150503d80600081146105f1576040519150601f19603f3d011682016040523d82523d6000602084013e6105f6565b606091505b5086848151811061060957610609610d60565b602090810291909101015290508061067d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060448201526064016104dd565b50600101610546565b5050509250929050565b43804060606106a086868661085a565b905093509350939050565b6060818067ffffffffffffffff8111156106c7576106c7610d31565b60405190808252806020026020018201604052801561070d57816020015b6040805180820190915260008152606060208201528152602001906001900390816106e55790505b5091503660005b828110156104e657600084828151811061073057610730610d60565b6020026020010151905086868381811061074c5761074c610d60565b905060200281019061075e9190610e76565b925061076d6020840184610ce2565b73ffffffffffffffffffffffffffffffffffffffff166107906040850185610dcd565b60405161079e929190610e32565b6000604051808303816000865af19150503d80600081146107db576040519150601f19603f3d011682016040523d82523d6000602084013e6107e0565b606091505b506020808401919091529015158083529084013517610851577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b50600101610714565b6060818067ffffffffffffffff81111561087657610876610d31565b6040519080825280602002602001820160405280156108bc57816020015b6040805180820190915260008152606060208201528152602001906001900390816108945790505b5091503660005b82811015610a105760008482815181106108df576108df610d60565b602002602001015190508686838181106108fb576108fb610d60565b905060200281019061090d9190610e42565b925061091c6020840184610ce2565b73ffffffffffffffffffffffffffffffffffffffff1661093f6020850185610dcd565b60405161094d929190610e32565b6000604051808303816000865af19150503d806000811461098a576040519150601f19603f3d011682016040523d82523d6000602084013e61098f565b606091505b506020830152151581528715610a07578051610a07576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060448201526064016104dd565b506001016108c3565b5050509392505050565b6000806060610a2b60018686610690565b919790965090945092505050565b60008083601f840112610a4b57600080fd5b50813567ffffffffffffffff811115610a6357600080fd5b6020830191508360208260051b8501011115610a7e57600080fd5b9250929050565b60008060208385031215610a9857600080fd5b823567ffffffffffffffff811115610aaf57600080fd5b610abb85828601610a39565b90969095509350505050565b6000815180845260005b81811015610aed57602081850181015186830182015201610ad1565b81811115610aff576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015610bb1578583037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001895281518051151584528401516040858501819052610b9d81860183610ac7565b9a86019a9450505090830190600101610b4f565b5090979650505050505050565b602081526000610bd16020830184610b32565b9392505050565b600060408201848352602060408185015281855180845260608601915060608160051b870101935082870160005b82811015610c52577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa0888703018452610c40868351610ac7565b95509284019290840190600101610c06565b509398975050505050505050565b600080600060408486031215610c7557600080fd5b83358015158114610c8557600080fd5b9250602084013567ffffffffffffffff811115610ca157600080fd5b610cad86828701610a39565b9497909650939450505050565b838152826020820152606060408201526000610cd96060830184610b32565b95945050505050565b600060208284031215610cf457600080fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114610bd157600080fd5b600060208284031215610d2a57600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81833603018112610dc357600080fd5b9190910192915050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112610e0257600080fd5b83018035915067ffffffffffffffff821115610e1d57600080fd5b602001915036819003821315610a7e57600080fd5b8183823760009101908152919050565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc1833603018112610dc357600080fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa1833603018112610dc357600080fdfea2646970667358221220bb2b5c71a328032f97c676ae39a1ec2148d3e5d6f73d95e9b17910152d61f16264736f6c634300080c00331ca0edce47092c0f398cebf3ffc267f05c8e7076e3b89445e0fe50f6332273d4569ba01b0b9d000e19b24c5869b0fc3b22b0d6fa47cd63316875cbbd577d76e6fde086 --rpc-url "$SETTLEMENT_RPC_URL" echo "Deploying contracts..." ./node_modules/@symbioticfi/relay-contracts/script/relay-deploy.sh script/MyRelayDeploy.sol script/my-relay-deploy.toml --broadcast --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 -vvvvv echo 'Waiting for deployment completion...' until [ -f /deploy-data/deployment-completed.json ]; do sleep 2; done echo "Setting interval mining..." cast rpc --rpc-url "$ANVIL_RPC_URL" evm_setIntervalMining 1 cast rpc --rpc-url "$SETTLEMENT_RPC_URL" evm_setIntervalMining 1 echo "Mine a single block to finalize the deployment..." cast rpc --rpc-url "$ANVIL_RPC_URL" evm_mine cast rpc --rpc-url "$SETTLEMENT_RPC_URL" evm_mine echo "Deployment completed successfully!" # Create deployment completion marker echo "$(date): Deployment completed successfully" > /deploy-data/deployment-complete.marker echo "Deployment completion marker created" ```` ## File: network-scripts/deployer.Dockerfile ````dockerfile FROM ghcr.io/foundry-rs/foundry:v1.4.3 USER root # Install Python (needed by relay deployment helper scripts) together with tomli fallback. RUN set -eux; \ if command -v apt-get >/dev/null 2>&1; then \ apt-get update; \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ python3 \ python3-venv \ python3-pip; \ rm -rf /var/lib/apt/lists/*; \ elif command -v apk >/dev/null 2>&1; then \ apk add --no-cache \ python3 \ py3-virtualenv \ py3-pip; \ else \ echo "Unable to determine package manager for Python installation." >&2; \ exit 1; \ fi; \ python3 -m pip install --no-cache-dir tomli; \ python3 --version USER foundry ```` ## File: network-scripts/genesis-generator.sh ````bash #!/bin/sh echo 'Waiting for deployment completion...' until [ -f /deploy-data/deployment-complete.marker ]; do sleep 2; done DRIVER_ADDRESS=0x43C27243F96591892976FFf886511807B65a33d5 MAX_RETRIES=50 RETRY_DELAY=2 attempt=1 while [ $attempt -le $MAX_RETRIES ]; do echo "Attempt $attempt of $MAX_RETRIES: Generating network genesis..." if /app/relay_utils network \ --chains http://anvil:8545,http://anvil-settlement:8546 \ --driver.address "$DRIVER_ADDRESS" \ --driver.chainid 31337 \ generate-genesis \ --commit \ --secret-keys 31337:0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80,31338:0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80; then echo 'Genesis generation completed successfully!' # Create genesis completion marker echo "$(date): Genesis generation completed successfully" > /deploy-data/genesis-complete.marker echo "Genesis completion marker created" echo "Waiting few seconds before exiting..." sleep 5 exit 0 else echo "Genesis generation failed on attempt $attempt" if [ $attempt -lt $MAX_RETRIES ]; then echo "Waiting $RETRY_DELAY seconds before retry..." sleep $RETRY_DELAY else echo "All $MAX_RETRIES attempts failed. Exiting with error." exit 1 fi attempt=$((attempt + 1)) fi done ```` ## File: network-scripts/sidecar-start.sh ````bash #!/bin/sh DRIVER_ADDRESS=0x43C27243F96591892976FFf886511807B65a33d5 cat > /tmp/sidecar.yaml << EOFCONFIG # Logging log: level: "debug" mode: "pretty" # API Server Configuration api: listen: ":8080" # Metrics Configuration metrics: pprof: true # Driver Contract driver: chain-id: 31337 address: "$DRIVER_ADDRESS" # P2P Configuration p2p: listen: "/ip4/0.0.0.0/tcp/8880" bootnodes: - /dns4/relay-sidecar-1/tcp/8880/p2p/16Uiu2HAmFUiPYAJ7bE88Q8d7Kznrw5ifrje2e5QFyt7uFPk2G3iR dht-mode: "server" mdns: true # EVM Configuration evm: chains: - "http://anvil:8545" - "http://anvil-settlement:8546" max-calls: 30 EOFCONFIG exec /app/relay_sidecar --config /tmp/sidecar.yaml --secret-keys "$1" --storage-dir "$2" ```` ## File: network-scripts/sum-node-start.sh ````bash #!/bin/sh SUMTASK_ADDRESS=0xDf12251aD82BF1eb0E0951AD15d37AE5ED3Ac1dF SETTLEMENT_SUMTASK_ADDRESS=0xDf12251aD82BF1eb0E0951AD15d37AE5ED3Ac1dF exec /app/sum-node --evm-rpc-urls http://anvil:8545,http://anvil-settlement:8546 --relay-api-url "$1" --contract-addresses "$SUMTASK_ADDRESS,$SETTLEMENT_SUMTASK_ADDRESS" --private-key "$2" --log-level info ```` ## File: off-chain/abis/SumTask.abi.json ````json [ { "type": "constructor", "inputs": [{ "name": "_settlement", "type": "address", "internalType": "address" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "TASK_EXPIRY", "inputs": [], "outputs": [{ "name": "", "type": "uint32", "internalType": "uint32" }], "stateMutability": "view" }, { "type": "function", "name": "createTask", "inputs": [ { "name": "numberA", "type": "uint256", "internalType": "uint256" }, { "name": "numberB", "type": "uint256", "internalType": "uint256" } ], "outputs": [{ "name": "taskId", "type": "bytes32", "internalType": "bytes32" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "getTaskStatus", "inputs": [{ "name": "taskId", "type": "bytes32", "internalType": "bytes32" }], "outputs": [ { "name": "", "type": "uint8", "internalType": "enum SumTask.TaskStatus" } ], "stateMutability": "view" }, { "type": "function", "name": "nonce", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "respondTask", "inputs": [ { "name": "taskId", "type": "bytes32", "internalType": "bytes32" }, { "name": "result", "type": "uint256", "internalType": "uint256" }, { "name": "epoch", "type": "uint48", "internalType": "uint48" }, { "name": "proof", "type": "bytes", "internalType": "bytes" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "responses", "inputs": [{ "name": "", "type": "bytes32", "internalType": "bytes32" }], "outputs": [ { "name": "answeredAt", "type": "uint48", "internalType": "uint48" }, { "name": "answer", "type": "uint256", "internalType": "uint256" } ], "stateMutability": "view" }, { "type": "function", "name": "settlement", "inputs": [], "outputs": [ { "name": "", "type": "address", "internalType": "contract ISettlement" } ], "stateMutability": "view" }, { "type": "function", "name": "tasks", "inputs": [{ "name": "", "type": "bytes32", "internalType": "bytes32" }], "outputs": [ { "name": "numberA", "type": "uint256", "internalType": "uint256" }, { "name": "numberB", "type": "uint256", "internalType": "uint256" }, { "name": "nonce", "type": "uint256", "internalType": "uint256" }, { "name": "createdAt", "type": "uint48", "internalType": "uint48" } ], "stateMutability": "view" }, { "type": "event", "name": "CreateTask", "inputs": [ { "name": "taskId", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "task", "type": "tuple", "indexed": false, "internalType": "struct SumTask.Task", "components": [ { "name": "numberA", "type": "uint256", "internalType": "uint256" }, { "name": "numberB", "type": "uint256", "internalType": "uint256" }, { "name": "nonce", "type": "uint256", "internalType": "uint256" }, { "name": "createdAt", "type": "uint48", "internalType": "uint48" } ] } ], "anonymous": false }, { "type": "event", "name": "RespondTask", "inputs": [ { "name": "taskId", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "response", "type": "tuple", "indexed": false, "internalType": "struct SumTask.Response", "components": [ { "name": "answeredAt", "type": "uint48", "internalType": "uint48" }, { "name": "answer", "type": "uint256", "internalType": "uint256" } ] } ], "anonymous": false }, { "type": "error", "name": "AlreadyResponded", "inputs": [] }, { "type": "error", "name": "InvalidQuorumSignature", "inputs": [] }, { "type": "error", "name": "InvalidVerifyingEpoch", "inputs": [] } ] ```` ## File: off-chain/cmd/benchmark/main.go ````go package main ⋮---- import ( "bytes" "context" "crypto/rand" "fmt" "log/slog" "math/big" "os" "os/exec" "strings" "time" "github.com/samber/lo" "sum/internal/utils" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" v1 "github.com/symbioticfi/relay/api/client/v1" "golang.org/x/sync/errgroup" ) ⋮---- "bytes" "context" "crypto/rand" "fmt" "log/slog" "math/big" "os" "os/exec" "strings" "time" ⋮---- "github.com/samber/lo" ⋮---- "sum/internal/utils" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" v1 "github.com/symbioticfi/relay/api/client/v1" "golang.org/x/sync/errgroup" ⋮---- type processes []process ⋮---- type process struct { args []string cmd *exec.Cmd stdOut *bytes.Buffer stdErr *bytes.Buffer apiAddr string relayClient *v1.SymbioticClient runSeparately bool } ⋮---- const ( operatorsCount = 3 numberOfSignRequests = 1000 sizeOfMessageBytes = 320 ) ⋮---- func main() ⋮---- func run(ctx context.Context) error ⋮---- func sendRequestAndWait(ctx context.Context, prs processes, nRequests int) *errors.Error ⋮---- func runProcesses(ctx context.Context, runSeparately bool) (processes, error) ⋮---- var prs processes ⋮---- func (prs processes) waitServerStarted(ctx context.Context) ⋮---- var startedCound int ⋮---- func (prs processes) stopProcesses() ⋮---- // Send an interrupt signal for a graceful shutdown, that is equivalent to pressing Ctrl+C. ⋮---- // If signaling fails, you can resort to killing the process forcefully. ⋮---- func (prs processes) sendMessageToAllRelays(ctx context.Context, epoch uint64) (string, error) ⋮---- var requestID string ⋮---- func sendSignMessageRequest(ctx context.Context, pr process, message []byte, epoch uint64) (string, error) ⋮---- func randomMessage(n int) []byte ⋮---- func (prs processes) printErrLogs() ```` ## File: off-chain/cmd/node/main.go ````go package main ⋮---- import ( "context" "encoding/json" "fmt" "log/slog" "math/big" "os" "os/signal" "syscall" "time" "github.com/ethereum/go-ethereum/core/types" "sum/internal/utils" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/crypto" v1 "github.com/symbioticfi/relay/api/client/v1" "sum/internal/contracts" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/ethclient" "github.com/go-errors/errors" "github.com/spf13/cobra" ) ⋮---- "context" "encoding/json" "fmt" "log/slog" "math/big" "os" "os/signal" "syscall" "time" ⋮---- "github.com/ethereum/go-ethereum/core/types" ⋮---- "sum/internal/utils" ⋮---- "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/crypto" v1 "github.com/symbioticfi/relay/api/client/v1" ⋮---- "sum/internal/contracts" ⋮---- "github.com/ethereum/go-ethereum/common" ⋮---- "github.com/ethereum/go-ethereum/ethclient" "github.com/go-errors/errors" "github.com/spf13/cobra" ⋮---- const ( TaskCreated uint8 = iota TaskResponded TaskExpired TaskNotFound ) ⋮---- type config struct { relayApiURL string evmRpcURLs []string contractAddresses []string privateKey string logLevel string } ⋮---- var relayClient *v1.SymbioticClient var evmClients map[int64]*ethclient.Client var sumContracts map[int64]*contracts.SumTask var lastBlocks map[int64]uint64 ⋮---- func main() ⋮---- func run() error ⋮---- var cfg config ⋮---- type TaskState struct { ChainID int64 Task contracts.SumTaskTask Result *big.Int SigEpoch int64 SigRequestID string AggProof []byte Statuses map[int64]uint8 } ⋮---- var tasks map[common.Hash]TaskState ⋮---- // rootCmd represents the base command when called without any subcommands var rootCmd = &cobra.Command{ Use: "sum-node", SilenceUsage: true, SilenceErrors: true, RunE: func(cmd *cobra.Command, args []string) error { switch cfg.logLevel { case "debug": slog.SetLogLoggerLevel(slog.LevelDebug) case "info": slog.SetLogLoggerLevel(slog.LevelInfo) case "warn": slog.SetLogLoggerLevel(slog.LevelWarn) case "error": slog.SetLogLoggerLevel(slog.LevelError) } ctx := signalContext(context.Background()) var err error conn, err := utils.GetGRPCConnection(cfg.relayApiURL) if err != nil { return errors.Errorf("failed to create relay client: %w", err) } relayClient = v1.NewSymbioticClient(conn) if len(cfg.evmRpcURLs) == 0 { return errors.Errorf("no RPC URLs provided") } if len(cfg.contractAddresses) != len(cfg.evmRpcURLs) { return errors.Errorf("mismatched lengths: evm-rpc-urls=%d, contract-addresses=%d", len(cfg.evmRpcURLs), len(cfg.contractAddresses)) } evmClients = make(map[int64]*ethclient.Client) sumContracts = make(map[int64]*contracts.SumTask) tasks = make(map[common.Hash]TaskState) lastBlocks = make(map[int64]uint64) for i, evmRpcURL := range cfg.evmRpcURLs { evmClient, err := ethclient.DialContext(ctx, evmRpcURL) if err != nil { return errors.Errorf("failed to connect to RPC URL '%s': %w", evmRpcURL, err) } chainID, err := evmClient.ChainID(ctx) if err != nil { return errors.Errorf("failed to get chain ID from RPC URL '%s': %w", evmRpcURL, err) } addr := common.HexToAddress(cfg.contractAddresses[i]) sumContract, err := contracts.NewSumTask(addr, evmClient) if err != nil { return errors.Errorf("failed to create sum contract for %s on chain %d: %w", addr.Hex(), chainID, err) } evmClients[chainID.Int64()] = evmClient sumContracts[chainID.Int64()] = sumContract finalizedBlockNumber, err := getFinalizedBlockNumber(ctx, evmClient) if err != nil { return errors.Errorf("failed to get finalized block number for chain %d: %w", chainID, err) } lastBlocks[chainID.Int64()] = finalizedBlockNumber slog.InfoContext(ctx, "Initialized chain", "chainID", chainID, "finalizedBlock", finalizedBlockNumber, "startBlock", lastBlocks[chainID.Int64()]) } ticker := time.NewTicker(1 * time.Second) defer ticker.Stop() for { select { case <-ticker.C: for chainID, evmClient := range evmClients { endBlockNumber, err := getFinalizedBlockNumber(ctx, evmClient) if err != nil { return errors.Errorf("failed to get finalized block number for chain %d: %w", chainID, err) } lastBlock := lastBlocks[chainID] if endBlockNumber < lastBlock { slog.DebugContext(ctx, "Finalized block number is behind last processed block, skipping", "chainID", chainID, "finalizedBlock", endBlockNumber, "lastProcessedBlock", lastBlock) continue } slog.DebugContext(ctx, "Fetching events", "chainID", chainID, "fromBlock", lastBlock, "toBlock", endBlockNumber) events, err := sumContracts[chainID].FilterCreateTask(&bind.FilterOpts{ Context: ctx, Start: lastBlock, End: &endBlockNumber, }, [][32]byte{}) if err != nil { return errors.Errorf("failed to filter new task created events: %w", err) } lastBlocks[chainID] = endBlockNumber + 1 err = processNewTasks(ctx, chainID, events) if err != nil { fmt.Printf("Error processing new task event: %v\n", err) } } err = fetchResults(ctx) if err != nil { fmt.Printf("Error fetching results: %v\n", err) } case <-ctx.Done(): return nil } } }, } ⋮---- var err error ⋮---- func getFinalizedBlockNumber(ctx context.Context, evmClient *ethclient.Client) (uint64, error) ⋮---- // Get finalized block and set starting point to 24 hours ago var raw json.RawMessage ⋮---- var head *types.Header ⋮---- func fetchResults(ctx context.Context) error ⋮---- // slog.InfoContext(ctx, "Failed to fetch aggregation proof", "err", err) ⋮---- func processProof(ctx context.Context, taskID common.Hash) error ⋮---- func processNewTasks(ctx context.Context, chainID int64, iter *contracts.SumTaskCreateTaskIterator) error ⋮---- // skip if task is not in created state ⋮---- func signalContext(ctx context.Context) context.Context ```` ## File: off-chain/internal/contracts/sumTask.go ````go // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. ⋮---- package contracts ⋮---- import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) ⋮---- "errors" "math/big" "strings" ⋮---- ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ⋮---- // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) ⋮---- // SumTaskResponse is an auto generated low-level Go binding around an user-defined struct. type SumTaskResponse struct { AnsweredAt *big.Int Answer *big.Int } ⋮---- // SumTaskTask is an auto generated low-level Go binding around an user-defined struct. type SumTaskTask struct { NumberA *big.Int NumberB *big.Int Nonce *big.Int CreatedAt *big.Int } ⋮---- // SumTaskMetaData contains all meta data concerning the SumTask contract. var SumTaskMetaData = &bind.MetaData{ ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_settlement\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"TASK_EXPIRY\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"createTask\",\"inputs\":[{\"name\":\"numberA\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"numberB\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"taskId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"getTaskStatus\",\"inputs\":[{\"name\":\"taskId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"enumSumTask.TaskStatus\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"nonce\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"respondTask\",\"inputs\":[{\"name\":\"taskId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"result\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"epoch\",\"type\":\"uint48\",\"internalType\":\"uint48\"},{\"name\":\"proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"responses\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"answeredAt\",\"type\":\"uint48\",\"internalType\":\"uint48\"},{\"name\":\"answer\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"settlement\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractISettlement\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"tasks\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"numberA\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"numberB\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"createdAt\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"CreateTask\",\"inputs\":[{\"name\":\"taskId\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"task\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structSumTask.Task\",\"components\":[{\"name\":\"numberA\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"numberB\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"createdAt\",\"type\":\"uint48\",\"internalType\":\"uint48\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RespondTask\",\"inputs\":[{\"name\":\"taskId\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"response\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structSumTask.Response\",\"components\":[{\"name\":\"answeredAt\",\"type\":\"uint48\",\"internalType\":\"uint48\"},{\"name\":\"answer\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"AlreadyResponded\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidQuorumSignature\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidVerifyingEpoch\",\"inputs\":[]}]", } ⋮---- // SumTaskABI is the input ABI used to generate the binding from. // Deprecated: Use SumTaskMetaData.ABI instead. var SumTaskABI = SumTaskMetaData.ABI ⋮---- // SumTask is an auto generated Go binding around an Ethereum contract. type SumTask struct { SumTaskCaller // Read-only binding to the contract SumTaskTransactor // Write-only binding to the contract SumTaskFilterer // Log filterer for contract events } ⋮---- SumTaskCaller // Read-only binding to the contract SumTaskTransactor // Write-only binding to the contract SumTaskFilterer // Log filterer for contract events ⋮---- // SumTaskCaller is an auto generated read-only Go binding around an Ethereum contract. type SumTaskCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } ⋮---- contract *bind.BoundContract // Generic contract wrapper for the low level calls ⋮---- // SumTaskTransactor is an auto generated write-only Go binding around an Ethereum contract. type SumTaskTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } ⋮---- // SumTaskFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type SumTaskFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } ⋮---- // SumTaskSession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type SumTaskSession struct { Contract *SumTask // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } ⋮---- Contract *SumTask // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session ⋮---- // SumTaskCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type SumTaskCallerSession struct { Contract *SumTaskCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } ⋮---- Contract *SumTaskCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session ⋮---- // SumTaskTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type SumTaskTransactorSession struct { Contract *SumTaskTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } ⋮---- Contract *SumTaskTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session ⋮---- // SumTaskRaw is an auto generated low-level Go binding around an Ethereum contract. type SumTaskRaw struct { Contract *SumTask // Generic contract binding to access the raw methods on } ⋮---- Contract *SumTask // Generic contract binding to access the raw methods on ⋮---- // SumTaskCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type SumTaskCallerRaw struct { Contract *SumTaskCaller // Generic read-only contract binding to access the raw methods on } ⋮---- Contract *SumTaskCaller // Generic read-only contract binding to access the raw methods on ⋮---- // SumTaskTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type SumTaskTransactorRaw struct { Contract *SumTaskTransactor // Generic write-only contract binding to access the raw methods on } ⋮---- Contract *SumTaskTransactor // Generic write-only contract binding to access the raw methods on ⋮---- // NewSumTask creates a new instance of SumTask, bound to a specific deployed contract. func NewSumTask(address common.Address, backend bind.ContractBackend) (*SumTask, error) ⋮---- // NewSumTaskCaller creates a new read-only instance of SumTask, bound to a specific deployed contract. func NewSumTaskCaller(address common.Address, caller bind.ContractCaller) (*SumTaskCaller, error) ⋮---- // NewSumTaskTransactor creates a new write-only instance of SumTask, bound to a specific deployed contract. func NewSumTaskTransactor(address common.Address, transactor bind.ContractTransactor) (*SumTaskTransactor, error) ⋮---- // NewSumTaskFilterer creates a new log filterer instance of SumTask, bound to a specific deployed contract. func NewSumTaskFilterer(address common.Address, filterer bind.ContractFilterer) (*SumTaskFilterer, error) ⋮---- // bindSumTask binds a generic wrapper to an already deployed contract. func bindSumTask(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) ⋮---- // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_SumTask *SumTaskRaw) Call(opts *bind.CallOpts, result *[]interface ⋮---- // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_SumTask *SumTaskRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) ⋮---- // Transact invokes the (paid) contract method with params as input values. func (_SumTask *SumTaskRaw) Transact(opts *bind.TransactOpts, method string, params ...interface ⋮---- // TASKEXPIRY is a free data retrieval call binding the contract method 0x240697b6. // // Solidity: function TASK_EXPIRY() view returns(uint32) func (_SumTask *SumTaskCaller) TASKEXPIRY(opts *bind.CallOpts) (uint32, error) ⋮---- var out []interface{} ⋮---- // GetTaskStatus is a free data retrieval call binding the contract method 0x2bf6cc79. ⋮---- // Solidity: function getTaskStatus(bytes32 taskId) view returns(uint8) func (_SumTask *SumTaskCaller) GetTaskStatus(opts *bind.CallOpts, taskId [32]byte) (uint8, error) ⋮---- // Nonce is a free data retrieval call binding the contract method 0xaffed0e0. ⋮---- // Solidity: function nonce() view returns(uint256) func (_SumTask *SumTaskCaller) Nonce(opts *bind.CallOpts) (*big.Int, error) ⋮---- // Responses is a free data retrieval call binding the contract method 0x72164a6c. ⋮---- // Solidity: function responses(bytes32 ) view returns(uint48 answeredAt, uint256 answer) func (_SumTask *SumTaskCaller) Responses(opts *bind.CallOpts, arg0 [32]byte) (struct ⋮---- // Settlement is a free data retrieval call binding the contract method 0x51160630. ⋮---- // Solidity: function settlement() view returns(address) func (_SumTask *SumTaskCaller) Settlement(opts *bind.CallOpts) (common.Address, error) ⋮---- // Tasks is a free data retrieval call binding the contract method 0xe579f500. ⋮---- // Solidity: function tasks(bytes32 ) view returns(uint256 numberA, uint256 numberB, uint256 nonce, uint48 createdAt) func (_SumTask *SumTaskCaller) Tasks(opts *bind.CallOpts, arg0 [32]byte) (struct ⋮---- // CreateTask is a paid mutator transaction binding the contract method 0xe75b2378. ⋮---- // Solidity: function createTask(uint256 numberA, uint256 numberB) returns(bytes32 taskId) func (_SumTask *SumTaskTransactor) CreateTask(opts *bind.TransactOpts, numberA *big.Int, numberB *big.Int) (*types.Transaction, error) ⋮---- // RespondTask is a paid mutator transaction binding the contract method 0xc92914cd. ⋮---- // Solidity: function respondTask(bytes32 taskId, uint256 result, uint48 epoch, bytes proof) returns() func (_SumTask *SumTaskTransactor) RespondTask(opts *bind.TransactOpts, taskId [32]byte, result *big.Int, epoch *big.Int, proof []byte) (*types.Transaction, error) ⋮---- // SumTaskCreateTaskIterator is returned from FilterCreateTask and is used to iterate over the raw logs and unpacked data for CreateTask events raised by the SumTask contract. type SumTaskCreateTaskIterator struct { Event *SumTaskCreateTask // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } ⋮---- Event *SumTaskCreateTask // Event containing the contract specifics and raw log ⋮---- contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data ⋮---- logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration ⋮---- // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *SumTaskCreateTaskIterator) Next() bool ⋮---- // If the iterator failed, stop iterating ⋮---- // If the iterator completed, deliver directly whatever's available ⋮---- // Iterator still in progress, wait for either a data or an error event ⋮---- // Error returns any retrieval or parsing error occurred during filtering. func (it *SumTaskCreateTaskIterator) Error() error ⋮---- // Close terminates the iteration process, releasing any pending underlying // resources. func (it *SumTaskCreateTaskIterator) Close() error ⋮---- // SumTaskCreateTask represents a CreateTask event raised by the SumTask contract. type SumTaskCreateTask struct { TaskId [32]byte Task SumTaskTask Raw types.Log // Blockchain specific contextual infos } ⋮---- Raw types.Log // Blockchain specific contextual infos ⋮---- // FilterCreateTask is a free log retrieval operation binding the contract event 0x091f91724daf92df11de4c7b494af095ec9c1325865974e9750636fbe5373677. ⋮---- // Solidity: event CreateTask(bytes32 indexed taskId, (uint256,uint256,uint256,uint48) task) func (_SumTask *SumTaskFilterer) FilterCreateTask(opts *bind.FilterOpts, taskId [][32]byte) (*SumTaskCreateTaskIterator, error) ⋮---- var taskIdRule []interface{} ⋮---- // WatchCreateTask is a free log subscription operation binding the contract event 0x091f91724daf92df11de4c7b494af095ec9c1325865974e9750636fbe5373677. ⋮---- func (_SumTask *SumTaskFilterer) WatchCreateTask(opts *bind.WatchOpts, sink chan<- *SumTaskCreateTask, taskId [][32]byte) (event.Subscription, error) ⋮---- // New log arrived, parse the event and forward to the user ⋮---- // ParseCreateTask is a log parse operation binding the contract event 0x091f91724daf92df11de4c7b494af095ec9c1325865974e9750636fbe5373677. ⋮---- func (_SumTask *SumTaskFilterer) ParseCreateTask(log types.Log) (*SumTaskCreateTask, error) ⋮---- // SumTaskRespondTaskIterator is returned from FilterRespondTask and is used to iterate over the raw logs and unpacked data for RespondTask events raised by the SumTask contract. type SumTaskRespondTaskIterator struct { Event *SumTaskRespondTask // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } ⋮---- Event *SumTaskRespondTask // Event containing the contract specifics and raw log ⋮---- // SumTaskRespondTask represents a RespondTask event raised by the SumTask contract. type SumTaskRespondTask struct { TaskId [32]byte Response SumTaskResponse Raw types.Log // Blockchain specific contextual infos } ⋮---- Raw types.Log // Blockchain specific contextual infos ⋮---- // FilterRespondTask is a free log retrieval operation binding the contract event 0xfc4f6d5b11d191a9cdec60e7a5819b4695dba8d8365e7afb1f24b159ceb7e287. ⋮---- // Solidity: event RespondTask(bytes32 indexed taskId, (uint48,uint256) response) func (_SumTask *SumTaskFilterer) FilterRespondTask(opts *bind.FilterOpts, taskId [][32]byte) (*SumTaskRespondTaskIterator, error) ⋮---- // WatchRespondTask is a free log subscription operation binding the contract event 0xfc4f6d5b11d191a9cdec60e7a5819b4695dba8d8365e7afb1f24b159ceb7e287. ⋮---- func (_SumTask *SumTaskFilterer) WatchRespondTask(opts *bind.WatchOpts, sink chan<- *SumTaskRespondTask, taskId [][32]byte) (event.Subscription, error) ⋮---- // ParseRespondTask is a log parse operation binding the contract event 0xfc4f6d5b11d191a9cdec60e7a5819b4695dba8d8365e7afb1f24b159ceb7e287. ⋮---- func (_SumTask *SumTaskFilterer) ParseRespondTask(log types.Log) (*SumTaskRespondTask, error) ```` ## File: off-chain/internal/utils/util.go ````go package utils ⋮---- import ( "time" grpcmiddleware "github.com/grpc-ecosystem/go-grpc-middleware" "github.com/grpc-ecosystem/go-grpc-middleware/retry" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" ) ⋮---- "time" ⋮---- grpcmiddleware "github.com/grpc-ecosystem/go-grpc-middleware" "github.com/grpc-ecosystem/go-grpc-middleware/retry" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" ⋮---- func GetGRPCConnection(address string) (*grpc.ClientConn, error) ```` ## File: off-chain/.dockerignore ```` # Git files .git .gitignore # Docker files Dockerfile .dockerignore # Documentation README.md *.md # IDE files .vscode/ .idea/ *.swp *.swo # OS files .DS_Store Thumbs.db # Logs *.log # Temporary files *.tmp *.temp # Test files *_test.go test/ # Build artifacts bin/ dist/ # Coverage files *.out coverage.txt # Go specific vendor/ ```` ## File: off-chain/Dockerfile ```` # Multi-stage build for the off-chain Go application # Build stage FROM golang:1.24.5-alpine AS builder # Install build dependencies RUN apk add --no-cache git ca-certificates tzdata # Set working directory WORKDIR /app # Copy go mod files COPY go.mod go.sum ./ # Download dependencies RUN go mod download # Copy source code COPY . . # Build the application with optimizations for production RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \ -ldflags="-w -s" \ -o /app/sum-node \ ./cmd/node # Runtime stage FROM alpine:3.19 # Install runtime dependencies RUN apk add --no-cache ca-certificates tzdata # Set working directory WORKDIR /app # Copy binary from builder stage COPY --from=builder /app/sum-node . # Expose port if needed (adjust based on your application) # EXPOSE 8080 # Set the entrypoint ENTRYPOINT ["./sum-node"] # Default command (can be overridden) CMD ["--help"] ```` ## File: off-chain/go.mod ```` module sum go 1.24.5 require ( github.com/ethereum/go-ethereum v1.16.3 github.com/go-errors/errors v1.5.1 github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 github.com/samber/lo v1.51.0 github.com/spf13/cobra v1.10.1 github.com/symbioticfi/relay v0.2.1-0.20250929084906-8a36673e5ad5 golang.org/x/sync v0.17.0 google.golang.org/grpc v1.75.1 ) require ( github.com/Microsoft/go-winio v0.6.2 // indirect github.com/bits-and-blooms/bitset v1.24.0 // indirect github.com/consensys/gnark-crypto v0.19.0 // indirect github.com/crate-crypto/go-eth-kzg v1.4.0 // indirect github.com/crate-crypto/go-ipa v0.0.0-20240724233137-53bbb0ceb27a // indirect github.com/deckarep/golang-set/v2 v2.8.0 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect github.com/ethereum/c-kzg-4844/v2 v2.1.1 // indirect github.com/ethereum/go-verkle v0.2.2 // indirect github.com/fsnotify/fsnotify v1.9.0 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/google/uuid v1.6.0 // indirect github.com/gorilla/websocket v1.5.3 // indirect github.com/holiman/uint256 v1.3.2 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/rogpeppe/go-internal v1.13.1 // indirect github.com/shirou/gopsutil v3.21.11+incompatible // indirect github.com/spf13/pflag v1.0.10 // indirect github.com/supranational/blst v0.3.15 // indirect github.com/tklauser/go-sysconf v0.3.15 // indirect github.com/tklauser/numcpus v0.10.0 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect golang.org/x/crypto v0.42.0 // indirect golang.org/x/net v0.44.0 // indirect golang.org/x/sys v0.36.0 // indirect golang.org/x/text v0.29.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20250908214217-97024824d090 // indirect google.golang.org/protobuf v1.36.9 // indirect ) ```` ## File: script/mocks/MockERC20.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; ⋮---- contract MockERC20 is ERC20 { ⋮---- function mint(address to, uint256 amount) public { ```` ## File: script/utils/BN254G2.sol ```` /** * @title Elliptic curve operations on twist points for alt_bn128 * @author Mustafa Al-Bassam (mus@musalbas.com) * @dev Homepage: https://github.com/musalbas/solidity-BN256G2 */ ⋮---- // WARNING: this code is used ONLY for testing purposes, DO NOT USE IN PRODUCTION ⋮---- /** * @notice Add two twist points * @param pt1xx Coefficient 1 of x on point 1 * @param pt1xy Coefficient 2 of x on point 1 * @param pt1yx Coefficient 1 of y on point 1 * @param pt1yy Coefficient 2 of y on point 1 * @param pt2xx Coefficient 1 of x on point 2 * @param pt2xy Coefficient 2 of x on point 2 * @param pt2yx Coefficient 1 of y on point 2 * @param pt2yy Coefficient 2 of y on point 2 * @return (pt3xx, pt3xy, pt3yx, pt3yy) */ function ECTwistAdd( ⋮---- /** * @notice Multiply a twist point by a scalar * @param s Scalar to multiply by * @param pt1xx Coefficient 1 of x * @param pt1xy Coefficient 2 of x * @param pt1yx Coefficient 1 of y * @param pt1yy Coefficient 2 of y * @return (pt2xx, pt2xy, pt2yx, pt2yy) */ function ECTwistMul(uint256 s, uint256 pt1xx, uint256 pt1xy, uint256 pt1yx, uint256 pt1yy) ⋮---- /** * @notice Get the field modulus * @return The field modulus */ function GetFieldModulus() internal pure returns (uint256) { ⋮---- function submod(uint256 a, uint256 b, uint256 n) internal pure returns (uint256) { ⋮---- function _FQ2Mul(uint256 xx, uint256 xy, uint256 yx, uint256 yy) internal pure returns (uint256, uint256) { ⋮---- function _FQ2Muc(uint256 xx, uint256 xy, uint256 c) internal pure returns (uint256, uint256) { ⋮---- function _FQ2Add(uint256 xx, uint256 xy, uint256 yx, uint256 yy) internal pure returns (uint256, uint256) { ⋮---- function _FQ2Sub(uint256 xx, uint256 xy, uint256 yx, uint256 yy) internal pure returns (uint256 rx, uint256 ry) { ⋮---- function _FQ2Div(uint256 xx, uint256 xy, uint256 yx, uint256 yy) internal view returns (uint256, uint256) { ⋮---- function _FQ2Inv(uint256 x, uint256 y) internal view returns (uint256, uint256) { ⋮---- function _isOnCurve(uint256 xx, uint256 xy, uint256 yx, uint256 yy) internal pure returns (bool) { ⋮---- function _modInv(uint256 a, uint256 n) internal view returns (uint256 result) { ⋮---- function _fromJacobian(uint256 pt1xx, uint256 pt1xy, uint256 pt1yx, uint256 pt1yy, uint256 pt1zx, uint256 pt1zy) ⋮---- function _ECTwistAddJacobian(_ECTwistAddJacobianArgs memory $) internal pure returns (uint256[6] memory pt3) { ⋮---- ($.pt2yx, $.pt2yy) = _FQ2Mul($.pt2yx, $.pt2yy, $.pt1zx, $.pt1zy); // U1 = y2 * z1 (pt3[PTYX], pt3[PTYY]) = _FQ2Mul($.pt1yx, $.pt1yy, $.pt2zx, $.pt2zy); // U2 = y1 * z2 ($.pt2xx, $.pt2xy) = _FQ2Mul($.pt2xx, $.pt2xy, $.pt1zx, $.pt1zy); // V1 = x2 * z1 (pt3[PTZX], pt3[PTZY]) = _FQ2Mul($.pt1xx, $.pt1xy, $.pt2zx, $.pt2zy); // V2 = x1 * z2 ⋮---- ($.pt2zx, $.pt2zy) = _FQ2Mul($.pt1zx, $.pt1zy, $.pt2zx, $.pt2zy); // W = z1 * z2 ($.pt1xx, $.pt1xy) = _FQ2Sub($.pt2yx, $.pt2yy, pt3[PTYX], pt3[PTYY]); // U = U1 - U2 ($.pt1yx, $.pt1yy) = _FQ2Sub($.pt2xx, $.pt2xy, pt3[PTZX], pt3[PTZY]); // V = V1 - V2 ($.pt1zx, $.pt1zy) = _FQ2Mul($.pt1yx, $.pt1yy, $.pt1yx, $.pt1yy); // V_squared = V * V ($.pt2yx, $.pt2yy) = _FQ2Mul($.pt1zx, $.pt1zy, pt3[PTZX], pt3[PTZY]); // V_squared_times_V2 = V_squared * V2 ($.pt1zx, $.pt1zy) = _FQ2Mul($.pt1zx, $.pt1zy, $.pt1yx, $.pt1yy); // V_cubed = V * V_squared (pt3[PTZX], pt3[PTZY]) = _FQ2Mul($.pt1zx, $.pt1zy, $.pt2zx, $.pt2zy); // newz = V_cubed * W ($.pt2xx, $.pt2xy) = _FQ2Mul($.pt1xx, $.pt1xy, $.pt1xx, $.pt1xy); // U * U ($.pt2xx, $.pt2xy) = _FQ2Mul($.pt2xx, $.pt2xy, $.pt2zx, $.pt2zy); // U * U * W ($.pt2xx, $.pt2xy) = _FQ2Sub($.pt2xx, $.pt2xy, $.pt1zx, $.pt1zy); // U * U * W - V_cubed ($.pt2zx, $.pt2zy) = _FQ2Muc($.pt2yx, $.pt2yy, 2); // 2 * V_squared_times_V2 ($.pt2xx, $.pt2xy) = _FQ2Sub($.pt2xx, $.pt2xy, $.pt2zx, $.pt2zy); // A = U * U * W - V_cubed - 2 * V_squared_times_V2 (pt3[PTXX], pt3[PTXY]) = _FQ2Mul($.pt1yx, $.pt1yy, $.pt2xx, $.pt2xy); // newx = V * A ($.pt1yx, $.pt1yy) = _FQ2Sub($.pt2yx, $.pt2yy, $.pt2xx, $.pt2xy); // V_squared_times_V2 - A ($.pt1yx, $.pt1yy) = _FQ2Mul($.pt1xx, $.pt1xy, $.pt1yx, $.pt1yy); // U * (V_squared_times_V2 - A) ($.pt1xx, $.pt1xy) = _FQ2Mul($.pt1zx, $.pt1zy, pt3[PTYX], pt3[PTYY]); // V_cubed * U2 (pt3[PTYX], pt3[PTYY]) = _FQ2Sub($.pt1yx, $.pt1yy, $.pt1xx, $.pt1xy); // newy = U * (V_squared_times_V2 - A) - V_cubed * U2 ⋮---- function _ECTwistDoubleJacobian( ⋮---- (pt2xx, pt2xy) = _FQ2Muc(pt1xx, pt1xy, 3); // 3 * x (pt2xx, pt2xy) = _FQ2Mul(pt2xx, pt2xy, pt1xx, pt1xy); // W = 3 * x * x (pt1zx, pt1zy) = _FQ2Mul(pt1yx, pt1yy, pt1zx, pt1zy); // S = y * z (pt2yx, pt2yy) = _FQ2Mul(pt1xx, pt1xy, pt1yx, pt1yy); // x * y (pt2yx, pt2yy) = _FQ2Mul(pt2yx, pt2yy, pt1zx, pt1zy); // B = x * y * S (pt1xx, pt1xy) = _FQ2Mul(pt2xx, pt2xy, pt2xx, pt2xy); // W * W (pt2zx, pt2zy) = _FQ2Muc(pt2yx, pt2yy, 8); // 8 * B (pt1xx, pt1xy) = _FQ2Sub(pt1xx, pt1xy, pt2zx, pt2zy); // H = W * W - 8 * B (pt2zx, pt2zy) = _FQ2Mul(pt1zx, pt1zy, pt1zx, pt1zy); // S_squared = S * S (pt2yx, pt2yy) = _FQ2Muc(pt2yx, pt2yy, 4); // 4 * B (pt2yx, pt2yy) = _FQ2Sub(pt2yx, pt2yy, pt1xx, pt1xy); // 4 * B - H (pt2yx, pt2yy) = _FQ2Mul(pt2yx, pt2yy, pt2xx, pt2xy); // W * (4 * B - H) (pt2xx, pt2xy) = _FQ2Muc(pt1yx, pt1yy, 8); // 8 * y (pt2xx, pt2xy) = _FQ2Mul(pt2xx, pt2xy, pt1yx, pt1yy); // 8 * y * y (pt2xx, pt2xy) = _FQ2Mul(pt2xx, pt2xy, pt2zx, pt2zy); // 8 * y * y * S_squared (pt2yx, pt2yy) = _FQ2Sub(pt2yx, pt2yy, pt2xx, pt2xy); // newy = W * (4 * B - H) - 8 * y * y * S_squared (pt2xx, pt2xy) = _FQ2Muc(pt1xx, pt1xy, 2); // 2 * H (pt2xx, pt2xy) = _FQ2Mul(pt2xx, pt2xy, pt1zx, pt1zy); // newx = 2 * H * S (pt2zx, pt2zy) = _FQ2Mul(pt1zx, pt1zy, pt2zx, pt2zy); // S * S_squared (pt2zx, pt2zy) = _FQ2Muc(pt2zx, pt2zy, 8); // newz = 8 * S * S_squared ⋮---- function _ECTwistMulJacobian( ```` ## File: script/utils/sort_errors.py ````python #!/usr/bin/env python3 ⋮---- def _error_sort_key(error_line: str) -> str ⋮---- signature = error_line.strip()[len("error ") :] name = signature.split("(", 1)[0].strip() ⋮---- def _extract_entries(block_text: str) -> List[Tuple[int, int, str, int]] ⋮---- entries: List[Tuple[int, int, str, int]] = [] offset = 0 entry_start: Optional[int] = None last_content_end: Optional[int] = None current_error: Optional[str] = None ⋮---- def finalize() -> None ⋮---- entry_start = None last_content_end = None current_error = None ⋮---- newline_idx = block_text.find("\n", offset) ⋮---- line_end = len(block_text) ⋮---- line_end = newline_idx + 1 line = block_text[offset:line_end] stripped = line.strip() ⋮---- last_content_end = line_end offset = line_end ⋮---- entry_start = offset ⋮---- current_error = line.strip() ⋮---- def _sort_error_block(text: str) -> Tuple[str, bool] ⋮---- marker = "/* ERRORS */" search_pos = 0 changed = False ⋮---- marker_idx = text.find(marker, search_pos) ⋮---- block_start = text.find("\n", marker_idx) ⋮---- cursor = block_start first_block_idx: Optional[int] = None last_block_idx = block_start ⋮---- newline_idx = text.find("\n", cursor) ⋮---- line_end = len(text) ⋮---- line = text[cursor:line_end] ⋮---- cursor = line_end ⋮---- first_block_idx = cursor last_block_idx = line_end ⋮---- search_pos = cursor ⋮---- block_text = text[first_block_idx:last_block_idx] entries = _extract_entries(block_text) ⋮---- search_pos = last_block_idx ⋮---- prefix = block_text[:entries[0][0]] suffix = block_text[entries[-1][1]:] sorted_entries = sorted(entries, key=lambda item: (item[2], item[3])) sorted_chunks = [block_text[start:end].rstrip("\n") for start, end, _, _ in sorted_entries] ⋮---- new_block = prefix + "\n\n".join(sorted_chunks) ⋮---- stripped_suffix = suffix.lstrip("\n") ⋮---- text = text[:first_block_idx] + new_block + text[last_block_idx:] changed = True search_pos = first_block_idx + len(new_block) ⋮---- def sort_errors_in_file(path: Path) ⋮---- original = path.read_text(encoding="utf-8") ⋮---- def iter_solidity_files(targets: Iterable[Path]) -> Iterable[Path] ⋮---- def resolve_targets(path_args: Iterable[str]) -> List[Path] ⋮---- defaults = [Path(name) for name in ("src", "examples") if Path(name).exists()] ⋮---- def sort_from_stdin() -> None ⋮---- errors = sys.stdin.read() sorted_errors = sorted(x.strip() for x in errors.splitlines()) ⋮---- def main() -> int ⋮---- parser = argparse.ArgumentParser( ⋮---- args = parser.parse_args() ⋮---- targets = resolve_targets(args.paths) ```` ## File: script/utils/sort_imports.py ````python #!/usr/bin/env python3 ⋮---- FROM_IMPORT_RE = re.compile(r'from\s+["\']([^"\']+)["\']', re.IGNORECASE | re.MULTILINE) DIRECT_IMPORT_RE = re.compile(r'import\s+["\']([^"\']+)["\']', re.IGNORECASE | re.MULTILINE) WHITESPACE_RE = re.compile(r"\s+") ⋮---- @dataclass class ImportEntry ⋮---- start: int end: int text: str path: str order: int ⋮---- def extract_path(import_text: str) -> str ⋮---- match = FROM_IMPORT_RE.search(import_text) ⋮---- match = DIRECT_IMPORT_RE.search(import_text) ⋮---- def collect_import_entries(lines: Sequence[str]) -> List[ImportEntry] ⋮---- entries: List[ImportEntry] = [] index = 0 ⋮---- stripped = lines[index].lstrip() ⋮---- start = index statement_lines = [lines[index].rstrip()] ⋮---- end = index text = "\n".join(statement_lines) path = extract_path(text) ⋮---- def normalize_import_text(import_text: str) -> str ⋮---- """Flatten whitespace so multi-line imports sort identically to single-line ones.""" compact = WHITESPACE_RE.sub(" ", import_text.strip()) compact = compact.replace("{ ", "{").replace(" }", "}") compact = compact.replace("( ", "(").replace(" )", ")") ⋮---- def classify_import(path: str) -> str ⋮---- normalized = path.lstrip("./") lower = normalized.lower() ⋮---- library = normalized.split("/", 1)[0] ⋮---- def build_sorted_block(entries: Sequence[ImportEntry]) -> List[str] ⋮---- grouped: Dict[str, List[ImportEntry]] = defaultdict(list) ⋮---- ordered_groups: List[List[ImportEntry]] = [] ⋮---- external_groups = sorted( ⋮---- block_text = "\n\n".join("\n".join(entry.text for entry in group) for group in ordered_groups) ⋮---- def sort_imports_in_file(path: Path) -> None ⋮---- original_text = path.read_text(encoding="utf-8") has_trailing_newline = original_text.endswith("\n") lines = original_text.splitlines() ⋮---- entries = collect_import_entries(lines) ⋮---- block_start = entries[0].start block_end = entries[-1].end covered_indexes = set() ⋮---- new_block_lines = build_sorted_block(entries) new_lines = lines[:block_start] + new_block_lines + lines[block_end + 1 :] new_text = "\n".join(new_lines) ⋮---- def iter_solidity_files(targets: Iterable[Path]) -> Iterable[Path] ⋮---- def resolve_targets(path_args: Iterable[str]) -> List[Path] ⋮---- defaults = [Path(name) for name in ("src", "examples") if Path(name).exists()] ⋮---- def main() -> int ⋮---- parser = argparse.ArgumentParser( ⋮---- args = parser.parse_args() ⋮---- targets = resolve_targets(args.paths) ```` ## File: script/my-relay-deploy.toml ````toml [31337] endpoint_url = "http://anvil:8545" [31338] endpoint_url = "http://anvil-settlement:8546" [1234567890] endpoint_url = "" keyRegistry = 31337 votingPowerProvider = [31337] settlement = [ 31337, 31338, ] valSetDriver = 31337 ```` ## File: script/MyRelayDeploy.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {Vm, VmSafe} from "forge-std/Vm.sol"; ⋮---- import {VotingPowers} from "../src/symbiotic/VotingPowers.sol"; import {KeyRegistry} from "../src/symbiotic/KeyRegistry.sol"; import {Driver} from "../src/symbiotic/Driver.sol"; import {Settlement} from "../src/symbiotic/Settlement.sol"; import {SumTask} from "../src/SumTask.sol"; import {MockERC20} from "./mocks/MockERC20.sol"; import {BN254G2} from "./utils/BN254G2.sol"; ⋮---- import {RelayDeploy} from "@symbioticfi/relay-contracts/script/RelayDeploy.sol"; ⋮---- import {BN254} from "@symbioticfi/relay-contracts/src/libraries/utils/BN254.sol"; import {KeyTags} from "@symbioticfi/relay-contracts/src/libraries/utils/KeyTags.sol"; import {KeyEcdsaSecp256k1} from "@symbioticfi/relay-contracts/src/libraries/keys/KeyEcdsaSecp256k1.sol"; import {KeyBlsBn254} from "@symbioticfi/relay-contracts/src/libraries/keys/KeyBlsBn254.sol"; import { SigVerifierBlsBn254Simple } from "@symbioticfi/relay-contracts/src/modules/settlement/sig-verifiers/SigVerifierBlsBn254Simple.sol"; import { SigVerifierBlsBn254ZK } from "@symbioticfi/relay-contracts/src/modules/settlement/sig-verifiers/SigVerifierBlsBn254ZK.sol"; import { IVotingPowerProvider } from "@symbioticfi/relay-contracts/src/interfaces/modules/voting-power/IVotingPowerProvider.sol"; import { IOpNetVaultAutoDeploy } from "@symbioticfi/relay-contracts/src/interfaces/modules/voting-power/extensions/IOpNetVaultAutoDeploy.sol"; import {INetworkManager} from "@symbioticfi/relay-contracts/src/interfaces/modules/base/INetworkManager.sol"; import {IOzEIP712} from "@symbioticfi/relay-contracts/src/interfaces/modules/base/IOzEIP712.sol"; import {IOzOwnable} from "@symbioticfi/relay-contracts/src/interfaces/modules/common/permissions/IOzOwnable.sol"; import { IKeyRegistry, KEY_TYPE_BLS_BN254, KEY_TYPE_ECDSA_SECP256K1 } from "@symbioticfi/relay-contracts/src/interfaces/modules/key-registry/IKeyRegistry.sol"; import {IValSetDriver} from "@symbioticfi/relay-contracts/src/interfaces/modules/valset-driver/IValSetDriver.sol"; import {IEpochManager} from "@symbioticfi/relay-contracts/src/interfaces/modules/valset-driver/IEpochManager.sol"; import {ISettlement} from "@symbioticfi/relay-contracts/src/interfaces/modules/settlement/ISettlement.sol"; ⋮---- import {Network, INetwork} from "@symbioticfi/network/src/Network.sol"; ⋮---- import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {IVault} from "@symbioticfi/core/src/interfaces/vault/IVault.sol"; import {INetworkMiddlewareService} from "@symbioticfi/core/src/interfaces/service/INetworkMiddlewareService.sol"; import {Logs} from "@symbioticfi/core/script/utils/Logs.sol"; import {SymbioticCoreConstants} from "@symbioticfi/core/test/integration/SymbioticCoreConstants.sol"; ⋮---- contract MyRelayDeploy is RelayDeploy { ⋮---- // Configurable constants ⋮---- uint48 internal constant SLASHING_WINDOW = 1 days; // 1 day uint208 internal constant MAX_VALIDATORS_COUNT = 1000; // 1000 validators uint256 internal constant MAX_VOTING_POWER = 2 ** 247; // no max limit uint256 internal constant MIN_INCLUSION_VOTING_POWER = 0; // include anyone uint248 internal constant QUORUM_THRESHOLD = (uint248(1e18) * 2) / 3 + 1; // 2/3 + 1 uint8 internal constant REQUIRED_KEY_TAG = 15; // 15 is the default key tag (BLS-BN254/15) ⋮---- uint8 internal constant REQUIRED_KEY_TAG_ECDSA = 16; // 16 is the default key tag for ecdsa keys (ECDSA-SECP256K1/0) ⋮---- // CREATE3 salts ⋮---- function getDeployerAddress() internal returns (address deployer) { ⋮---- function getStakingToken() internal returns (address) { ⋮---- function getNetwork() internal returns (address) { ⋮---- function _keyRegistryParams() internal override returns (address implementation, bytes memory initData) { ⋮---- function _votingPowerProviderParams() internal override returns (address implementation, bytes memory initData) { ⋮---- function _settlementParams() internal override returns (address implementation, bytes memory initData) { ⋮---- function _valSetDriverParams() internal override returns (address implementation, bytes memory initData) { ⋮---- function runDeployKeyRegistry() public override { ⋮---- function runDeployVotingPowerProvider() public override { ⋮---- function runDeploySettlement() public override { ⋮---- function runDeployValSetDriver() public override { ⋮---- function configureOperatorKeys(uint256 index) public { ⋮---- // Register BLS-BN254 key with tag 11, not related to header key tag ⋮---- // Register ECDSA key ⋮---- function registerOperator(uint256 index, uint256 stakeAmount) public { ⋮---- function fundOperators() public { ⋮---- function getOperator(uint256 index) public returns (VmSafe.Wallet memory operator) { // deterministic operator private key ⋮---- function getBLSKeys(uint256 privateKey) public returns (BN254.G1Point memory, BN254.G2Point memory) { ⋮---- function printOperatorsInfo() public { ```` ## File: snapshots/gas.txt ```` No files changed, compilation skipped Ran 2 tests for test/SumTask.t.sol:SumTaskTest [PASS] test_CreateTask() (gas: 123340) [PASS] test_RespondToTask() (gas: 205638) Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 3.73ms (1.36ms CPU time) ╭----------------------------------+-----------------+--------+--------+--------+---------╮ | src/SumTask.sol:SumTask Contract | | | | | | +=========================================================================================+ | Deployment Cost | Deployment Size | | | | | |----------------------------------+-----------------+--------+--------+--------+---------| | 0 | 2587 | | | | | |----------------------------------+-----------------+--------+--------+--------+---------| | | | | | | | |----------------------------------+-----------------+--------+--------+--------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |----------------------------------+-----------------+--------+--------+--------+---------| | createTask | 115256 | 115256 | 115256 | 115256 | 2 | |----------------------------------+-----------------+--------+--------+--------+---------| | nonce | 2294 | 2294 | 2294 | 2294 | 1 | |----------------------------------+-----------------+--------+--------+--------+---------| | respondTask | 78984 | 78984 | 78984 | 78984 | 1 | |----------------------------------+-----------------+--------+--------+--------+---------| | responses | 4665 | 4665 | 4665 | 4665 | 1 | ╰----------------------------------+-----------------+--------+--------+--------+---------╯ ╭------------------------------------------------------+-----------------+------+--------+------+---------╮ | test/mock/SettlementMock.sol:SettlementMock Contract | | | | | | +=========================================================================================================+ | Deployment Cost | Deployment Size | | | | | |------------------------------------------------------+-----------------+------+--------+------+---------| | 226020 | 827 | | | | | |------------------------------------------------------+-----------------+------+--------+------+---------| | | | | | | | |------------------------------------------------------+-----------------+------+--------+------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |------------------------------------------------------+-----------------+------+--------+------+---------| | getCaptureTimestampFromValSetHeaderAt | 372 | 372 | 372 | 372 | 1 | |------------------------------------------------------+-----------------+------+--------+------+---------| | getQuorumThresholdFromValSetHeaderAt | 308 | 308 | 308 | 308 | 1 | |------------------------------------------------------+-----------------+------+--------+------+---------| | getRequiredKeyTagFromValSetHeaderAt | 438 | 438 | 438 | 438 | 1 | |------------------------------------------------------+-----------------+------+--------+------+---------| | verifyQuorumSigAt | 1249 | 1249 | 1249 | 1249 | 1 | ╰------------------------------------------------------+-----------------+------+--------+------+---------╯ Ran 1 test suite in 6.23ms (3.73ms CPU time): 2 tests passed, 0 failed, 0 skipped (2 total tests) ```` ## File: snapshots/sizes.txt ```` No files changed, compilation skipped ╭--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------╮ | Contract | Runtime Size (B) | Initcode Size (B) | Runtime Margin (B) | Initcode Margin (B) | +====================================================================================================================================================================================+ | Address | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | BN254 | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | BN254G2 | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | Bytes | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | Checkpoints (node_modules/@openzeppelin/contracts/utils/structs/Checkpoints.sol) | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | Checkpoints (node_modules/@symbioticfi/core/src/contracts/libraries/Checkpoints.sol) | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | Checkpoints (node_modules/@symbioticfi/relay-contracts/src/libraries/structs/Checkpoints.sol) | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | Create2 | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | CreateXWrapper | 2,764 | 2,792 | 21,812 | 46,360 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | Driver | 17,519 | 17,547 | 7,057 | 31,605 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | ECDSA | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | ERC1967Proxy | 122 | 934 | 24,454 | 48,218 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | ERC1967Utils | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | ERC4626Math | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | Errors | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | ExtraDataStorageHelper | 123 | 173 | 24,453 | 48,979 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | FeeOnTransferToken | 1,785 | 3,197 | 22,791 | 45,955 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | InputNormalizer | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | KeyBlsBn254 | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | KeyEcdsaSecp256k1 | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | KeyRegistry (node_modules/@symbioticfi/relay-contracts/src/modules/key-registry/KeyRegistry.sol) | 14,998 | 15,026 | 9,578 | 34,126 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | KeyRegistry (src/symbiotic/KeyRegistry.sol) | 15,267 | 15,295 | 9,309 | 33,857 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | KeyTags | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | Logs | 4,290 | 4,342 | 20,286 | 44,810 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | Math | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | MessageHashUtils | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | MockERC20 | 1,821 | 2,911 | 22,755 | 46,241 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | Network | 12,358 | 12,550 | 12,218 | 36,602 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | OpNetVaultAutoDeployLogic | 5,693 | 5,745 | 18,883 | 43,407 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | Panic | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | PersistentSet | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | ProxyAdmin | 977 | 1,213 | 23,599 | 47,939 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | SafeCast | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | SafeERC20 | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | Settlement (src/symbiotic/Settlement.sol) | 11,798 | 11,826 | 12,778 | 37,326 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | SettlementMock | 799 | 827 | 23,777 | 48,325 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | SigBlsBn254 | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | SigEcdsaSecp256k1 | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | SigVerifierBlsBn254Simple | 4,946 | 4,974 | 19,630 | 44,178 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | SigVerifierBlsBn254ZK | 2,694 | 3,774 | 21,882 | 45,378 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | SignatureChecker | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | SignedMath | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | Simulation | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | StorageSlot | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | Strings | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | Subnetwork | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | SumTask | 2,421 | 2,555 | 22,155 | 46,597 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | SymbioticCoreBytecode | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | SymbioticCoreConstants | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | SymbioticUtils | 80 | 109 | 24,496 | 49,043 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | TimelockControllerUpgradeable | 7,690 | 7,718 | 16,886 | 41,434 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | Token | 1,723 | 3,065 | 22,853 | 46,087 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | TransparentUpgradeableProxy | 1,073 | 3,445 | 23,503 | 45,707 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | VotingPowerProviderLogic | 15,628 | 15,680 | 8,948 | 33,472 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | VotingPowers | 14,815 | 15,023 | 9,761 | 34,129 | ╰--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------╯ ```` ## File: src/symbiotic/Driver.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {OzAccessControl} from "@symbioticfi/relay-contracts/src/modules/common/permissions/OzAccessControl.sol"; import {ValSetDriver} from "@symbioticfi/relay-contracts/src/modules/valset-driver/ValSetDriver.sol"; ⋮---- contract Driver is ValSetDriver, OzAccessControl { function initialize(ValSetDriverInitParams memory valSetDriverInitParams, address defaultAdmin) ```` ## File: src/symbiotic/KeyRegistry.sol ```` // SPDX-License-Identifier: MIT ⋮---- import { KeyRegistry as SymbioticKeyRegistry } from "@symbioticfi/relay-contracts/src/modules/key-registry/KeyRegistry.sol"; ⋮---- contract KeyRegistry is SymbioticKeyRegistry { function initialize(KeyRegistryInitParams memory keyRegistryInitParams) public virtual initializer { ```` ## File: src/symbiotic/Settlement.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {OzAccessControl} from "@symbioticfi/relay-contracts/src/modules/common/permissions/OzAccessControl.sol"; import {Settlement as SymbioticSettlement} from "@symbioticfi/relay-contracts/src/modules/settlement/Settlement.sol"; ⋮---- contract Settlement is SymbioticSettlement, OzAccessControl { function initialize(SettlementInitParams memory settlementInitParams, address defaultAdmin) ```` ## File: src/symbiotic/VotingPowers.sol ```` // SPDX-License-Identifier: MIT ⋮---- import { EqualStakeVPCalc } from "@symbioticfi/relay-contracts/src/modules/voting-power/common/voting-power-calc/EqualStakeVPCalc.sol"; import { OpNetVaultAutoDeploy } from "@symbioticfi/relay-contracts/src/modules/voting-power/extensions/OpNetVaultAutoDeploy.sol"; import {OzOwnable} from "@symbioticfi/relay-contracts/src/modules/common/permissions/OzOwnable.sol"; import {VotingPowerProvider} from "@symbioticfi/relay-contracts/src/modules/voting-power/VotingPowerProvider.sol"; ⋮---- contract VotingPowers is VotingPowerProvider, OzOwnable, EqualStakeVPCalc, OpNetVaultAutoDeploy { ⋮---- function initialize( ⋮---- function _registerOperatorImpl(address operator) internal override(OpNetVaultAutoDeploy, VotingPowerProvider) { ⋮---- function _unregisterOperatorVaultImpl(address operator, address vault) ```` ## File: src/SumTask.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {ISettlement} from "@symbioticfi/relay-contracts/src/interfaces/modules/settlement/ISettlement.sol"; ⋮---- contract SumTask { ⋮---- event CreateTask(bytes32 indexed taskId, Task task); ⋮---- event RespondTask(bytes32 indexed taskId, Response response); ⋮---- function getTaskStatus(bytes32 taskId) public view returns (TaskStatus) { ⋮---- function createTask(uint256 numberA, uint256 numberB) public returns (bytes32 taskId) { ⋮---- function respondTask(bytes32 taskId, uint256 result, uint48 epoch, bytes calldata proof) public { // check if the task is not responded yet ⋮---- // verify that the verifying epoch is not stale ⋮---- // verify the quorum signature ```` ## File: test/mock/SettlementMock.sol ```` // SPDX-License-Identifier: MIT ⋮---- contract SettlementMock { function getRequiredKeyTagFromValSetHeaderAt(uint48) public pure returns (uint8) { ⋮---- function getQuorumThresholdFromValSetHeaderAt(uint48) public pure returns (uint256) { ⋮---- function getCaptureTimestampFromValSetHeaderAt(uint48) public pure returns (uint48) { ⋮---- function getLastCommittedHeaderEpoch() public pure returns (uint48) { ⋮---- function verifyQuorumSigAt(bytes calldata, uint8, uint256, bytes calldata, uint48, bytes calldata) ⋮---- function verifyQuorumSig(bytes calldata, uint8, uint256, bytes calldata) public pure returns (bool) { ```` ## File: test/SumTask.t.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {Test} from "forge-std/Test.sol"; import {SumTask} from "../src/SumTask.sol"; import {SettlementMock} from "./mock/SettlementMock.sol"; ⋮---- contract SumTaskTest is Test { ⋮---- function setUp() public { ⋮---- function test_CreateTask() public { ⋮---- function test_RespondToTask() public { ```` ## File: .gitignore ```` # macOS .DS_Store # Ignore node_modules and dependencies node_modules *.log yarn-error.log # Ignore build outputs dist out **/__pycache__ # Ignore environment files .env # Ignore version control files docs/autogen/.git docs/autogen/.gitignore # Ignore editor and OS-specific files *.swp *.DS_Store Thumbs.db # Ignore IDE-specific files .idea/ .vscode/ cache/ out/ broadcast/ deployments/ script/logs.txt lcov.info /target /coverage /report .password # Network generated files temp-network/ ```` ## File: .gitmodules ```` [submodule "lib/forge-std"] path = lib/forge-std url = https://github.com/foundry-rs/forge-std ```` ## File: .pre-commit-config.yaml ````yaml repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v5.0.0 hooks: - id: mixed-line-ending args: ["--fix=lf"] exclude: "^(docs/autogen|snapshots/)" - id: trailing-whitespace exclude: "^(docs/autogen|snapshots/)" - id: end-of-file-fixer exclude: "^(docs/autogen|snapshots/)" - id: check-merge-conflict - id: check-json exclude: "^(docs/autogen|snapshots/)" - id: check-yaml - repo: local hooks: - id: sort-imports name: Sort imports description: Normalize and sort import statements in Solidity files language: system entry: python3 script/utils/sort_imports.py files: "^(src|examples)/.*\\.sol$" pass_filenames: true - id: sort-errors name: Sort solidity errors description: Alphabetize error declarations in Solidity files language: system entry: python3 script/utils/sort_errors.py files: "^(src|examples)/.*\\.sol$" pass_filenames: true - id: format name: Format solidity code description: Format solidity code with `forge fmt` language: system entry: forge fmt files: '\.sol$' exclude: "^lib/" pass_filenames: true - id: forge-snapshots name: Update forge snapshots language: system entry: bash -lc 'mkdir -p snapshots; forge build; forge build --sizes | tee snapshots/sizes.txt >/dev/null; forge test --isolate --gas-report | tee snapshots/gas.txt >/dev/null' pass_filenames: false - repo: https://github.com/pre-commit/mirrors-prettier rev: v3.1.0 hooks: - id: prettier name: Format non-solidity files with prettier exclude: "^(docs/autogen|snapshots/)" language_version: system ```` ## File: .prettierignore ```` foundry.toml out lib/ cache/ docs/autogenerated *.sol deployments/ snapshots/ ```` ## File: .prettierrc ```` { "printWidth": 120, "tabWidth": 2, "useTabs": false, "singleQuote": false, "bracketSpacing": true, "trailingComma": "all", "overrides": [ { "files": "*.sol", "options": { "printWidth": 120, "tabWidth": 4, "useTabs": false, "singleQuote": false, "bracketSpacing": false } }, { "files": "*.json", "options": { "tabWidth": 4 } } ] } ```` ## File: CONTRIBUTING.md ````markdown # Contributing - [Install](#install) - [Pre-commit Hooks](#pre-commit-hooks) - [Requirements for merge](#requirements-for-merge) - [Branching](#branching) - [Main](#main) - [Audit](#audit) - [Code Practices](#code-practices) - [Code Style](#code-style) - [Solidity Versioning](#solidity-versioning) - [Interfaces](#interfaces) - [NatSpec \& Comments](#natspec--comments) - [Testing](#testing) - [Best Practices](#best-practices) - [IR Compilation](#ir-compilation) - [Gas Metering](#gas-metering) - [Deployment](#deployment) - [Bytecode Hash](#bytecode-hash) - [Dependency Management](#dependency-management) - [Releases](#releases) ## Install Follow these steps to set up your local environment for development: - [Install foundry](https://book.getfoundry.sh/getting-started/installation) - Install dependencies: `forge install` - [Install pre-commit](https://pre-commit.com/#installation) - Install pre commit hooks: `pre-commit install` ## Pre-commit Hooks Follow the [installation steps](#install) to enable pre-commit hooks. To ensure consistency in our formatting `pre-commit` is used to check whether code was formatted properly and the documentation is up to date. Whenever a commit does not meet the checks implemented by pre-commit, the commit will fail and the pre-commit checks will modify the files to make the commits pass. Include these changes in your commit for the next commit attempt to succeed. On pull requests the CI checks whether all pre-commit hooks were run correctly. This repo includes the following pre-commit hooks that are defined in the `.pre-commit-config.yaml`: - `mixed-line-ending`: This hook ensures that all files have the same line endings (LF). - `trailing-whitespace`: Strips trailing spaces from lines so that diffs remain clean and editors don't introduce noise. - `end-of-file-fixer`: Ensures every file ends with a single newline and removes extra blank lines at the end of files. - `check-merge-conflict`: Fails when Git merge conflict markers are present to avoid committing unresolved conflicts. - `check-json`: Validates JSON files and fails fast on malformed syntax. - `check-yaml`: Parses YAML files to verify they are syntactically valid. - `sort-imports`: Normalises and sorts imports according to the rules mentioned in the [Code Style](#code-style) below. - `sort-errors`: Sorts errors according to the rules mentioned in the [Code Style](#code-style) below. - `format`: This hook uses `forge fmt` to format all Solidity files. - `doc`: This hook uses `forge doc` to generate the Solidity documentation. Commit the generated files whenever the documentation changes. - `prettier`: All remaining files are formatted using prettier. ## Requirements for merge In order for a PR to be merged, it must pass the following requirements: - All commits within the PR must be signed - CI must pass (tests, linting, etc.) - New features must be merged with associated tests - Bug fixes must have a corresponding test that fails without the fix - The PR must be approved by at least one maintainer ## Branching This section outlines the branching strategy of this repo. ### Main The main branch is supposed to reflect the deployed state on all networks, if not indicated otherwise inside the README. Only audited code should be merged into main. Сommits from dev branches should be merged into the main branch using a regular merge strategy. The commit messages should follow [the Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/). ### Audit Before an audit, the code should be frozen on a branch dedicated to the audit with the naming convention `audit/`. Each fix in response to an audit finding should be developed as a separate commit. The commit message should look similar to `fix: - `. ## Code Practices ### Code Style The repo follows the official [Solidity Style Guide](https://docs.soliditylang.org/en/latest/style-guide.html). In addition to that, this repo also borrows the following rules from [OpenZeppelin](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/GUIDELINES.md#solidity-conventions): - Internal or private state variables or functions should have an underscore prefix. ```solidity contract TestContract { uint256 private _privateVar; uint256 internal _internalVar; function _testInternal() internal { ... } function _testPrivate() private { ... } } ``` - Naming collisions should be avoided using a single trailing underscore. ```solidity contract TestContract { uint256 public foo; constructor(uint256 foo_) { foo = foo_; } } ``` - Interface names should have a capital I prefix. ```solidity interface IERC777 { ``` - Contracts not intended to be used standalone should be marked abstract, so they are required to be inherited by other contracts. ```solidity abstract contract AccessControl is ..., { ``` - Unchecked arithmetic blocks should contain comments explaining why overflow is guaranteed not to happen or is permissible. If the reason is immediately apparent from the line above the unchecked block, the comment may be omitted. Also, such exceptions/additions exist: - Functions should be grouped according to their visibility and ordered: 1. constructor 2. external 3. public 4. internal 5. private 6. receive function (if exists) 7. fallback function (if exists) - Each contract should be virtually divided into sections by using such separators: 1. /\* CONSTANTS \*/ 2. /\* IMMUTABLES \*/ 3. /\* STATE VARIABLES \*/ 4. /\* MODIFIERS \*/ 5. /\* CONSTRUCTOR \*/ 6. /\* EXTERNAL FUNCTIONS \*/ 7. /\* PUBLIC FUNCTIONS \*/ 8. /\* INTERNAL FUNCTIONS \*/ 9. /\* PRIVATE FUNCTIONS \*/ 10. /\* RECEIVE FUNCTION \*/ 11. /\* FALLBACK FUNCTION \*/ - Each interface should be virtually divided into sections by using such separators: 1. /\* ERRORS \*/ 2. /\* STRUCTS \*/ 3. /\* EVENTS \*/ 4. /\* FUNCTIONS \*/ - Do not use external and private visibilities in most cases. - Events should generally be emitted immediately after the state change that they represent, and should be named the same as the function's name. Some exceptions may be made for gas efficiency if the result doesn't affect the observable ordering of events. ```solidity function _burn(address who, uint256 value) internal { super._burn(who, value); emit Burn(who, value); } ``` - Custom errors should be used whenever possible. The naming should be concise and easy to read. - Imports should be divided into separate groups and ordered alphabetically ascending inside each group: 1. contracts 2. libraries 3. interfaces 4. external files separately ```solidity import {NetworkManager} from "../base/NetworkManager.sol"; import {OzEIP712} from "../base/OzEIP712.sol"; import {PermissionManager} from "../base/PermissionManager.sol"; import {Checkpoints} from "../../libraries/structs/Checkpoints.sol"; import {KeyTags} from "../../libraries/utils/KeyTags.sol"; import {ISettlement} from "../interfaces/modules/settlement/ISettlement.sol"; import {ISigVerifier} from "../interfaces/modules/settlement/sig-verifiers/ISigVerifier.sol"; import {StaticDelegateCallable} from "@symbioticfi/core/src/contracts/common/StaticDelegateCallable.sol"; import {Subnetwork} from "@symbioticfi/core/src/contracts/libraries/Subnetwork.sol"; import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; ``` - In case of comparison with `msg.sender` or `tx.origin`, these keywords should be on the right side of the inequality. ```solidity modifier onlyOwner() internal { if (owner != msg.sender) { revert NotOwner(); } } ``` - Errors should be ordered alphabetically ascending. ```solidity error InsufficientFunds(); error NoAccess(); error NotOwner(); ``` ### Solidity Versioning Contracts that are meant to be deployed should have an explicit version set in the `pragma` statement. ```solidity pragma solidity 0.8.X; ``` Abstract contracts, libraries and interfaces should use the caret (`^`) range operator to specify the version range to ensure better compatibility. ```solidity pragma solidity ^0.X.0; ``` Libraries and abstract contracts using functionality introduced in newer versions of Solidity can use caret range operators with higher path versions (e.g., `^0.8.24` when using transient storage opcodes). For interfaces, it should be considered to use the greater than or equal to (`>=`) range operator to ensure better compatibility with future versions of Solidity. ### Interfaces Every contract MUST implement its corresponding interface that includes all externally callable functions, errors and events. ### NatSpec & Comments Interfaces should be the entry point for all contracts. When exploring a contract within the repository, the interface MUST contain all relevant information to understand the functionality of the contract in the form of NatSpec comments. This includes all externally callable functions, structs, errors and events. The NatSpec documentation MUST be added to the functions, structs, errors and events within the interface. This allows a reader to understand the functionality of a function before moving on to the implementation. The implementing functions MUST point to the NatSpec documentation in the interface using `@inheritdoc`. Internal and private functions shouldn't have NatSpec documentation except for `@dev` comments, whenever more context is needed. Additional comments within a function should only be used to give more context to more complex operations; otherwise, the code should be kept readable and self-explanatory. NatSpec comments in contracts should use a triple slash (`///`) to bring less noise to the implementation, while libraries and interfaces should use `/* */` wrappers. The comments should respect the following rules: - For read functions: `@notice Returns <...>` - For write functions: `@notice ` - For structs: `@notice ` - For errors: `@notice Raised when <...>` - For events: `@notice Emitted when <...>` Each contract/library/interface should have a title comment that should follow such a structure: 1. `@title ` (e.g., `Vault`) 2. `@notice Contract/Library/Interface for <...>.` - also, other variations are possible, e.g.: - `@notice Interface for the Vault contract.` - `@notice Base contract for <...>.` - `@notice Library-logic for <...>.` 3. `@dev <...>` (optional) ## Testing The following testing practices should be followed when writing unit tests for new code. All functions, lines and branches should be tested to result in 100% testing coverage. Fuzz parameters and conditions whenever possible. Extremes should be tested in dedicated edge case and corner case tests. Invariants should be tested in dedicated invariant tests. Differential testing should be used to compare assembly implementations with implementations in Solidity or testing alternative implementations against existing Solidity or non-Solidity code using ffi. New features must be merged with associated tests. Bug fixes should have a corresponding test that fails without the bug fix. ### Best Practices Best practices and naming conventions should be followed as outlined in the [Foundry Book](https://getfoundry.sh/forge/tests/overview). ### IR Compilation All contracts and tests should be compilable without IR whenever possible. ### Gas Metering Gas for function calls should be metered using the built-in `vm.snapshotGasLastCall` function in forge. To meter across multiple calls `vm.startSnapshotGas` and `vm.stopSnapshotGas` can be used. Tests that measure gas should be annotated with `/// forge-config: default.isolate = true` and not be fuzzed to ensure that the gas snapshot is accurate and consistent for CI verification. All external functions should have a gas snapshot test, and diverging paths within a function should have appropriate gas snapshot tests. For more information on gas metering, see the [Forge cheatcodes reference](https://getfoundry.sh/reference/cheatcodes/gas-snapshots/#snapshotgas-cheatcodes). ### Bytecode Hash Bytecode hash should be set to `none` in the `foundry.toml` file to ensure that the bytecode is consistent. ## Dependency Management The preferred way to manage dependencies is using [`forge install`](https://book.getfoundry.sh/forge/dependencies). This ensures that your project uses the correct versions and structure for all external libraries. Also, `npm` and `soldeer` packages should be published to increase coverage of different use-cases. ## Releases Every deployment and change made to contracts after deployment should be accompanied by a tag and release on GitHub. ```` ## File: foundry.lock ```` { "circuits": { "rev": "338c1b1faadf409d9f9fb7f64e7e2d1df4da9d16" }, "lib/forge-std": { "tag": { "name": "v1.11.0", "rev": "8e40513d678f392f398620b3ef2b418648b33e89" } } } ```` ## File: foundry.toml ````toml [profile.default] evm_version = "prague" solc = "0.8.28" optimizer = true optimizer_runs = 200 via_ir = false bytecode_hash = "none" src = "src" out = "out" libs = ["lib"] fs_permissions = [{ access = "read-write", path = "./"}] gas_reports = ["*"] gas_limit = "18446744073709551615" dynamic_test_linking = true ignored_warnings_from = ["test/","script/"] ffi = true [rpc_endpoints] mainnet = "${ETH_RPC_URL}" hoodi = "${ETH_RPC_URL_HOODI}" holesky = "${ETH_RPC_URL_HOLESKY}" sepolia = "${ETH_RPC_URL_SEPOLIA}" [fmt] bracket_spacing = false int_types = "long" line_length = 120 multiline_func_header = "attributes_first" number_underscore = "thousands" quote_style = "double" tab_width = 4 single_line_statement_blocks = "preserve" sort_imports = false contract_new_lines = false override_spacing = false hex_underscore = "preserve" wrap_comments = false [lint] lint_on_build = false exclude_lints = ["asm-keccak256","mixed-case-function","mixed-case-variable","pascal-case-struct","screaming-snake-case-const"] ignore = ["test/**/*.sol","script/**/*.sol","src/interfaces/**/*.sol"] additional_compiler_profiles = [ { name = "test", via_ir = false, optimizer = false }, ] compilation_restrictions = [ { paths = "test/**", via_ir = false, optimizer = false }, ] [profile.default.fuzz] runs = 1000 max_test_rejects = 262144 [profile.pr.fuzz] runs = 10000 max_test_rejects = 262144 [profile.ci.fuzz] runs = 100000 max_test_rejects = 262144 [profile.debug] via_ir = false optimizer_runs = 200 fuzz.runs = 100 # See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options ```` ## File: generate_network.sh ````bash #!/bin/bash # Symbiotic Network Generator # This script generates a Docker Compose setup for a local blockchain network # with configurable number of operators, commiters, and aggregators set -e # Define the image tag for the relay service, that the current sum node is compatible with RELAY_IMAGE_TAG="0.3.0" RED='\033[0;31m' GREEN='\033[0;32m' YELLOW='\033[1;33m' BLUE='\033[0;34m' NC='\033[0m' # Default values DEFAULT_OPERATORS=4 DEFAULT_COMMITERS=1 DEFAULT_AGGREGATORS=1 MAX_OPERATORS=999 print_status() { echo -e "${GREEN}[INFO]${NC} $1" } print_warning() { echo -e "${YELLOW}[WARNING]${NC} $1" } print_error() { echo -e "${RED}[ERROR]${NC} $1" } print_header() { echo -e "${BLUE}================================${NC}" echo -e "${BLUE}$1${NC}" echo -e "${BLUE}================================${NC}" } validate_number() { local num=$1 local name=$2 if ! [[ "$num" =~ ^[0-9]+$ ]] || [ "$num" -lt 1 ]; then print_error "$name must be a positive integer" exit 1 fi } get_user_input() { echo print_header "Symbiotic Network Configuration" echo read -p "Enter number of operators (default: $DEFAULT_OPERATORS, max: $MAX_OPERATORS): " operators operators=${operators:-$DEFAULT_OPERATORS} validate_number "$operators" "Number of operators" read -p "Enter number of commiters (default: $DEFAULT_COMMITERS): " commiters commiters=${commiters:-$DEFAULT_COMMITERS} validate_number "$commiters" "Number of commiters" read -p "Enter number of aggregators (default: $DEFAULT_AGGREGATORS): " aggregators aggregators=${aggregators:-$DEFAULT_AGGREGATORS} validate_number "$aggregators" "Number of aggregators" # Validate that commiters + aggregators <= operators total_special_roles=$((commiters + aggregators)) if [ "$total_special_roles" -gt "$operators" ]; then print_error "Total commiters ($commiters) + aggregators ($aggregators) cannot exceed total operators ($operators)" exit 1 fi if [ "$operators" -gt $MAX_OPERATORS ]; then print_error "Maximum $MAX_OPERATORS operators supported. Requested: $operators" exit 1 fi print_status "Configuration:" print_status " Operators: $operators" print_status " Committers: $commiters" print_status " Aggregators: $aggregators" print_status " Regular signers: $((operators - total_special_roles))" } # Function to generate Docker Compose file generate_docker_compose() { local operators=$1 local commiters=$2 local aggregators=$3 local network_dir="temp-network" if [ -d "$network_dir" ]; then print_status "Cleaning up existing $network_dir directory..." rm -rf "$network_dir" fi mkdir -p "$network_dir/deploy-data" chmod 777 "$network_dir/deploy-data" # Create cache and broadcast directories with proper permissions print_status "Creating out, cache and broadcast directories..." mkdir -p "$network_dir/out" "$network_dir/cache" "$network_dir/broadcast" chmod 777 "$network_dir/out" "$network_dir/cache" "$network_dir/broadcast" local deploy_config_src="script/my-relay-deploy.toml" local deploy_config_dst="$network_dir/my-relay-deploy.toml" if [ ! -f "$deploy_config_src" ]; then print_error "Deployment config not found at $deploy_config_src" exit 1 fi print_status "Copying deployment config to $deploy_config_dst" cp "$deploy_config_src" "$deploy_config_dst" for i in $(seq 1 $operators); do local storage_dir="$network_dir/data-$(printf "%02d" $i)" mkdir -p "$storage_dir" # Make sure the directory is writable chmod 777 "$storage_dir" done local anvil_port=8545 local anvil_settlement_port=8546 local relay_start_port=8081 local sum_start_port=9091 cat > "$network_dir/docker-compose.yml" << EOF services: # Main Anvil local Ethereum network (Chain ID: 31337) anvil: image: ghcr.io/foundry-rs/foundry:v1.4.3 container_name: symbiotic-anvil entrypoint: ["anvil"] command: "--port 8545 --chain-id 31337 --timestamp 1754051800 --auto-impersonate --slots-in-an-epoch 1 --accounts 10 --balance 10000 --gas-limit 30000000 --gas-price 10000000" environment: - ANVIL_IP_ADDR=0.0.0.0 ports: - "8545:8545" networks: - symbiotic-network healthcheck: test: ["CMD", "cast", "client", "--rpc-url", "http://localhost:8545"] interval: 2s timeout: 1s retries: 10 # Settlement Anvil local Ethereum network (Chain ID: 31338) anvil-settlement: image: ghcr.io/foundry-rs/foundry:v1.4.3 container_name: symbiotic-anvil-settlement entrypoint: ["anvil"] command: "--port 8546 --chain-id 31338 --timestamp 1754051800 --auto-impersonate --slots-in-an-epoch 1 --accounts 10 --balance 10000 --gas-limit 30000000 --gas-price 10000000" environment: - ANVIL_IP_ADDR=0.0.0.0 ports: - "8546:8546" networks: - symbiotic-network healthcheck: test: ["CMD", "cast", "client", "--rpc-url", "http://localhost:8546"] interval: 2s timeout: 1s retries: 10 # Contract deployment service for main chain deployer: build: context: .. dockerfile: network-scripts/deployer.Dockerfile image: symbiotic-deployer container_name: symbiotic-deployer user: "1000:1000" volumes: - ../:/app - ./cache:/app/cache - ./broadcast:/app/broadcast - ./out:/app/out - ./deploy-data:/deploy-data - ./my-relay-deploy.toml:/my-relay-deploy.toml working_dir: /app command: ./network-scripts/deploy.sh depends_on: anvil: condition: service_healthy anvil-settlement: condition: service_healthy networks: - symbiotic-network environment: - OPERATOR_COUNT=$operators - NUM_AGGREGATORS=$aggregators - NUM_COMMITTERS=$commiters # Genesis generation service genesis-generator: image: symbioticfi/relay:$RELAY_IMAGE_TAG container_name: symbiotic-genesis-generator volumes: - ../:/workspace - ./deploy-data:/deploy-data working_dir: /workspace command: ./network-scripts/genesis-generator.sh depends_on: deployer: condition: service_completed_successfully networks: - symbiotic-network EOF local committer_count=0 local aggregator_count=0 local signer_count=0 # Calculate symb private key properly # ECDSA secp256k1 private keys must be 32 bytes (64 hex chars) and within range [1, n-1] # where n = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 BASE_PRIVATE_KEY=1000000000000000000 SWARM_KEY=0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364140 for i in $(seq 1 $operators); do local port=$((relay_start_port + i - 1)) local storage_dir="data-$(printf "%02d" $i)" local key_index=$((i - 1)) SYMB_PRIVATE_KEY_DECIMAL=$(($BASE_PRIVATE_KEY + $key_index)) SYMB_SECONDARY_PRIVATE_KEY_DECIMAL=$(($BASE_PRIVATE_KEY + $key_index + 10000)) SYMB_PRIVATE_KEY_HEX=$(printf "%064x" $SYMB_PRIVATE_KEY_DECIMAL) SYMB_SECONDARY_PRIVATE_KEY_HEX=$(printf "%064x" $SYMB_SECONDARY_PRIVATE_KEY_DECIMAL) # Validate ECDSA secp256k1 private key range (must be between 1 and n-1) # Maximum valid key: 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364140 if [ $SYMB_PRIVATE_KEY_DECIMAL -eq 0 ]; then echo "ERROR: Generated private key is zero (invalid for ECDSA)" exit 1 fi cat >> "$network_dir/docker-compose.yml" << EOF # Relay sidecar $i ($role_name) relay-sidecar-$i: image: symbioticfi/relay:$RELAY_IMAGE_TAG container_name: symbiotic-relay-$i command: - /workspace/network-scripts/sidecar-start.sh - symb/0/15/0x$SYMB_PRIVATE_KEY_HEX,symb/0/11/0x$SYMB_SECONDARY_PRIVATE_KEY_HEX,symb/1/0/0x$SYMB_PRIVATE_KEY_HEX,evm/1/31337/0x$SYMB_PRIVATE_KEY_HEX,evm/1/31338/0x$SYMB_PRIVATE_KEY_HEX,p2p/1/0/$SWARM_KEY,p2p/1/1/$SYMB_PRIVATE_KEY_HEX - /app/$storage_dir ports: - "$port:8080" volumes: - ../:/workspace - ./$storage_dir:/app/$storage_dir - ./deploy-data:/deploy-data depends_on: genesis-generator: condition: service_completed_successfully networks: - symbiotic-network restart: unless-stopped EOF local relay_port=$((relay_start_port + i - 1)) local sum_port=$((sum_start_port + i - 1)) cat >> "$network_dir/docker-compose.yml" << EOF # Sum node $i sum-node-$i: build: context: ../off-chain dockerfile: Dockerfile container_name: symbiotic-sum-node-$i entrypoint: ["/workspace/network-scripts/sum-node-start.sh"] command: ["relay-sidecar-$i:8080", "$SYMB_PRIVATE_KEY_HEX"] volumes: - ../:/workspace - ./deploy-data:/deploy-data ports: - "$sum_port:8080" depends_on: relay-sidecar-$i: condition: service_started networks: - symbiotic-network restart: unless-stopped EOF done cat >> "$network_dir/docker-compose.yml" << EOF networks: symbiotic-network: driver: bridge EOF } # Main execution main() { print_header "Symbiotic Network Generator" # Check if required tools are available if ! command -v docker &> /dev/null; then print_error "Docker is not installed or not in PATH" exit 1 fi if ! command -v docker-compose &> /dev/null && ! docker compose version &> /dev/null; then print_error "Docker Compose is not installed or not in PATH" exit 1 fi get_user_input print_status "Generating Docker Compose configuration..." print_status "Creating $operators new operator accounts..." generate_docker_compose "$operators" "$commiters" "$aggregators" print_header "Setup Complete!" echo print_status "Files generated in temp-network/ directory:" echo " - temp-network/docker-compose.yml" echo " - temp-network/data-* (storage directories)" echo print_status "To start the network, run:" echo " docker compose --project-directory temp-network up -d" echo print_status "To check the status, run:" echo " docker compose --project-directory temp-network ps" echo print_status "To view logs, run:" echo " docker compose --project-directory temp-network logs -f" echo print_warning "Note: The first startup may take several minutes(2-4mins) as it needs to:" echo " 1. Download Docker images" echo " 2. Build the sum-node image" echo " 3. Deploy contracts" echo " 4. Generate network genesis and fund operators" echo } main "$@" ```` ## File: package.json ````json { "name": "@symbioticfi/symbiotic-super-sum", "version": "1.0.0", "description": "Simple task-based network built with Symbiotic Relay", "homepage": "https://symbiotic.fi/symbiotic-super-sum", "bugs": "https://github.com/symbioticfi/symbiotic-super-sum/issues", "license": "MIT", "author": "Symbiotic Team", "files": [ "examples/**/*", "src/**/*", "script/**/*", "test/mocks/**/*" ], "repository": { "type": "git", "url": "https://github.com/symbioticfi/symbiotic-super-sum.git" }, "keywords": [ "solidity", "ethereum", "smart", "contracts", "security" ], "dependencies": { "@openzeppelin/contracts": "5.4.0", "@openzeppelin/contracts-upgradeable": "5.4.0", "@symbioticfi/core": "1.0.3", "@symbioticfi/relay-contracts": "^1.0.0-rc.1", "@symbioticfi/network": "1.0.0-rc.1" } } ```` ## File: README.md ````markdown # Sum task network example [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/symbioticfi/symbiotic-super-sum) ## Prerequisites ### Clone the repository ```bash git clone https://github.com/symbioticfi/symbiotic-super-sum.git ``` Update submodules ```bash git submodule update --init --recursive ``` Install dependencies ```bash npm install ``` ## Running in Docker ### Dependencies - Docker ### Quick Start 1. **Generate the network configuration:** ```bash ./generate_network.sh ``` 2. **Start the network:** ```bash docker compose --project-directory temp-network up -d ``` 3. **Check status:** ```bash docker compose --project-directory temp-network ps ``` ### Services #### Core Services - **anvil**: Local Ethereum network (port 8545) - **anvil-settlement**: Local Ethereum network (port 8546) - **deployer**: Contract deployment service - **genesis-generator**: Network genesis generation service - **network-validator**: intermediary service to mark network setup completion for all nodes #### Relay Sidecars - **relay-sidecar-1**: First relay sidecar (port 8081) - **relay-sidecar-2**: Second relay sidecar (port 8082) - **relay-sidecar-N**: Nth relay sidecar (port 808N) #### Sum Nodes - **sum-node-1**: First sum node (port 9091) - **sum-node-2**: Second sum node (port 9092) - **sum-node-N**: Nth sum node (port 909N) ### Start the network ```bash docker compose --project-directory temp-network up -d ``` ### Check status ```bash docker compose --project-directory temp-network ps ``` ### View logs ```bash # View all logs docker compose --project-directory temp-network logs -f # View specific service logs docker compose --project-directory temp-network logs -f anvil docker compose --project-directory temp-network logs -f anvil-settlement docker compose --project-directory temp-network logs -f deployer docker compose --project-directory temp-network logs -f genesis-generator docker compose --project-directory temp-network logs -f relay-sidecar-1 docker compose --project-directory temp-network logs -f sum-node-1 ``` ### Stop the network ```bash docker compose --project-directory temp-network down ``` ### Clean up data ```bash docker compose --project-directory temp-network down -v rm -rf temp-network ``` ### Create a task ```bash taskID=$(cast send --rpc-url http://127.0.0.1:8545 --json \ --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 \ 0xDf12251aD82BF1eb0E0951AD15d37AE5ED3Ac1dF \ "createTask(uint256,uint256)" 33 9 | jq -r '.logs[0].topics[1]') ``` or ```bash taskID=$(cast send --rpc-url http://127.0.0.1:8546 --json \ --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 \ 0xDf12251aD82BF1eb0E0951AD15d37AE5ED3Ac1dF \ "createTask(uint256,uint256)" 33 9 | jq -r '.logs[0].topics[1]') ``` ### Check task result ```bash result=$(cast call --rpc-url http://127.0.0.1:8545 \ 0xDf12251aD82BF1eb0E0951AD15d37AE5ED3Ac1dF \ "responses(bytes32)" $taskID) cast decode-abi --json "data()(uint48,uint256)" $result ``` or ```bash result=$(cast call --rpc-url http://127.0.0.1:8546 \ 0xDf12251aD82BF1eb0E0951AD15d37AE5ED3Ac1dF \ "responses(bytes32)" $taskID) cast decode-abi --json "data()(uint48,uint256)" $result ``` ### Troubleshooting 1. **Services not starting**: Check logs with `docker compose --project-directory temp-network logs [service-name]` 2. **Port conflicts**: Ensure ports 8545-8546 8081-8099, 9091-9099 are available 3. **Build issues**: Rebuild with `docker compose --project-directory temp-network build` 4. **Reset everything**: `docker compose --project-directory temp-network down -v && rm -rf temp-network && ./generate_network.sh && docker compose --project-directory temp-network up -d` ### Service Endpoints - **Anvil RPC**: http://localhost:8545 - **Anvil Settlement RPC**: http://localhost:8546 - **Relay sidecar 1**: http://localhost:8081 - **Relay sidecar 2**: http://localhost:8082 - **Sum node 1**: http://localhost:9091 - **Sum node 2**: http://localhost:9092 ### Network Configuration The network supports: - **Up to 999 operators** (configurable via `generate_network.sh`) - **Committers**: Operators that commit to the network - **Aggregators**: Operators that aggregate results - **Signers**: Regular operators that sign messages ### Debugging ```bash # Access container shell docker compose --project-directory temp-network exec anvil sh docker compose --project-directory temp-network exec relay-sidecar-1 sh docker compose --project-directory temp-network exec sum-node-1 sh # View real-time logs docker compose --project-directory temp-network logs -f --tail=100 ``` ### Performance Monitoring ```bash # Check resource usage docker stats # Monitor specific container docker stats symbiotic-anvil symbiotic-relay-1 symbiotic-sum-node-1 ``` ## Local Deployments http://anvil:8545: - `ValSetDriver`: 0x43C27243F96591892976FFf886511807B65a33d5 - `SumTask`: 0xDf12251aD82BF1eb0E0951AD15d37AE5ED3Ac1dF - `VotingPowerProvider`: 0x369c72C823A4Fc8d2A3A5C3B15082fb34A342878 - `KeyRegistry`: 0xe1557A820E1f50dC962c3392b875Fe0449eb184F - `Settlement`: 0x882B9439598239d9626164f7578F812Ef324F5Cb - `Network`: 0xfdc4b2cA12dD7b1463CC01D8022a49BDcf5cFa24 http://anvil-settlement:8546: - `SumTask`: 0xDf12251aD82BF1eb0E0951AD15d37AE5ED3Ac1dF - `Settlement`: 0x882B9439598239d9626164f7578F812Ef324F5Cb ```` ## File: remappings.txt ```` node_modules/@symbioticfi/relay-contracts:forge-std/=lib/forge-std/src/ @openzeppelin/contracts/=node_modules/@openzeppelin/contracts/ @openzeppelin/contracts-upgradeable/=node_modules/@openzeppelin/contracts-upgradeable/ @symbioticfi/relay-contracts/=node_modules/@symbioticfi/relay-contracts/ @symbioticfi/network/=node_modules/@symbioticfi/network/ @symbioticfi/core/=node_modules/@symbioticfi/core/ ```` --- ## Symbiotic Flight Delays This file is a merged representation of the entire codebase, combined into a single document by Repomix. The content has been processed where content has been compressed (code blocks are separated by ⋮---- delimiter). # File Summary ## Purpose This file contains a packed representation of the entire repository's contents. It is designed to be easily consumable by AI systems for analysis, code review, or other automated processes. ## File Format The content is organized as follows: 1. This summary section 2. Repository information 3. Directory structure 4. Repository files (if enabled) 5. Multiple file entries, each consisting of: a. A header with the file path (## File: path/to/file) b. The full contents of the file in a code block ## Usage Guidelines - This file should be treated as read-only. Any changes should be made to the original repository files, not this packed version. - When processing this file, use the file path to distinguish between different files in the repository. - Be aware that this file may contain sensitive information. Handle it with the same level of security as you would the original repository. ## Notes - Some files may have been excluded based on .gitignore rules and Repomix's configuration - Binary files are not included in this packed representation. Please refer to the Repository Structure section for a complete list of file paths, including binary files - Files matching patterns in .gitignore are excluded - Files matching default ignore patterns are excluded - Content has been compressed - code blocks are separated by ⋮---- delimiter - Files are sorted by Git change count (files with more changes are at the bottom) # Directory Structure ``` .github/ ISSUE_TEMPLATE/ BUG_REPORT.yaml FEATURE_IMPROVEMENT.yaml workflows/ pre-commit.yaml test.yaml trufflehog.yml CODEOWNERS PULL_REQUEST_TEMPLATE.md network-scripts/ deploy.sh deployer.Dockerfile flight-node-start.sh genesis-generator.sh sidecar-start.sh off-chain/ abis/ FlightDelays.abi.json cmd/ benchmark/ main.go flights-api/ main.go node/ main.go internal/ contracts/ flightDelays.go flights/ store_test.go store.go types.go utils/ util.go .dockerignore Dockerfile go.mod script/ mocks/ MockERC20.sol SymbioticRewardsConstantsHelper.sol utils/ BN254G2.sol sort_errors.py sort_imports.py my-relay-deploy.toml MyRelayDeploy.sol snapshots/ gas.txt sizes.txt src/ symbiotic/ Driver.sol KeyRegistry.sol Settlement.sol VotingPowers.sol FlightDelays.sol test/ mock/ FlightDelaysMocks.sol SettlementMock.sol FlightDelays.t.sol ui/ public/ alpha-air.png beta-wings.png gamma-connect.png logo.png src/ abi/ ERC20.json FlightDelays.json Rewards.json Slasher.json Vault.json api/ flights.ts components/ BuyerPage.tsx ProviderPage.tsx constants/ airlines.ts utils/ format.ts hash.ts App.tsx config.ts main.tsx styles.css types.ts wallet.tsx .dockerignore .env.docker .env.example Dockerfile index.html package.json tsconfig.json tsconfig.tsbuildinfo vite.config.ts .gitignore .gitmodules .pre-commit-config.yaml .prettierignore .prettierrc CONTRIBUTING.md foundry.lock foundry.toml generate_network.sh package.json pnpm-workspace.yaml README.md remappings.txt ``` # Files ## File: .github/ISSUE_TEMPLATE/BUG_REPORT.yaml ````yaml name: Bug report description: File a bug report to help us improve the code title: "[Bug]: " labels: ["bug"] body: - type: markdown attributes: value: | Please check that the bug is not already being tracked. - type: textarea attributes: label: Describe the bug description: Provide a clear and concise description of what the bug is and which contracts it affects. validations: required: true - type: textarea attributes: label: Expected Behavior description: Provide a clear and concise description of the desired fix. validations: required: true - type: textarea attributes: label: To Reproduce description: If you have written tests to showcase the bug, what can we run to reproduce the issue? placeholder: "git checkout / forge test --isolate --mt " - type: textarea attributes: label: Additional context description: If there is any additional context needed like a dependency or integrating contract that is affected please describe it below. ```` ## File: .github/ISSUE_TEMPLATE/FEATURE_IMPROVEMENT.yaml ````yaml name: Feature Improvement description: Suggest an improvement. labels: ["triage"] body: - type: markdown attributes: value: | Please ensure that the feature has not already been requested. - type: dropdown attributes: label: Component description: Which area of code does your idea improve? multiple: true options: - Gas Optimization - General design optimization (improving efficiency, cleanliness, or developer experience) - Testing - Documentation - type: textarea attributes: label: Describe the suggested feature and problem it solves. description: Provide a clear and concise description of what feature you would like to see, and what problems it solves. validations: required: true - type: textarea attributes: label: Describe the desired implementation. description: If possible, provide a suggested architecture change or implementation. - type: textarea attributes: label: Describe alternatives. description: If possible, describe the alternatives you've considered, or describe the current functionality and how it may be sub-optimal. - type: textarea attributes: label: Additional context. description: Please list any additional dependencies or integrating contacts that are affected. ```` ## File: .github/workflows/pre-commit.yaml ````yaml # checks that pre-commit hooks pass before allowing to merge a PR name: pre-commit on: pull_request: branches: [main, master, staging, dev, feat/**, fix/**] concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true env: FOUNDRY_PROFILE: ${{ github.event_name == 'push' && 'ci' || 'pr' }} ETH_RPC_URL: ${{ secrets.ETH_RPC_URL }} jobs: pre-commit: runs-on: ubuntu-latest timeout-minutes: 45 steps: - uses: bullfrogsec/bullfrog@1831f79cce8ad602eef14d2163873f27081ebfb3 # v0.8.4 - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: submodules: recursive - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: "3.11" - name: Install Foundry uses: foundry-rs/foundry-toolchain@82dee4ba654bd2146511f85f0d013af94670c4de # v1.4.0 with: version: stable - name: Enable pnpm run: corepack enable - name: Install dependencies run: pnpm install --frozen-lockfile - name: Install pre-commit run: python -m pip install --upgrade pip pre-commit - name: Run pre-commit run: pre-commit run --all-files --color always --show-diff-on-failure env: SKIP: forge-snapshots ```` ## File: .github/workflows/test.yaml ````yaml name: test on: pull_request: branches: [main, master, staging, dev, feat/**, fix/**] push: branches: [main, master, staging, dev] concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true env: FOUNDRY_PROFILE: ${{ github.event_name == 'push' && 'ci' || 'pr' }} ETH_RPC_URL: ${{ secrets.ETH_RPC_URL }} jobs: forge-test: name: Foundry project runs-on: ubuntu-latest timeout-minutes: 45 steps: - uses: bullfrogsec/bullfrog@1831f79cce8ad602eef14d2163873f27081ebfb3 # v0.8.4 - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: submodules: recursive - name: Install Foundry uses: foundry-rs/foundry-toolchain@82dee4ba654bd2146511f85f0d013af94670c4de # v1.4.0 with: version: stable - name: Enable pnpm run: corepack enable - name: Install dependencies run: pnpm install --frozen-lockfile - name: Run Forge fmt check run: forge fmt --check - name: Run Forge tests run: forge test --isolate ```` ## File: .github/workflows/trufflehog.yml ````yaml name: TruffleHog on: pull_request: types: [opened, synchronize, reopened] permissions: contents: read pull-requests: write id-token: write issues: write concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: scan: runs-on: ubuntu-latest timeout-minutes: 15 steps: - uses: bullfrogsec/bullfrog@1831f79cce8ad602eef14d2163873f27081ebfb3 # v0.8.4 - name: Checkout code uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: fetch-depth: 0 - name: TruffleHog OSS id: trufflehog uses: trufflesecurity/trufflehog@0f58ae7c5036094a1e3e750d18772af92821b503 # v3.90.5 with: path: . base: ${{ github.event.pull_request.base.sha }} head: ${{ github.event.pull_request.head.sha }} extra_args: --results=verified,unknown ```` ## File: .github/CODEOWNERS ```` * @symbioticfi/contracts * @symbioticfi/relay ```` ## File: .github/PULL_REQUEST_TEMPLATE.md ````markdown # Pull Request ## Description Please include a summary of the change and which feature was implemented or which issue was fixed. Also, include relevant motivation and context. List any dependencies that are required for this change. Fixes # (issue) ### How Has This Been Tested? Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration. # Checklist: - [ ] 100% test and branch coverage - [ ] check slither or other analyzer for severe issues - [ ] fuzz and invariant tests (when applicable) --- ### Considerations - I have followed the [contributing guidelines](../CONTRIBUTING.md). - My code follows the style guidelines of this project and I have run `forge fmt` and prettier to ensure the code style is valid - I have performed a self-review of my own code - I have commented my code, particularly in hard-to-understand areas - I have made corresponding changes to the documentation - I have added tests that prove my fix is effective or that my feature works - New and existing unit tests pass locally with my changes ### Additional context Add any other context about the pull request here. ```` ## File: network-scripts/deploy.sh ````bash #!/bin/sh set -e ANVIL_RPC_URL=${ANVIL_RPC_URL:-http://anvil:8545} MULTICALL_ADDRESS=0x05f32b3cc3888453ff71b01135b34ff8e41263f2 MULTICALL_BALANCE_HEX=0xde0b6b3a7640000 # 1 ether echo "Waiting for anvil to be ready..." until cast client --rpc-url "$ANVIL_RPC_URL" > /dev/null 2>&1; do sleep 1; done echo "Deploying Multicall3 contracts..." cast rpc --rpc-url "$ANVIL_RPC_URL" anvil_setBalance "$MULTICALL_ADDRESS" "$MULTICALL_BALANCE_HEX" cast rpc --rpc-url "$ANVIL_RPC_URL" anvil_setNonce "$MULTICALL_ADDRESS" 0x0 cast publish 0xf90f538085174876e800830f42408080b90f00608060405234801561001057600080fd5b50610ee0806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e1461025a578063bce38bd714610275578063c3077fa914610288578063ee82ac5e1461029b57600080fd5b80634d2301cc146101ec57806372425d9d1461022157806382ad56cb1461023457806386d516e81461024757600080fd5b80633408e470116100c65780633408e47014610191578063399542e9146101a45780633e64a696146101c657806342cbb15c146101d957600080fd5b80630f28c97d146100f8578063174dea711461011a578063252dba421461013a57806327e86d6e1461015b575b600080fd5b34801561010457600080fd5b50425b6040519081526020015b60405180910390f35b61012d610128366004610a85565b6102ba565b6040516101119190610bbe565b61014d610148366004610a85565b6104ef565b604051610111929190610bd8565b34801561016757600080fd5b50437fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0140610107565b34801561019d57600080fd5b5046610107565b6101b76101b2366004610c60565b610690565b60405161011193929190610cba565b3480156101d257600080fd5b5048610107565b3480156101e557600080fd5b5043610107565b3480156101f857600080fd5b50610107610207366004610ce2565b73ffffffffffffffffffffffffffffffffffffffff163190565b34801561022d57600080fd5b5044610107565b61012d610242366004610a85565b6106ab565b34801561025357600080fd5b5045610107565b34801561026657600080fd5b50604051418152602001610111565b61012d610283366004610c60565b61085a565b6101b7610296366004610a85565b610a1a565b3480156102a757600080fd5b506101076102b6366004610d18565b4090565b60606000828067ffffffffffffffff8111156102d8576102d8610d31565b60405190808252806020026020018201604052801561031e57816020015b6040805180820190915260008152606060208201528152602001906001900390816102f65790505b5092503660005b8281101561047757600085828151811061034157610341610d60565b6020026020010151905087878381811061035d5761035d610d60565b905060200281019061036f9190610d8f565b6040810135958601959093506103886020850185610ce2565b73ffffffffffffffffffffffffffffffffffffffff16816103ac6060870187610dcd565b6040516103ba929190610e32565b60006040518083038185875af1925050503d80600081146103f7576040519150601f19603f3d011682016040523d82523d6000602084013e6103fc565b606091505b50602080850191909152901515808452908501351761046d577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b5050600101610325565b508234146104e6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f4d756c746963616c6c333a2076616c7565206d69736d6174636800000000000060448201526064015b60405180910390fd5b50505092915050565b436060828067ffffffffffffffff81111561050c5761050c610d31565b60405190808252806020026020018201604052801561053f57816020015b606081526020019060019003908161052a5790505b5091503660005b8281101561068657600087878381811061056257610562610d60565b90506020028101906105749190610e42565b92506105836020840184610ce2565b73ffffffffffffffffffffffffffffffffffffffff166105a66020850185610dcd565b6040516105b4929190610e32565b6000604051808303816000865af19150503d80600081146105f1576040519150601f19603f3d011682016040523d82523d6000602084013e6105f6565b606091505b5086848151811061060957610609610d60565b602090810291909101015290508061067d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060448201526064016104dd565b50600101610546565b5050509250929050565b43804060606106a086868661085a565b905093509350939050565b6060818067ffffffffffffffff8111156106c7576106c7610d31565b60405190808252806020026020018201604052801561070d57816020015b6040805180820190915260008152606060208201528152602001906001900390816106e55790505b5091503660005b828110156104e657600084828151811061073057610730610d60565b6020026020010151905086868381811061074c5761074c610d60565b905060200281019061075e9190610e76565b925061076d6020840184610ce2565b73ffffffffffffffffffffffffffffffffffffffff166107906040850185610dcd565b60405161079e929190610e32565b6000604051808303816000865af19150503d80600081146107db576040519150601f19603f3d011682016040523d82523d6000602084013e6107e0565b606091505b506020808401919091529015158083529084013517610851577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b50600101610714565b6060818067ffffffffffffffff81111561087657610876610d31565b6040519080825280602002602001820160405280156108bc57816020015b6040805180820190915260008152606060208201528152602001906001900390816108945790505b5091503660005b82811015610a105760008482815181106108df576108df610d60565b602002602001015190508686838181106108fb576108fb610d60565b905060200281019061090d9190610e42565b925061091c6020840184610ce2565b73ffffffffffffffffffffffffffffffffffffffff1661093f6020850185610dcd565b60405161094d929190610e32565b6000604051808303816000865af19150503d806000811461098a576040519150601f19603f3d011682016040523d82523d6000602084013e61098f565b606091505b506020830152151581528715610a07578051610a07576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060448201526064016104dd565b506001016108c3565b5050509392505050565b6000806060610a2b60018686610690565b919790965090945092505050565b60008083601f840112610a4b57600080fd5b50813567ffffffffffffffff811115610a6357600080fd5b6020830191508360208260051b8501011115610a7e57600080fd5b9250929050565b60008060208385031215610a9857600080fd5b823567ffffffffffffffff811115610aaf57600080fd5b610abb85828601610a39565b90969095509350505050565b6000815180845260005b81811015610aed57602081850181015186830182015201610ad1565b81811115610aff576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015610bb1578583037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001895281518051151584528401516040858501819052610b9d81860183610ac7565b9a86019a9450505090830190600101610b4f565b5090979650505050505050565b602081526000610bd16020830184610b32565b9392505050565b600060408201848352602060408185015281855180845260608601915060608160051b870101935082870160005b82811015610c52577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa0888703018452610c40868351610ac7565b95509284019290840190600101610c06565b509398975050505050505050565b600080600060408486031215610c7557600080fd5b83358015158114610c8557600080fd5b9250602084013567ffffffffffffffff811115610ca157600080fd5b610cad86828701610a39565b9497909650939450505050565b838152826020820152606060408201526000610cd96060830184610b32565b95945050505050565b600060208284031215610cf457600080fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114610bd157600080fd5b600060208284031215610d2a57600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81833603018112610dc357600080fd5b9190910192915050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112610e0257600080fd5b83018035915067ffffffffffffffff821115610e1d57600080fd5b602001915036819003821315610a7e57600080fd5b8183823760009101908152919050565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc1833603018112610dc357600080fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa1833603018112610dc357600080fdfea2646970667358221220bb2b5c71a328032f97c676ae39a1ec2148d3e5d6f73d95e9b17910152d61f16264736f6c634300080c00331ca0edce47092c0f398cebf3ffc267f05c8e7076e3b89445e0fe50f6332273d4569ba01b0b9d000e19b24c5869b0fc3b22b0d6fa47cd63316875cbbd577d76e6fde086 --rpc-url "$ANVIL_RPC_URL" echo "Deploying contracts..." ./node_modules/@symbioticfi/relay-contracts/script/relay-deploy.sh script/MyRelayDeploy.sol script/my-relay-deploy.toml --broadcast --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 -vvvvv echo 'Waiting for deployment completion...' until [ -f /deploy-data/deployment-completed.json ]; do sleep 2; done echo "Setting interval mining..." cast rpc --rpc-url "$ANVIL_RPC_URL" evm_setIntervalMining 1 echo "Mine a single block to finalize the deployment..." cast rpc --rpc-url "$ANVIL_RPC_URL" evm_mine echo "Deployment completed successfully!" # Create deployment completion marker echo "$(date): Deployment completed successfully" > /deploy-data/deployment-complete.marker echo "Deployment completion marker created" ```` ## File: network-scripts/deployer.Dockerfile ````dockerfile FROM ghcr.io/foundry-rs/foundry:v1.4.4 USER root # Install Python (needed by relay deployment helper scripts) together with tomli fallback. RUN set -eux; \ if command -v apt-get >/dev/null 2>&1; then \ apt-get update; \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ python3 \ python3-venv \ python3-pip; \ rm -rf /var/lib/apt/lists/*; \ elif command -v apk >/dev/null 2>&1; then \ apk add --no-cache \ python3 \ py3-virtualenv \ py3-pip; \ else \ echo "Unable to determine package manager for Python installation." >&2; \ exit 1; \ fi; \ python3 -m pip install --no-cache-dir tomli; \ python3 --version USER foundry ```` ## File: network-scripts/flight-node-start.sh ````bash #!/bin/sh FLIGHT_DELAYS_ADDRESS=0xA4b0f5eb09891c1538494c4989Eea0203b1153b1 exec /app/flight-node --relay-api-url "$1" --evm-rpc-url http://anvil:8545 --flight-delays-address "$FLIGHT_DELAYS_ADDRESS" --flights-api-url http://flights-api:8085 --private-key "$2" --log-level info ```` ## File: network-scripts/genesis-generator.sh ````bash #!/bin/sh echo 'Waiting for deployment completion...' until [ -f /deploy-data/deployment-complete.marker ]; do sleep 2; done DRIVER_ADDRESS=0x43C27243F96591892976FFf886511807B65a33d5 MAX_RETRIES=50 RETRY_DELAY=2 attempt=1 while [ $attempt -le $MAX_RETRIES ]; do echo "Attempt $attempt of $MAX_RETRIES: Generating network genesis..." if /app/relay_utils network \ --chains http://anvil:8545 \ --driver.address "$DRIVER_ADDRESS" \ --driver.chainid 31337 \ generate-genesis \ --commit \ --secret-keys 31337:0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80; then echo 'Genesis generation completed successfully!' # Create genesis completion marker echo "$(date): Genesis generation completed successfully" > /deploy-data/genesis-complete.marker echo "Genesis completion marker created" echo "Waiting few seconds before exiting..." sleep 5 exit 0 else echo "Genesis generation failed on attempt $attempt" if [ $attempt -lt $MAX_RETRIES ]; then echo "Waiting $RETRY_DELAY seconds before retry..." sleep $RETRY_DELAY else echo "All $MAX_RETRIES attempts failed. Exiting with error." exit 1 fi attempt=$((attempt + 1)) fi done ```` ## File: network-scripts/sidecar-start.sh ````bash #!/bin/sh DRIVER_ADDRESS=0x43C27243F96591892976FFf886511807B65a33d5 cat > /tmp/sidecar.yaml << EOFCONFIG # Logging log: level: "debug" mode: "pretty" # API Server Configuration api: listen: ":8080" # Metrics Configuration metrics: pprof: true # Driver Contract driver: chain-id: 31337 address: "$DRIVER_ADDRESS" # P2P Configuration p2p: listen: "/ip4/0.0.0.0/tcp/8880" bootnodes: - /dns4/relay-sidecar-1/tcp/8880/p2p/16Uiu2HAmFUiPYAJ7bE88Q8d7Kznrw5ifrje2e5QFyt7uFPk2G3iR dht-mode: "server" mdns: true # EVM Configuration evm: chains: - "http://anvil:8545" max-calls: 30 EOFCONFIG exec /app/relay_sidecar --config /tmp/sidecar.yaml --secret-keys "$1" --storage-dir "$2" ```` ## File: off-chain/abis/FlightDelays.abi.json ````json [ { "type": "constructor", "inputs": [ { "name": "vaultConfigurator", "type": "address", "internalType": "address" }, { "name": "operatorVaultOptInService", "type": "address", "internalType": "address" }, { "name": "operatorNetworkOptInService", "type": "address", "internalType": "address" }, { "name": "defaultStakerRewardsFactory", "type": "address", "internalType": "address" }, { "name": "operatorRegistry", "type": "address", "internalType": "address" } ], "stateMutability": "nonpayable" }, { "type": "function", "name": "DEFAULT_STAKER_REWARDS_FACTORY", "inputs": [], "outputs": [ { "name": "", "type": "address", "internalType": "address" } ], "stateMutability": "view" }, { "type": "function", "name": "NETWORK", "inputs": [], "outputs": [ { "name": "", "type": "address", "internalType": "address" } ], "stateMutability": "view" }, { "type": "function", "name": "OPERATOR_NETWORK_OPT_IN_SERVICE", "inputs": [], "outputs": [ { "name": "", "type": "address", "internalType": "address" } ], "stateMutability": "view" }, { "type": "function", "name": "OPERATOR_VAULT_OPT_IN_SERVICE", "inputs": [], "outputs": [ { "name": "", "type": "address", "internalType": "address" } ], "stateMutability": "view" }, { "type": "function", "name": "SUBNETWORK", "inputs": [], "outputs": [ { "name": "", "type": "bytes32", "internalType": "bytes32" } ], "stateMutability": "view" }, { "type": "function", "name": "SUBNETWORK_IDENTIFIER", "inputs": [], "outputs": [ { "name": "", "type": "uint96", "internalType": "uint96" } ], "stateMutability": "view" }, { "type": "function", "name": "VAULT_CONFIGURATOR", "inputs": [], "outputs": [ { "name": "", "type": "address", "internalType": "address" } ], "stateMutability": "view" }, { "type": "function", "name": "airlines", "inputs": [ { "name": "airlineId", "type": "bytes32", "internalType": "bytes32" } ], "outputs": [ { "name": "vault", "type": "address", "internalType": "address" }, { "name": "rewards", "type": "address", "internalType": "address" }, { "name": "covered", "type": "uint256", "internalType": "uint256" }, { "name": "lastFlightId", "type": "bytes32", "internalType": "bytes32" } ], "stateMutability": "view" }, { "type": "function", "name": "buyInsurance", "inputs": [ { "name": "airlineId", "type": "bytes32", "internalType": "bytes32" }, { "name": "flightId", "type": "bytes32", "internalType": "bytes32" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "claimInsurance", "inputs": [ { "name": "airlineId", "type": "bytes32", "internalType": "bytes32" }, { "name": "flightId", "type": "bytes32", "internalType": "bytes32" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "collateral", "inputs": [], "outputs": [ { "name": "", "type": "address", "internalType": "address" } ], "stateMutability": "view" }, { "type": "function", "name": "createFlight", "inputs": [ { "name": "airlineId", "type": "bytes32", "internalType": "bytes32" }, { "name": "flightId", "type": "bytes32", "internalType": "bytes32" }, { "name": "scheduledTimestamp", "type": "uint48", "internalType": "uint48" }, { "name": "epoch", "type": "uint48", "internalType": "uint48" }, { "name": "proof", "type": "bytes", "internalType": "bytes" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "delayFlight", "inputs": [ { "name": "airlineId", "type": "bytes32", "internalType": "bytes32" }, { "name": "flightId", "type": "bytes32", "internalType": "bytes32" }, { "name": "epoch", "type": "uint48", "internalType": "uint48" }, { "name": "proof", "type": "bytes", "internalType": "bytes" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "delayWindow", "inputs": [], "outputs": [ { "name": "", "type": "uint48", "internalType": "uint48" } ], "stateMutability": "view" }, { "type": "function", "name": "departFlight", "inputs": [ { "name": "airlineId", "type": "bytes32", "internalType": "bytes32" }, { "name": "flightId", "type": "bytes32", "internalType": "bytes32" }, { "name": "epoch", "type": "uint48", "internalType": "uint48" }, { "name": "proof", "type": "bytes", "internalType": "bytes" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "flights", "inputs": [ { "name": "airlineId", "type": "bytes32", "internalType": "bytes32" }, { "name": "flightId", "type": "bytes32", "internalType": "bytes32" } ], "outputs": [ { "name": "timestamp", "type": "uint48", "internalType": "uint48" }, { "name": "status", "type": "uint8", "internalType": "enum FlightDelays.FlightStatus" }, { "name": "policiesSold", "type": "uint128", "internalType": "uint128" }, { "name": "previousFlightId", "type": "bytes32", "internalType": "bytes32" } ], "stateMutability": "view" }, { "type": "function", "name": "initialize", "inputs": [ { "name": "initParams", "type": "tuple", "internalType": "struct FlightDelays.InitParams", "components": [ { "name": "votingPowers", "type": "address", "internalType": "address" }, { "name": "settlement", "type": "address", "internalType": "address" }, { "name": "collateral", "type": "address", "internalType": "address" }, { "name": "vaultEpochDuration", "type": "uint48", "internalType": "uint48" }, { "name": "messageExpiry", "type": "uint32", "internalType": "uint32" }, { "name": "policyWindow", "type": "uint48", "internalType": "uint48" }, { "name": "delayWindow", "type": "uint48", "internalType": "uint48" }, { "name": "policyPremium", "type": "uint256", "internalType": "uint256" }, { "name": "policyPayout", "type": "uint256", "internalType": "uint256" } ] } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "messageExpiry", "inputs": [], "outputs": [ { "name": "", "type": "uint32", "internalType": "uint32" } ], "stateMutability": "view" }, { "type": "function", "name": "policies", "inputs": [ { "name": "airlineId", "type": "bytes32", "internalType": "bytes32" }, { "name": "flightId", "type": "bytes32", "internalType": "bytes32" }, { "name": "buyer", "type": "address", "internalType": "address" } ], "outputs": [ { "name": "policyStatus", "type": "uint8", "internalType": "enum FlightDelays.PolicyStatus" } ], "stateMutability": "view" }, { "type": "function", "name": "policyPayout", "inputs": [], "outputs": [ { "name": "", "type": "uint256", "internalType": "uint256" } ], "stateMutability": "view" }, { "type": "function", "name": "policyPremium", "inputs": [], "outputs": [ { "name": "", "type": "uint256", "internalType": "uint256" } ], "stateMutability": "view" }, { "type": "function", "name": "policyWindow", "inputs": [], "outputs": [ { "name": "", "type": "uint48", "internalType": "uint48" } ], "stateMutability": "view" }, { "type": "function", "name": "settlement", "inputs": [], "outputs": [ { "name": "", "type": "address", "internalType": "address" } ], "stateMutability": "view" }, { "type": "function", "name": "staticDelegateCall", "inputs": [ { "name": "target", "type": "address", "internalType": "address" }, { "name": "data", "type": "bytes", "internalType": "bytes" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "vaultEpochDuration", "inputs": [], "outputs": [ { "name": "", "type": "uint48", "internalType": "uint48" } ], "stateMutability": "view" }, { "type": "function", "name": "votingPowers", "inputs": [], "outputs": [ { "name": "", "type": "address", "internalType": "address" } ], "stateMutability": "view" }, { "type": "event", "name": "AirlineVaultDeployed", "inputs": [ { "name": "airlineId", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "vault", "type": "address", "indexed": false, "internalType": "address" }, { "name": "rewards", "type": "address", "indexed": false, "internalType": "address" } ], "anonymous": false }, { "type": "event", "name": "FlightCreated", "inputs": [ { "name": "airlineId", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "flightId", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "scheduledTimestamp", "type": "uint48", "indexed": false, "internalType": "uint48" } ], "anonymous": false }, { "type": "event", "name": "FlightDelayed", "inputs": [ { "name": "airlineId", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "flightId", "type": "bytes32", "indexed": true, "internalType": "bytes32" } ], "anonymous": false }, { "type": "event", "name": "FlightDeparted", "inputs": [ { "name": "airlineId", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "flightId", "type": "bytes32", "indexed": true, "internalType": "bytes32" } ], "anonymous": false }, { "type": "event", "name": "InitSubnetwork", "inputs": [ { "name": "network", "type": "address", "indexed": false, "internalType": "address" }, { "name": "subnetworkId", "type": "uint96", "indexed": false, "internalType": "uint96" } ], "anonymous": false }, { "type": "event", "name": "Initialized", "inputs": [ { "name": "version", "type": "uint64", "indexed": false, "internalType": "uint64" } ], "anonymous": false }, { "type": "event", "name": "InsuranceClaimed", "inputs": [ { "name": "airlineId", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "flightId", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "buyer", "type": "address", "indexed": true, "internalType": "address" }, { "name": "payout", "type": "uint256", "indexed": false, "internalType": "uint256" } ], "anonymous": false }, { "type": "event", "name": "InsurancePurchased", "inputs": [ { "name": "airlineId", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "flightId", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "buyer", "type": "address", "indexed": true, "internalType": "address" }, { "name": "premium", "type": "uint256", "indexed": false, "internalType": "uint256" } ], "anonymous": false }, { "type": "error", "name": "BuyWindowClosed", "inputs": [] }, { "type": "error", "name": "FlightAlreadyExists", "inputs": [] }, { "type": "error", "name": "FlightNotDelayable", "inputs": [] }, { "type": "error", "name": "FlightNotDelayed", "inputs": [] }, { "type": "error", "name": "FlightNotScheduled", "inputs": [] }, { "type": "error", "name": "InsufficientCoverage", "inputs": [] }, { "type": "error", "name": "InvalidEpoch", "inputs": [] }, { "type": "error", "name": "InvalidFlight", "inputs": [] }, { "type": "error", "name": "InvalidInitialization", "inputs": [] }, { "type": "error", "name": "InvalidMessageSignature", "inputs": [] }, { "type": "error", "name": "InvalidPolicy", "inputs": [] }, { "type": "error", "name": "InvalidTimestamp", "inputs": [] }, { "type": "error", "name": "NetworkManager_InvalidNetwork", "inputs": [] }, { "type": "error", "name": "NotInitializing", "inputs": [] }, { "type": "error", "name": "PolicyAlreadyPurchased", "inputs": [] }, { "type": "error", "name": "PolicyNotFound", "inputs": [] }, { "type": "error", "name": "PreviousFlightIncomplete", "inputs": [] }, { "type": "error", "name": "SafeERC20FailedOperation", "inputs": [ { "name": "token", "type": "address", "internalType": "address" } ] } ] ```` ## File: off-chain/cmd/benchmark/main.go ````go package main ⋮---- import ( "bytes" "context" "crypto/rand" "fmt" "log/slog" "math/big" "os" "os/exec" "strings" "time" "github.com/samber/lo" "sum/internal/utils" "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" v1 "github.com/symbioticfi/relay/api/client/v1" "golang.org/x/sync/errgroup" ) ⋮---- "bytes" "context" "crypto/rand" "fmt" "log/slog" "math/big" "os" "os/exec" "strings" "time" ⋮---- "github.com/samber/lo" ⋮---- "sum/internal/utils" ⋮---- "github.com/ethereum/go-ethereum/common" "github.com/go-errors/errors" v1 "github.com/symbioticfi/relay/api/client/v1" "golang.org/x/sync/errgroup" ⋮---- type processes []process ⋮---- type process struct { args []string cmd *exec.Cmd stdOut *bytes.Buffer stdErr *bytes.Buffer apiAddr string relayClient *v1.SymbioticClient runSeparately bool } ⋮---- const ( operatorsCount = 3 numberOfSignRequests = 1000 sizeOfMessageBytes = 320 ) ⋮---- func main() ⋮---- func run(ctx context.Context) error ⋮---- func sendRequestAndWait(ctx context.Context, prs processes, nRequests int) *errors.Error ⋮---- func runProcesses(ctx context.Context, runSeparately bool) (processes, error) ⋮---- var prs processes ⋮---- func (prs processes) waitServerStarted(ctx context.Context) ⋮---- var startedCound int ⋮---- func (prs processes) stopProcesses() ⋮---- // Send an interrupt signal for a graceful shutdown, that is equivalent to pressing Ctrl+C. ⋮---- // If signaling fails, you can resort to killing the process forcefully. ⋮---- func (prs processes) sendMessageToAllRelays(ctx context.Context, epoch uint64) (string, error) ⋮---- var requestID string ⋮---- func sendSignMessageRequest(ctx context.Context, pr process, message []byte, epoch uint64) (string, error) ⋮---- func randomMessage(n int) []byte ⋮---- func (prs processes) printErrLogs() ```` ## File: off-chain/cmd/flights-api/main.go ````go package main ⋮---- import ( "context" "encoding/json" "errors" "fmt" "log/slog" "math/rand" "net/http" "os" "os/signal" "strconv" "strings" "sync" "syscall" "time" "github.com/go-chi/chi/v5" "github.com/go-chi/chi/v5/middleware" "github.com/spf13/cobra" "sum/internal/flights" ) ⋮---- "context" "encoding/json" "errors" "fmt" "log/slog" "math/rand" "net/http" "os" "os/signal" "strconv" "strings" "sync" "syscall" "time" ⋮---- "github.com/go-chi/chi/v5" "github.com/go-chi/chi/v5/middleware" "github.com/spf13/cobra" ⋮---- "sum/internal/flights" ⋮---- type config struct { listenAddr string } ⋮---- var cfg config ⋮---- var rootCmd = &cobra.Command{ Use: "flights-api", Short: "Mock flights API backing the flight delay protocol", SilenceUsage: true, SilenceErrors: true, RunE: func(cmd *cobra.Command, args []string) error { ctx, cancel := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) defer cancel() store := flights.NewStore(seedAirlines(), seedFlights()) generator := newFlightGenerator(store) generator.start(ctx) srv := newFlightServer(store) httpServer := &http.Server{ Addr: cfg.listenAddr, Handler: srv.routes(), ReadHeaderTimeout: 5 * time.Second, ReadTimeout: 10 * time.Second, WriteTimeout: 10 * time.Second, } done := make(chan struct{}) go func() { <-ctx.Done() shutdownCtx, cancel := context.WithTimeout(context.Background(), 5*time.Second) defer cancel() if err := httpServer.Shutdown(shutdownCtx); err != nil { slog.Error("Failed to shut down flights API", "error", err) } close(done) }() slog.Info("Flights API listening", "addr", cfg.listenAddr) err := httpServer.ListenAndServe() if err != nil && !errors.Is(err, http.ErrServerClosed) { return err } <-done return nil }, } ⋮---- func main() ⋮---- type flightServer struct { store *flights.Store } ⋮---- func newFlightServer(store *flights.Store) *flightServer ⋮---- func (s *flightServer) routes() http.Handler ⋮---- func (s *flightServer) handleListAirlines(w http.ResponseWriter, r *http.Request) ⋮---- type createAirlineRequest struct { AirlineID string `json:"airlineId"` Name string `json:"name"` Code string `json:"code"` } ⋮---- func (s *flightServer) handleCreateAirline(w http.ResponseWriter, r *http.Request) ⋮---- var body createAirlineRequest ⋮---- func (s *flightServer) handleListFlights(w http.ResponseWriter, r *http.Request) ⋮---- type createFlightRequest struct { FlightID string `json:"flightId"` DepartureTimestamp int64 `json:"departureTimestamp"` } ⋮---- func (s *flightServer) handleCreateFlight(w http.ResponseWriter, r *http.Request) ⋮---- var body createFlightRequest ⋮---- func (s *flightServer) handleUpdateStatus(status flights.Status) http.HandlerFunc ⋮---- func writeJSON(w http.ResponseWriter, status int, payload any) ⋮---- func respondError(w http.ResponseWriter, status int, message string) ⋮---- func mapStoreError(err error) (int, string) ⋮---- func seedAirlines() []flights.Airline ⋮---- func seedFlights() []flights.Flight ⋮---- type flightGenerator struct { store *flights.Store rand *rand.Rand counters map[string]int createInterval time.Duration updateInterval time.Duration mu sync.Mutex } ⋮---- func newFlightGenerator(store *flights.Store) *flightGenerator ⋮---- func (g *flightGenerator) start(ctx context.Context) ⋮---- func (g *flightGenerator) bootstrapCounters() ⋮---- func (g *flightGenerator) maybeCreateFlights() ⋮---- func (g *flightGenerator) advanceFlights() ⋮---- func (g *flightGenerator) updateStatus(airlineID, flightID string, status flights.Status) ⋮---- func (g *flightGenerator) nextFlightID(airlineID string) string ⋮---- func parseFlightNumber(id string) int ⋮---- func corsMiddleware(next http.Handler) http.Handler ```` ## File: off-chain/cmd/node/main.go ````go package main ⋮---- import ( "context" "crypto/ecdsa" "encoding/json" "errors" "fmt" "log/slog" "math/big" "net/http" "net/url" "os" "os/signal" "sort" "strings" "syscall" "time" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/ethclient" "github.com/spf13/cobra" v1 "github.com/symbioticfi/relay/api/client/v1" "sum/internal/contracts" "sum/internal/flights" "sum/internal/utils" ) ⋮---- "context" "crypto/ecdsa" "encoding/json" "errors" "fmt" "log/slog" "math/big" "net/http" "net/url" "os" "os/signal" "sort" "strings" "syscall" "time" ⋮---- "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/ethclient" "github.com/spf13/cobra" v1 "github.com/symbioticfi/relay/api/client/v1" ⋮---- "sum/internal/contracts" "sum/internal/flights" "sum/internal/utils" ⋮---- const ( keyTag = 15 maxUint48 = (1 << 48) - 1 ⋮---- type config struct { relayAPIURL string evmRPCURL string contractAddress string flightsAPIURL string privateKeyHex string pollInterval time.Duration proofPollInterval time.Duration logLevel string } ⋮---- var cfg config ⋮---- var rootCmd = &cobra.Command{ Use: "flight-node", Short: "Flight delay oracle node", SilenceUsage: true, SilenceErrors: true, RunE: func(cmd *cobra.Command, args []string) error { switch strings.ToLower(cfg.logLevel) { case "debug": slog.SetLogLoggerLevel(slog.LevelDebug) case "warn": slog.SetLogLoggerLevel(slog.LevelWarn) case "error": slog.SetLogLoggerLevel(slog.LevelError) default: slog.SetLogLoggerLevel(slog.LevelInfo) } ctx, cancel := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) defer cancel() conn, err := utils.GetGRPCConnection(cfg.relayAPIURL) if err != nil { return fmt.Errorf("create relay client: %w", err) } defer conn.Close() relayClient := v1.NewSymbioticClient(conn) evmClient, err := ethclient.DialContext(ctx, cfg.evmRPCURL) if err != nil { return fmt.Errorf("dial evm rpc: %w", err) } defer evmClient.Close() chainID, err := evmClient.ChainID(ctx) if err != nil { return fmt.Errorf("fetch chain id: %w", err) } contractAddr := common.HexToAddress(cfg.contractAddress) flightDelays, err := contracts.NewFlightDelays(contractAddr, evmClient) if err != nil { return fmt.Errorf("bind flight delays: %w", err) } flightsClient := newFlightsAPIClient(cfg.flightsAPIURL) privKey, err := crypto.HexToECDSA(strings.TrimPrefix(cfg.privateKeyHex, "0x")) if err != nil { return fmt.Errorf("parse private key: %w", err) } node := &flightNode{ relayClient: relayClient, ethClient: evmClient, contract: flightDelays, chainID: chainID, privateKey: privKey, flightsAPI: flightsClient, pending: make(map[string]*pendingAction), } if err := node.syncFlights(ctx); err != nil { slog.Warn("initial sync failed", "error", err) } pollTicker := time.NewTicker(cfg.pollInterval) defer pollTicker.Stop() proofTicker := time.NewTicker(cfg.proofPollInterval) defer proofTicker.Stop() for { select { case <-pollTicker.C: if err := node.syncFlights(ctx); err != nil { slog.Warn("sync flights failed", "error", err) } case <-proofTicker.C: if err := node.fetchProofs(ctx); err != nil { slog.Warn("fetch proofs failed", "error", err) } if err := node.submitReadyActions(ctx); err != nil { slog.Warn("submit actions failed", "error", err) } case <-ctx.Done(): slog.Info("shutting down flight node") return nil } } }, } ⋮---- func main() ⋮---- var ( bytes32Type = mustABIType("bytes32") ⋮---- func mustABIType(name string) abi.Type ⋮---- type actionType string ⋮---- type flightStatus uint8 ⋮---- const ( actionCreate actionType = "CREATE" actionDelay actionType = "DELAY" actionDepart actionType = "DEPART" statusNone flightStatus = 0 statusScheduled flightStatus = 1 statusDelayed flightStatus = 2 statusDeparted flightStatus = 3 ) ⋮---- type pendingAction struct { Key string Airline flights.Airline Flight flights.Flight AirlineHash common.Hash FlightHash common.Hash PreviousFlightHash common.Hash Type actionType Epoch uint64 RequestID string Proof []byte Submitted bool TargetStatus flightStatus TxHash common.Hash CreatedAt time.Time } ⋮---- type flightNode struct { relayClient *v1.SymbioticClient ethClient *ethclient.Client contract *contracts.FlightDelays chainID *big.Int privateKey *ecdsa.PrivateKey flightsAPI *flightsAPIClient pending map[string]*pendingAction } ⋮---- func (n *flightNode) syncFlights(ctx context.Context) error ⋮---- func (n *flightNode) evaluateAirlineFlights(ctx context.Context, airline flights.Airline, flightsForAirline []flights.Flight) error ⋮---- var prev common.Hash ⋮---- func (n *flightNode) evaluateFlight(ctx context.Context, airline flights.Airline, flight flights.Flight, airlineHash common.Hash, previousFlightHash common.Hash) error ⋮---- func determineAction(apiStatus flights.Status, onChain flightStatus) (actionType, bool) ⋮---- func (n *flightNode) enqueueAction(ctx context.Context, key string, action actionType, airline flights.Airline, flight flights.Flight, airlineHash, flightHash, previousFlightHash common.Hash) error ⋮---- func (n *flightNode) requestSignature(ctx context.Context, payload []byte) (uint64, string, error) ⋮---- var suggestedEpoch uint64 ⋮---- func (n *flightNode) fetchProofs(ctx context.Context) error ⋮---- func (n *flightNode) submitReadyActions(ctx context.Context) error ⋮---- func (n *flightNode) submitAction(ctx context.Context, action *pendingAction) error ⋮---- var txHash common.Hash ⋮---- func (n *flightNode) canSubmitCreate(ctx context.Context, action *pendingAction) (bool, error) ⋮---- func (n *flightNode) clearSatisfiedPending(airlineHash, flightHash common.Hash, status flightStatus) ⋮---- func targetStatusFor(action actionType) flightStatus ⋮---- func buildMessagePayload(action actionType, airlineHash, flightHash, previousFlightHash common.Hash, departure uint64) ([]byte, error) ⋮---- var inner []byte var err error ⋮---- func hashIdentifier(id string) common.Hash ⋮---- func actionKey(airlineHash, flightHash common.Hash, action actionType) string ⋮---- type flightsAPIClient struct { baseURL string httpClient *http.Client } ⋮---- func newFlightsAPIClient(baseURL string) *flightsAPIClient ⋮---- func (c *flightsAPIClient) ListAirlines(ctx context.Context) ([]flights.Airline, error) ⋮---- var body struct { Airlines []flights.Airline `json:"airlines"` } ⋮---- func (c *flightsAPIClient) ListFlights(ctx context.Context, airlineID string) ([]flights.Flight, error) ⋮---- var body struct { Flights []flights.Flight `json:"flights"` } ```` ## File: off-chain/internal/contracts/flightDelays.go ````go // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. ⋮---- package contracts ⋮---- import ( "errors" "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ) ⋮---- "errors" "math/big" "strings" ⋮---- ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" ⋮---- // Reference imports to suppress errors if they are not otherwise used. var ( _ = errors.New _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription _ = abi.ConvertType ) ⋮---- // FlightDelaysInitParams is an auto generated low-level Go binding around an user-defined struct. type FlightDelaysInitParams struct { VotingPowers common.Address Settlement common.Address Collateral common.Address VaultEpochDuration *big.Int MessageExpiry uint32 PolicyWindow *big.Int DelayWindow *big.Int PolicyPremium *big.Int PolicyPayout *big.Int } ⋮---- // FlightDelaysMetaData contains all meta data concerning the FlightDelays contract. var FlightDelaysMetaData = &bind.MetaData{ ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"vaultConfigurator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorVaultOptInService\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorNetworkOptInService\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"defaultStakerRewardsFactory\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorRegistry\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"DEFAULT_STAKER_REWARDS_FACTORY\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"NETWORK\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"OPERATOR_NETWORK_OPT_IN_SERVICE\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"OPERATOR_VAULT_OPT_IN_SERVICE\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"SUBNETWORK\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"SUBNETWORK_IDENTIFIER\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint96\",\"internalType\":\"uint96\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"VAULT_CONFIGURATOR\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"airlines\",\"inputs\":[{\"name\":\"airlineId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"vault\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"rewards\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"covered\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"lastFlightId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"buyInsurance\",\"inputs\":[{\"name\":\"airlineId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"flightId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"claimInsurance\",\"inputs\":[{\"name\":\"airlineId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"flightId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"collateral\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"createFlight\",\"inputs\":[{\"name\":\"airlineId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"flightId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"scheduledTimestamp\",\"type\":\"uint48\",\"internalType\":\"uint48\"},{\"name\":\"previousFlightId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"epoch\",\"type\":\"uint48\",\"internalType\":\"uint48\"},{\"name\":\"proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"delayFlight\",\"inputs\":[{\"name\":\"airlineId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"flightId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"epoch\",\"type\":\"uint48\",\"internalType\":\"uint48\"},{\"name\":\"proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"delayWindow\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"departFlight\",\"inputs\":[{\"name\":\"airlineId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"flightId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"epoch\",\"type\":\"uint48\",\"internalType\":\"uint48\"},{\"name\":\"proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"flights\",\"inputs\":[{\"name\":\"airlineId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"flightId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"timestamp\",\"type\":\"uint48\",\"internalType\":\"uint48\"},{\"name\":\"status\",\"type\":\"uint8\",\"internalType\":\"enumFlightDelays.FlightStatus\"},{\"name\":\"policiesSold\",\"type\":\"uint128\",\"internalType\":\"uint128\"},{\"name\":\"previousFlightId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"initParams\",\"type\":\"tuple\",\"internalType\":\"structFlightDelays.InitParams\",\"components\":[{\"name\":\"votingPowers\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"settlement\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"collateral\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"vaultEpochDuration\",\"type\":\"uint48\",\"internalType\":\"uint48\"},{\"name\":\"messageExpiry\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"policyWindow\",\"type\":\"uint48\",\"internalType\":\"uint48\"},{\"name\":\"delayWindow\",\"type\":\"uint48\",\"internalType\":\"uint48\"},{\"name\":\"policyPremium\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"policyPayout\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"messageExpiry\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"policies\",\"inputs\":[{\"name\":\"airlineId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"flightId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"buyer\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"policyStatus\",\"type\":\"uint8\",\"internalType\":\"enumFlightDelays.PolicyStatus\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"policyPayout\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"policyPremium\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"policyWindow\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"settlement\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"staticDelegateCall\",\"inputs\":[{\"name\":\"target\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"vaultEpochDuration\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint48\",\"internalType\":\"uint48\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"votingPowers\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"AirlineVaultDeployed\",\"inputs\":[{\"name\":\"airlineId\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"vault\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"rewards\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"FlightCreated\",\"inputs\":[{\"name\":\"airlineId\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"flightId\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"scheduledTimestamp\",\"type\":\"uint48\",\"indexed\":false,\"internalType\":\"uint48\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"FlightDelayed\",\"inputs\":[{\"name\":\"airlineId\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"flightId\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"FlightDeparted\",\"inputs\":[{\"name\":\"airlineId\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"flightId\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"InitSubnetwork\",\"inputs\":[{\"name\":\"network\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"subnetworkId\",\"type\":\"uint96\",\"indexed\":false,\"internalType\":\"uint96\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"InsuranceClaimed\",\"inputs\":[{\"name\":\"airlineId\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"flightId\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"buyer\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"payout\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"InsurancePurchased\",\"inputs\":[{\"name\":\"airlineId\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"flightId\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"buyer\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"premium\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"BuyWindowClosed\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"FlightAlreadyExists\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"FlightNotDelayable\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"FlightNotDelayed\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"FlightNotScheduled\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InsufficientCoverage\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidEpoch\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidFlight\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidInitialization\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidMessageSignature\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidPolicy\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidTimestamp\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NetworkManager_InvalidNetwork\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotInitializing\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"PolicyAlreadyPurchased\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"PolicyNotFound\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"PreviousFlightIncomplete\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"SafeERC20FailedOperation\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}]}]", } ⋮---- // FlightDelaysABI is the input ABI used to generate the binding from. // Deprecated: Use FlightDelaysMetaData.ABI instead. var FlightDelaysABI = FlightDelaysMetaData.ABI ⋮---- // FlightDelays is an auto generated Go binding around an Ethereum contract. type FlightDelays struct { FlightDelaysCaller // Read-only binding to the contract FlightDelaysTransactor // Write-only binding to the contract FlightDelaysFilterer // Log filterer for contract events } ⋮---- FlightDelaysCaller // Read-only binding to the contract FlightDelaysTransactor // Write-only binding to the contract FlightDelaysFilterer // Log filterer for contract events ⋮---- // FlightDelaysCaller is an auto generated read-only Go binding around an Ethereum contract. type FlightDelaysCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } ⋮---- contract *bind.BoundContract // Generic contract wrapper for the low level calls ⋮---- // FlightDelaysTransactor is an auto generated write-only Go binding around an Ethereum contract. type FlightDelaysTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } ⋮---- // FlightDelaysFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type FlightDelaysFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } ⋮---- // FlightDelaysSession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type FlightDelaysSession struct { Contract *FlightDelays // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } ⋮---- Contract *FlightDelays // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session ⋮---- // FlightDelaysCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type FlightDelaysCallerSession struct { Contract *FlightDelaysCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } ⋮---- Contract *FlightDelaysCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session ⋮---- // FlightDelaysTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type FlightDelaysTransactorSession struct { Contract *FlightDelaysTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } ⋮---- Contract *FlightDelaysTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session ⋮---- // FlightDelaysRaw is an auto generated low-level Go binding around an Ethereum contract. type FlightDelaysRaw struct { Contract *FlightDelays // Generic contract binding to access the raw methods on } ⋮---- Contract *FlightDelays // Generic contract binding to access the raw methods on ⋮---- // FlightDelaysCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type FlightDelaysCallerRaw struct { Contract *FlightDelaysCaller // Generic read-only contract binding to access the raw methods on } ⋮---- Contract *FlightDelaysCaller // Generic read-only contract binding to access the raw methods on ⋮---- // FlightDelaysTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type FlightDelaysTransactorRaw struct { Contract *FlightDelaysTransactor // Generic write-only contract binding to access the raw methods on } ⋮---- Contract *FlightDelaysTransactor // Generic write-only contract binding to access the raw methods on ⋮---- // NewFlightDelays creates a new instance of FlightDelays, bound to a specific deployed contract. func NewFlightDelays(address common.Address, backend bind.ContractBackend) (*FlightDelays, error) ⋮---- // NewFlightDelaysCaller creates a new read-only instance of FlightDelays, bound to a specific deployed contract. func NewFlightDelaysCaller(address common.Address, caller bind.ContractCaller) (*FlightDelaysCaller, error) ⋮---- // NewFlightDelaysTransactor creates a new write-only instance of FlightDelays, bound to a specific deployed contract. func NewFlightDelaysTransactor(address common.Address, transactor bind.ContractTransactor) (*FlightDelaysTransactor, error) ⋮---- // NewFlightDelaysFilterer creates a new log filterer instance of FlightDelays, bound to a specific deployed contract. func NewFlightDelaysFilterer(address common.Address, filterer bind.ContractFilterer) (*FlightDelaysFilterer, error) ⋮---- // bindFlightDelays binds a generic wrapper to an already deployed contract. func bindFlightDelays(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) ⋮---- // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. func (_FlightDelays *FlightDelaysRaw) Call(opts *bind.CallOpts, result *[]interface ⋮---- // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. func (_FlightDelays *FlightDelaysRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) ⋮---- // Transact invokes the (paid) contract method with params as input values. func (_FlightDelays *FlightDelaysRaw) Transact(opts *bind.TransactOpts, method string, params ...interface ⋮---- // DEFAULTSTAKERREWARDSFACTORY is a free data retrieval call binding the contract method 0x360d7094. // // Solidity: function DEFAULT_STAKER_REWARDS_FACTORY() view returns(address) func (_FlightDelays *FlightDelaysCaller) DEFAULTSTAKERREWARDSFACTORY(opts *bind.CallOpts) (common.Address, error) ⋮---- var out []interface{} ⋮---- // NETWORK is a free data retrieval call binding the contract method 0x8759e6d1. ⋮---- // Solidity: function NETWORK() view returns(address) func (_FlightDelays *FlightDelaysCaller) NETWORK(opts *bind.CallOpts) (common.Address, error) ⋮---- // OPERATORNETWORKOPTINSERVICE is a free data retrieval call binding the contract method 0x1a80e500. ⋮---- // Solidity: function OPERATOR_NETWORK_OPT_IN_SERVICE() view returns(address) func (_FlightDelays *FlightDelaysCaller) OPERATORNETWORKOPTINSERVICE(opts *bind.CallOpts) (common.Address, error) ⋮---- // OPERATORVAULTOPTINSERVICE is a free data retrieval call binding the contract method 0x128e5d82. ⋮---- // Solidity: function OPERATOR_VAULT_OPT_IN_SERVICE() view returns(address) func (_FlightDelays *FlightDelaysCaller) OPERATORVAULTOPTINSERVICE(opts *bind.CallOpts) (common.Address, error) ⋮---- // SUBNETWORK is a free data retrieval call binding the contract method 0x773e6b54. ⋮---- // Solidity: function SUBNETWORK() view returns(bytes32) func (_FlightDelays *FlightDelaysCaller) SUBNETWORK(opts *bind.CallOpts) ([32]byte, error) ⋮---- // SUBNETWORKIDENTIFIER is a free data retrieval call binding the contract method 0xabacb807. ⋮---- // Solidity: function SUBNETWORK_IDENTIFIER() view returns(uint96) func (_FlightDelays *FlightDelaysCaller) SUBNETWORKIDENTIFIER(opts *bind.CallOpts) (*big.Int, error) ⋮---- // VAULTCONFIGURATOR is a free data retrieval call binding the contract method 0xb25bc0c0. ⋮---- // Solidity: function VAULT_CONFIGURATOR() view returns(address) func (_FlightDelays *FlightDelaysCaller) VAULTCONFIGURATOR(opts *bind.CallOpts) (common.Address, error) ⋮---- // Airlines is a free data retrieval call binding the contract method 0x116a272b. ⋮---- // Solidity: function airlines(bytes32 airlineId) view returns(address vault, address rewards, uint256 covered, bytes32 lastFlightId) func (_FlightDelays *FlightDelaysCaller) Airlines(opts *bind.CallOpts, airlineId [32]byte) (struct ⋮---- // Collateral is a free data retrieval call binding the contract method 0xd8dfeb45. ⋮---- // Solidity: function collateral() view returns(address) func (_FlightDelays *FlightDelaysCaller) Collateral(opts *bind.CallOpts) (common.Address, error) ⋮---- // DelayWindow is a free data retrieval call binding the contract method 0x9e4f4b76. ⋮---- // Solidity: function delayWindow() view returns(uint48) func (_FlightDelays *FlightDelaysCaller) DelayWindow(opts *bind.CallOpts) (*big.Int, error) ⋮---- // Flights is a free data retrieval call binding the contract method 0x45e8026d. ⋮---- // Solidity: function flights(bytes32 airlineId, bytes32 flightId) view returns(uint48 timestamp, uint8 status, uint128 policiesSold, bytes32 previousFlightId) func (_FlightDelays *FlightDelaysCaller) Flights(opts *bind.CallOpts, airlineId [32]byte, flightId [32]byte) (struct ⋮---- // MessageExpiry is a free data retrieval call binding the contract method 0x5c96f9b5. ⋮---- // Solidity: function messageExpiry() view returns(uint32) func (_FlightDelays *FlightDelaysCaller) MessageExpiry(opts *bind.CallOpts) (uint32, error) ⋮---- // Policies is a free data retrieval call binding the contract method 0x73714bcd. ⋮---- // Solidity: function policies(bytes32 airlineId, bytes32 flightId, address buyer) view returns(uint8 policyStatus) func (_FlightDelays *FlightDelaysCaller) Policies(opts *bind.CallOpts, airlineId [32]byte, flightId [32]byte, buyer common.Address) (uint8, error) ⋮---- // PolicyPayout is a free data retrieval call binding the contract method 0x365ca41e. ⋮---- // Solidity: function policyPayout() view returns(uint256) func (_FlightDelays *FlightDelaysCaller) PolicyPayout(opts *bind.CallOpts) (*big.Int, error) ⋮---- // PolicyPremium is a free data retrieval call binding the contract method 0x22b6fefe. ⋮---- // Solidity: function policyPremium() view returns(uint256) func (_FlightDelays *FlightDelaysCaller) PolicyPremium(opts *bind.CallOpts) (*big.Int, error) ⋮---- // PolicyWindow is a free data retrieval call binding the contract method 0x0da1f7ca. ⋮---- // Solidity: function policyWindow() view returns(uint48) func (_FlightDelays *FlightDelaysCaller) PolicyWindow(opts *bind.CallOpts) (*big.Int, error) ⋮---- // Settlement is a free data retrieval call binding the contract method 0x51160630. ⋮---- // Solidity: function settlement() view returns(address) func (_FlightDelays *FlightDelaysCaller) Settlement(opts *bind.CallOpts) (common.Address, error) ⋮---- // VaultEpochDuration is a free data retrieval call binding the contract method 0xee1b2207. ⋮---- // Solidity: function vaultEpochDuration() view returns(uint48) func (_FlightDelays *FlightDelaysCaller) VaultEpochDuration(opts *bind.CallOpts) (*big.Int, error) ⋮---- // VotingPowers is a free data retrieval call binding the contract method 0xc00f50eb. ⋮---- // Solidity: function votingPowers() view returns(address) func (_FlightDelays *FlightDelaysCaller) VotingPowers(opts *bind.CallOpts) (common.Address, error) ⋮---- // BuyInsurance is a paid mutator transaction binding the contract method 0xb8f37ab2. ⋮---- // Solidity: function buyInsurance(bytes32 airlineId, bytes32 flightId) returns() func (_FlightDelays *FlightDelaysTransactor) BuyInsurance(opts *bind.TransactOpts, airlineId [32]byte, flightId [32]byte) (*types.Transaction, error) ⋮---- // ClaimInsurance is a paid mutator transaction binding the contract method 0x147dbcf1. ⋮---- // Solidity: function claimInsurance(bytes32 airlineId, bytes32 flightId) returns() func (_FlightDelays *FlightDelaysTransactor) ClaimInsurance(opts *bind.TransactOpts, airlineId [32]byte, flightId [32]byte) (*types.Transaction, error) ⋮---- // CreateFlight is a paid mutator transaction binding the contract method 0xd97650b0. ⋮---- // Solidity: function createFlight(bytes32 airlineId, bytes32 flightId, uint48 scheduledTimestamp, bytes32 previousFlightId, uint48 epoch, bytes proof) returns() func (_FlightDelays *FlightDelaysTransactor) CreateFlight(opts *bind.TransactOpts, airlineId [32]byte, flightId [32]byte, scheduledTimestamp *big.Int, previousFlightId [32]byte, epoch *big.Int, proof []byte) (*types.Transaction, error) ⋮---- // DelayFlight is a paid mutator transaction binding the contract method 0x43bfd533. ⋮---- // Solidity: function delayFlight(bytes32 airlineId, bytes32 flightId, uint48 epoch, bytes proof) returns() func (_FlightDelays *FlightDelaysTransactor) DelayFlight(opts *bind.TransactOpts, airlineId [32]byte, flightId [32]byte, epoch *big.Int, proof []byte) (*types.Transaction, error) ⋮---- // DepartFlight is a paid mutator transaction binding the contract method 0x13f8a494. ⋮---- // Solidity: function departFlight(bytes32 airlineId, bytes32 flightId, uint48 epoch, bytes proof) returns() func (_FlightDelays *FlightDelaysTransactor) DepartFlight(opts *bind.TransactOpts, airlineId [32]byte, flightId [32]byte, epoch *big.Int, proof []byte) (*types.Transaction, error) ⋮---- // Initialize is a paid mutator transaction binding the contract method 0x08251708. ⋮---- // Solidity: function initialize((address,address,address,uint48,uint32,uint48,uint48,uint256,uint256) initParams) returns() func (_FlightDelays *FlightDelaysTransactor) Initialize(opts *bind.TransactOpts, initParams FlightDelaysInitParams) (*types.Transaction, error) ⋮---- // StaticDelegateCall is a paid mutator transaction binding the contract method 0x9f86fd85. ⋮---- // Solidity: function staticDelegateCall(address target, bytes data) returns() func (_FlightDelays *FlightDelaysTransactor) StaticDelegateCall(opts *bind.TransactOpts, target common.Address, data []byte) (*types.Transaction, error) ⋮---- // FlightDelaysAirlineVaultDeployedIterator is returned from FilterAirlineVaultDeployed and is used to iterate over the raw logs and unpacked data for AirlineVaultDeployed events raised by the FlightDelays contract. type FlightDelaysAirlineVaultDeployedIterator struct { Event *FlightDelaysAirlineVaultDeployed // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } ⋮---- Event *FlightDelaysAirlineVaultDeployed // Event containing the contract specifics and raw log ⋮---- contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data ⋮---- logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration ⋮---- // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. func (it *FlightDelaysAirlineVaultDeployedIterator) Next() bool ⋮---- // If the iterator failed, stop iterating ⋮---- // If the iterator completed, deliver directly whatever's available ⋮---- // Iterator still in progress, wait for either a data or an error event ⋮---- // Error returns any retrieval or parsing error occurred during filtering. func (it *FlightDelaysAirlineVaultDeployedIterator) Error() error ⋮---- // Close terminates the iteration process, releasing any pending underlying // resources. func (it *FlightDelaysAirlineVaultDeployedIterator) Close() error ⋮---- // FlightDelaysAirlineVaultDeployed represents a AirlineVaultDeployed event raised by the FlightDelays contract. type FlightDelaysAirlineVaultDeployed struct { AirlineId [32]byte Vault common.Address Rewards common.Address Raw types.Log // Blockchain specific contextual infos } ⋮---- Raw types.Log // Blockchain specific contextual infos ⋮---- // FilterAirlineVaultDeployed is a free log retrieval operation binding the contract event 0x6cb291016784959f890661d07225a645792785a83baeb2592251dcc9e4e7bf34. ⋮---- // Solidity: event AirlineVaultDeployed(bytes32 indexed airlineId, address vault, address rewards) func (_FlightDelays *FlightDelaysFilterer) FilterAirlineVaultDeployed(opts *bind.FilterOpts, airlineId [][32]byte) (*FlightDelaysAirlineVaultDeployedIterator, error) ⋮---- var airlineIdRule []interface{} ⋮---- // WatchAirlineVaultDeployed is a free log subscription operation binding the contract event 0x6cb291016784959f890661d07225a645792785a83baeb2592251dcc9e4e7bf34. ⋮---- func (_FlightDelays *FlightDelaysFilterer) WatchAirlineVaultDeployed(opts *bind.WatchOpts, sink chan<- *FlightDelaysAirlineVaultDeployed, airlineId [][32]byte) (event.Subscription, error) ⋮---- // New log arrived, parse the event and forward to the user ⋮---- // ParseAirlineVaultDeployed is a log parse operation binding the contract event 0x6cb291016784959f890661d07225a645792785a83baeb2592251dcc9e4e7bf34. ⋮---- func (_FlightDelays *FlightDelaysFilterer) ParseAirlineVaultDeployed(log types.Log) (*FlightDelaysAirlineVaultDeployed, error) ⋮---- // FlightDelaysFlightCreatedIterator is returned from FilterFlightCreated and is used to iterate over the raw logs and unpacked data for FlightCreated events raised by the FlightDelays contract. type FlightDelaysFlightCreatedIterator struct { Event *FlightDelaysFlightCreated // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } ⋮---- Event *FlightDelaysFlightCreated // Event containing the contract specifics and raw log ⋮---- // FlightDelaysFlightCreated represents a FlightCreated event raised by the FlightDelays contract. type FlightDelaysFlightCreated struct { AirlineId [32]byte FlightId [32]byte ScheduledTimestamp *big.Int Raw types.Log // Blockchain specific contextual infos } ⋮---- Raw types.Log // Blockchain specific contextual infos ⋮---- // FilterFlightCreated is a free log retrieval operation binding the contract event 0x1e735cf33b66ed3dc00862d938ae4f8f7dbbda9493652fc483c3607ce23c0070. ⋮---- // Solidity: event FlightCreated(bytes32 indexed airlineId, bytes32 indexed flightId, uint48 scheduledTimestamp) func (_FlightDelays *FlightDelaysFilterer) FilterFlightCreated(opts *bind.FilterOpts, airlineId [][32]byte, flightId [][32]byte) (*FlightDelaysFlightCreatedIterator, error) ⋮---- var flightIdRule []interface{} ⋮---- // WatchFlightCreated is a free log subscription operation binding the contract event 0x1e735cf33b66ed3dc00862d938ae4f8f7dbbda9493652fc483c3607ce23c0070. ⋮---- func (_FlightDelays *FlightDelaysFilterer) WatchFlightCreated(opts *bind.WatchOpts, sink chan<- *FlightDelaysFlightCreated, airlineId [][32]byte, flightId [][32]byte) (event.Subscription, error) ⋮---- // ParseFlightCreated is a log parse operation binding the contract event 0x1e735cf33b66ed3dc00862d938ae4f8f7dbbda9493652fc483c3607ce23c0070. ⋮---- func (_FlightDelays *FlightDelaysFilterer) ParseFlightCreated(log types.Log) (*FlightDelaysFlightCreated, error) ⋮---- // FlightDelaysFlightDelayedIterator is returned from FilterFlightDelayed and is used to iterate over the raw logs and unpacked data for FlightDelayed events raised by the FlightDelays contract. type FlightDelaysFlightDelayedIterator struct { Event *FlightDelaysFlightDelayed // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } ⋮---- Event *FlightDelaysFlightDelayed // Event containing the contract specifics and raw log ⋮---- // FlightDelaysFlightDelayed represents a FlightDelayed event raised by the FlightDelays contract. type FlightDelaysFlightDelayed struct { AirlineId [32]byte FlightId [32]byte Raw types.Log // Blockchain specific contextual infos } ⋮---- // FilterFlightDelayed is a free log retrieval operation binding the contract event 0x8e8076a6235494b484b7cd7000b0bb95229118813ebf3437799a65912956d478. ⋮---- // Solidity: event FlightDelayed(bytes32 indexed airlineId, bytes32 indexed flightId) func (_FlightDelays *FlightDelaysFilterer) FilterFlightDelayed(opts *bind.FilterOpts, airlineId [][32]byte, flightId [][32]byte) (*FlightDelaysFlightDelayedIterator, error) ⋮---- // WatchFlightDelayed is a free log subscription operation binding the contract event 0x8e8076a6235494b484b7cd7000b0bb95229118813ebf3437799a65912956d478. ⋮---- func (_FlightDelays *FlightDelaysFilterer) WatchFlightDelayed(opts *bind.WatchOpts, sink chan<- *FlightDelaysFlightDelayed, airlineId [][32]byte, flightId [][32]byte) (event.Subscription, error) ⋮---- // ParseFlightDelayed is a log parse operation binding the contract event 0x8e8076a6235494b484b7cd7000b0bb95229118813ebf3437799a65912956d478. ⋮---- func (_FlightDelays *FlightDelaysFilterer) ParseFlightDelayed(log types.Log) (*FlightDelaysFlightDelayed, error) ⋮---- // FlightDelaysFlightDepartedIterator is returned from FilterFlightDeparted and is used to iterate over the raw logs and unpacked data for FlightDeparted events raised by the FlightDelays contract. type FlightDelaysFlightDepartedIterator struct { Event *FlightDelaysFlightDeparted // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } ⋮---- Event *FlightDelaysFlightDeparted // Event containing the contract specifics and raw log ⋮---- // FlightDelaysFlightDeparted represents a FlightDeparted event raised by the FlightDelays contract. type FlightDelaysFlightDeparted struct { AirlineId [32]byte FlightId [32]byte Raw types.Log // Blockchain specific contextual infos } ⋮---- // FilterFlightDeparted is a free log retrieval operation binding the contract event 0x2894e01f1028238685425dd73fa9ec9fea4ea16dfd68e0fc5ff8985cd6e1a183. ⋮---- // Solidity: event FlightDeparted(bytes32 indexed airlineId, bytes32 indexed flightId) func (_FlightDelays *FlightDelaysFilterer) FilterFlightDeparted(opts *bind.FilterOpts, airlineId [][32]byte, flightId [][32]byte) (*FlightDelaysFlightDepartedIterator, error) ⋮---- // WatchFlightDeparted is a free log subscription operation binding the contract event 0x2894e01f1028238685425dd73fa9ec9fea4ea16dfd68e0fc5ff8985cd6e1a183. ⋮---- func (_FlightDelays *FlightDelaysFilterer) WatchFlightDeparted(opts *bind.WatchOpts, sink chan<- *FlightDelaysFlightDeparted, airlineId [][32]byte, flightId [][32]byte) (event.Subscription, error) ⋮---- // ParseFlightDeparted is a log parse operation binding the contract event 0x2894e01f1028238685425dd73fa9ec9fea4ea16dfd68e0fc5ff8985cd6e1a183. ⋮---- func (_FlightDelays *FlightDelaysFilterer) ParseFlightDeparted(log types.Log) (*FlightDelaysFlightDeparted, error) ⋮---- // FlightDelaysInitSubnetworkIterator is returned from FilterInitSubnetwork and is used to iterate over the raw logs and unpacked data for InitSubnetwork events raised by the FlightDelays contract. type FlightDelaysInitSubnetworkIterator struct { Event *FlightDelaysInitSubnetwork // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } ⋮---- Event *FlightDelaysInitSubnetwork // Event containing the contract specifics and raw log ⋮---- // FlightDelaysInitSubnetwork represents a InitSubnetwork event raised by the FlightDelays contract. type FlightDelaysInitSubnetwork struct { Network common.Address SubnetworkId *big.Int Raw types.Log // Blockchain specific contextual infos } ⋮---- Raw types.Log // Blockchain specific contextual infos ⋮---- // FilterInitSubnetwork is a free log retrieval operation binding the contract event 0x469c2e982e7d76d34cf5d1e72abee29749bb9971942c180e9023cea09f5f8e83. ⋮---- // Solidity: event InitSubnetwork(address network, uint96 subnetworkId) func (_FlightDelays *FlightDelaysFilterer) FilterInitSubnetwork(opts *bind.FilterOpts) (*FlightDelaysInitSubnetworkIterator, error) ⋮---- // WatchInitSubnetwork is a free log subscription operation binding the contract event 0x469c2e982e7d76d34cf5d1e72abee29749bb9971942c180e9023cea09f5f8e83. ⋮---- func (_FlightDelays *FlightDelaysFilterer) WatchInitSubnetwork(opts *bind.WatchOpts, sink chan<- *FlightDelaysInitSubnetwork) (event.Subscription, error) ⋮---- // ParseInitSubnetwork is a log parse operation binding the contract event 0x469c2e982e7d76d34cf5d1e72abee29749bb9971942c180e9023cea09f5f8e83. ⋮---- func (_FlightDelays *FlightDelaysFilterer) ParseInitSubnetwork(log types.Log) (*FlightDelaysInitSubnetwork, error) ⋮---- // FlightDelaysInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the FlightDelays contract. type FlightDelaysInitializedIterator struct { Event *FlightDelaysInitialized // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } ⋮---- Event *FlightDelaysInitialized // Event containing the contract specifics and raw log ⋮---- // FlightDelaysInitialized represents a Initialized event raised by the FlightDelays contract. type FlightDelaysInitialized struct { Version uint64 Raw types.Log // Blockchain specific contextual infos } ⋮---- Raw types.Log // Blockchain specific contextual infos ⋮---- // FilterInitialized is a free log retrieval operation binding the contract event 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2. ⋮---- // Solidity: event Initialized(uint64 version) func (_FlightDelays *FlightDelaysFilterer) FilterInitialized(opts *bind.FilterOpts) (*FlightDelaysInitializedIterator, error) ⋮---- // WatchInitialized is a free log subscription operation binding the contract event 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2. ⋮---- func (_FlightDelays *FlightDelaysFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *FlightDelaysInitialized) (event.Subscription, error) ⋮---- // ParseInitialized is a log parse operation binding the contract event 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2. ⋮---- func (_FlightDelays *FlightDelaysFilterer) ParseInitialized(log types.Log) (*FlightDelaysInitialized, error) ⋮---- // FlightDelaysInsuranceClaimedIterator is returned from FilterInsuranceClaimed and is used to iterate over the raw logs and unpacked data for InsuranceClaimed events raised by the FlightDelays contract. type FlightDelaysInsuranceClaimedIterator struct { Event *FlightDelaysInsuranceClaimed // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } ⋮---- Event *FlightDelaysInsuranceClaimed // Event containing the contract specifics and raw log ⋮---- // FlightDelaysInsuranceClaimed represents a InsuranceClaimed event raised by the FlightDelays contract. type FlightDelaysInsuranceClaimed struct { AirlineId [32]byte FlightId [32]byte Buyer common.Address Payout *big.Int Raw types.Log // Blockchain specific contextual infos } ⋮---- // FilterInsuranceClaimed is a free log retrieval operation binding the contract event 0x57e4f7b973a879494a4ada5b47e55405e342f437cf7280d04008aac8dde6a588. ⋮---- // Solidity: event InsuranceClaimed(bytes32 indexed airlineId, bytes32 indexed flightId, address indexed buyer, uint256 payout) func (_FlightDelays *FlightDelaysFilterer) FilterInsuranceClaimed(opts *bind.FilterOpts, airlineId [][32]byte, flightId [][32]byte, buyer []common.Address) (*FlightDelaysInsuranceClaimedIterator, error) ⋮---- var buyerRule []interface{} ⋮---- // WatchInsuranceClaimed is a free log subscription operation binding the contract event 0x57e4f7b973a879494a4ada5b47e55405e342f437cf7280d04008aac8dde6a588. ⋮---- func (_FlightDelays *FlightDelaysFilterer) WatchInsuranceClaimed(opts *bind.WatchOpts, sink chan<- *FlightDelaysInsuranceClaimed, airlineId [][32]byte, flightId [][32]byte, buyer []common.Address) (event.Subscription, error) ⋮---- // ParseInsuranceClaimed is a log parse operation binding the contract event 0x57e4f7b973a879494a4ada5b47e55405e342f437cf7280d04008aac8dde6a588. ⋮---- func (_FlightDelays *FlightDelaysFilterer) ParseInsuranceClaimed(log types.Log) (*FlightDelaysInsuranceClaimed, error) ⋮---- // FlightDelaysInsurancePurchasedIterator is returned from FilterInsurancePurchased and is used to iterate over the raw logs and unpacked data for InsurancePurchased events raised by the FlightDelays contract. type FlightDelaysInsurancePurchasedIterator struct { Event *FlightDelaysInsurancePurchased // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data logs chan types.Log // Log channel receiving the found contract events sub ethereum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } ⋮---- Event *FlightDelaysInsurancePurchased // Event containing the contract specifics and raw log ⋮---- // FlightDelaysInsurancePurchased represents a InsurancePurchased event raised by the FlightDelays contract. type FlightDelaysInsurancePurchased struct { AirlineId [32]byte FlightId [32]byte Buyer common.Address Premium *big.Int Raw types.Log // Blockchain specific contextual infos } ⋮---- // FilterInsurancePurchased is a free log retrieval operation binding the contract event 0xb5741046414a47afe0df7618cfbff25d005a117a6e9aa4dde31c6c8ffb6ab4d5. ⋮---- // Solidity: event InsurancePurchased(bytes32 indexed airlineId, bytes32 indexed flightId, address indexed buyer, uint256 premium) func (_FlightDelays *FlightDelaysFilterer) FilterInsurancePurchased(opts *bind.FilterOpts, airlineId [][32]byte, flightId [][32]byte, buyer []common.Address) (*FlightDelaysInsurancePurchasedIterator, error) ⋮---- // WatchInsurancePurchased is a free log subscription operation binding the contract event 0xb5741046414a47afe0df7618cfbff25d005a117a6e9aa4dde31c6c8ffb6ab4d5. ⋮---- func (_FlightDelays *FlightDelaysFilterer) WatchInsurancePurchased(opts *bind.WatchOpts, sink chan<- *FlightDelaysInsurancePurchased, airlineId [][32]byte, flightId [][32]byte, buyer []common.Address) (event.Subscription, error) ⋮---- // ParseInsurancePurchased is a log parse operation binding the contract event 0xb5741046414a47afe0df7618cfbff25d005a117a6e9aa4dde31c6c8ffb6ab4d5. ⋮---- func (_FlightDelays *FlightDelaysFilterer) ParseInsurancePurchased(log types.Log) (*FlightDelaysInsurancePurchased, error) ```` ## File: off-chain/internal/flights/store_test.go ````go package flights ⋮---- import ( "testing" "time" ) ⋮---- "testing" "time" ⋮---- func TestUpdateStatusAllowsDelayedToDeparted(t *testing.T) ⋮---- func TestUpdateStatusRejectsInvalidTransitions(t *testing.T) ```` ## File: off-chain/internal/flights/store.go ````go package flights ⋮---- import ( "sort" "strings" "sync" "time" ) ⋮---- "sort" "strings" "sync" "time" ⋮---- // Store keeps airlines and flights in memory for the mock API. type Store struct { mu sync.RWMutex airlines map[string]Airline flights map[string]map[string]*Flight // airlineID -> flightID -> Flight } ⋮---- flights map[string]map[string]*Flight // airlineID -> flightID -> Flight ⋮---- // NewStore creates an in-memory store seeded with the provided airlines and flights. func NewStore(initialAirlines []Airline, initialFlights []Flight) *Store ⋮---- // ListAirlines returns airlines sorted alphabetically by code then name. func (s *Store) ListAirlines() []Airline ⋮---- // AddAirline registers a new airline. func (s *Store) AddAirline(airline Airline) error ⋮---- // ListFlights returns flights for the given airline sorted by departure. func (s *Store) ListFlights(airlineID string) ([]Flight, error) ⋮---- // GetFlight returns a specific flight copy. func (s *Store) GetFlight(airlineID, flightID string) (Flight, error) ⋮---- // CreateFlight registers a new flight for an airline. func (s *Store) CreateFlight(airlineID string, flight Flight) (Flight, error) ⋮---- func (s *Store) createFlightLocked(airlineID string, flight Flight) error ⋮---- // UpdateStatus updates the status for a flight with basic validation. func (s *Store) UpdateStatus(airlineID, flightID string, status Status) (Flight, error) ⋮---- func isValidTransition(from, to Status) bool ```` ## File: off-chain/internal/flights/types.go ````go package flights ⋮---- import "errors" ⋮---- // Status describes the lifecycle state of a flight tracked by the mock API. type Status string ⋮---- const ( StatusScheduled Status = "SCHEDULED" StatusDelayed Status = "DELAYED" StatusDeparted Status = "DEPARTED" ) ⋮---- // Airline represents a carrier that can have flights scheduled on-chain. type Airline struct { AirlineID string `json:"airlineId"` Name string `json:"name"` Code string `json:"code"` } ⋮---- // Flight is a single tracked flight instance owned by an airline. type Flight struct { AirlineID string `json:"airlineId"` FlightID string `json:"flightId"` DepartureTimestamp int64 `json:"departureTimestamp"` Status Status `json:"status"` UpdatedAt int64 `json:"updatedAt"` } ⋮---- var ( ErrAirlineExists = errors.New("airline already exists") ⋮---- // validStatus reports whether the provided status is recognised by the API. func validStatus(status Status) bool ```` ## File: off-chain/internal/utils/util.go ````go package utils ⋮---- import ( "time" grpcmiddleware "github.com/grpc-ecosystem/go-grpc-middleware" "github.com/grpc-ecosystem/go-grpc-middleware/retry" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" ) ⋮---- "time" ⋮---- grpcmiddleware "github.com/grpc-ecosystem/go-grpc-middleware" "github.com/grpc-ecosystem/go-grpc-middleware/retry" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" ⋮---- func GetGRPCConnection(address string) (*grpc.ClientConn, error) ```` ## File: off-chain/.dockerignore ```` # Git files .git .gitignore # Docker files Dockerfile .dockerignore # Documentation README.md *.md # IDE files .vscode/ .idea/ *.swp *.swo # OS files .DS_Store Thumbs.db # Logs *.log # Temporary files *.tmp *.temp # Test files *_test.go test/ # Build artifacts bin/ dist/ # Coverage files *.out coverage.txt # Go specific vendor/ ```` ## File: off-chain/Dockerfile ```` # Multi-stage build for the off-chain Go application # Build stage FROM golang:1.24.5-alpine AS builder # Install build dependencies RUN apk add --no-cache git ca-certificates tzdata # Set working directory WORKDIR /app # Copy go mod files COPY go.mod go.sum ./ # Download dependencies RUN go mod download # Copy source code COPY . . # Build the binaries with optimizations for production RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \ -ldflags="-w -s" \ -o /app/flight-node \ ./cmd/node RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \ -ldflags="-w -s" \ -o /app/flights-api \ ./cmd/flights-api # Runtime stage FROM alpine:3.19 # Install runtime dependencies RUN apk add --no-cache ca-certificates tzdata # Set working directory WORKDIR /app # Copy binaries from builder stage COPY --from=builder /app/flight-node . COPY --from=builder /app/flights-api . # Expose port if needed (adjust based on your application) # EXPOSE 8080 # Set the entrypoint ENTRYPOINT ["/app/flight-node"] # Default command (can be overridden) CMD ["--help"] ```` ## File: off-chain/go.mod ```` module sum go 1.24.5 require ( github.com/ethereum/go-ethereum v1.16.3 github.com/go-chi/chi/v5 v5.2.3 github.com/go-errors/errors v1.5.1 github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 github.com/samber/lo v1.51.0 github.com/spf13/cobra v1.10.1 github.com/symbioticfi/relay v0.2.1-0.20250929084906-8a36673e5ad5 golang.org/x/sync v0.17.0 google.golang.org/grpc v1.75.1 ) require ( github.com/Microsoft/go-winio v0.6.2 // indirect github.com/bits-and-blooms/bitset v1.24.0 // indirect github.com/consensys/gnark-crypto v0.19.0 // indirect github.com/crate-crypto/go-eth-kzg v1.4.0 // indirect github.com/crate-crypto/go-ipa v0.0.0-20240724233137-53bbb0ceb27a // indirect github.com/deckarep/golang-set/v2 v2.8.0 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect github.com/ethereum/c-kzg-4844/v2 v2.1.1 // indirect github.com/ethereum/go-verkle v0.2.2 // indirect github.com/fsnotify/fsnotify v1.9.0 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/google/uuid v1.6.0 // indirect github.com/gorilla/websocket v1.5.3 // indirect github.com/holiman/uint256 v1.3.2 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/rogpeppe/go-internal v1.13.1 // indirect github.com/shirou/gopsutil v3.21.11+incompatible // indirect github.com/spf13/pflag v1.0.10 // indirect github.com/supranational/blst v0.3.15 // indirect github.com/tklauser/go-sysconf v0.3.15 // indirect github.com/tklauser/numcpus v0.10.0 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect golang.org/x/crypto v0.42.0 // indirect golang.org/x/net v0.44.0 // indirect golang.org/x/sys v0.36.0 // indirect golang.org/x/text v0.29.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20250908214217-97024824d090 // indirect google.golang.org/protobuf v1.36.9 // indirect ) ```` ## File: script/mocks/MockERC20.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; ⋮---- contract MockERC20 is ERC20 { ⋮---- function mint(address to, uint256 amount) public { ```` ## File: script/mocks/SymbioticRewardsConstantsHelper.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {SymbioticRewardsConstants} from "@symbioticfi/rewards/test/integration/SymbioticRewardsConstants.sol"; ⋮---- contract SymbioticRewardsConstantsHelper { function defaultStakerRewardsFactory() public returns (address) { ```` ## File: script/utils/BN254G2.sol ```` /** * @title Elliptic curve operations on twist points for alt_bn128 * @author Mustafa Al-Bassam (mus@musalbas.com) * @dev Homepage: https://github.com/musalbas/solidity-BN256G2 */ ⋮---- // WARNING: this code is used ONLY for testing purposes, DO NOT USE IN PRODUCTION ⋮---- /** * @notice Add two twist points * @param pt1xx Coefficient 1 of x on point 1 * @param pt1xy Coefficient 2 of x on point 1 * @param pt1yx Coefficient 1 of y on point 1 * @param pt1yy Coefficient 2 of y on point 1 * @param pt2xx Coefficient 1 of x on point 2 * @param pt2xy Coefficient 2 of x on point 2 * @param pt2yx Coefficient 1 of y on point 2 * @param pt2yy Coefficient 2 of y on point 2 * @return (pt3xx, pt3xy, pt3yx, pt3yy) */ function ECTwistAdd( ⋮---- /** * @notice Multiply a twist point by a scalar * @param s Scalar to multiply by * @param pt1xx Coefficient 1 of x * @param pt1xy Coefficient 2 of x * @param pt1yx Coefficient 1 of y * @param pt1yy Coefficient 2 of y * @return (pt2xx, pt2xy, pt2yx, pt2yy) */ function ECTwistMul(uint256 s, uint256 pt1xx, uint256 pt1xy, uint256 pt1yx, uint256 pt1yy) ⋮---- /** * @notice Get the field modulus * @return The field modulus */ function GetFieldModulus() internal pure returns (uint256) { ⋮---- function submod(uint256 a, uint256 b, uint256 n) internal pure returns (uint256) { ⋮---- function _FQ2Mul(uint256 xx, uint256 xy, uint256 yx, uint256 yy) internal pure returns (uint256, uint256) { ⋮---- function _FQ2Muc(uint256 xx, uint256 xy, uint256 c) internal pure returns (uint256, uint256) { ⋮---- function _FQ2Add(uint256 xx, uint256 xy, uint256 yx, uint256 yy) internal pure returns (uint256, uint256) { ⋮---- function _FQ2Sub(uint256 xx, uint256 xy, uint256 yx, uint256 yy) internal pure returns (uint256 rx, uint256 ry) { ⋮---- function _FQ2Div(uint256 xx, uint256 xy, uint256 yx, uint256 yy) internal view returns (uint256, uint256) { ⋮---- function _FQ2Inv(uint256 x, uint256 y) internal view returns (uint256, uint256) { ⋮---- function _isOnCurve(uint256 xx, uint256 xy, uint256 yx, uint256 yy) internal pure returns (bool) { ⋮---- function _modInv(uint256 a, uint256 n) internal view returns (uint256 result) { ⋮---- function _fromJacobian(uint256 pt1xx, uint256 pt1xy, uint256 pt1yx, uint256 pt1yy, uint256 pt1zx, uint256 pt1zy) ⋮---- function _ECTwistAddJacobian(_ECTwistAddJacobianArgs memory $) internal pure returns (uint256[6] memory pt3) { ⋮---- ($.pt2yx, $.pt2yy) = _FQ2Mul($.pt2yx, $.pt2yy, $.pt1zx, $.pt1zy); // U1 = y2 * z1 (pt3[PTYX], pt3[PTYY]) = _FQ2Mul($.pt1yx, $.pt1yy, $.pt2zx, $.pt2zy); // U2 = y1 * z2 ($.pt2xx, $.pt2xy) = _FQ2Mul($.pt2xx, $.pt2xy, $.pt1zx, $.pt1zy); // V1 = x2 * z1 (pt3[PTZX], pt3[PTZY]) = _FQ2Mul($.pt1xx, $.pt1xy, $.pt2zx, $.pt2zy); // V2 = x1 * z2 ⋮---- ($.pt2zx, $.pt2zy) = _FQ2Mul($.pt1zx, $.pt1zy, $.pt2zx, $.pt2zy); // W = z1 * z2 ($.pt1xx, $.pt1xy) = _FQ2Sub($.pt2yx, $.pt2yy, pt3[PTYX], pt3[PTYY]); // U = U1 - U2 ($.pt1yx, $.pt1yy) = _FQ2Sub($.pt2xx, $.pt2xy, pt3[PTZX], pt3[PTZY]); // V = V1 - V2 ($.pt1zx, $.pt1zy) = _FQ2Mul($.pt1yx, $.pt1yy, $.pt1yx, $.pt1yy); // V_squared = V * V ($.pt2yx, $.pt2yy) = _FQ2Mul($.pt1zx, $.pt1zy, pt3[PTZX], pt3[PTZY]); // V_squared_times_V2 = V_squared * V2 ($.pt1zx, $.pt1zy) = _FQ2Mul($.pt1zx, $.pt1zy, $.pt1yx, $.pt1yy); // V_cubed = V * V_squared (pt3[PTZX], pt3[PTZY]) = _FQ2Mul($.pt1zx, $.pt1zy, $.pt2zx, $.pt2zy); // newz = V_cubed * W ($.pt2xx, $.pt2xy) = _FQ2Mul($.pt1xx, $.pt1xy, $.pt1xx, $.pt1xy); // U * U ($.pt2xx, $.pt2xy) = _FQ2Mul($.pt2xx, $.pt2xy, $.pt2zx, $.pt2zy); // U * U * W ($.pt2xx, $.pt2xy) = _FQ2Sub($.pt2xx, $.pt2xy, $.pt1zx, $.pt1zy); // U * U * W - V_cubed ($.pt2zx, $.pt2zy) = _FQ2Muc($.pt2yx, $.pt2yy, 2); // 2 * V_squared_times_V2 ($.pt2xx, $.pt2xy) = _FQ2Sub($.pt2xx, $.pt2xy, $.pt2zx, $.pt2zy); // A = U * U * W - V_cubed - 2 * V_squared_times_V2 (pt3[PTXX], pt3[PTXY]) = _FQ2Mul($.pt1yx, $.pt1yy, $.pt2xx, $.pt2xy); // newx = V * A ($.pt1yx, $.pt1yy) = _FQ2Sub($.pt2yx, $.pt2yy, $.pt2xx, $.pt2xy); // V_squared_times_V2 - A ($.pt1yx, $.pt1yy) = _FQ2Mul($.pt1xx, $.pt1xy, $.pt1yx, $.pt1yy); // U * (V_squared_times_V2 - A) ($.pt1xx, $.pt1xy) = _FQ2Mul($.pt1zx, $.pt1zy, pt3[PTYX], pt3[PTYY]); // V_cubed * U2 (pt3[PTYX], pt3[PTYY]) = _FQ2Sub($.pt1yx, $.pt1yy, $.pt1xx, $.pt1xy); // newy = U * (V_squared_times_V2 - A) - V_cubed * U2 ⋮---- function _ECTwistDoubleJacobian( ⋮---- (pt2xx, pt2xy) = _FQ2Muc(pt1xx, pt1xy, 3); // 3 * x (pt2xx, pt2xy) = _FQ2Mul(pt2xx, pt2xy, pt1xx, pt1xy); // W = 3 * x * x (pt1zx, pt1zy) = _FQ2Mul(pt1yx, pt1yy, pt1zx, pt1zy); // S = y * z (pt2yx, pt2yy) = _FQ2Mul(pt1xx, pt1xy, pt1yx, pt1yy); // x * y (pt2yx, pt2yy) = _FQ2Mul(pt2yx, pt2yy, pt1zx, pt1zy); // B = x * y * S (pt1xx, pt1xy) = _FQ2Mul(pt2xx, pt2xy, pt2xx, pt2xy); // W * W (pt2zx, pt2zy) = _FQ2Muc(pt2yx, pt2yy, 8); // 8 * B (pt1xx, pt1xy) = _FQ2Sub(pt1xx, pt1xy, pt2zx, pt2zy); // H = W * W - 8 * B (pt2zx, pt2zy) = _FQ2Mul(pt1zx, pt1zy, pt1zx, pt1zy); // S_squared = S * S (pt2yx, pt2yy) = _FQ2Muc(pt2yx, pt2yy, 4); // 4 * B (pt2yx, pt2yy) = _FQ2Sub(pt2yx, pt2yy, pt1xx, pt1xy); // 4 * B - H (pt2yx, pt2yy) = _FQ2Mul(pt2yx, pt2yy, pt2xx, pt2xy); // W * (4 * B - H) (pt2xx, pt2xy) = _FQ2Muc(pt1yx, pt1yy, 8); // 8 * y (pt2xx, pt2xy) = _FQ2Mul(pt2xx, pt2xy, pt1yx, pt1yy); // 8 * y * y (pt2xx, pt2xy) = _FQ2Mul(pt2xx, pt2xy, pt2zx, pt2zy); // 8 * y * y * S_squared (pt2yx, pt2yy) = _FQ2Sub(pt2yx, pt2yy, pt2xx, pt2xy); // newy = W * (4 * B - H) - 8 * y * y * S_squared (pt2xx, pt2xy) = _FQ2Muc(pt1xx, pt1xy, 2); // 2 * H (pt2xx, pt2xy) = _FQ2Mul(pt2xx, pt2xy, pt1zx, pt1zy); // newx = 2 * H * S (pt2zx, pt2zy) = _FQ2Mul(pt1zx, pt1zy, pt2zx, pt2zy); // S * S_squared (pt2zx, pt2zy) = _FQ2Muc(pt2zx, pt2zy, 8); // newz = 8 * S * S_squared ⋮---- function _ECTwistMulJacobian( ```` ## File: script/utils/sort_errors.py ````python #!/usr/bin/env python3 ⋮---- def _error_sort_key(error_line: str) -> str ⋮---- signature = error_line.strip()[len("error ") :] name = signature.split("(", 1)[0].strip() ⋮---- def _extract_entries(block_text: str) -> List[Tuple[int, int, str, int]] ⋮---- entries: List[Tuple[int, int, str, int]] = [] offset = 0 entry_start: Optional[int] = None last_content_end: Optional[int] = None current_error: Optional[str] = None ⋮---- def finalize() -> None ⋮---- entry_start = None last_content_end = None current_error = None ⋮---- newline_idx = block_text.find("\n", offset) ⋮---- line_end = len(block_text) ⋮---- line_end = newline_idx + 1 line = block_text[offset:line_end] stripped = line.strip() ⋮---- last_content_end = line_end offset = line_end ⋮---- entry_start = offset ⋮---- current_error = line.strip() ⋮---- def _sort_error_block(text: str) -> Tuple[str, bool] ⋮---- marker = "/* ERRORS */" search_pos = 0 changed = False ⋮---- marker_idx = text.find(marker, search_pos) ⋮---- block_start = text.find("\n", marker_idx) ⋮---- cursor = block_start first_block_idx: Optional[int] = None last_block_idx = block_start ⋮---- newline_idx = text.find("\n", cursor) ⋮---- line_end = len(text) ⋮---- line = text[cursor:line_end] ⋮---- cursor = line_end ⋮---- first_block_idx = cursor last_block_idx = line_end ⋮---- search_pos = cursor ⋮---- block_text = text[first_block_idx:last_block_idx] entries = _extract_entries(block_text) ⋮---- search_pos = last_block_idx ⋮---- prefix = block_text[:entries[0][0]] suffix = block_text[entries[-1][1]:] sorted_entries = sorted(entries, key=lambda item: (item[2], item[3])) sorted_chunks = [block_text[start:end].rstrip("\n") for start, end, _, _ in sorted_entries] ⋮---- new_block = prefix + "\n\n".join(sorted_chunks) ⋮---- stripped_suffix = suffix.lstrip("\n") ⋮---- text = text[:first_block_idx] + new_block + text[last_block_idx:] changed = True search_pos = first_block_idx + len(new_block) ⋮---- def sort_errors_in_file(path: Path) ⋮---- original = path.read_text(encoding="utf-8") ⋮---- def iter_solidity_files(targets: Iterable[Path]) -> Iterable[Path] ⋮---- def resolve_targets(path_args: Iterable[str]) -> List[Path] ⋮---- defaults = [Path(name) for name in ("src", "examples") if Path(name).exists()] ⋮---- def sort_from_stdin() -> None ⋮---- errors = sys.stdin.read() sorted_errors = sorted(x.strip() for x in errors.splitlines()) ⋮---- def main() -> int ⋮---- parser = argparse.ArgumentParser( ⋮---- args = parser.parse_args() ⋮---- targets = resolve_targets(args.paths) ```` ## File: script/utils/sort_imports.py ````python #!/usr/bin/env python3 ⋮---- FROM_IMPORT_RE = re.compile(r'from\s+["\']([^"\']+)["\']', re.IGNORECASE | re.MULTILINE) DIRECT_IMPORT_RE = re.compile(r'import\s+["\']([^"\']+)["\']', re.IGNORECASE | re.MULTILINE) WHITESPACE_RE = re.compile(r"\s+") ⋮---- @dataclass class ImportEntry ⋮---- start: int end: int text: str path: str order: int ⋮---- def extract_path(import_text: str) -> str ⋮---- match = FROM_IMPORT_RE.search(import_text) ⋮---- match = DIRECT_IMPORT_RE.search(import_text) ⋮---- def collect_import_entries(lines: Sequence[str]) -> List[ImportEntry] ⋮---- entries: List[ImportEntry] = [] index = 0 ⋮---- stripped = lines[index].lstrip() ⋮---- start = index statement_lines = [lines[index].rstrip()] ⋮---- end = index text = "\n".join(statement_lines) path = extract_path(text) ⋮---- def normalize_import_text(import_text: str) -> str ⋮---- """Flatten whitespace so multi-line imports sort identically to single-line ones.""" compact = WHITESPACE_RE.sub(" ", import_text.strip()) compact = compact.replace("{ ", "{").replace(" }", "}") compact = compact.replace("( ", "(").replace(" )", ")") ⋮---- def classify_import(path: str) -> str ⋮---- normalized = path.lstrip("./") lower = normalized.lower() ⋮---- library = normalized.split("/", 1)[0] ⋮---- def build_sorted_block(entries: Sequence[ImportEntry]) -> List[str] ⋮---- grouped: Dict[str, List[ImportEntry]] = defaultdict(list) ⋮---- ordered_groups: List[List[ImportEntry]] = [] ⋮---- external_groups = sorted( ⋮---- block_text = "\n\n".join("\n".join(entry.text for entry in group) for group in ordered_groups) ⋮---- def sort_imports_in_file(path: Path) -> None ⋮---- original_text = path.read_text(encoding="utf-8") has_trailing_newline = original_text.endswith("\n") lines = original_text.splitlines() ⋮---- entries = collect_import_entries(lines) ⋮---- block_start = entries[0].start block_end = entries[-1].end covered_indexes = set() ⋮---- new_block_lines = build_sorted_block(entries) new_lines = lines[:block_start] + new_block_lines + lines[block_end + 1 :] new_text = "\n".join(new_lines) ⋮---- def iter_solidity_files(targets: Iterable[Path]) -> Iterable[Path] ⋮---- def resolve_targets(path_args: Iterable[str]) -> List[Path] ⋮---- defaults = [Path(name) for name in ("src", "examples") if Path(name).exists()] ⋮---- def main() -> int ⋮---- parser = argparse.ArgumentParser( ⋮---- args = parser.parse_args() ⋮---- targets = resolve_targets(args.paths) ```` ## File: script/my-relay-deploy.toml ````toml [31337] endpoint_url = "http://anvil:8545" [1234567890] endpoint_url = "" keyRegistry = 31337 votingPowerProvider = [31337] settlement = [31337] valSetDriver = 31337 ```` ## File: script/MyRelayDeploy.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {Vm, VmSafe} from "forge-std/Vm.sol"; ⋮---- import {VotingPowers} from "../src/symbiotic/VotingPowers.sol"; import {FlightDelays} from "../src/FlightDelays.sol"; import {KeyRegistry} from "../src/symbiotic/KeyRegistry.sol"; import {Driver} from "../src/symbiotic/Driver.sol"; import {Settlement} from "../src/symbiotic/Settlement.sol"; import {MockERC20} from "./mocks/MockERC20.sol"; import {BN254G2} from "./utils/BN254G2.sol"; import {SymbioticRewardsConstantsHelper} from "./mocks/SymbioticRewardsConstantsHelper.sol"; ⋮---- import {RelayDeploy} from "@symbioticfi/relay-contracts/script/RelayDeploy.sol"; ⋮---- import {BN254} from "@symbioticfi/relay-contracts/src/libraries/utils/BN254.sol"; import {KeyTags} from "@symbioticfi/relay-contracts/src/libraries/utils/KeyTags.sol"; import {KeyEcdsaSecp256k1} from "@symbioticfi/relay-contracts/src/libraries/keys/KeyEcdsaSecp256k1.sol"; import {KeyBlsBn254} from "@symbioticfi/relay-contracts/src/libraries/keys/KeyBlsBn254.sol"; import { SigVerifierBlsBn254Simple } from "@symbioticfi/relay-contracts/src/modules/settlement/sig-verifiers/SigVerifierBlsBn254Simple.sol"; import { SigVerifierBlsBn254ZK } from "@symbioticfi/relay-contracts/src/modules/settlement/sig-verifiers/SigVerifierBlsBn254ZK.sol"; import { IVotingPowerProvider } from "@symbioticfi/relay-contracts/src/interfaces/modules/voting-power/IVotingPowerProvider.sol"; import { IOpNetVaultAutoDeploy } from "@symbioticfi/relay-contracts/src/interfaces/modules/voting-power/extensions/IOpNetVaultAutoDeploy.sol"; import {INetworkManager} from "@symbioticfi/relay-contracts/src/interfaces/modules/base/INetworkManager.sol"; import {IOzEIP712} from "@symbioticfi/relay-contracts/src/interfaces/modules/base/IOzEIP712.sol"; import {IOzOwnable} from "@symbioticfi/relay-contracts/src/interfaces/modules/common/permissions/IOzOwnable.sol"; import { IKeyRegistry, KEY_TYPE_BLS_BN254, KEY_TYPE_ECDSA_SECP256K1 } from "@symbioticfi/relay-contracts/src/interfaces/modules/key-registry/IKeyRegistry.sol"; import { IBaseSlashing } from "@symbioticfi/relay-contracts/src/interfaces/modules/voting-power/extensions/IBaseSlashing.sol"; import { IBaseRewards } from "@symbioticfi/relay-contracts/src/interfaces/modules/voting-power/extensions/IBaseRewards.sol"; import {IValSetDriver} from "@symbioticfi/relay-contracts/src/interfaces/modules/valset-driver/IValSetDriver.sol"; import {IEpochManager} from "@symbioticfi/relay-contracts/src/interfaces/modules/valset-driver/IEpochManager.sol"; import {ISettlement} from "@symbioticfi/relay-contracts/src/interfaces/modules/settlement/ISettlement.sol"; ⋮---- import {Network, INetwork} from "@symbioticfi/network/src/Network.sol"; ⋮---- import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {IVault} from "@symbioticfi/core/src/interfaces/vault/IVault.sol"; import {INetworkMiddlewareService} from "@symbioticfi/core/src/interfaces/service/INetworkMiddlewareService.sol"; import {Logs} from "@symbioticfi/core/script/utils/Logs.sol"; import {SymbioticCoreConstants} from "@symbioticfi/core/test/integration/SymbioticCoreConstants.sol"; ⋮---- contract MyRelayDeploy is RelayDeploy { ⋮---- // Configurable constants ⋮---- uint48 internal constant SLASHING_WINDOW = 1 days; // 1 day uint208 internal constant MAX_VALIDATORS_COUNT = 1000; // 1000 validators uint256 internal constant MAX_VOTING_POWER = 2 ** 247; // no max limit uint256 internal constant MIN_INCLUSION_VOTING_POWER = 0; // include anyone uint248 internal constant QUORUM_THRESHOLD = (uint248(1e18) * 2) / 3 + 1; // 2/3 + 1 uint8 internal constant REQUIRED_KEY_TAG = 15; // 15 is the default key tag (BLS-BN254/15) ⋮---- uint8 internal constant REQUIRED_KEY_TAG_ECDSA = 16; // 16 is the default key tag for ecdsa keys (ECDSA-SECP256K1/0) ⋮---- // CREATE3 salts ⋮---- function getDeployerAddress() internal returns (address deployer) { ⋮---- function getStakingToken() internal withoutBroadcast returns (address) { ⋮---- function getInsuranceToken() internal withoutBroadcast returns (address) { ⋮---- function getDefaultStakerRewardsFactory() internal withoutBroadcast returns (address) { ⋮---- function getNetwork() internal withoutBroadcast returns (address) { ⋮---- function _keyRegistryParams() internal override returns (address implementation, bytes memory initData) { ⋮---- function _votingPowerProviderParams() internal override returns (address implementation, bytes memory initData) { ⋮---- function _settlementParams() internal override returns (address implementation, bytes memory initData) { ⋮---- function _valSetDriverParams() internal override returns (address implementation, bytes memory initData) { ⋮---- function runDeployKeyRegistry() public override { ⋮---- function runDeployVotingPowerProvider() public override { ⋮---- function runDeploySettlement() public override { ⋮---- function runDeployValSetDriver() public override { ⋮---- function configureOperatorKeys(uint256 index) public { ⋮---- // Register BLS-BN254 key with tag 11, not related to header key tag ⋮---- // Register ECDSA key ⋮---- function registerOperator(uint256 index, uint256 stakeAmount) public { ⋮---- function fundOperators() public { ⋮---- function getOperator(uint256 index) public returns (VmSafe.Wallet memory operator) { // deterministic operator private key ⋮---- function getBLSKeys(uint256 privateKey) public returns (BN254.G1Point memory, BN254.G2Point memory) { ⋮---- function printOperatorsInfo() public { ```` ## File: snapshots/gas.txt ```` No files changed, compilation skipped Ran 10 tests for test/FlightDelays.t.sol:FlightDelaysTest [PASS] testBuyInsuranceAndRecordPolicy() (gas: 1193983) [PASS] testCannotBuyAfterWindowCloses() (gas: 1069590) [PASS] testCannotBuyBeforePolicyWindowOpens() (gas: 1069193) [PASS] testCannotBuyInsuranceWithoutFlight() (gas: 32987) [PASS] testCannotBuyOnceFlightDelayed() (gas: 1111461) [PASS] testCompleteFlightDistributesRewards() (gas: 1507642) [PASS] testCreateFlightRequiresSequentialOrdering() (gas: 944838) [PASS] testDelayFlightAndClaim() (gas: 1436930) [PASS] testDelayRequiresEarlierFlightsProcessed() (gas: 1276496) [PASS] testFlightsMustBeCreatedWithNonDecreasingTimestamp() (gas: 1042914) Suite result: ok. 10 passed; 0 failed; 0 skipped; finished in 4.51ms (9.57ms CPU time) ╭-----------------------------------------------+-----------------+-------+--------+-------+---------╮ | script/mocks/MockERC20.sol:MockERC20 Contract | | | | | | +====================================================================================================+ | Deployment Cost | Deployment Size | | | | | |-----------------------------------------------+-----------------+-------+--------+-------+---------| | 557307 | 3103 | | | | | |-----------------------------------------------+-----------------+-------+--------+-------+---------| | | | | | | | |-----------------------------------------------+-----------------+-------+--------+-------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |-----------------------------------------------+-----------------+-------+--------+-------+---------| | approve | 46678 | 46678 | 46678 | 46678 | 10 | |-----------------------------------------------+-----------------+-------+--------+-------+---------| | balanceOf | 2559 | 2559 | 2559 | 2559 | 2 | |-----------------------------------------------+-----------------+-------+--------+-------+---------| | mint | 34227 | 34227 | 34227 | 34227 | 7 | |-----------------------------------------------+-----------------+-------+--------+-------+---------| | transfer | 51625 | 51625 | 51625 | 51625 | 7 | ╰-----------------------------------------------+-----------------+-------+--------+-------+---------╯ ╭--------------------------------------------+-----------------+--------+--------+--------+---------╮ | src/FlightDelays.sol:FlightDelays Contract | | | | | | +===================================================================================================+ | Deployment Cost | Deployment Size | | | | | |--------------------------------------------+-----------------+--------+--------+--------+---------| | 0 | 11085 | | | | | |--------------------------------------------+-----------------+--------+--------+--------+---------| | | | | | | | |--------------------------------------------+-----------------+--------+--------+--------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |--------------------------------------------+-----------------+--------+--------+--------+---------| | airlines | 8959 | 8959 | 8959 | 8959 | 1 | |--------------------------------------------+-----------------+--------+--------+--------+---------| | buyInsurance | 24759 | 72448 | 27489 | 134327 | 7 | |--------------------------------------------+-----------------+--------+--------+--------+---------| | claimInsurance | 52798 | 52798 | 52798 | 52798 | 1 | |--------------------------------------------+-----------------+--------+--------+--------+---------| | createFlight | 40183 | 596529 | 893204 | 893204 | 14 | |--------------------------------------------+-----------------+--------+--------+--------+---------| | delayFlight | 42441 | 73528 | 50150 | 151373 | 4 | |--------------------------------------------+-----------------+--------+--------+--------+---------| | delayWindow | 2407 | 2407 | 2407 | 2407 | 1 | |--------------------------------------------+-----------------+--------+--------+--------+---------| | departFlight | 51356 | 202741 | 202741 | 354126 | 2 | |--------------------------------------------+-----------------+--------+--------+--------+---------| | flights | 4959 | 4959 | 4959 | 4959 | 2 | |--------------------------------------------+-----------------+--------+--------+--------+---------| | initialize | 238659 | 238659 | 238659 | 238659 | 10 | |--------------------------------------------+-----------------+--------+--------+--------+---------| | policies | 2809 | 2809 | 2809 | 2809 | 2 | |--------------------------------------------+-----------------+--------+--------+--------+---------| | policyWindow | 2364 | 2364 | 2364 | 2364 | 1 | ╰--------------------------------------------+-----------------+--------+--------+--------+---------╯ ╭------------------------------------------------------+-----------------+------+--------+------+---------╮ | test/mock/FlightDelaysMocks.sol:MockRewards Contract | | | | | | +=========================================================================================================+ | Deployment Cost | Deployment Size | | | | | |------------------------------------------------------+-----------------+------+--------+------+---------| | 0 | 1188 | | | | | |------------------------------------------------------+-----------------+------+--------+------+---------| | | | | | | | |------------------------------------------------------+-----------------+------+--------+------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |------------------------------------------------------+-----------------+------+--------+------+---------| | lastAmount | 2316 | 2316 | 2316 | 2316 | 1 | |------------------------------------------------------+-----------------+------+--------+------+---------| | lastSnapshot | 2395 | 2395 | 2395 | 2395 | 1 | |------------------------------------------------------+-----------------+------+--------+------+---------| | lastToken | 2325 | 2325 | 2325 | 2325 | 1 | ╰------------------------------------------------------+-----------------+------+--------+------+---------╯ ╭-------------------------------------------------------------+-----------------+------+--------+------+---------╮ | test/mock/FlightDelaysMocks.sol:MockRewardsFactory Contract | | | | | | +================================================================================================================+ | Deployment Cost | Deployment Size | | | | | |-------------------------------------------------------------+-----------------+------+--------+------+---------| | 372083 | 1505 | | | | | |-------------------------------------------------------------+-----------------+------+--------+------+---------| | | | | | | | |-------------------------------------------------------------+-----------------+------+--------+------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |-------------------------------------------------------------+-----------------+------+--------+------+---------| | lastRewards | 2323 | 2323 | 2323 | 2323 | 1 | ╰-------------------------------------------------------------+-----------------+------+--------+------+---------╯ ╭------------------------------------------------------+-----------------+------+--------+------+---------╮ | test/mock/FlightDelaysMocks.sol:MockSlasher Contract | | | | | | +=========================================================================================================+ | Deployment Cost | Deployment Size | | | | | |------------------------------------------------------+-----------------+------+--------+------+---------| | 0 | 1019 | | | | | |------------------------------------------------------+-----------------+------+--------+------+---------| | | | | | | | |------------------------------------------------------+-----------------+------+--------+------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |------------------------------------------------------+-----------------+------+--------+------+---------| | slashableStake | 3369 | 3369 | 3369 | 3369 | 3 | ╰------------------------------------------------------+-----------------+------+--------+------+---------╯ ╭----------------------------------------------------+-----------------+-------+--------+-------+---------╮ | test/mock/FlightDelaysMocks.sol:MockVault Contract | | | | | | +=========================================================================================================+ | Deployment Cost | Deployment Size | | | | | |----------------------------------------------------+-----------------+-------+--------+-------+---------| | 0 | 1005 | | | | | |----------------------------------------------------+-----------------+-------+--------+-------+---------| | | | | | | | |----------------------------------------------------+-----------------+-------+--------+-------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |----------------------------------------------------+-----------------+-------+--------+-------+---------| | activeStake | 2312 | 2312 | 2312 | 2312 | 3 | |----------------------------------------------------+-----------------+-------+--------+-------+---------| | setActiveStake | 26530 | 26530 | 26530 | 26530 | 7 | |----------------------------------------------------+-----------------+-------+--------+-------+---------| | slasher | 2325 | 2325 | 2325 | 2325 | 3 | ╰----------------------------------------------------+-----------------+-------+--------+-------+---------╯ ╭----------------------------------------------------------------+-----------------+------+--------+------+---------╮ | test/mock/FlightDelaysMocks.sol:MockVaultConfigurator Contract | | | | | | +===================================================================================================================+ | Deployment Cost | Deployment Size | | | | | |----------------------------------------------------------------+-----------------+------+--------+------+---------| | 714096 | 3227 | | | | | |----------------------------------------------------------------+-----------------+------+--------+------+---------| | | | | | | | |----------------------------------------------------------------+-----------------+------+--------+------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |----------------------------------------------------------------+-----------------+------+--------+------+---------| | lastVault | 2302 | 2302 | 2302 | 2302 | 7 | ╰----------------------------------------------------------------+-----------------+------+--------+------+---------╯ ╭-----------------------------------------------------------+-----------------+-------+--------+-------+---------╮ | test/mock/FlightDelaysMocks.sol:VotingPowersMock Contract | | | | | | +================================================================================================================+ | Deployment Cost | Deployment Size | | | | | |-----------------------------------------------------------+-----------------+-------+--------+-------+---------| | 739953 | 3350 | | | | | |-----------------------------------------------------------+-----------------+-------+--------+-------+---------| | | | | | | | |-----------------------------------------------------------+-----------------+-------+--------+-------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |-----------------------------------------------------------+-----------------+-------+--------+-------+---------| | NETWORK | 334 | 334 | 334 | 334 | 10 | |-----------------------------------------------------------+-----------------+-------+--------+-------+---------| | SUBNETWORK_IDENTIFIER | 271 | 271 | 271 | 271 | 10 | |-----------------------------------------------------------+-----------------+-------+--------+-------+---------| | setFlightDelays | 44000 | 44000 | 44000 | 44000 | 10 | ╰-----------------------------------------------------------+-----------------+-------+--------+-------+---------╯ ╭------------------------------------------------------+-----------------+------+--------+------+---------╮ | test/mock/SettlementMock.sol:SettlementMock Contract | | | | | | +=========================================================================================================+ | Deployment Cost | Deployment Size | | | | | |------------------------------------------------------+-----------------+------+--------+------+---------| | 226020 | 827 | | | | | |------------------------------------------------------+-----------------+------+--------+------+---------| | | | | | | | |------------------------------------------------------+-----------------+------+--------+------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |------------------------------------------------------+-----------------+------+--------+------+---------| | getCaptureTimestampFromValSetHeaderAt | 372 | 372 | 372 | 372 | 20 | |------------------------------------------------------+-----------------+------+--------+------+---------| | getQuorumThresholdFromValSetHeaderAt | 308 | 308 | 308 | 308 | 20 | |------------------------------------------------------+-----------------+------+--------+------+---------| | getRequiredKeyTagFromValSetHeaderAt | 438 | 438 | 438 | 438 | 20 | |------------------------------------------------------+-----------------+------+--------+------+---------| | verifyQuorumSigAt | 1249 | 1249 | 1249 | 1249 | 20 | ╰------------------------------------------------------+-----------------+------+--------+------+---------╯ Ran 1 test suite in 8.51ms (4.51ms CPU time): 10 tests passed, 0 failed, 0 skipped (10 total tests) ```` ## File: snapshots/sizes.txt ```` No files changed, compilation skipped ╭--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------╮ | Contract | Runtime Size (B) | Initcode Size (B) | Runtime Margin (B) | Initcode Margin (B) | +====================================================================================================================================================================================+ | Address | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | BN254 | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | BN254G2 | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | BaseRewardsLogic | 1,606 | 1,658 | 22,970 | 47,494 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | BaseSlashingLogic | 4,387 | 4,439 | 20,189 | 44,713 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | Bytes | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | Checkpoints (node_modules/@openzeppelin/contracts/utils/structs/Checkpoints.sol) | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | Checkpoints (node_modules/@symbioticfi/core/src/contracts/libraries/Checkpoints.sol) | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | Checkpoints (node_modules/@symbioticfi/relay-contracts/src/libraries/structs/Checkpoints.sol) | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | Create2 | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | CreateXWrapper | 2,764 | 2,792 | 21,812 | 46,360 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | Driver | 17,519 | 17,547 | 7,057 | 31,605 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | ECDSA | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | ERC1967Proxy | 122 | 934 | 24,454 | 48,218 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | ERC1967Utils | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | ERC4626Math | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | Errors | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | ExtraDataStorageHelper | 123 | 173 | 24,453 | 48,979 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | FeeOnTransferToken | 1,785 | 3,197 | 22,791 | 45,955 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | FlightDelays | 10,617 | 10,925 | 13,959 | 38,227 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | InputNormalizer | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | KeyBlsBn254 | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | KeyEcdsaSecp256k1 | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | KeyRegistry (node_modules/@symbioticfi/relay-contracts/src/modules/key-registry/KeyRegistry.sol) | 14,998 | 15,026 | 9,578 | 34,126 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | KeyRegistry (src/symbiotic/KeyRegistry.sol) | 15,267 | 15,295 | 9,309 | 33,857 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | KeyTags | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | Logs | 4,290 | 4,342 | 20,286 | 44,810 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | Math | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | MessageHashUtils | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | MockERC20 | 1,821 | 2,911 | 22,755 | 46,241 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | MockRewards | 1,030 | 1,156 | 23,546 | 47,996 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | MockRewardsFactory | 1,477 | 1,505 | 23,099 | 47,647 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | MockSlasher | 849 | 987 | 23,727 | 48,165 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | MockVault | 747 | 941 | 23,829 | 48,211 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | MockVaultConfigurator | 3,064 | 3,195 | 21,512 | 45,957 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | Network | 12,358 | 12,550 | 12,218 | 36,602 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | OpNetVaultAutoDeployLogic | 5,693 | 5,745 | 18,883 | 43,407 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | OperatorRegistryMock | 57 | 83 | 24,519 | 49,069 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | OptInServiceMock | 199 | 225 | 24,377 | 48,927 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | Panic | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | PersistentSet | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | ProxyAdmin | 977 | 1,213 | 23,599 | 47,939 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | SafeCast | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | SafeERC20 | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | Settlement (src/symbiotic/Settlement.sol) | 11,798 | 11,826 | 12,778 | 37,326 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | SettlementMock | 799 | 827 | 23,777 | 48,325 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | SigBlsBn254 | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | SigEcdsaSecp256k1 | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | SigVerifierBlsBn254Simple | 4,946 | 4,974 | 19,630 | 44,178 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | SigVerifierBlsBn254ZK | 2,694 | 3,774 | 21,882 | 45,378 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | SignatureChecker | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | SignedMath | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | Simulation | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | StorageSlot | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | Strings | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | Subnetwork | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | SymbioticCoreBytecode | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | SymbioticCoreConstants | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | SymbioticRewardsConstants | 44 | 94 | 24,532 | 49,058 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | SymbioticRewardsConstantsHelper | 348 | 376 | 24,228 | 48,776 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | SymbioticUtils | 80 | 109 | 24,496 | 49,043 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | TimelockControllerUpgradeable | 7,690 | 7,718 | 16,886 | 41,434 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | Token | 1,723 | 3,065 | 22,853 | 46,087 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | TransparentUpgradeableProxy | 1,073 | 3,445 | 23,503 | 45,707 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | VotingPowerProviderLogic | 15,628 | 15,680 | 8,948 | 33,472 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | VotingPowers | 17,135 | 17,343 | 7,441 | 31,809 | |--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------| | VotingPowersMock | 3,065 | 3,286 | 21,511 | 45,866 | ╰--------------------------------------------------------------------------------------------------+------------------+-------------------+--------------------+---------------------╯ ```` ## File: src/symbiotic/Driver.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {OzAccessControl} from "@symbioticfi/relay-contracts/src/modules/common/permissions/OzAccessControl.sol"; import {ValSetDriver} from "@symbioticfi/relay-contracts/src/modules/valset-driver/ValSetDriver.sol"; ⋮---- contract Driver is ValSetDriver, OzAccessControl { function initialize(ValSetDriverInitParams memory valSetDriverInitParams, address defaultAdmin) ```` ## File: src/symbiotic/KeyRegistry.sol ```` // SPDX-License-Identifier: MIT ⋮---- import { KeyRegistry as SymbioticKeyRegistry } from "@symbioticfi/relay-contracts/src/modules/key-registry/KeyRegistry.sol"; ⋮---- contract KeyRegistry is SymbioticKeyRegistry { function initialize(KeyRegistryInitParams memory keyRegistryInitParams) public virtual initializer { ```` ## File: src/symbiotic/Settlement.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {OzAccessControl} from "@symbioticfi/relay-contracts/src/modules/common/permissions/OzAccessControl.sol"; import {Settlement as SymbioticSettlement} from "@symbioticfi/relay-contracts/src/modules/settlement/Settlement.sol"; ⋮---- contract Settlement is SymbioticSettlement, OzAccessControl { function initialize(SettlementInitParams memory settlementInitParams, address defaultAdmin) ```` ## File: src/symbiotic/VotingPowers.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {BaseRewards} from "@symbioticfi/relay-contracts/src/modules/voting-power/extensions/BaseRewards.sol"; import {BaseSlashing} from "@symbioticfi/relay-contracts/src/modules/voting-power/extensions/BaseSlashing.sol"; import { EqualStakeVPCalc } from "@symbioticfi/relay-contracts/src/modules/voting-power/common/voting-power-calc/EqualStakeVPCalc.sol"; import { IBaseRewards } from "@symbioticfi/relay-contracts/src/interfaces/modules/voting-power/extensions/IBaseRewards.sol"; import { IBaseSlashing } from "@symbioticfi/relay-contracts/src/interfaces/modules/voting-power/extensions/IBaseSlashing.sol"; import { IOpNetVaultAutoDeploy } from "@symbioticfi/relay-contracts/src/interfaces/modules/voting-power/extensions/IOpNetVaultAutoDeploy.sol"; import {IOzOwnable} from "@symbioticfi/relay-contracts/src/interfaces/modules/common/permissions/IOzOwnable.sol"; import {ISetMaxNetworkLimitHook} from "@symbioticfi/network/src/interfaces/ISetMaxNetworkLimitHook.sol"; import {IVault} from "@symbioticfi/core/src/interfaces/vault/IVault.sol"; import { IVotingPowerProvider } from "@symbioticfi/relay-contracts/src/interfaces/modules/voting-power/IVotingPowerProvider.sol"; import { OpNetVaultAutoDeploy } from "@symbioticfi/relay-contracts/src/modules/voting-power/extensions/OpNetVaultAutoDeploy.sol"; import {OzOwnable} from "@symbioticfi/relay-contracts/src/modules/common/permissions/OzOwnable.sol"; import {VotingPowerProvider} from "@symbioticfi/relay-contracts/src/modules/voting-power/VotingPowerProvider.sol"; ⋮---- contract VotingPowers is ⋮---- function initialize( ⋮---- function _registerOperatorImpl(address operator) internal override(OpNetVaultAutoDeploy, VotingPowerProvider) { ⋮---- function _unregisterOperatorVaultImpl(address operator, address vault) ⋮---- /// @dev To simplify protocol management, FlightDelays contract need to deploy new Vaults for airlines automatically. /// Due to Network's contract implementation allowing to set max network limit only to its middleware, it is done via VotingPowers contract, /// because it already contains extensions for rewards and slashing so a good choice to be a "middleware". function setMaxNetworkLimit(address vault) public { ⋮---- function setFlightDelays(address flightDelays_) public checkPermission { ```` ## File: src/FlightDelays.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {VotingPowers} from "./symbiotic/VotingPowers.sol"; ⋮---- import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import { TimelockControllerUpgradeable } from "@openzeppelin/contracts-upgradeable/governance/TimelockControllerUpgradeable.sol"; ⋮---- import {IBaseDelegator} from "@symbioticfi/core/src/interfaces/delegator/IBaseDelegator.sol"; import { IBaseRewards } from "@symbioticfi/relay-contracts/src/interfaces/modules/voting-power/extensions/IBaseRewards.sol"; import {IBaseSlasher} from "@symbioticfi/core/src/interfaces/slasher/IBaseSlasher.sol"; import { IBaseSlashing } from "@symbioticfi/relay-contracts/src/interfaces/modules/voting-power/extensions/IBaseSlashing.sol"; import { IDefaultStakerRewardsFactory } from "@symbioticfi/rewards/src/interfaces/defaultStakerRewards/IDefaultStakerRewardsFactory.sol"; import { IDefaultStakerRewards } from "@symbioticfi/rewards/src/interfaces/defaultStakerRewards/IDefaultStakerRewards.sol"; import {INetworkManager} from "@symbioticfi/relay-contracts/src/interfaces/modules/base/INetworkManager.sol"; import { IOperatorNetworkSpecificDelegator } from "@symbioticfi/core/src/interfaces/delegator/IOperatorNetworkSpecificDelegator.sol"; import {IOperatorRegistry} from "@symbioticfi/core/src/interfaces/IOperatorRegistry.sol"; import {IOptInService} from "@symbioticfi/core/src/interfaces/service/IOptInService.sol"; import {ISettlement} from "@symbioticfi/relay-contracts/src/interfaces/modules/settlement/ISettlement.sol"; import {ISlasher} from "@symbioticfi/core/src/interfaces/slasher/ISlasher.sol"; import {IVaultConfigurator} from "@symbioticfi/core/src/interfaces/IVaultConfigurator.sol"; import {IVault} from "@symbioticfi/core/src/interfaces/vault/IVault.sol"; import { IVotingPowerProvider } from "@symbioticfi/relay-contracts/src/interfaces/modules/voting-power/IVotingPowerProvider.sol"; import {NetworkManager} from "@symbioticfi/relay-contracts/src/modules/base/NetworkManager.sol"; import {Subnetwork} from "@symbioticfi/core/src/contracts/libraries/Subnetwork.sol"; ⋮---- contract FlightDelays is NetworkManager { ⋮---- event AirlineVaultDeployed(bytes32 indexed airlineId, address vault, address rewards); event FlightCreated(bytes32 indexed airlineId, bytes32 indexed flightId, uint48 scheduledTimestamp); event FlightDelayed(bytes32 indexed airlineId, bytes32 indexed flightId); event FlightDeparted(bytes32 indexed airlineId, bytes32 indexed flightId); event InsurancePurchased( ⋮---- event InsuranceClaimed(bytes32 indexed airlineId, bytes32 indexed flightId, address indexed buyer, uint256 payout); ⋮---- function initialize(InitParams calldata initParams) external initializer { ⋮---- function createFlight( ⋮---- function delayFlight(bytes32 airlineId, bytes32 flightId, uint48 epoch, bytes calldata proof) external { ⋮---- function departFlight(bytes32 airlineId, bytes32 flightId, uint48 epoch, bytes calldata proof) external { ⋮---- function buyInsurance(bytes32 airlineId, bytes32 flightId) external { ⋮---- function claimInsurance(bytes32 airlineId, bytes32 flightId) external { ⋮---- function _deployAirline(bytes32 airlineId) internal { ⋮---- function _verifyFlightMessage(bytes memory payload, uint48 epoch, bytes calldata proof) internal view { ```` ## File: test/mock/FlightDelaysMocks.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; ⋮---- import {IVaultConfigurator} from "@symbioticfi/core/src/interfaces/IVaultConfigurator.sol"; import {IVault} from "@symbioticfi/core/src/interfaces/vault/IVault.sol"; import { IDefaultStakerRewards } from "@symbioticfi/rewards/src/interfaces/defaultStakerRewards/IDefaultStakerRewards.sol"; import { IBaseSlashing } from "@symbioticfi/relay-contracts/src/interfaces/modules/voting-power/extensions/IBaseSlashing.sol"; import { IBaseRewards } from "@symbioticfi/relay-contracts/src/interfaces/modules/voting-power/extensions/IBaseRewards.sol"; import {INetworkManager} from "@symbioticfi/relay-contracts/src/interfaces/modules/base/INetworkManager.sol"; ⋮---- contract MockVault { ⋮---- function setSlasher(address slasher_) external { ⋮---- function setActiveStake(uint256 amount) external { ⋮---- function activeStake() external view returns (uint256) { ⋮---- function onSlash(uint256 amount) external returns (uint256) { ⋮---- contract MockSlasher { ⋮---- function slash(bytes32, address, uint256 amount, uint48, bytes calldata) external returns (uint256) { ⋮---- function slashableStake(bytes32, address, uint48, bytes calldata) external view returns (uint256) { ⋮---- contract MockVaultConfigurator { ⋮---- function create(IVaultConfigurator.InitParams calldata params) ⋮---- contract MockRewardsFactory { ⋮---- function create(IDefaultStakerRewards.InitParams calldata params) external returns (address) { ⋮---- contract MockRewards { ⋮---- function distributeRewards(address network, address token, uint256 amount, bytes calldata data) external { ⋮---- contract OperatorRegistryMock { function registerOperator() external {} ⋮---- contract OptInServiceMock { ⋮---- function optIn(address where) external { ⋮---- contract VotingPowersMock is IBaseSlashing, IBaseRewards, INetworkManager { ⋮---- function setSuccess(bool success) external { ⋮---- function getSlasher() external pure returns (address) { ⋮---- function setSlasher(address) external override {} ⋮---- function slashVault(uint48 timestamp, address vault, address operator, uint256 amount, bytes memory) ⋮---- function executeSlashVault(address, uint256 slashIndex, bytes memory) ⋮---- function getRewarder() external view returns (address) { ⋮---- function setRewarder(address rewarder_) external override { ⋮---- function distributeStakerRewards(address stakerRewards, address token, uint256 amount, bytes memory data) ⋮---- function distributeOperatorRewards(address, address, uint256, bytes32) external pure override { // no-op for tests ⋮---- function NETWORK() external view override returns (address) { ⋮---- function SUBNETWORK_IDENTIFIER() external view override returns (uint96) { ⋮---- function SUBNETWORK() external view override returns (bytes32) { ⋮---- function setFlightDelays(address fd) external { ⋮---- function setMaxNetworkLimit(address) external view { ```` ## File: test/mock/SettlementMock.sol ```` // SPDX-License-Identifier: MIT ⋮---- contract SettlementMock { function getRequiredKeyTagFromValSetHeaderAt(uint48) public pure returns (uint8) { ⋮---- function getQuorumThresholdFromValSetHeaderAt(uint48) public pure returns (uint256) { ⋮---- function getCaptureTimestampFromValSetHeaderAt(uint48) public pure returns (uint48) { ⋮---- function getLastCommittedHeaderEpoch() public pure returns (uint48) { ⋮---- function verifyQuorumSigAt(bytes calldata, uint8, uint256, bytes calldata, uint48, bytes calldata) ⋮---- function verifyQuorumSig(bytes calldata, uint8, uint256, bytes calldata) public pure returns (bool) { ```` ## File: test/FlightDelays.t.sol ```` // SPDX-License-Identifier: MIT ⋮---- import {Test} from "forge-std/Test.sol"; ⋮---- import {FlightDelays} from "../src/FlightDelays.sol"; import {SettlementMock} from "./mock/SettlementMock.sol"; import { MockVaultConfigurator, MockRewardsFactory, MockVault, MockRewards, OperatorRegistryMock, OptInServiceMock, VotingPowersMock } from "./mock/FlightDelaysMocks.sol"; import {MockERC20} from "../script/mocks/MockERC20.sol"; ⋮---- contract FlightDelaysTest is Test { ⋮---- function setUp() public { ⋮---- function testBuyInsuranceAndRecordPolicy() public { ⋮---- function testDelayFlightAndClaim() public { ⋮---- function testCompleteFlightDistributesRewards() public { ⋮---- function testDelayRequiresEarlierFlightsProcessed() public { ⋮---- function testFlightsMustBeCreatedWithNonDecreasingTimestamp() public { ⋮---- function testCreateFlightRequiresSequentialOrdering() public { ⋮---- function testCannotBuyInsuranceWithoutFlight() public { ⋮---- function testCannotBuyBeforePolicyWindowOpens() public { ⋮---- function testCannotBuyAfterWindowCloses() public { ⋮---- function testCannotBuyOnceFlightDelayed() public { ⋮---- function _createFlight() internal { ⋮---- function _fundLatestVault(uint256 amount) internal { ```` ## File: ui/src/abi/ERC20.json ````json [ { "type": "function", "name": "name", "stateMutability": "view", "inputs": [], "outputs": [{ "name": "", "type": "string" }] }, { "type": "function", "name": "symbol", "stateMutability": "view", "inputs": [], "outputs": [{ "name": "", "type": "string" }] }, { "type": "function", "name": "decimals", "stateMutability": "view", "inputs": [], "outputs": [{ "name": "", "type": "uint8" }] }, { "type": "function", "name": "balanceOf", "stateMutability": "view", "inputs": [{ "name": "account", "type": "address" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "type": "function", "name": "allowance", "stateMutability": "view", "inputs": [ { "name": "owner", "type": "address" }, { "name": "spender", "type": "address" } ], "outputs": [{ "name": "", "type": "uint256" }] }, { "type": "function", "name": "approve", "stateMutability": "nonpayable", "inputs": [ { "name": "spender", "type": "address" }, { "name": "amount", "type": "uint256" } ], "outputs": [{ "name": "", "type": "bool" }] } ] ```` ## File: ui/src/abi/FlightDelays.json ````json [ { "type": "constructor", "inputs": [ { "name": "vaultConfigurator", "type": "address", "internalType": "address" }, { "name": "operatorVaultOptInService", "type": "address", "internalType": "address" }, { "name": "operatorNetworkOptInService", "type": "address", "internalType": "address" }, { "name": "defaultStakerRewardsFactory", "type": "address", "internalType": "address" }, { "name": "operatorRegistry", "type": "address", "internalType": "address" } ], "stateMutability": "nonpayable" }, { "type": "function", "name": "DEFAULT_STAKER_REWARDS_FACTORY", "inputs": [], "outputs": [ { "name": "", "type": "address", "internalType": "address" } ], "stateMutability": "view" }, { "type": "function", "name": "NETWORK", "inputs": [], "outputs": [ { "name": "", "type": "address", "internalType": "address" } ], "stateMutability": "view" }, { "type": "function", "name": "OPERATOR_NETWORK_OPT_IN_SERVICE", "inputs": [], "outputs": [ { "name": "", "type": "address", "internalType": "address" } ], "stateMutability": "view" }, { "type": "function", "name": "OPERATOR_VAULT_OPT_IN_SERVICE", "inputs": [], "outputs": [ { "name": "", "type": "address", "internalType": "address" } ], "stateMutability": "view" }, { "type": "function", "name": "SUBNETWORK", "inputs": [], "outputs": [ { "name": "", "type": "bytes32", "internalType": "bytes32" } ], "stateMutability": "view" }, { "type": "function", "name": "SUBNETWORK_IDENTIFIER", "inputs": [], "outputs": [ { "name": "", "type": "uint96", "internalType": "uint96" } ], "stateMutability": "view" }, { "type": "function", "name": "VAULT_CONFIGURATOR", "inputs": [], "outputs": [ { "name": "", "type": "address", "internalType": "address" } ], "stateMutability": "view" }, { "type": "function", "name": "airlines", "inputs": [ { "name": "airlineId", "type": "bytes32", "internalType": "bytes32" } ], "outputs": [ { "name": "vault", "type": "address", "internalType": "address" }, { "name": "rewards", "type": "address", "internalType": "address" }, { "name": "covered", "type": "uint256", "internalType": "uint256" }, { "name": "lastFlightId", "type": "bytes32", "internalType": "bytes32" } ], "stateMutability": "view" }, { "type": "function", "name": "buyInsurance", "inputs": [ { "name": "airlineId", "type": "bytes32", "internalType": "bytes32" }, { "name": "flightId", "type": "bytes32", "internalType": "bytes32" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "claimInsurance", "inputs": [ { "name": "airlineId", "type": "bytes32", "internalType": "bytes32" }, { "name": "flightId", "type": "bytes32", "internalType": "bytes32" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "collateral", "inputs": [], "outputs": [ { "name": "", "type": "address", "internalType": "address" } ], "stateMutability": "view" }, { "type": "function", "name": "createFlight", "inputs": [ { "name": "airlineId", "type": "bytes32", "internalType": "bytes32" }, { "name": "flightId", "type": "bytes32", "internalType": "bytes32" }, { "name": "scheduledTimestamp", "type": "uint48", "internalType": "uint48" }, { "name": "epoch", "type": "uint48", "internalType": "uint48" }, { "name": "proof", "type": "bytes", "internalType": "bytes" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "delayFlight", "inputs": [ { "name": "airlineId", "type": "bytes32", "internalType": "bytes32" }, { "name": "flightId", "type": "bytes32", "internalType": "bytes32" }, { "name": "epoch", "type": "uint48", "internalType": "uint48" }, { "name": "proof", "type": "bytes", "internalType": "bytes" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "delayWindow", "inputs": [], "outputs": [ { "name": "", "type": "uint48", "internalType": "uint48" } ], "stateMutability": "view" }, { "type": "function", "name": "departFlight", "inputs": [ { "name": "airlineId", "type": "bytes32", "internalType": "bytes32" }, { "name": "flightId", "type": "bytes32", "internalType": "bytes32" }, { "name": "epoch", "type": "uint48", "internalType": "uint48" }, { "name": "proof", "type": "bytes", "internalType": "bytes" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "flights", "inputs": [ { "name": "airlineId", "type": "bytes32", "internalType": "bytes32" }, { "name": "flightId", "type": "bytes32", "internalType": "bytes32" } ], "outputs": [ { "name": "timestamp", "type": "uint48", "internalType": "uint48" }, { "name": "status", "type": "uint8", "internalType": "enum FlightDelays.FlightStatus" }, { "name": "policiesSold", "type": "uint128", "internalType": "uint128" }, { "name": "previousFlightId", "type": "bytes32", "internalType": "bytes32" } ], "stateMutability": "view" }, { "type": "function", "name": "initialize", "inputs": [ { "name": "initParams", "type": "tuple", "internalType": "struct FlightDelays.InitParams", "components": [ { "name": "votingPowers", "type": "address", "internalType": "address" }, { "name": "settlement", "type": "address", "internalType": "address" }, { "name": "collateral", "type": "address", "internalType": "address" }, { "name": "vaultEpochDuration", "type": "uint48", "internalType": "uint48" }, { "name": "messageExpiry", "type": "uint32", "internalType": "uint32" }, { "name": "policyWindow", "type": "uint48", "internalType": "uint48" }, { "name": "delayWindow", "type": "uint48", "internalType": "uint48" }, { "name": "policyPremium", "type": "uint256", "internalType": "uint256" }, { "name": "policyPayout", "type": "uint256", "internalType": "uint256" } ] } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "messageExpiry", "inputs": [], "outputs": [ { "name": "", "type": "uint32", "internalType": "uint32" } ], "stateMutability": "view" }, { "type": "function", "name": "policies", "inputs": [ { "name": "airlineId", "type": "bytes32", "internalType": "bytes32" }, { "name": "flightId", "type": "bytes32", "internalType": "bytes32" }, { "name": "buyer", "type": "address", "internalType": "address" } ], "outputs": [ { "name": "policyStatus", "type": "uint8", "internalType": "enum FlightDelays.PolicyStatus" } ], "stateMutability": "view" }, { "type": "function", "name": "policyPayout", "inputs": [], "outputs": [ { "name": "", "type": "uint256", "internalType": "uint256" } ], "stateMutability": "view" }, { "type": "function", "name": "policyPremium", "inputs": [], "outputs": [ { "name": "", "type": "uint256", "internalType": "uint256" } ], "stateMutability": "view" }, { "type": "function", "name": "policyWindow", "inputs": [], "outputs": [ { "name": "", "type": "uint48", "internalType": "uint48" } ], "stateMutability": "view" }, { "type": "function", "name": "settlement", "inputs": [], "outputs": [ { "name": "", "type": "address", "internalType": "address" } ], "stateMutability": "view" }, { "type": "function", "name": "staticDelegateCall", "inputs": [ { "name": "target", "type": "address", "internalType": "address" }, { "name": "data", "type": "bytes", "internalType": "bytes" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "vaultEpochDuration", "inputs": [], "outputs": [ { "name": "", "type": "uint48", "internalType": "uint48" } ], "stateMutability": "view" }, { "type": "function", "name": "votingPowers", "inputs": [], "outputs": [ { "name": "", "type": "address", "internalType": "address" } ], "stateMutability": "view" }, { "type": "event", "name": "AirlineVaultDeployed", "inputs": [ { "name": "airlineId", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "vault", "type": "address", "indexed": false, "internalType": "address" }, { "name": "rewards", "type": "address", "indexed": false, "internalType": "address" } ], "anonymous": false }, { "type": "event", "name": "FlightCreated", "inputs": [ { "name": "airlineId", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "flightId", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "scheduledTimestamp", "type": "uint48", "indexed": false, "internalType": "uint48" } ], "anonymous": false }, { "type": "event", "name": "FlightDelayed", "inputs": [ { "name": "airlineId", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "flightId", "type": "bytes32", "indexed": true, "internalType": "bytes32" } ], "anonymous": false }, { "type": "event", "name": "FlightDeparted", "inputs": [ { "name": "airlineId", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "flightId", "type": "bytes32", "indexed": true, "internalType": "bytes32" } ], "anonymous": false }, { "type": "event", "name": "InitSubnetwork", "inputs": [ { "name": "network", "type": "address", "indexed": false, "internalType": "address" }, { "name": "subnetworkId", "type": "uint96", "indexed": false, "internalType": "uint96" } ], "anonymous": false }, { "type": "event", "name": "Initialized", "inputs": [ { "name": "version", "type": "uint64", "indexed": false, "internalType": "uint64" } ], "anonymous": false }, { "type": "event", "name": "InsuranceClaimed", "inputs": [ { "name": "airlineId", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "flightId", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "buyer", "type": "address", "indexed": true, "internalType": "address" }, { "name": "payout", "type": "uint256", "indexed": false, "internalType": "uint256" } ], "anonymous": false }, { "type": "event", "name": "InsurancePurchased", "inputs": [ { "name": "airlineId", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "flightId", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "buyer", "type": "address", "indexed": true, "internalType": "address" }, { "name": "premium", "type": "uint256", "indexed": false, "internalType": "uint256" } ], "anonymous": false }, { "type": "error", "name": "BuyWindowClosed", "inputs": [] }, { "type": "error", "name": "FlightAlreadyExists", "inputs": [] }, { "type": "error", "name": "FlightNotDelayable", "inputs": [] }, { "type": "error", "name": "FlightNotDelayed", "inputs": [] }, { "type": "error", "name": "FlightNotScheduled", "inputs": [] }, { "type": "error", "name": "InsufficientCoverage", "inputs": [] }, { "type": "error", "name": "InvalidEpoch", "inputs": [] }, { "type": "error", "name": "InvalidFlight", "inputs": [] }, { "type": "error", "name": "InvalidInitialization", "inputs": [] }, { "type": "error", "name": "InvalidMessageSignature", "inputs": [] }, { "type": "error", "name": "InvalidPolicy", "inputs": [] }, { "type": "error", "name": "InvalidTimestamp", "inputs": [] }, { "type": "error", "name": "NetworkManager_InvalidNetwork", "inputs": [] }, { "type": "error", "name": "NotInitializing", "inputs": [] }, { "type": "error", "name": "PolicyAlreadyPurchased", "inputs": [] }, { "type": "error", "name": "PolicyNotFound", "inputs": [] }, { "type": "error", "name": "PreviousFlightIncomplete", "inputs": [] }, { "type": "error", "name": "SafeERC20FailedOperation", "inputs": [ { "name": "token", "type": "address", "internalType": "address" } ] } ] ```` ## File: ui/src/abi/Rewards.json ````json [ { "type": "function", "name": "claimable", "stateMutability": "view", "inputs": [ { "name": "token", "type": "address" }, { "name": "account", "type": "address" }, { "name": "data", "type": "bytes" } ], "outputs": [{ "name": "", "type": "uint256" }] }, { "type": "function", "name": "claimRewards", "stateMutability": "nonpayable", "inputs": [ { "name": "recipient", "type": "address" }, { "name": "token", "type": "address" }, { "name": "data", "type": "bytes" } ], "outputs": [] } ] ```` ## File: ui/src/abi/Slasher.json ````json [ { "type": "function", "name": "slashableStake", "stateMutability": "view", "inputs": [ { "name": "network", "type": "bytes32" }, { "name": "operator", "type": "address" }, { "name": "captureTimestamp", "type": "uint48" }, { "name": "hints", "type": "bytes" } ], "outputs": [{ "name": "", "type": "uint256" }] } ] ```` ## File: ui/src/abi/Vault.json ````json [ { "type": "function", "name": "deposit", "stateMutability": "nonpayable", "inputs": [ { "name": "onBehalfOf", "type": "address" }, { "name": "amount", "type": "uint256" } ], "outputs": [ { "name": "depositedAmount", "type": "uint256" }, { "name": "mintedShares", "type": "uint256" } ] }, { "type": "function", "name": "withdraw", "stateMutability": "nonpayable", "inputs": [ { "name": "claimer", "type": "address" }, { "name": "amount", "type": "uint256" } ], "outputs": [ { "name": "burnedShares", "type": "uint256" }, { "name": "mintedShares", "type": "uint256" } ] }, { "type": "function", "name": "activeBalanceOf", "stateMutability": "view", "inputs": [{ "name": "account", "type": "address" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "type": "function", "name": "slasher", "stateMutability": "view", "inputs": [], "outputs": [{ "name": "", "type": "address" }] } ] ```` ## File: ui/src/api/flights.ts ````typescript import type { AirlineDTO, AirlineWithFlights, FlightDTO } from "../types"; ⋮---- async function getJSON(url: string): Promise ⋮---- function normalizeBase(url: string) ⋮---- export async function fetchAirlinesWithFlights(baseUrl: string): Promise ```` ## File: ui/src/components/BuyerPage.tsx ````typescript import type { ReactNode } from "react"; ⋮---- import { airlineImages } from "../constants/airlines"; import type { ChainFlightData, FlattenedFlight, PolicyMap, ProtocolInfo } from "../types"; import { formatTimestamp } from "../utils/format"; import { flightKey } from "../utils/hash"; ⋮----