Conversation
|
Caution Review the following alerts detected in dependencies. According to your organization's Security Policy, you must resolve all "Block" alerts before proceeding. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
Looking good!
This compiles the core package for both EVM and PVM, but I don't see a way for it to actually run any test cases with the PVM code path.
We should try to find a way to run all of the tests (in both core and plugin-hardhat) using the PVM code path, if feasible, perhaps using a custom GitHub workflow to modify the way it runs. Even if that is not feasible, we should aim to add at least one mainline test scenario (e.g. deploy and upgrade a proxy) using PVM.
(If that has been tested manually already, I think this would be ok as-is, and the automated tests can be added later)
Co-authored-by: Eric Lau <ericglau@outlook.com>
|
Can we also add some simple negative tests? These could be based on
|
| it('invalid upgrade', async () => { | ||
| const { Greeter, Invalid } = context; | ||
| const greeter = await upgrades.deployProxy(Greeter, ['Hola mundo!'], { kind: 'uups' }); | ||
| await expect(upgrades.upgradeProxy(greeter, Invalid)).to.be.rejectedWith(/New storage layout is incompatible.*/); |
There was a problem hiding this comment.
This test case was originally intended to check for unsafe patterns in the implementation contract itself, unrelated to storage layout. Since there is no selfdestruct, we should test for another pattern such as with a constructor in InvalidPVMProxiable.
Specifically, I would suggest:
- Add a storage variable
string greeting;inInvalidPVMProxiableso that its storage layout matches that ofGreeterProxiable - Add a constructor in
InvalidPVMProxiable - Change this
expectto look for an error about the constructor.
Support precompiled contracts for PolkaVM deployments.
What should be done to move this PR to ready state:
resolcNB: NodeJS version was pushed to 22.x, because Hardhat Polkadot plugin requires built-in WebSocket, that is present only in v22 and higher
Closes #1188