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

[VEN-3101][VEN-3102]: XVS, XVS Vault and XVS Bridge on Berachain #505

Open
wants to merge 14 commits into
base: feat/berachain-oracle-governance
Choose a base branch
from

Conversation

web3rover
Copy link
Contributor

Description

Resolves VEN

@web3rover web3rover marked this pull request as ready for review February 18, 2025 10:20
@web3rover web3rover requested a review from chechu February 18, 2025 10:20
@chechu chechu changed the title XVS and XVS Bridge on Berachain [VEN-3101][VEN-3102]: XVS and XVS Bridge on Berachain Feb 20, 2025
@web3rover web3rover changed the title [VEN-3101][VEN-3102]: XVS and XVS Bridge on Berachain [VEN-3101][VEN-3102]: XVS, XVS Vault and XVS Bridge on Berachain Feb 20, 2025
@@ -222,7 +222,10 @@ const config: HardhatUserConfig = {
berachainbartio: {
url: process.env.ARCHIVE_NODE_berachainbartio || "https://bartio.rpc.berachain.com",
chainId: 80084,
accounts: DEPLOYER_PRIVATE_KEY ? [`0x${DEPLOYER_PRIVATE_KEY}`] : [],
// accounts: DEPLOYER_PRIVATE_KEY ? [`0x${DEPLOYER_PRIVATE_KEY}`] : [],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we have commented this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

[
{
target: ACM,
signature: "giveCallPermission(address,string,address)",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also add them in Aggregator, WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So that we can have all permission related thing at one place, i.e. in ACMAggregator

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

maxDailyReceiveLimit: parseUnits("102000", 18),
maxSingleReceiveTransactionLimit: parseUnits("20400", 18),
},
];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also add base and unichain configuration.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

];
}

const vip452 = () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const vip452 = () => {
const vip453 = () => {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

});

describe("Pre-VIP behaviour", async () => {
it("Bridge Owner != multisig", async () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it be Normal Timelock?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

});

it("Trusted remote should not exist for any network(bsctestnet, opbnbtestnet, sepolia, arbitumsepolia, zksyncsepolia)", async () => {
await expect(xvsBridge.getTrustedRemoteAddress(LzChainId.bsctestnet)).to.be.revertedWith(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also add base and unichain sepolia.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

testForkedNetworkVipCommands("vip453 configures bridge", await vip453());

describe("Post-VIP behaviour", async () => {
it("Should set bridge owner to multisig", async () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
it("Should set bridge owner to multisig", async () => {
it("Should set bridge owner to Normal Timelock", async () => {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed


it("Should set correct max single receive limit for all six networks", async () => {
let limit = await xvsBridge.chainIdToMaxSingleReceiveTransactionLimit(LzChainId.bsctestnet);
expect(limit).equals(parseUnits("20400", 18));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
expect(limit).equals(parseUnits("20400", 18));
expect(limit).equals(SINGLE_RECEIVE_LIMIT);

Just for consistency

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

expect(limit).equals(MIN_DEST_GAS);
});
});

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use checkXVSBridge to test bridge on Berachain?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is meant to test the other networks

expect(isActive).equals(true);
});
});
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also check for pause state of vault.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

},
};

function splitPermissions(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems we need to configure 93 permissions for this VIP, so we don't need to split them into different chunks. I would remote this logic from this specific file. If we need it in the future, we could add it to the src/permissions.ts file.

This VIP is specific for berachainbartio, we can assume it, and remove the network dimension from the different variables in this file (berachainbartio), to simplify it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@chechu chechu force-pushed the feat/berachain-xvs branch 2 times, most recently from a3500c4 to 0cb0a6f Compare February 26, 2025 12:32
Copy link
Member

@chechu chechu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've reviewed commands and permissions. They lgtm. I've not reviewed the simulations yet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants