Skip to content

Commit

Permalink
Fixes for Shell upgrade (#1220)
Browse files Browse the repository at this point in the history
  • Loading branch information
vgeddes authored Jun 10, 2024
1 parent 1192a5f commit 1e18e01
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 19 deletions.
5 changes: 4 additions & 1 deletion contracts/foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ optimizer_runs = 20000
via_ir = false
test = 'test'
script = 'scripts'
fs_permissions = [{ access = "read-write", path = "test/data" }, { access = "read", path = "./" }]
fs_permissions = [
{ access = "read-write", path = "test/data" },
{ access = "read", path = "./" },
]

ignored_error_codes = [
# DeployLocal.sol is never deployed
Expand Down
9 changes: 4 additions & 5 deletions contracts/scripts/DeployBeefyClient.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@ contract DeployBeefyClient is Script {
}

function readConfig() internal pure returns (Config memory config) {
// Checkpoint generated at block 20733663 using the `./beefy-checkpoint.js` script in Polkadot-JS.
// Block 20733663 is significant as that was when our bridge was initialized on BridgeHub.
// Checkpoint generated using the script `./beefy-checkpoint.js` script in Polkadot-JS.
config = Config({
startBlock: 20733663,
current: BeefyClient.ValidatorSet({id: 496, length: 297, root: 0xdd04a3a0a4a19180bdae78ecc0c089491d22f5b65b685199d877f20b7fc76434}),
next: BeefyClient.ValidatorSet({id: 497, length: 297, root: 0xdd04a3a0a4a19180bdae78ecc0c089491d22f5b65b685199d877f20b7fc76434}),
startBlock: 21087413,
current: BeefyClient.ValidatorSet({id: 644, length: 297, root: 0x3db19e57e6a7deaec1204d4fb8295cab4e24f8902f54e70d25f273abfe346ada}),
next: BeefyClient.ValidatorSet({id: 645, length: 297, root: 0x3db19e57e6a7deaec1204d4fb8295cab4e24f8902f54e70d25f273abfe346ada}),
randaoCommitDelay: 128,
randaoCommitExpiration: 24,
minimumSignatures: 17
Expand Down
2 changes: 1 addition & 1 deletion contracts/scripts/UpgradeShell.sol
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ contract UpgradeShell is Script {
function readConfig() internal pure returns (Config memory config) {
config = Config({
gatewayProxy: 0x27ca963C279c93801941e1eB8799c23f407d68e7,
beefyClient: address(0),
beefyClient: 0x6eD05bAa904df3DE117EcFa638d4CB84e1B8A00C,
bridgeHubParaID: ParaID.wrap(1002),
bridgeHubAgentID: 0x03170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c111314,
foreignTokenDecimals: 10,
Expand Down
6 changes: 3 additions & 3 deletions contracts/scripts/beefy-checkpoint.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// Polkadot-JS script to generate a BEEFY checkpoint

let beefyBlock = 20733663;
let blockHash = await api.rpc.chain.getBlockHash(beefyBlock);
let blockHash = await api.rpc.beefy.getFinalizedHead();
let header = await api.rpc.chain.getHeader(blockHash);
let apiAtBlock = await api.at(blockHash);

let authorities = await apiAtBlock.query.beefyMmrLeaf.beefyAuthorities();
let nextAuthorities =
await apiAtBlock.query.beefyMmrLeaf.beefyNextAuthorities();

let beefyCheckpoint = {
startBlock: beefyBlock,
startBlock: header.number.toNumber(),
current: {
id: authorities.id.toNumber(),
root: authorities.keysetCommitment.toHex(),
Expand Down
9 changes: 4 additions & 5 deletions contracts/scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@

set -eux

forge script "scripts/DeployBeefyClient.sol:DeployBeefyClient" \
export FOUNDRY_PROFILE=production

forge script "$1" \
--chain-id 1 \
--rpc-url "${MAINNET_RPC_URL}" \
--ledger \
--mnemonic-derivation-paths "${MNEMONIC_DERIVATION_PATH}" \
--broadcast \
--verify \
--optimize \
--via-ir \
--optimizer-runs 100000 \
-vvvv
-vvv
1 change: 0 additions & 1 deletion contracts/src/Types.sol
Original file line number Diff line number Diff line change
Expand Up @@ -107,5 +107,4 @@ struct Ticket {

struct TokenInfo {
bool isRegistered;
bytes31 __padding;
}
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1e18e01

Please sign in to comment.