Skip to content

Commit

Permalink
chore: Merge Provernet back to master (#8070)
Browse files Browse the repository at this point in the history
This PR merges provernet back to master

---------

Co-authored-by: Santiago Palladino <[email protected]>
  • Loading branch information
PhilWindle and spalladino authored Aug 20, 2024
1 parent 19bd8a9 commit 82f3dc7
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 32 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/devnet-deploys.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ env:
TF_VAR_BOT_NO_START: true
TF_VAR_BOT_PRIVATE_TRANSFERS_PER_TX: 0 # no private transfers
TF_VAR_BOT_PUBLIC_TRANSFERS_PER_TX: 1
TF_VAR_BOT_TX_MINED_WAIT_SECONDS: 2400
TF_VAR_BOT_TX_MINED_WAIT_SECONDS: 4800
TF_VAR_BOT_FOLLOW_CHAIN: "PROVEN"
TF_VAR_BOT_TX_INTERVAL_SECONDS: 180
TF_VAR_BOT_COUNT: 1
Expand Down Expand Up @@ -112,6 +112,7 @@ jobs:
faucet_lb_priority: ${{ steps.set_network_vars.outputs.faucet_lb_priority }}
bot_no_wait: ${{ steps.set_network_vars.outputs.bot_no_wait }}
max_txs_per_block: ${{ steps.set_network_vars.outputs.max_txs_per_block }}
bot_follow_chain: ${{ steps.set_network_vars.outputs.bot_follow_chain }}
min_txs_per_block: ${{ steps.set_network_vars.outputs.min_txs_per_block }}
bot_flush_setup_txs: ${{ steps.set_network_vars.outputs.bot_flush_setup_txs }}
bot_max_pending_txs: ${{ steps.set_network_vars.outputs.bot_max_pending_txs }}
Expand Down Expand Up @@ -139,6 +140,7 @@ jobs:
echo "bot_no_wait=false" >> $GITHUB_OUTPUT
echo "min_txs_per_block=1" >> $GITHUB_OUTPUT
echo "max_txs_per_block=64" >> $GITHUB_OUTPUT
echo "bot_follow_chain=PROVEN" >> $GITHUB_OUTPUT
echo "bot_flush_setup_txs=false" >> $GITHUB_OUTPUT
echo "bot_max_pending_txs=1" >> $GITHUB_OUTPUT
elif [ "$BRANCH_NAME" = "provernet" ]
Expand All @@ -159,6 +161,7 @@ jobs:
echo "bot_no_wait=true" >> $GITHUB_OUTPUT
echo "min_txs_per_block=4" >> $GITHUB_OUTPUT
echo "max_txs_per_block=4" >> $GITHUB_OUTPUT
echo "bot_follow_chain=NONE" >> $GITHUB_OUTPUT
echo "bot_flush_setup_txs=true" >> $GITHUB_OUTPUT
echo "bot_max_pending_txs=20" >> $GITHUB_OUTPUT
elif [ "$BRANCH_NAME" = "alphanet" ]
Expand All @@ -179,6 +182,7 @@ jobs:
echo "bot_no_wait=false" >> $GITHUB_OUTPUT
echo "min_txs_per_block=1" >> $GITHUB_OUTPUT
echo "max_txs_per_block=64" >> $GITHUB_OUTPUT
echo "bot_follow_chain=PROVEN" >> $GITHUB_OUTPUT
echo "bot_flush_setup_txs=false" >> $GITHUB_OUTPUT
echo "bot_max_pending_txs=1" >> $GITHUB_OUTPUT
else
Expand Down Expand Up @@ -452,13 +456,13 @@ jobs:
working-directory: ./yarn-project/aztec/terraform/node
run: |
terraform init -input=false -backend-config="key=${{ env.DEPLOY_TAG }}/aztec-node"
terraform apply -input=false -auto-approve -var="NODE_P2P_TCP_PORT=${{ needs.set-network.outputs.node_tcp_range_start }}" -var="NODE_P2P_UDP_PORT=${{ needs.set-network.outputs.node_udp_range_start }}"
terraform apply -input=false -auto-approve -replace="aws_efs_file_system.node_data_store" -var="NODE_P2P_TCP_PORT=${{ needs.set-network.outputs.node_tcp_range_start }}" -var="NODE_P2P_UDP_PORT=${{ needs.set-network.outputs.node_udp_range_start }}"
- name: Deploy Aztec Prover Nodes
working-directory: ./yarn-project/aztec/terraform/prover-node
run: |
terraform init -input=false -backend-config="key=${{ env.DEPLOY_TAG }}/aztec-prover-node"
terraform apply -input=false -auto-approve -var="NODE_P2P_TCP_PORT=${{ needs.set-network.outputs.prover_node_tcp_range_start }}" -var="NODE_P2P_UDP_PORT=${{ needs.set-network.outputs.prover_node_udp_range_start }}"
terraform apply -input=false -auto-approve -replace="aws_efs_file_system.prover_node_data_store" -var="NODE_P2P_TCP_PORT=${{ needs.set-network.outputs.prover_node_tcp_range_start }}" -var="NODE_P2P_UDP_PORT=${{ needs.set-network.outputs.prover_node_udp_range_start }}"
- name: Deploy Provers
working-directory: ./yarn-project/aztec/terraform/prover
Expand All @@ -470,7 +474,7 @@ jobs:
working-directory: ./yarn-project/aztec/terraform/pxe
run: |
terraform init -input=false -backend-config="key=${{ env.DEPLOY_TAG }}/pxe"
terraform apply -input=false -auto-approve
terraform apply -input=false -auto-approve -replace="aws_efs_file_system.pxe_data_store"
bootstrap:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -585,6 +589,7 @@ jobs:
TF_VAR_BOT_MAX_PENDING_TXS: ${{ needs.set-network.outputs.bot_max_pending_txs }}
TF_VAR_SEQ_MIN_TX_PER_BLOCK: ${{ needs.set-network.outputs.min_txs_per_block }}
TF_VAR_SEQ_MAX_TX_PER_BLOCK: ${{ needs.set-network.outputs.max_txs_per_block }}
TF_VAR_BOT_FOLLOW_CHAIN: ${{ needs.set-network.outputs.bot_follow_chain }}
TF_VAR_PROVING_ENABLED: true
TF_VAR_BOT_NO_START: false
steps:
Expand Down Expand Up @@ -643,7 +648,8 @@ jobs:
run: |
./.github/scripts/wait_for_infra.sh pxe ${{ env.DEPLOY_TAG }} ${{ env.API_KEY }}
- name: Deploy verifier
- name: Deploy verifier (allow failure)
continue-on-error: true
working-directory: ./yarn-project/aztec/terraform/pxe
run: |
set -eo pipefail
Expand Down
2 changes: 1 addition & 1 deletion l1-contracts/src/core/FeeJuicePortal.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ contract FeeJuicePortal is IFeeJuicePortal, Ownable {
IERC20 public underlying;
bytes32 public l2TokenAddress;

constructor() Ownable(msg.sender) {}
constructor(address owner) Ownable(owner) {}

/**
* @notice Initialize the FeeJuicePortal
Expand Down
2 changes: 1 addition & 1 deletion l1-contracts/test/Rollup.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ contract RollupTest is DecoderBase {
registry = new Registry(address(this));
availabilityOracle = new AvailabilityOracle();
portalERC20 = new PortalERC20();
feeJuicePortal = new FeeJuicePortal();
feeJuicePortal = new FeeJuicePortal(address(this));
portalERC20.mint(address(feeJuicePortal), Constants.FEE_JUICE_INITIAL_MINT);
feeJuicePortal.initialize(
address(registry), address(portalERC20), bytes32(Constants.FEE_JUICE_ADDRESS)
Expand Down
6 changes: 5 additions & 1 deletion yarn-project/aztec/terraform/node/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,11 @@ resource "aws_ecs_task_definition" "aztec-node" {
{
name = "NETWORK_NAME",
value = "${var.DEPLOY_TAG}"
}
},
{
name = "VALIDATOR_DISABLED",
value = "1"
},
]
mountPoints = [
{
Expand Down
3 changes: 2 additions & 1 deletion yarn-project/aztec/terraform/prover-node/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ resource "aws_ecs_task_definition" "aztec-prover-node" {
environment = [
// General
{ name = "NODE_ENV", value = "production" },
{ name = "LOG_LEVEL", value = "debug" },
{ name = "LOG_LEVEL", value = "verbose" },
{ name = "DEBUG", value = "aztec:*,-json-rpc:json_proxy:*,-aztec:avm_simulator:*" },
{ name = "DEPLOY_TAG", value = var.DEPLOY_TAG },
{ name = "NETWORK_NAME", value = "${var.DEPLOY_TAG}" },
Expand Down Expand Up @@ -198,6 +198,7 @@ resource "aws_ecs_task_definition" "aztec-prover-node" {
{ name = "PROVER_REAL_PROOFS", value = tostring(var.PROVING_ENABLED) },
{ name = "BB_WORKING_DIRECTORY", value = "${local.data_dir}/prover_node_${count.index + 1}/temp" },
{ name = "ACVM_WORKING_DIRECTORY", value = "${local.data_dir}/prover_node_${count.index + 1}/temp" },
{ name = "PROVER_NODE_MAX_PENDING_JOBS", value = tostring(var.PROVER_NODE_MAX_PENDING_JOBS) },

// Metrics
{ name = "OTEL_EXPORTER_OTLP_ENDPOINT", value = "http://aztec-otel.local:4318" },
Expand Down
5 changes: 5 additions & 0 deletions yarn-project/aztec/terraform/prover-node/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ variable "PROVING_ENABLED" {
default = false
}

variable "PROVER_NODE_MAX_PENDING_JOBS" {
type = number
default = 16
}

variable "BOOTSTRAP_NODES" {
type = string
default = ""
Expand Down
9 changes: 8 additions & 1 deletion yarn-project/bot/src/factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@ export class BotFactory {
throw new Error(`Either a PXE client or a PXE URL must be provided`);
}

this.node = dependencies.node;

if (dependencies.pxe) {
this.log.info(`Using local PXE`);
this.pxe = dependencies.pxe;
return;
}
this.log.info(`Using remote PXE at ${config.pxeUrl!}`);
this.pxe = createPXEClient(config.pxeUrl!);
this.node = dependencies.node;
}

/**
Expand Down Expand Up @@ -60,6 +61,8 @@ export class BotFactory {
} else {
this.log.info(`Initializing account at ${account.getAddress().toString()}`);
const sentTx = account.deploy();
const txHash = await sentTx.getTxHash();
this.log.info(`Sent tx with hash ${txHash.to0xString()}`);
if (this.config.flushSetupTransactions) {
this.log.verbose('Flushing transactions');
await this.node!.flushTxs();
Expand Down Expand Up @@ -93,6 +96,8 @@ export class BotFactory {
} else {
this.log.info(`Deploying token contract at ${address.toString()}`);
const sentTx = deploy.send(deployOpts);
const txHash = await sentTx.getTxHash();
this.log.info(`Sent tx with hash ${txHash.to0xString()}`);
if (this.config.flushSetupTransactions) {
this.log.verbose('Flushing transactions');
await this.node!.flushTxs();
Expand Down Expand Up @@ -123,6 +128,8 @@ export class BotFactory {
return;
}
const sentTx = new BatchCall(token.wallet, calls).send();
const txHash = await sentTx.getTxHash();
this.log.info(`Sent tx with hash ${txHash.to0xString()}`);
if (this.config.flushSetupTransactions) {
this.log.verbose('Flushing transactions');
await this.node!.flushTxs();
Expand Down
27 changes: 8 additions & 19 deletions yarn-project/ethereum/src/deploy_l1_contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,7 @@ export const deployL1Contracts = async (

logger.info(`Deployed Fee Juice at ${feeJuiceAddress}`);

const feeJuicePortalAddress = await deployL1Contract(
walletClient,
publicClient,
contractsToDeploy.feeJuicePortal.contractAbi,
contractsToDeploy.feeJuicePortal.contractBytecode,
);
const feeJuicePortalAddress = await deployer.deploy(contractsToDeploy.feeJuicePortal, [account.address.toString()]);

logger.info(`Deployed Gas Portal at ${feeJuicePortalAddress}`);

Expand Down Expand Up @@ -224,19 +219,13 @@ export const deployL1Contracts = async (
`Initialized Gas Portal at ${feeJuicePortalAddress} to bridge between L1 ${feeJuiceAddress} to L2 ${args.l2FeeJuiceAddress}`,
);

const rollupAddress = await deployL1Contract(
walletClient,
publicClient,
contractsToDeploy.rollup.contractAbi,
contractsToDeploy.rollup.contractBytecode,
[
getAddress(registryAddress.toString()),
getAddress(availabilityOracleAddress.toString()),
getAddress(feeJuicePortalAddress.toString()),
args.vkTreeRoot.toString(),
account.address.toString(),
],
);
const rollupAddress = await deployer.deploy(contractsToDeploy.rollup, [
getAddress(registryAddress.toString()),
getAddress(availabilityOracleAddress.toString()),
getAddress(feeJuicePortalAddress.toString()),
args.vkTreeRoot.toString(),
account.address.toString(),
]);
logger.info(`Deployed Rollup at ${rollupAddress}`);

// Set initial blocks as proven if requested
Expand Down
4 changes: 2 additions & 2 deletions yarn-project/foundation/src/log/logger.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import debug from 'debug';
import { inspect } from 'util';

import { type LogData, type LogFn } from './log_fn.js';

Expand Down Expand Up @@ -88,8 +89,7 @@ function logWithDebug(debug: debug.Debugger, level: LogLevel, msg: string, data?
* @returns A string with both the log message and the error message.
*/
function fmtErr(msg: string, err?: Error | unknown): string {
const errStr = err && [(err as Error).name, (err as Error).message].filter(x => !!x).join(' ');
return err ? `${msg}: ${errStr || err}` : msg;
return err ? `${msg}: ${inspect(err)}` : msg;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ export class L1Publisher {
...pick(tx!, 'calldataGas', 'calldataSize'),
eventName: 'proof-published-to-l1',
};
this.log.info(`Published L2 block to L1 rollup contract`, { ...stats, ...ctx });
this.log.info(`Published proof to L1 rollup contract`, { ...stats, ...ctx });
this.metrics.recordSubmitProof(timer.ms(), stats);
return true;
}
Expand Down

0 comments on commit 82f3dc7

Please sign in to comment.