Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -403,8 +403,7 @@ jobs:
download-circuits,
build-nix-flake,
]
if:
always() && needs.validate-and-prepare.result == 'success' && needs.build-binaries.result == 'success'
if: always() && needs.validate-and-prepare.result == 'success' && needs.build-binaries.result == 'success'
steps:
- name: Checkout
uses: actions/checkout@v6
Expand Down
27 changes: 3 additions & 24 deletions crates/evm/src/actors/ciphernode_registry_sol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// or FITNESS FOR A PARTICULAR PURPOSE.

use crate::actors::evm_parser::EvmParser;
use crate::contracts::ICiphernodeRegistry;
use crate::domain::ciphernode_registry_events::extractor;
use crate::domain::error_decoder::{decode_error_from_str, format_evm_error};
use crate::helpers::{encode_zk_proof, send_tx_with_retry, EthProvider};
Expand All @@ -14,7 +15,6 @@ use alloy::{
primitives::{Address, Bytes, B256, U256},
providers::{Provider, WalletProvider},
rpc::types::TransactionReceipt,
sol,
};
use anyhow::Result;
use e3_events::{
Expand All @@ -26,13 +26,6 @@ use e3_utils::{ArcBytes, NotifySync, MAILBOX_LIMIT};
use std::collections::{HashMap, HashSet};
use tracing::{error, info};

sol!(
#[sol(rpc)]
#[derive(Debug)]
ICiphernodeRegistry,
"../../packages/enclave-contracts/artifacts/contracts/interfaces/ICiphernodeRegistry.sol/ICiphernodeRegistry.json"
);

/// Connects to CiphernodeRegistry.sol converting EVM events to EnclaveEvents
pub struct CiphernodeRegistrySolReader;

Expand Down Expand Up @@ -539,14 +532,7 @@ pub async fn fetch_dkg_fold_attestation_verifier<P: Provider + Clone>(
provider: &P,
registry_address: Address,
) -> Result<Option<Address>> {
sol! {
#[sol(rpc)]
interface ICiphernodeRegistryDkgFoldView {
function dkgFoldAttestationVerifier() external view returns (address);
}
}

let contract = ICiphernodeRegistryDkgFoldView::new(registry_address, provider);
let contract = ICiphernodeRegistry::new(registry_address, provider);
let verifier = contract.dkgFoldAttestationVerifier().call().await?;
if verifier == Address::ZERO {
Ok(None)
Expand All @@ -566,14 +552,7 @@ pub async fn fetch_accusation_vote_validity<P: Provider + Clone>(
provider: &P,
registry_address: Address,
) -> Result<Option<U256>> {
sol! {
#[sol(rpc)]
interface ICiphernodeRegistryAccusationVoteView {
function accusationVoteValidity() external view returns (uint256);
}
}

let contract = ICiphernodeRegistryAccusationVoteView::new(registry_address, provider);
let contract = ICiphernodeRegistry::new(registry_address, provider);
let validity = contract.accusationVoteValidity().call().await?;
if validity.is_zero() {
Ok(None)
Expand Down
8 changes: 1 addition & 7 deletions crates/evm/src/actors/enclave_sol_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE.

use crate::contracts::IEnclave;
use crate::domain::error_decoder::format_evm_error;
use crate::domain::plaintext_publication::validate_plaintext_output;
use crate::helpers::{encode_zk_proof, EthProvider};
Expand All @@ -12,7 +13,6 @@ use actix::prelude::*;
use alloy::{
primitives::Address,
providers::{Provider, WalletProvider},
sol,
};
use alloy::{
primitives::{Bytes, U256},
Expand All @@ -33,12 +33,6 @@ use e3_utils::MAILBOX_LIMIT;
use std::collections::{HashMap, HashSet};
use tracing::info;

sol!(
#[sol(rpc)]
IEnclave,
"../../packages/enclave-contracts/artifacts/contracts/interfaces/IEnclave.sol/IEnclave.json"
);

/// Consumes events from the event bus and calls EVM methods on the Enclave.sol contract
pub struct EnclaveSolWriter<P> {
provider: EthProvider<P>,
Expand Down
21 changes: 2 additions & 19 deletions crates/evm/src/actors/slashing_manager_sol_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
//! `proposeSlashByDkgParty` when DKG anchors resolve, and falls back to
//! operator-attributed `proposeSlash` otherwise.

use crate::contracts::{ICiphernodeRegistry, ISlashingManager};
use crate::domain::attestation_evidence::encode_attestation_evidence;
use crate::domain::error_decoder::format_evm_error;
use crate::domain::slash_submission::{should_submit_slash, submission_delay, submission_rank};
Expand All @@ -20,7 +21,6 @@ use alloy::{
primitives::{Address, Bytes, U256},
providers::{Provider, WalletProvider},
rpc::types::TransactionReceipt,
sol,
};
use anyhow::Result;
use e3_events::prelude::*;
Expand All @@ -33,12 +33,6 @@ use e3_events::{AccusationQuorumReached, EType};
use e3_utils::NotifySync;
use tracing::{info, warn};

sol!(
#[sol(rpc)]
ISlashingManager,
"../../packages/enclave-contracts/artifacts/contracts/interfaces/ISlashingManager.sol/ISlashingManager.json"
);

/// Submits `AccusationQuorumReached` events as slash proposals on-chain.
pub struct SlashingManagerSolWriter<P> {
provider: EthProvider<P>,
Expand Down Expand Up @@ -261,24 +255,13 @@ async fn resolve_party_id_for_operator<P: Provider + WalletProvider + Clone>(
e3_id: U256,
operator: Address,
) -> Result<Option<U256>> {
sol! {
#[sol(rpc)]
interface IRegistryDkgView {
function getDkgAnchors(uint256 e3Id)
external
view
returns (uint256[] memory partyIds, bytes32[] memory, bytes32[] memory);
function canonicalCommitteeNodeAt(uint256 e3Id, uint256 partyId) external view returns (address);
}
}

let slashing = ISlashingManager::new(contract_address, provider.provider());
let registry = slashing.ciphernodeRegistry().call().await?;
if registry == Address::ZERO {
return Ok(None);
}

let registry_view = IRegistryDkgView::new(registry, provider.provider());
let registry_view = ICiphernodeRegistry::new(registry, provider.provider());
let anchors = registry_view.getDkgAnchors(e3_id).call().await?;
for pid in anchors.partyIds {
let node = registry_view
Expand Down
Loading
Loading