Skip to content

Commit

Permalink
fix:merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
supernovahs committed Nov 21, 2024
1 parent e2a8eb2 commit 490d380
Show file tree
Hide file tree
Showing 11 changed files with 610 additions and 419 deletions.
981 changes: 596 additions & 385 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion bin/incredible-squaring-avs/src/commands/avs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,6 @@ pub async fn register_operator_with_el_and_avs(
signer = LocalSigner::decrypt_keystore(ecdsa_keystore_path, ecdsa_keystore_password)?;
}
let s = signer.to_field_bytes();

let avs_registry_writer = AvsRegistryChainWriter::build_avs_registry_chain_writer(
get_logger(),
rpc_url.clone(),
Expand Down
2 changes: 1 addition & 1 deletion contracts/anvil/deploy-avs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ parent_path=$(
cd "$parent_path"

cd ../
forge script script/IncredibleSquaringDeployer.s.sol --rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcast --slow
forge script script/IncredibleSquaringDeployer.s.sol --rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcast

forge script script/ContractsRegistry.s.sol --rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcast --slow

Expand Down
1 change: 1 addition & 0 deletions contracts/incredible_squaring_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"num_quorums": 1,
"operator_params": [10000,15000,100],
"operator_addr": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
"operator_2_addr":"0x0b065a0423f076a340f37e16e1ce22e23d66caf2",
"contracts_registry_addr": "0x5FbDB2315678afecb367f032d93F642f64180aa3",
"task_generator_addr": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
"aggregator_addr":"0xa0Ee7A142d267C1f36714E4a8F75612F20a79720"
Expand Down
14 changes: 7 additions & 7 deletions contracts/script/IncredibleSquaringDeployer.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ contract IncredibleSquaringDeployer is Script {
address public TASK_GENERATOR_ADDR;
address public CONTRACTS_REGISTRY_ADDR;
address public OPERATOR_ADDR;
address public OPERATOR_2_ADDR;
ContractsRegistry contractsRegistry;

StrategyBaseTVLLimits public erc20MockStrategy;
Expand Down Expand Up @@ -98,17 +99,16 @@ contract IncredibleSquaringDeployer is Script {
IncredibleSquaringDeploymentLib.IncredibleSquaringSetupConfig memory isConfig =
IncredibleSquaringDeploymentLib.readIncredibleSquaringConfigJson("incredible_squaring_config");

// AGGREGATOR_ADDR = vm.envAddress("AGGREGATOR_ADDR");
// TASK_GENERATOR_ADDR = vm.envAddress("TASK_GENERATOR_ADDR");
// CONTRACTS_REGISTRY_ADDR = vm.envAddress("CONTRACTS_REGISTRY_ADDR");
// OPERATOR_ADDR = vm.envAddress("OPERATOR_ADDR");
// contractsRegistry = ContractsRegistry(CONTRACTS_REGISTRY_ADDR);

configData = CoreDeploymentLib.readDeploymentJson("script/deployments/core/", block.chainid);

erc20Mock = new MockERC20();
FundOperator.fund_operator(address(erc20Mock), isConfig.operator_addr, 10e18);

FundOperator.fund_operator(address(erc20Mock), isConfig.operator_2_addr, 10e18);
console.log("operator_2_addr");
console.log(isConfig.operator_2_addr);
(bool s ,) = isConfig.operator_2_addr.call{value: 0.1 ether}("");
require(s);
console.log(isConfig.operator_2_addr.balance);
incredibleSquaringStrategy = IStrategy(StrategyFactory(configData.strategyFactory).deployNewStrategy(erc20Mock));
rewardscoordinator = configData.rewardsCoordinator;

Expand Down
2 changes: 1 addition & 1 deletion contracts/script/deployments/core/31337.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"lastUpdate":{"timestamp":"1732120151","block_number":"1"},"addresses":{"proxyAdmin":"0xe7f1725e7734ce288f8367e1bb143e90bb3f0512","delegation":"0xcf7ed3acca5a467e9e704c703e8d87f634fb0fc9","delegationManagerImpl":"0x68b1d87f95878fe05b998f19b66f4baba5de1aed","avsDirectory":"0x5fc8d32690cc91d4c39d9d3abcbd16989f875707","avsDirectoryImpl":"0x3aa5ebb10dc797cac828524e59a333d0a371443c","strategyManager":"0xa513e6e4b8f2a923d98304ec87f64353c4d5c853","strategyManagerImpl":"0xc6e7df5e7b4f2a278906862b61205850344d4e7d","eigenPodManager":"0x8a791620dd6260079bf849dc5567adc3f2fdc318","eigenPodManagerImpl":"0x4ed7c70f96b99c776995fb64377f0d4ab3b0e1c1","strategyFactory":"0x9a9f2ccfde556a7e9ff0848998aa4a0cfd8863ae","rewardsCoordinator":"0xb7f8bc63bbcad18155201308c8f3540b07f84f5e","strategyBeacon":"0xc5a5c42992decbae36851359345fe25997f5c42d"}}
{"lastUpdate":{"timestamp":"1732177770","block_number":"1"},"addresses":{"proxyAdmin":"0xe7f1725e7734ce288f8367e1bb143e90bb3f0512","delegation":"0xcf7ed3acca5a467e9e704c703e8d87f634fb0fc9","delegationManagerImpl":"0x68b1d87f95878fe05b998f19b66f4baba5de1aed","avsDirectory":"0x5fc8d32690cc91d4c39d9d3abcbd16989f875707","avsDirectoryImpl":"0x3aa5ebb10dc797cac828524e59a333d0a371443c","strategyManager":"0xa513e6e4b8f2a923d98304ec87f64353c4d5c853","strategyManagerImpl":"0xc6e7df5e7b4f2a278906862b61205850344d4e7d","eigenPodManager":"0x8a791620dd6260079bf849dc5567adc3f2fdc318","eigenPodManagerImpl":"0x4ed7c70f96b99c776995fb64377f0d4ab3b0e1c1","strategyFactory":"0x9a9f2ccfde556a7e9ff0848998aa4a0cfd8863ae","rewardsCoordinator":"0xb7f8bc63bbcad18155201308c8f3540b07f84f5e","strategyBeacon":"0xc5a5c42992decbae36851359345fe25997f5c42d"}}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"lastUpdate":{"timestamp":"1732120152","block_number":"36"},"addresses":{"proxyAdmin":"0x70e0ba845a1a0f2da3359c97e0285013525ffc49","IncredibleSquaringServiceManager":"0x99bba657f2bbc93c02d617f8ba121cb8fc104acf","incredibleSquaringServiceManagerImpl":"0xdbc43ba45381e02825b14322cddd15ec4b3164e6","IncredibleSquaringTaskManager":"0x5eb3bc0a489c5a8288765d2336659ebca68fcd00","registryCoordinator":"0x809d550fca64d94bd9f66e60752a544199cfac3d","blsapkRegistry":"0x1291be112d480055dafd8a610b7d1e203891c274","indexRegistry":"0xb7278a61aa25c888815afc32ad3cc52ff24fe575","stakeRegistry":"0x8f86403a4de0bb5791fa46b8e795c547942fe4cf","operatorStateRetriever":"0x2bdcc0de6be1f7d2ee689a0342d76f52e8efaba3","strategy":"0x2b961e3959b79326a8e7f64ef0d2d825707669b5","token":"0x0000000000000000000000000000000000000000"}}
{"lastUpdate":{"timestamp":"1732177805","block_number":"36"},"addresses":{"proxyAdmin":"0x99bba657f2bbc93c02d617f8ba121cb8fc104acf","IncredibleSquaringServiceManager":"0x8f86403a4de0bb5791fa46b8e795c547942fe4cf","incredibleSquaringServiceManagerImpl":"0x4c4a2f8c81640e47606d3fd77b353e87ba015584","IncredibleSquaringTaskManager":"0x809d550fca64d94bd9f66e60752a544199cfac3d","registryCoordinator":"0x1291be112d480055dafd8a610b7d1e203891c274","blsapkRegistry":"0xb7278a61aa25c888815afc32ad3cc52ff24fe575","indexRegistry":"0x82e01223d51eb87e16a03e24687edf0f294da6f1","stakeRegistry":"0x5eb3bc0a489c5a8288765d2336659ebca68fcd00","operatorStateRetriever":"0x7bc06c482dead17c0e297afbc32f6e63d3846650","strategy":"0x2b961e3959b79326a8e7f64ef0d2d825707669b5","token":"0x0000000000000000000000000000000000000000"}}
2 changes: 2 additions & 0 deletions contracts/script/utils/IncredibleSquaringDeploymentLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ library IncredibleSquaringDeploymentLib {
uint256 numQuorums;
uint256[] operatorParams;
address operator_addr;
address operator_2_addr;
address contracts_registry_addr;
address task_generator_addr;
address aggregator_addr;
Expand Down Expand Up @@ -212,6 +213,7 @@ library IncredibleSquaringDeploymentLib {
data.contracts_registry_addr = json.readAddress(".contracts_registry_addr");
data.operator_addr = json.readAddress(".operator_addr");
data.task_generator_addr = json.readAddress(".task_generator_addr");
data.operator_2_addr = json.readAddress(".operator_2_addr");
return data;
}

Expand Down
17 changes: 0 additions & 17 deletions crates/aggregator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,12 @@ impl Aggregator {
),
_ => return Err(Error::invalid_params("Expected a map")),
};
info!("calling process_signed_task_response");
// Call the process_signed_task_response function
let result = aggregator
.lock()
.await
.process_signed_task_response(signed_task_response)
.await;
info!("process_signed_task_response_result{:?}", result);
match result {
Ok(_) => Ok(Value::Bool(true)),
Err(_) => Err(Error::invalid_params("invalid")),
Expand Down Expand Up @@ -224,8 +222,6 @@ impl Aggregator {
let mut stream = sub.into_stream();

while let Some(log) = stream.next().await {
info!("received new task created in aggregator ");

let NewTaskCreated { taskIndex, task } = log.log_decode()?.inner.data;

aggregator
Expand All @@ -244,16 +240,9 @@ impl Aggregator {
quorum_nums.push(*val);
}

info!("quorum_nums[0]{:?}", quorum_nums[0]);
info!(
"quorum_threhold_percentage[0]{:?}",
quorum_threshold_percentages[0]
);

let time_to_expiry = tokio::time::Duration::from_secs(
(TASK_CHALLENGE_WINDOW_BLOCK * BLOCK_TIME_SECONDS).into(),
);
info!("initializing new task in bls aggregation service");
let _ = aggregator
.lock()
.await
Expand All @@ -267,8 +256,6 @@ impl Aggregator {
)
.await
.map_err(|e: BlsAggregationServiceError| eyre::eyre!(e));

info!("initialized new task in bls aggregation service");
}

Ok(())
Expand All @@ -287,10 +274,6 @@ impl Aggregator {
&mut self,
signed_task_response: SignedTaskResponse,
) -> Result<(), AggregatorError> {
info!(
"received request for task response for index{:?}",
signed_task_response.task_response.referenceTaskIndex
);
let task_index = signed_task_response.task_response.referenceTaskIndex;

let task_response_digest = alloy::primitives::keccak256(TaskResponse::abi_encode(
Expand Down
5 changes: 0 additions & 5 deletions crates/chainio/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,10 @@ pub mod error;
/// Fake avs writer
pub mod fake_avs_writer;

use std::str::FromStr;

use alloy::{
network::EthereumWallet,
primitives::{Address, U256},
rpc::types::TransactionReceipt,
signers::local::PrivateKeySigner,
};
use alloy_provider::ProviderBuilder;
use eigen_types::operator::{QuorumNum, QuorumThresholdPercentage};
use eigen_utils::{
get_provider, get_signer,
Expand Down
2 changes: 1 addition & 1 deletion crates/config/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//! config
use alloy::hex::FromHex;
use alloy::primitives::{Address, Bytes, FixedBytes, U256};
use eigen_types::operator::OperatorId;
use error::ConfigError;
use serde::{Deserialize, Serialize};
use std::str::FromStr;
Expand Down Expand Up @@ -375,7 +376,6 @@ impl IncredibleConfig {
.map_err(ConfigError::HexParse)
}

pub fn get_operator_id(&self) -> Result<OperatorId, error::ConfigError> {
pub fn get_operator_id(&self) -> Result<FixedBytes<32>, error::ConfigError> {
FixedBytes::from_hex(self.operator_config.operator_id.as_bytes())
.map_err(ConfigError::HexParse)
Expand Down

0 comments on commit 490d380

Please sign in to comment.