Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: hyperchain upgrade fix2 (don't merge) #401

Merged
merged 78 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
f60c7bb
add set validator timelock
kelemeno Apr 23, 2024
294559e
add validator timelock in hyperchain
kelemeno Apr 23, 2024
49e6faa
l2bridge deploy fix
kelemeno Apr 23, 2024
d1db98e
settling l2bridge in l1bridge
kelemeno Apr 23, 2024
5d2b08b
can't set field in hardhat
kelemeno Apr 23, 2024
7fff94c
adding ability to print out calls
kelemeno Apr 24, 2024
7892707
rename input field
kelemeno Apr 24, 2024
55b38ec
Merge branch 'release-v23' of ssh://github.com/matter-labs/era-contra…
kelemeno Apr 24, 2024
77ee688
lint
kelemeno Apr 24, 2024
d593c36
separate gov operations
kelemeno Apr 24, 2024
1b3b046
Merge branch 'release-v23' of ssh://github.com/matter-labs/era-contra…
kelemeno Apr 24, 2024
606e581
hot wallet migration
kelemeno Apr 24, 2024
85bdef8
stas comments
kelemeno Apr 24, 2024
f0109c4
typo, remove redundunt test
kelemeno Apr 24, 2024
150f647
multiple contract ver
kelemeno Apr 24, 2024
309c18e
remove extra this.
kelemeno Apr 24, 2024
f3a4618
Merge branch 'release-v23' of ssh://github.com/matter-labs/era-contra…
kelemeno Apr 24, 2024
a2d0816
Merge branch 'release-v23' of ssh://github.com/matter-labs/era-contra…
kelemeno Apr 24, 2024
48cc997
Merge branch 'release-v23' into kl/hyperchain-upgrade-fix2
StanislavBreadless Apr 24, 2024
24b0157
updating migration script
kelemeno Apr 24, 2024
9e47b3e
lint
kelemeno Apr 24, 2024
5bc4297
Merge branch 'kl/hyperchain-upgrade-fix2' of ssh://github.com/matter-…
kelemeno Apr 24, 2024
262eefb
base of script
StanislavBreadless Apr 24, 2024
f74f4e3
Merge branch 'release-v23' into sb-script-to-double-check
StanislavBreadless Apr 24, 2024
46b7db3
check everything except for STM
StanislavBreadless Apr 24, 2024
e4365e7
more small fixes
kelemeno Apr 24, 2024
26c528d
linting
kelemeno Apr 24, 2024
f598022
accept ownership script
StanislavBreadless Apr 25, 2024
4e3e254
remove proxy admin from accepting ownership
StanislavBreadless Apr 25, 2024
1a0551b
fix lint
StanislavBreadless Apr 25, 2024
2c1ef86
remove proxy admin addr 2
StanislavBreadless Apr 25, 2024
c059c61
wip l2 checker
StanislavBreadless Apr 25, 2024
61566a7
spellcheck
StanislavBreadless Apr 25, 2024
a8eeedf
Merge branch 'sb-accept-ownership-script' of ssh://github.com/matter-…
kelemeno Apr 25, 2024
443dad9
Merge branch 'release-v23' of ssh://github.com/matter-labs/era-contra…
kelemeno Apr 25, 2024
a910c00
consistency checker for l2
StanislavBreadless Apr 25, 2024
1cb2ae9
make printing pending owner
kelemeno Apr 25, 2024
3ad5f11
better ownership checks
StanislavBreadless Apr 25, 2024
e226fc8
Merge branch 'sb-script-to-double-check' of ssh://github.com/matter-l…
kelemeno Apr 25, 2024
9e3b7aa
stm init comparison
StanislavBreadless Apr 25, 2024
265be70
Merge branch 'sb-script-to-double-check' of ssh://github.com/matter-l…
kelemeno Apr 25, 2024
822868a
automated init cut hash checks
StanislavBreadless Apr 25, 2024
23ed0bb
deep checks with latest version
StanislavBreadless Apr 25, 2024
27d7226
Merge branch 'sb-script-to-double-check' of ssh://github.com/matter-l…
kelemeno Apr 25, 2024
30978cf
upgrade process important commit
kelemeno Apr 25, 2024
0234c61
fixing some more addresses
kelemeno Apr 25, 2024
856e029
l2Bridge upgrade printing
kelemeno Apr 25, 2024
bb52717
modified ValidatorTimelock for Stage
kelemeno Apr 25, 2024
5624345
further fix
kelemeno Apr 25, 2024
26e105d
gasPrice fix
kelemeno Apr 25, 2024
c0f78e3
add chain admin to upgrade hyperchains
kelemeno Apr 26, 2024
3bb0df2
revert Validtor Timelock
kelemeno Apr 26, 2024
3e41d8e
add validator timelock to upgrade Hyperchains
kelemeno Apr 26, 2024
01dddf5
linting
kelemeno Apr 26, 2024
2ba538a
really add validator timelock
kelemeno Apr 26, 2024
dfae622
cleaned up validator issues
kelemeno Apr 26, 2024
50ca803
package.json
kelemeno Apr 26, 2024
54edde3
Merge branch 'release-v23' of ssh://github.com/matter-labs/era-contra…
kelemeno Apr 26, 2024
4d12199
Merge branch 'release-v23' of ssh://github.com/matter-labs/era-contra…
kelemeno Apr 26, 2024
2ecceae
stm addresses
kelemeno Apr 26, 2024
76a1416
more linting
kelemeno Apr 26, 2024
e1600d3
Merge branch 'release-v23' of ssh://github.com/matter-labs/era-contra…
kelemeno Apr 26, 2024
f5b4698
addresses in consistency checker and
kelemeno Apr 26, 2024
15ca744
l2 bridge consistency constants
kelemeno Apr 26, 2024
966edd4
Merge branch 'release-v23' of ssh://github.com/matter-labs/era-contra…
kelemeno May 5, 2024
cdfeaeb
load correct beacon proxy bytecode
kelemeno May 6, 2024
f792e76
mainnet addresses
kelemeno May 7, 2024
5ca6a23
easier verification for Stas
kelemeno May 8, 2024
98f960e
nonce fix
kelemeno May 8, 2024
15948b2
small changes
kelemeno May 8, 2024
aebc0ce
lint
kelemeno May 8, 2024
1196a09
small typo
kelemeno May 8, 2024
70fe858
started reverting changes in order to merge
kelemeno May 8, 2024
6b3528f
some small cleaning
kelemeno May 8, 2024
47d46aa
linting
kelemeno May 8, 2024
eb3e09e
Merge branch 'release-v23' of ssh://github.com/matter-labs/era-contra…
kelemeno May 8, 2024
b54d20a
fix slither
kelemeno May 8, 2024
8b14b9e
unneeded //
kelemeno May 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion l1-contracts/scripts/hyperchain-upgrade-2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ async function main() {
.option("--nonce <nonce>")
.option("--owner-address <owner-address>")
.option("--create2-salt <create2-salt>")
.option("--print-file-path <print-file-path>")
.option("--diamond-upgrade-init <version>")
.option("--only-verifier")
.action(async (cmd) => {
Expand Down Expand Up @@ -53,7 +54,7 @@ async function main() {
verbose: true,
});

await upgradeToHyperchains2(deployer, gasPrice);
await upgradeToHyperchains2(deployer, gasPrice, cmd.printFilePath);
});

await program.parseAsync(process.argv);
Expand Down
3 changes: 2 additions & 1 deletion l1-contracts/scripts/hyperchain-upgrade-3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ async function main() {
.option("--nonce <nonce>")
.option("--owner-address <owner-address>")
.option("--create2-salt <create2-salt>")
.option("--print-file-path <print-file-path>")
.option("--diamond-upgrade-init <version>")
.option("--only-verifier")
.action(async (cmd) => {
Expand Down Expand Up @@ -53,7 +54,7 @@ async function main() {
verbose: true,
});

await upgradeToHyperchains3(deployer);
await upgradeToHyperchains3(deployer, cmd.printFilePath);
});

await program.parseAsync(process.argv);
Expand Down
19 changes: 18 additions & 1 deletion l1-contracts/src.ts/deploy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as hardhat from "hardhat";
import "@nomiclabs/hardhat-ethers";

import * as fs from "fs";
import type { BigNumberish, providers, Signer, Wallet } from "ethers";
import { ethers } from "ethers";
import { hexlify, Interface } from "ethers/lib/utils";
Expand Down Expand Up @@ -45,6 +46,14 @@ export interface DeployerConfig {
defaultAccountBytecodeHash?: string;
}

export interface Operation {
calls: { target: string; value: BigNumberish; data: string }[];
predecessor: string;
salt: string;
}

export type OperationOrString = Operation | string;

export class Deployer {
public addresses: DeployedAddresses;
public deployWallet: Wallet;
Expand Down Expand Up @@ -446,13 +455,21 @@ export class Deployer {
}

/// this should be only use for local testing
public async executeUpgrade(targetAddress: string, value: BigNumberish, callData: string) {
public async executeUpgrade(targetAddress: string, value: BigNumberish, callData: string, printFileName?: string) {
const governance = IGovernanceFactory.connect(this.addresses.Governance, this.deployWallet);
const operation = {
calls: [{ target: targetAddress, value: value, data: callData }],
predecessor: ethers.constants.HashZero,
salt: ethers.utils.hexlify(ethers.utils.randomBytes(32)),
};
if (printFileName) {
console.log("Operation: ", operation);
const transactions = JSON.parse(fs.readFileSync(`${printFileName}/transactions.json`).toString());
transactions.furtherOperations = transactions.furtherOperations || [];
transactions.furtherOperations.push(operation);
fs.writeFileSync(printFileName, JSON.stringify(transactions, null, 2));
return;
}
const scheduleTx = await governance.scheduleTransparent(operation, 0);
await scheduleTx.wait();
if (this.verbose) {
Expand Down
Loading
Loading