Skip to content

Commit

Permalink
fixed failing l1 tests
Browse files Browse the repository at this point in the history
lint fix

add new address for blob sender

remove unused fn

lint

fixed test

lint
  • Loading branch information
koloz193 committed Mar 13, 2024
1 parent 6d03eaa commit 4ba7688
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 39 deletions.
1 change: 1 addition & 0 deletions l1-contracts/.env
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ CONTRACTS_CREATE2_FACTORY_ADDR=0x0000000000000000000000000000000000000000
CONTRACTS_VALIDATOR_TIMELOCK_ADDR=0x0000000000000000000000000000000000000000
CONTRACTS_VALIDATOR_TIMELOCK_EXECUTION_DELAY=0
ETH_SENDER_SENDER_OPERATOR_COMMIT_ETH_ADDR=0x0000000000000000000000000000000000000000
ETH_SENDER_SENDER_OPERATOR_BLOBS_ETH_ADDR=0x0000000000000000000000000000000000000001
CONTRACTS_SHARED_BRIDGE_UPGRADE_STORAGE_SWITCH=0
40 changes: 22 additions & 18 deletions l1-contracts/src.ts/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
getAddressFromEnv,
getHashFromEnv,
getNumberFromEnv,
getOptionalAddressFromEnv,
PubdataPricingMode,
hashL2Bytecode,
DIAMOND_CUT_DATA_ABI_STRING,
Expand Down Expand Up @@ -674,9 +673,10 @@ export class Deployer {
}
this.chainId = parseInt(chainId, 16);

const validatorAddress = getAddressFromEnv("ETH_SENDER_SENDER_OPERATOR_COMMIT_ETH_ADDR");
const validatorOneAddress = getAddressFromEnv("ETH_SENDER_SENDER_OPERATOR_COMMIT_ETH_ADDR");
const validatorTwoAddress = getAddressFromEnv("ETH_SENDER_SENDER_OPERATOR_BLOBS_ETH_ADDR");
const validatorTimelock = this.validatorTimelock(this.deployWallet);
const tx2 = await validatorTimelock.addValidator(chainId, validatorAddress, {
const tx2 = await validatorTimelock.addValidator(chainId, validatorOneAddress, {
gasPrice,
nonce,
gasLimit,
Expand All @@ -686,18 +686,30 @@ export class Deployer {
console.log(`Validator registered, gas used: ${receipt2.gasUsed.toString()}`);
}

const diamondProxy = this.stateTransitionContract(this.deployWallet);
const tx3 = await diamondProxy.setTokenMultiplier(1, 1);
nonce++;

const tx3 = await validatorTimelock.addValidator(chainId, validatorTwoAddress, {
gasPrice,
nonce,
gasLimit,
});
const receipt3 = await tx3.wait();
if (this.verbose) {
console.log(`BaseTokenMultiplier set, gas used: ${receipt3.gasUsed.toString()}`);
console.log(`Validator registered, gas used: ${receipt3.gasUsed.toString()}`);
}

const diamondProxy = this.stateTransitionContract(this.deployWallet);
const tx4 = await diamondProxy.setTokenMultiplier(1, 1);
const receipt4 = await tx4.wait();
if (this.verbose) {
console.log(`BaseTokenMultiplier set, gas used: ${receipt4.gasUsed.toString()}`);
}

if (validiumMode) {
const tx4 = await diamondProxy.setValidiumMode(PubdataPricingMode.Validium);
const receipt4 = await tx4.wait();
const tx5 = await diamondProxy.setValidiumMode(PubdataPricingMode.Validium);
const receipt5 = await tx5.wait();
if (this.verbose) {
console.log(`Validium mode set, gas used: ${receipt4.gasUsed.toString()}`);
console.log(`Validium mode set, gas used: ${receipt5.gasUsed.toString()}`);
}
}
}
Expand All @@ -724,18 +736,10 @@ export class Deployer {
public async deployValidatorTimelock(create2Salt: string, ethTxOptions: ethers.providers.TransactionRequest) {
ethTxOptions.gasLimit ??= 10_000_000;
const executionDelay = getNumberFromEnv("CONTRACTS_VALIDATOR_TIMELOCK_EXECUTION_DELAY");
const commitValidatorAddress = getAddressFromEnv("ETH_SENDER_SENDER_OPERATOR_COMMIT_ETH_ADDR");
const blobValidatorAddress = getOptionalAddressFromEnv("ETH_SENDER_SENDER_OPERATOR_BLOBS_ETH_ADDR");

const validatorAddresses = [commitValidatorAddress];

if (blobValidatorAddress && blobValidatorAddress.length > 0) {
validatorAddresses.push(blobValidatorAddress);
}

const contractAddress = await this.deployViaCreate2(
"ValidatorTimelock",
[this.ownerAddress, this.addresses.StateTransition.DiamondProxy, executionDelay, validatorAddresses],
[this.ownerAddress, executionDelay],
create2Salt,
ethTxOptions
);
Expand Down
5 changes: 0 additions & 5 deletions l1-contracts/src.ts/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,6 @@ export function getAddressFromEnv(envName: string): string {
return address;
}

export function getOptionalAddressFromEnv(envName: string): string {
const address = process.env[envName];
return address;
}

export function getHashFromEnv(envName: string): string {
const hash = process.env[envName];
if (!/^0x[a-fA-F0-9]{64}$/.test(hash)) {
Expand Down
32 changes: 16 additions & 16 deletions l1-contracts/test/test_config/constant/hardhat.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,96 +3,96 @@
"name": "DAI",
"symbol": "DAI",
"decimals": 18,
"address": "0x3c138Dd13EC52C1Ea7e73c8DD16EF6D0593bDcf3"
"address": "0x0F3934f734e62Daa87715B3E4640eFDB89246571"
},
{
"name": "wBTC",
"symbol": "wBTC",
"decimals": 8,
"address": "0x76258E6b9F71d45BCeAA0CC6514B910d7D8aC807"
"address": "0x421e18B8c90Fe0e4AA6f049d6D5fdbA3093b698C"
},
{
"name": "BAT",
"symbol": "BAT",
"decimals": 18,
"address": "0xc7fc371d3340337407bDfE48e2113085DD89FFe2"
"address": "0x94f0779546Ed463dABBa2f71aB10410e9C8A839D"
},
{
"name": "GNT",
"symbol": "GNT",
"decimals": 18,
"address": "0xAAFc93A3E06857a40d82fB61F038288dCDfcE7eF"
"address": "0xE3D1be6c892D4f7b09c3940b67741104c2FFB34b"
},
{
"name": "MLTT",
"symbol": "MLTT",
"decimals": 18,
"address": "0x0F3934f734e62Daa87715B3E4640eFDB89246571"
"address": "0x632655228439172CC496A17c0ceA170917FebE18"
},
{
"name": "DAIK",
"symbol": "DAIK",
"decimals": 18,
"address": "0x421e18B8c90Fe0e4AA6f049d6D5fdbA3093b698C"
"address": "0x211e762c89e588AfB3ec50b0017Cd5250bBb111A"
},
{
"name": "wBTCK",
"symbol": "wBTCK",
"decimals": 8,
"address": "0x94f0779546Ed463dABBa2f71aB10410e9C8A839D"
"address": "0xEFc9af2B75706c223C1Af2e4dEaBDfeE46f8Bf85"
},
{
"name": "BATK",
"symbol": "BATS",
"decimals": 18,
"address": "0xE3D1be6c892D4f7b09c3940b67741104c2FFB34b"
"address": "0x41a0577764aDdc7B86149884324e1E53A5EE82C6"
},
{
"name": "GNTK",
"symbol": "GNTS",
"decimals": 18,
"address": "0x632655228439172CC496A17c0ceA170917FebE18"
"address": "0xc21042CA11b84072229b91750805Fd611290ecF8"
},
{
"name": "MLTTK",
"symbol": "MLTTS",
"decimals": 18,
"address": "0x211e762c89e588AfB3ec50b0017Cd5250bBb111A"
"address": "0xe1630b33Dcad7d2376FDA96cd19F2A3A633E60ce"
},
{
"name": "DAIL",
"symbol": "DAIL",
"decimals": 18,
"address": "0xEFc9af2B75706c223C1Af2e4dEaBDfeE46f8Bf85"
"address": "0xE982e1ff2d8972B09aCF7728E8b5e23149bd74eb"
},
{
"name": "wBTCL",
"symbol": "wBTCP",
"decimals": 8,
"address": "0x41a0577764aDdc7B86149884324e1E53A5EE82C6"
"address": "0x6ca4A813AcAcfF0CA91746a759D0ffD4420eF160"
},
{
"name": "BATL",
"symbol": "BATW",
"decimals": 18,
"address": "0xc21042CA11b84072229b91750805Fd611290ecF8"
"address": "0xA16cABea54068663d9295Fc63093724ed97a1aF7"
},
{
"name": "GNTL",
"symbol": "GNTW",
"decimals": 18,
"address": "0xe1630b33Dcad7d2376FDA96cd19F2A3A633E60ce"
"address": "0x11da4a6F691E170439E88505d45f9800751e6AAd"
},
{
"name": "MLTTL",
"symbol": "MLTTW",
"decimals": 18,
"address": "0xE982e1ff2d8972B09aCF7728E8b5e23149bd74eb"
"address": "0x27D1cd196aB20961c6345a4FB2715C98856Aa2c6"
},
{
"name": "Wrapped Ether",
"symbol": "WETH",
"decimals": 18,
"address": "0x6ca4A813AcAcfF0CA91746a759D0ffD4420eF160"
"address": "0xa578622084d27E5c9D1590556ac9504DcC0503a2"
}
]

0 comments on commit 4ba7688

Please sign in to comment.