Skip to content

Commit

Permalink
Merged origin/main.
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanIliev545 committed Dec 11, 2024
2 parents aa8af84 + ff717b7 commit f687365
Show file tree
Hide file tree
Showing 34 changed files with 435 additions and 136 deletions.
41 changes: 38 additions & 3 deletions .github/workflows/manual-deploy-testnet-l2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ jobs:
-l1_chain_id=${{ vars.L1_CHAIN_ID }} \
-l1_beacon_url=${{ vars.L1_BEACON_URL }} \
-l1_blob_archive_url=${{ vars.L1_BLOB_ARCHIVE_URL }} \
-system_contracts_upgrader=${{ vars.NETWORK_SEQUENCER_SYSTEMCONTRACTSUPGRADER }} \
-postgres_db_host=postgres://tenuser:${{ secrets.TEN_POSTGRES_USER_PWD }}@postgres-ten-${{ github.event.inputs.testnet_type }}.postgres.database.azure.com:5432/ \
start'
Expand All @@ -375,12 +376,46 @@ jobs:
./.github/workflows/runner-scripts/wait-node-healthy.sh --host=obscuronode-0-${{ github.event.inputs.testnet_type }}.uksouth.cloudapp.azure.com
./.github/workflows/runner-scripts/wait-node-healthy.sh --host=obscuronode-1-${{ github.event.inputs.testnet_type }}.uksouth.cloudapp.azure.com
./.github/workflows/runner-scripts/wait-node-healthy.sh --host=obscuronode-2-${{ github.event.inputs.testnet_type }}.uksouth.cloudapp.azure.com
deploy-l2-contracts:
grant-sequencer-enclaves:
needs:
- build
- check-obscuro-is-healthy
runs-on: ubuntu-latest
environment:
name: ${{ github.event.inputs.testnet_type }}
steps:
- uses: actions/checkout@v4

- name: 'Grant permission to sequencer enclave(s)'
id: grantSequencerPermission
shell: bash
run: |
go run ./testnet/launcher/l1grantsequencers/cmd \
-l1_http_url=${{ secrets.L1_HTTP_URL }} \
-private_key=${{ secrets.ACCOUNT_PK_WORKER }} \
-management_contract_addr=${{ needs.build.outputs.MGMT_CONTRACT_ADDR }} \
-docker_image=${{ vars.L2_HARDHATDEPLOYER_DOCKER_BUILD_TAG }} \
-sequencer_url=http://obscuronode-0-${{ github.event.inputs.testnet_type }}.uksouth.cloudapp.azure.com:80
- name: 'Save sequencer permissioning container logs'
run: |
docker logs `docker ps -aqf "name=grant-sequencers"` > grant-sequencers.out 2>&1
- name: 'Upload sequencer permissioning container logs'
uses: actions/upload-artifact@v4
with:
name: grant-sequencers
path: |
grant-sequencers.out
retention-days: 7

deploy-l2-contracts:
needs:
- build
- grant-sequencer-enclaves
runs-on: ubuntu-latest
environment:
name: ${{ github.event.inputs.testnet_type }}
steps:
Expand Down Expand Up @@ -417,7 +452,7 @@ jobs:

update-loadbalancer:
needs:
- check-obscuro-is-healthy
- grant-sequencer-enclaves
runs-on: ubuntu-latest
environment:
name: ${{ github.event.inputs.testnet_type }}
Expand Down Expand Up @@ -450,7 +485,7 @@ jobs:
testnet_type: ${{ github.event.inputs.testnet_type }}
secrets: inherit
needs:
- check-obscuro-is-healthy
- grant-sequencer-enclaves

obscuro-test-repository-dispatch:
runs-on: ubuntu-latest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,13 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
networkConfig["TransactionPostProcessorAddress"],
signer
);

// TODO: add callback with the security epic when we add the EOA config and all the rules for access
// to system contracts
/*
const receipt = await transactionPostProcessor.addOnBlockEndCallback(zenTestnet.address);
if (receipt.status !== 1) {

const tx = await transactionPostProcessor.addOnBlockEndCallback(zenTestnet.address);
const receipt = await tx.wait();
if (receipt.status != 1) {
throw new Error("Failed to register Zen token as a system callback");
}
console.log(`Callback added at ${receipt.transactionHash}`); */
console.log(`Callback added at ${receipt.hash}`);
}
export default func;
func.tags = ['ZenBase', 'ZenBase_deploy'];
Expand Down
39 changes: 39 additions & 0 deletions contracts/deployment_scripts/testnet/layer2/003_set_fee.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import {HardhatRuntimeEnvironment} from 'hardhat/types';
import {DeployFunction} from 'hardhat-deploy/types';
import { Receipt } from 'hardhat-deploy/dist/types';
import { network } from 'hardhat';

/*
This script sets the fee for the message bus to prevent spam.
*/
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const l2Network = hre;

const l2Accounts = await l2Network.getNamedAccounts();

const networkConfig = await l2Network.network.provider.request({
method: "net_config",
});

const signer = await l2Network.ethers.getSigner(l2Accounts.deployer);
const fees = await l2Network.ethers.getContractAt(
'Fees',
networkConfig["PublicSystemContracts"]["Fees"],
signer
);

const owner = await fees.owner();
console.log(`Owner = ${owner}`);
console.log(`Signer = ${l2Accounts.deployer}`);

const tx = await fees.setMessageFee(32*10000);
const receipt =await tx.wait();

if (receipt.status != 1) {
throw new Error("Failed to set message fee");
}
console.log(`Fee set at ${receipt.hash}`);
}
export default func;
func.tags = ['SetFees', 'SetFees_deploy'];
func.dependencies = ['ZenBase'];

Large diffs are not rendered by default.

66 changes: 64 additions & 2 deletions contracts/generated/EthereumBridge/EthereumBridge.go

Large diffs are not rendered by default.

Loading

0 comments on commit f687365

Please sign in to comment.