Skip to content

Commit

Permalink
test(contracts): WIP on tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mempirate committed Oct 9, 2024
1 parent abdb69c commit eb1d9fe
Show file tree
Hide file tree
Showing 8 changed files with 277 additions and 16 deletions.
58 changes: 43 additions & 15 deletions bolt-contracts/script/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ pragma solidity 0.8.25;

import {Script, console} from "forge-std/Script.sol";

import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";

import {BoltValidators} from "../src/contracts/BoltValidators.sol";
import {BoltManager} from "../src/contracts/BoltManager.sol";
import {BoltEigenLayerMiddleware} from "../src/contracts/BoltEigenLayerMiddleware.sol";
Expand All @@ -21,27 +23,53 @@ contract DeployBolt is Script {
) public {
vm.startBroadcast();

address sender = msg.sender;
// The admin address will be authorized to call the adminOnly functions
// on the contract implementations, as well as upgrade the contracts.
address admin = msg.sender;

// TODO: IMPORTANT: Use a different account for the proxy admin!
// Otherwise we will not be able to access the adminOnly functions
// on the underlying implementations through the proxy.
// We can however call them directly if needed.

address validatorsImplementation = address(new BoltValidators(admin));
console.log("BoltValidators implementation deployed at", validatorsImplementation);

BoltValidators validators = new BoltValidators(sender);
console.log("BoltValidators deployed at", address(validators));
address validatorsProxy = address(new ERC1967Proxy(validatorsImplementation, ""));
console.log("BoltValidators proxy deployed at", validatorsProxy);

BoltManager manager = new BoltManager(sender, address(validators));
console.log("BoltManager deployed at", address(manager));
address managerImplementation = address(new BoltManager(admin, validatorsProxy));
console.log("BoltManager implementation deployed at", managerImplementation);

BoltEigenLayerMiddleware eigenLayerMiddleware = new BoltEigenLayerMiddleware(
sender, address(validators), eigenlayerAVSDirectory, eigenlayerDelegationManager, eigenlayerStrategyManager
address managerProxy = address(new ERC1967Proxy(managerImplementation, ""));
console.log("BoltManager proxy deployed at", managerProxy);

address eigenLayerMiddlewareImplementation = address(
new BoltEigenLayerMiddleware(
admin, managerProxy, eigenlayerAVSDirectory, eigenlayerDelegationManager, eigenlayerStrategyManager
)
);
console.log("BoltEigenLayerMiddleware deployed at", address(eigenLayerMiddleware));
BoltSymbioticMiddleware symbioticMiddleware = new BoltSymbioticMiddleware(
sender,
address(validators),
symbioticNetwork,
symbioticOperatorRegistry,
symbioticOperatorNetOptIn,
symbioticVaultRegistry

console.log("BoltEigenLayerMiddleware implementation deployed at", eigenLayerMiddlewareImplementation);

address eigenLayerMiddlewareProxy = address(new ERC1967Proxy(eigenLayerMiddlewareImplementation, ""));
console.log("BoltEigenLayerMiddleware proxy deployed at", eigenLayerMiddlewareProxy);

address symbioticMiddleware = address(
new BoltSymbioticMiddleware(
admin,
address(managerProxy),
symbioticNetwork,
symbioticOperatorRegistry,
symbioticOperatorNetOptIn,
symbioticVaultRegistry
)
);
console.log("BoltSymbioticMiddleware deployed at", address(symbioticMiddleware));

address symbioticMiddlewareProxy = address(new ERC1967Proxy(symbioticMiddleware, ""));
console.log("BoltSymbioticMiddleware proxy deployed at", address(symbioticMiddlewareProxy));

vm.stopBroadcast();
}
}
2 changes: 1 addition & 1 deletion bolt-contracts/src/contracts/BoltManager.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.25;

import {Ownable} from "lib/openzeppelin-contracts/contracts/access/Ownable.sol";
import {OwnableUpgradeable} from "lib/openzeppelin-contracts/contracts/access/OwnableUpgradeable.sol";
import {Time} from "lib/openzeppelin-contracts/contracts/utils/types/Time.sol";
import {EnumerableSet} from "lib/openzeppelin-contracts/contracts/utils/structs/EnumerableSet.sol";
import {IERC20} from "lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol";
Expand Down
2 changes: 2 additions & 0 deletions testnets/holesky/.cb.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CB_JWT_BOLT=eJKLUApazN25QHrBszhpCqYmq83yUWc2
CB_JWTS="{\"BOLT\":\"eJKLUApazN25QHrBszhpCqYmq83yUWc2\"}"
115 changes: 115 additions & 0 deletions testnets/holesky/cb.docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
services:
cb_bolt:
image: ghcr.io/chainbound/bolt-sidecar:v0.3.0-alpha-rc.1
container_name: cb_bolt
environment:
CB_MODULE_ID: BOLT
CB_CONFIG: /cb-config.toml
CB_SIGNER_JWT: ${CB_JWT_BOLT}
SIGNER_SERVER: cb_signer:20000
BOLT_SIDECAR_BUILDER_PROXY_PORT: '18551'
BOLT_SIDECAR_CONSTRAINTS_API: http://cb_pbs:18550
BOLT_SIDECAR_BEACON_API: http://100.85.200.41:4400
BOLT_SIDECAR_EXECUTION_API: http://100.85.200.41:4485
BOLT_SIDECAR_JWT_HEX: 89732cef77d7e9a20021ee8f419dbbb51bdf7f60586932c272ddef02e70cb755
BOLT_SIDECAR_ENGINE_API: http://100.85.200.41:4451
BOLT_SIDECAR_VALIDATOR_INDEXES: 1..2
BOLT_SIDECAR_CHAIN: holesky
BOLT_SIDECAR_METRICS_PORT: '10000'
BOLT_SIDECAR_FEE_RECIPIENT: '0x0000000000000000000000000000000000000000'
METRICS_SERVER: 10000
USE_FILE_LOGS: true
RUST_LOG: debug
MAX_LOG_FILES: 30
volumes:
- ./cb-bolt-config.toml:/cb-config.toml:ro
- ./logs/BOLT:/var/logs/commit-boost
networks:
- signer_network
- monitoring_network
depends_on:
- cb_signer
cb_pbs:
image: ghcr.io/chainbound/bolt-boost:v0.3.0-alpha-rc.1
container_name: cb_pbs
ports:
- 18550:18550
environment:
CB_CONFIG: /cb-config.toml
USE_FILE_LOGS: true
RUST_LOG: debug
MAX_LOG_FILES: 30
METRICS_SERVER: 10000
volumes:
- ./cb-bolt-config.toml:/cb-config.toml:ro
- ./logs/pbs:/var/logs/commit-boost
networks:
- monitoring_network
cb_signer:
image: commitboost_signer
container_name: cb_signer
environment:
CB_CONFIG: /cb-config.toml
CB_JWTS: ${CB_JWTS}
SIGNER_SERVER: 20000
USE_FILE_LOGS: true
RUST_LOG: debug
MAX_LOG_FILES: 30
METRICS_SERVER: 10000
CB_SIGNER_FILE: /keys.json
volumes:
- ./cb-bolt-config.toml:/cb-config.toml:ro
- ././keys.json:/keys.json:ro
- ./logs/signer:/var/logs/commit-boost
networks:
- signer_network
- monitoring_network
cb_prometheus:
image: prom/prometheus:latest
container_name: cb_prometheus
ports:
- 9090:9090
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
- ./targets.json:/etc/prometheus/targets.json
- prometheus-data:/prometheus
networks:
- monitoring_network
cb_grafana:
image: grafana/grafana:latest
container_name: cb_grafana
ports:
- 3000:3000
environment:
- GF_SECURITY_ADMIN_PASSWORD=admin
volumes:
- ./grafana/dashboards:/etc/grafana/provisioning/dashboards
- ./grafana/datasources:/etc/grafana/provisioning/datasources
- grafana-data:/var/lib/grafana
networks:
- monitoring_network
depends_on:
- cb_prometheus
logging:
driver: none
cb_cadvisor:
image: gcr.io/cadvisor/cadvisor
container_name: cb_cadvisor
ports:
- 8080:8080
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
networks:
- monitoring_network
volumes:
prometheus-data:
driver: local
grafana-data:
driver: local
networks:
monitoring_network:
driver: bridge
signer_network:
driver: bridge
46 changes: 46 additions & 0 deletions testnets/holesky/logs/pbs/pbs.2024-09-11
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{"timestamp":"2024-09-11T12:36:34.518374Z","level":"INFO","fields":{"message":"Starting bolt-boost with the following relays:","chain":"Holesky"},"target":"bolt_boost"}
{"timestamp":"2024-09-11T12:36:34.518388Z","level":"INFO","fields":{"message":"ID: example-relay - URI: http://0xa1cec75a3f0661e99299274182938151e8433c61a19222347ea1313d839229cb4ce4e3e5aa2bdeb71c8fcf1b084963c2@abc.xyz/"},"target":"bolt_boost"}
{"timestamp":"2024-09-11T12:44:09.499978Z","level":"INFO","fields":{"message":"Starting bolt-boost with the following relays:","chain":"Holesky"},"target":"bolt_boost"}
{"timestamp":"2024-09-11T12:44:09.499990Z","level":"INFO","fields":{"message":"ID: example-relay - URI: http://0xa1cec75a3f0661e99299274182938151e8433c61a19222347ea1313d839229cb4ce4e3e5aa2bdeb71c8fcf1b084963c2@abc.xyz/"},"target":"bolt_boost"}
{"timestamp":"2024-09-11T12:44:09.500852Z","level":"INFO","fields":{"message":"Starting PBS service","address":"0.0.0.0:18550","events_subs":0},"target":"cb_pbs::service"}
{"timestamp":"2024-09-11T12:44:09.501500Z","level":"INFO","fields":{"message":"Starting metrics server on port 10000"},"target":"cb_metrics::provider"}
{"timestamp":"2024-09-11T12:58:05.935766Z","level":"INFO","fields":{"message":"Starting bolt-boost with the following relays:","chain":"Holesky"},"target":"bolt_boost"}
{"timestamp":"2024-09-11T12:58:05.935775Z","level":"INFO","fields":{"message":"ID: example-relay - URI: http://0xa1cec75a3f0661e99299274182938151e8433c61a19222347ea1313d839229cb4ce4e3e5aa2bdeb71c8fcf1b084963c2@abc.xyz/"},"target":"bolt_boost"}
{"timestamp":"2024-09-11T12:58:05.936286Z","level":"INFO","fields":{"message":"Starting metrics server on port 10000"},"target":"cb_metrics::provider"}
{"timestamp":"2024-09-11T12:58:05.936371Z","level":"INFO","fields":{"message":"Starting PBS service","address":"0.0.0.0:18550","events_subs":0},"target":"cb_pbs::service"}
{"timestamp":"2024-09-11T13:29:40.402543Z","level":"INFO","fields":{"message":"Starting bolt-boost with the following relays:","chain":"Holesky"},"target":"bolt_boost"}
{"timestamp":"2024-09-11T13:29:40.402859Z","level":"INFO","fields":{"message":"ID: example-relay - URI: http://0xa1cec75a3f0661e99299274182938151e8433c61a19222347ea1313d839229cb4ce4e3e5aa2bdeb71c8fcf1b084963c2@abc.xyz/"},"target":"bolt_boost"}
{"timestamp":"2024-09-11T13:29:40.403625Z","level":"INFO","fields":{"message":"Starting metrics server on port 10000"},"target":"cb_metrics::provider"}
{"timestamp":"2024-09-11T13:29:40.403807Z","level":"INFO","fields":{"message":"Starting PBS service","address":"0.0.0.0:18550","events_subs":0},"target":"cb_pbs::service"}
{"timestamp":"2024-09-11T13:33:47.575507Z","level":"INFO","fields":{"message":"Starting bolt-boost with the following relays:","chain":"Holesky"},"target":"bolt_boost"}
{"timestamp":"2024-09-11T13:33:47.575515Z","level":"INFO","fields":{"message":"ID: example-relay - URI: http://0xa1cec75a3f0661e99299274182938151e8433c61a19222347ea1313d839229cb4ce4e3e5aa2bdeb71c8fcf1b084963c2@abc.xyz/"},"target":"bolt_boost"}
{"timestamp":"2024-09-11T13:33:47.576128Z","level":"INFO","fields":{"message":"Starting PBS service","address":"0.0.0.0:18550","events_subs":0},"target":"cb_pbs::service"}
{"timestamp":"2024-09-11T13:33:47.576135Z","level":"INFO","fields":{"message":"Starting metrics server on port 10000"},"target":"cb_metrics::provider"}
{"timestamp":"2024-09-11T13:38:26.286570Z","level":"INFO","fields":{"message":"Starting bolt-boost with the following relays:","chain":"Holesky"},"target":"bolt_boost"}
{"timestamp":"2024-09-11T13:38:26.286579Z","level":"INFO","fields":{"message":"ID: example-relay - URI: http://0xa1cec75a3f0661e99299274182938151e8433c61a19222347ea1313d839229cb4ce4e3e5aa2bdeb71c8fcf1b084963c2@abc.xyz/"},"target":"bolt_boost"}
{"timestamp":"2024-09-11T13:38:26.287236Z","level":"INFO","fields":{"message":"Starting metrics server on port 10000"},"target":"cb_metrics::provider"}
{"timestamp":"2024-09-11T13:38:26.288260Z","level":"INFO","fields":{"message":"Starting PBS service","address":"0.0.0.0:18550","events_subs":0},"target":"cb_pbs::service"}
{"timestamp":"2024-09-11T13:39:32.787030Z","level":"INFO","fields":{"message":"Starting bolt-boost with the following relays:","chain":"Holesky"},"target":"bolt_boost"}
{"timestamp":"2024-09-11T13:39:32.787110Z","level":"INFO","fields":{"message":"ID: example-relay - URI: http://0xa1cec75a3f0661e99299274182938151e8433c61a19222347ea1313d839229cb4ce4e3e5aa2bdeb71c8fcf1b084963c2@abc.xyz/"},"target":"bolt_boost"}
{"timestamp":"2024-09-11T13:39:32.787435Z","level":"INFO","fields":{"message":"Starting PBS service","address":"0.0.0.0:18550","events_subs":0},"target":"cb_pbs::service"}
{"timestamp":"2024-09-11T13:39:32.787456Z","level":"INFO","fields":{"message":"Starting metrics server on port 10000"},"target":"cb_metrics::provider"}
{"timestamp":"2024-09-11T13:48:03.820547Z","level":"INFO","fields":{"message":"Starting bolt-boost with the following relays:","chain":"Holesky"},"target":"bolt_boost"}
{"timestamp":"2024-09-11T13:48:03.820629Z","level":"INFO","fields":{"message":"ID: example-relay - URI: http://0xa1cec75a3f0661e99299274182938151e8433c61a19222347ea1313d839229cb4ce4e3e5aa2bdeb71c8fcf1b084963c2@abc.xyz/"},"target":"bolt_boost"}
{"timestamp":"2024-09-11T13:48:03.820971Z","level":"INFO","fields":{"message":"Starting metrics server on port 10000"},"target":"cb_metrics::provider"}
{"timestamp":"2024-09-11T13:48:03.821076Z","level":"INFO","fields":{"message":"Starting PBS service","address":"0.0.0.0:18550","events_subs":0},"target":"cb_pbs::service"}
{"timestamp":"2024-09-11T13:49:46.905956Z","level":"INFO","fields":{"message":"Starting bolt-boost with the following relays:","chain":"Holesky"},"target":"bolt_boost"}
{"timestamp":"2024-09-11T13:49:46.906113Z","level":"INFO","fields":{"message":"ID: example-relay - URI: http://0xa1cec75a3f0661e99299274182938151e8433c61a19222347ea1313d839229cb4ce4e3e5aa2bdeb71c8fcf1b084963c2@abc.xyz/"},"target":"bolt_boost"}
{"timestamp":"2024-09-11T13:49:46.906254Z","level":"INFO","fields":{"message":"Starting metrics server on port 10000"},"target":"cb_metrics::provider"}
{"timestamp":"2024-09-11T13:49:46.906373Z","level":"INFO","fields":{"message":"Starting PBS service","address":"0.0.0.0:18550","events_subs":0},"target":"cb_pbs::service"}
{"timestamp":"2024-09-11T13:59:13.961663Z","level":"INFO","fields":{"message":"Starting bolt-boost with the following relays:","chain":"Holesky"},"target":"bolt_boost"}
{"timestamp":"2024-09-11T13:59:13.961717Z","level":"INFO","fields":{"message":"ID: example-relay - URI: http://0xa1cec75a3f0661e99299274182938151e8433c61a19222347ea1313d839229cb4ce4e3e5aa2bdeb71c8fcf1b084963c2@abc.xyz/"},"target":"bolt_boost"}
{"timestamp":"2024-09-11T13:59:13.962299Z","level":"INFO","fields":{"message":"Starting metrics server on port 10000"},"target":"cb_metrics::provider"}
{"timestamp":"2024-09-11T13:59:13.962488Z","level":"INFO","fields":{"message":"Starting PBS service","address":"0.0.0.0:18550","events_subs":0},"target":"cb_pbs::service"}
{"timestamp":"2024-09-11T14:04:43.274986Z","level":"INFO","fields":{"message":"Starting bolt-boost with the following relays:","chain":"Holesky"},"target":"bolt_boost"}
{"timestamp":"2024-09-11T14:04:43.275020Z","level":"INFO","fields":{"message":"ID: example-relay - URI: http://0xa1cec75a3f0661e99299274182938151e8433c61a19222347ea1313d839229cb4ce4e3e5aa2bdeb71c8fcf1b084963c2@abc.xyz/"},"target":"bolt_boost"}
{"timestamp":"2024-09-11T14:04:43.276642Z","level":"INFO","fields":{"message":"Starting PBS service","address":"0.0.0.0:18550","events_subs":0},"target":"cb_pbs::service"}
{"timestamp":"2024-09-11T14:04:43.276947Z","level":"INFO","fields":{"message":"Starting metrics server on port 10000"},"target":"cb_metrics::provider"}
{"timestamp":"2024-09-11T14:12:27.560971Z","level":"INFO","fields":{"message":"Starting bolt-boost with the following relays:","chain":"Holesky"},"target":"bolt_boost"}
{"timestamp":"2024-09-11T14:12:27.561262Z","level":"INFO","fields":{"message":"ID: example-relay - URI: http://0xa1cec75a3f0661e99299274182938151e8433c61a19222347ea1313d839229cb4ce4e3e5aa2bdeb71c8fcf1b084963c2@abc.xyz/"},"target":"bolt_boost"}
{"timestamp":"2024-09-11T14:12:27.561943Z","level":"INFO","fields":{"message":"Starting metrics server on port 10000"},"target":"cb_metrics::provider"}
{"timestamp":"2024-09-11T14:12:27.562565Z","level":"INFO","fields":{"message":"Starting PBS service","address":"0.0.0.0:18550","events_subs":0},"target":"cb_pbs::service"}
Loading

0 comments on commit eb1d9fe

Please sign in to comment.