Skip to content

Commit

Permalink
feat: introduce mainnet profile (#544)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrekucci authored Dec 26, 2024
1 parent 8ceeb28 commit 38a385e
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 12 deletions.
2 changes: 1 addition & 1 deletion contracts/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if [ "${DEPLOY_TYPE}" = "core" ]; then
echo "Deploying core contracts in testnet environment"
ORACLE_KEYSTORE_ADDRESS="$ORACLE_KEYSTORE_ADDRESS" \
"${FORGE_BIN_PATH}" script \
"${SCRIPT_PATH_PREFIX}/core/DeployCore.s.sol:DeployTestnet" \
"${SCRIPT_PATH_PREFIX}/core/DeployCore.s.sol:DeployCore" \
--root "${CONTRACT_REPO_ROOT_PATH}" \
--priority-gas-price 2000000000 \
--with-gas-price 5000000000 \
Expand Down
3 changes: 1 addition & 2 deletions contracts/scripts/core/DeployCore.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol";
import {BlockTracker} from "../../contracts/core/BlockTracker.sol";
import {console} from "forge-std/console.sol";

contract DeployTestnet is Script {
contract DeployCore is Script {

// Amount of ETH to initially fund the oracle account on L1 chain.
uint256 public constant ORACLE_INITIAL_FUNDING = 0.5 ether;
Expand All @@ -23,7 +23,6 @@ contract DeployTestnet is Script {
error FailedToSendETHToOracle(address addr);

function run() external {
require(block.chainid == 17864, "chainID not 17864 (testnet env)");
vm.startBroadcast();

uint256 minStake = 1 ether;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ job "{{ job.name }}" {
task "contracts" {
driver = "exec"

{% if profile == 'testnet' %}
{% if profile == 'testnet' or profile == 'mainnet' %}
resources {
cpu = 4000
memory = 2048
Expand Down Expand Up @@ -148,8 +148,10 @@ job "{{ job.name }}" {
--directory /usr/local \
--strip-components=1

find local/contracts -type f -name "._*.sol" -exec rm -f {} +
chmod +x local/foundry.sh && local/foundry.sh
chmod +x ${XDG_CONFIG_HOME}/.foundry/bin/foundryup && ${XDG_CONFIG_HOME}/.foundry/bin/foundryup -i nightly-e649e62f125244a3ef116be25dfdc81a2afbaf2a
chmod +x ${XDG_CONFIG_HOME}/.foundry/bin/foundryup
${XDG_CONFIG_HOME}/.foundry/bin/foundryup -i nightly-e649e62f125244a3ef116be25dfdc81a2afbaf2a
export PATH="${XDG_CONFIG_HOME}/.foundry/bin:$PATH"
chmod +x ${CONTRACT_REPO_ROOT_PATH}/entrypoint.sh
echo ""
Expand Down Expand Up @@ -218,6 +220,10 @@ job "{{ job.name }}" {
export RPC_URL="{{ job.env['l1_rpc_url'] }}"
export CHAIN_ID="17000"
export ETHERSCAN_API_KEY="{{ job.env['etherscan_api_key'] }}"
{% elif profile == 'mainnet' %}
export RPC_URL="{{ job.env['l1_rpc_url'] }}"
export CHAIN_ID="1"
export ETHERSCAN_API_KEY="{{ job.env['etherscan_api_key'] }}"
{% endif %}

{%- raw %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ job "{{ job.name }}" {
sidecar = true
}

{% if profile == 'testnet' %}
{% if profile == 'testnet' or profile == 'mainnet' %}
resources {
cores = 4
memory = 8192
Expand Down Expand Up @@ -158,7 +158,7 @@ job "{{ job.name }}" {
task "relayer" {
driver = "exec"

{% if profile == 'testnet' %}
{% if profile == 'testnet' or profile == 'mainnet' %}
resources {
cores = 4
memory = 8192
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ job "{{ job.name }}" {
task "dashboard" {
driver = "exec"

{% if profile == 'testnet' %}
{% if profile == 'testnet' or profile == 'mainnet' %}
resources {
memory = 4096
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ job "{{ job.name }}" {
driver = "exec"
kill_timeout = "25s"

{% if profile == 'testnet' or profile == 'archive' %}
{% if profile == 'testnet' or profile == 'mainnet' or profile == 'archive' %}
resources {
cores = 6
memory = 32768
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ job "{{ job.name }}" {
sidecar = true
}

{% if profile == 'testnet' %}
{% if profile == 'testnet' or profile == 'mainnet' %}
resources {
cores = 4
memory = 8192
Expand Down Expand Up @@ -151,7 +151,7 @@ job "{{ job.name }}" {
task "oracle" {
driver = "exec"

{% if profile == 'testnet' %}
{% if profile == 'testnet' or profile == 'mainnet' %}
resources {
cores = 4
memory = 8192
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ job "{{ job.name }}" {
task "node" {
driver = "exec"

{% if profile == 'testnet' %}
{% if profile == 'testnet' or profile == 'mainnet' %}
resources {
cores = 4
memory = 8192
Expand Down
7 changes: 7 additions & 0 deletions infrastructure/nomad/playbooks/variables/environments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,10 @@ environments:
secrets: fetch
genesis_timestamp: "0x668ebdff"
domain: testnet.mev-commit.xyz
mainenv:
chain_id: 8855
profile: "{{ profile }}"
version: "{{ version }}"
secrets: fetch
genesis_timestamp: "0x676d7ae2"
domain: mev-commit.xyz
15 changes: 15 additions & 0 deletions infrastructure/nomad/playbooks/variables/profiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,21 @@ profiles:
- *mev_commit_provider_emulator_node1_job
- *datadog_agent_metrics_collector_job

mainnet:
jobs:
- *artifacts_job
- *datadog_agent_logs_collector_job
- *otel_collector_job
- *mev_commit_geth_bootnode1_job
- *mev_commit_geth_signer_node1_job
- *mev_commit_geth_member_node_job
- *contracts_deployer_job
- *mev_commit_bridge_job
- *mev_commit_dashboard_job
- *mev_commit_bootnode1_job
- *mev_commit_oracle_job
- *datadog_agent_metrics_collector_job

stressnet:
jobs:
- *artifacts_job
Expand Down

0 comments on commit 38a385e

Please sign in to comment.