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

[Do not merge] dApp-friendly contract deployment #3118

Draft
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

r-czajkowski
Copy link
Contributor

@r-czajkowski r-czajkowski commented Jul 29, 2022

Ref: threshold-network/token-dashboard#136

We need a dApp-friendly version of deployment allowing dashboard developers to build UI components without having to run geth/ganache/hardhat locally and deploying contracts locally.

This PR aims at presenting changes to smart contracts deployed to Sepolia that are used by the dApp development team for day-to-day work. Please do not merge this PR to main branch. Smart contract with the changes presented here are pushed to NPM registry with a tag dapp-development-sepolia.

Main changes:

  • changes the authorizationDecreaseDelay and authorizationDecreaseChangePeriod to 180 seconds instead of 45 days, so we can test the authorization decrease flow faster in the T dapp on testnet.

Change the `authorizationDecreaseDelay` and
`authorizationDecreaseChangePeriod` to `180` seconds in `RandomBeacon`
and `WalletRegistry`. It means that we can test the authroziation
decrease flow faster in the T dapp on testnet.
@michalinacienciala
Copy link
Contributor

michalinacienciala commented Aug 2, 2022

Could you change this PR to draft and add a visible info in the description that those changes are not supposed to get merged to main?
Also, I was wondering if there's some way to additionally block the merging of this PR via GH settings. I mean something similar to protected branches functionality. From a quick googling I don't see such setting... Marking the PR as draft and explaining that the changes should not go to main will need to be enough then... [EDIT]: Oh, I see now that the CODEOWNERS file is there to protect us from unwanted merges. Good then 👍 But we could change PR to draft and add info to the description anyway.

CODEOWNERS Outdated
Comment on lines 35 to 36
/solidity/random-beacon/contracts/RandomBeacon.sol @pdyraga @nkuba @lukasz-zimnoch
/solidity/ecdsa/contracts/WalletRegistry.sol @pdyraga @nkuba @lukasz-zimnoch
Copy link
Member

Choose a reason for hiding this comment

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

Let's extract CODEOWNERS change to a separate PR and merge it to main.

The CODEOWNERS should cover two contracts listed here as well as all files in:

  • solidity/ecdsa/contracts/libraries
  • solidity/ecdsa/contracts/api
  • solidity/random-beacon/contracts/libraries/
  • solidity/random-beacon/contracts/api

Let's add there all developers who worked on the Solidity code of the mentioned smart contracts: @pdyraga @nkuba @lukasz-zimnoch @dimpar @tomaszslabon.

This will not only protect dApp-dev-only changes from being merged but will also protect from any accidental changes to an already audited code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@pdyraga pdyraga changed the title Dapp-friendly deployment [Do not merge] dApp-friendly contract deployment Aug 2, 2022
@r-czajkowski r-czajkowski marked this pull request as draft August 4, 2022 07:38
We need to create the mocked wallet in this contract because the
tbtc-v2.ts lib looks up wallet by id to get the active wallet public
key. Please see
https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/ethereum.ts#L392-L395.
The `Bridge` contract from the `tbtc-v2` stores the hash of the wllet's
public key not public key.
@michalinacienciala
Copy link
Contributor

@r-czajkowski, when I tested the deployment of ecdsa contracts from dapp-development branch, I got following error:

································|··············
 |  WalletRegistryGovernance     ·     17.088  │
 ································|··············
 |  Wallets                      ·      0.086  │
 ·-------------------------------|-------------·

Error in plugin hardhat-contract-sizer: Warning: 1 contracts exceed the size limit for mainnet deployment.

For more info run Hardhat with --show-stack-traces
error Command failed with exit code 1.

This happens both on yarn deploy:test and yarn build.

nkuba
nkuba previously approved these changes Aug 18, 2022
) external {
wallets.registry[ecdsaWalletID].publicKeyX = publicKeyX;
wallets.registry[ecdsaWalletID].publicKeyY = publicKeyY;
emit WalletCreated(ecdsaWalletID, 0x0);
Copy link
Member

Choose a reason for hiding this comment

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

Maybe use some dummy value instead of 0x0 which seems a default empty value?

After merging the `main` branch we hit the `WalletRegisrty` contract
size limit. So here we get rid of the `WalletCreated` event to reduce
the contract size.
r-czajkowski and others added 5 commits August 19, 2022 08:42
Set `dapp-development-goerli` tag for `@keep-network/random-beacon` and
`@threshold-network/solidity-contracts`. We need dapp-friendly contracts
here.
We are publishing packages with code from `dapp-development` branch under
versions that use `-dapp-dev-goerli.X` suffix. Our `package.json` on this branch
should reflect that. If we do not set it up, the CI job used to pubblish the
package will not be able to correctly bump up the version of the package.
Set `dapp-development-goerli` tag for `@threshold-network/solidity-contracts`.
We need dapp-friendly contracts here.
r-czajkowski and others added 8 commits September 14, 2022 10:11
We need the latest version of the `@threshold-network/solidity-contrcts`
with the `dapp-development-goerli` tag.
We need the latest version of the
`@threshold-network/solidity-contracts` and `keep-network/random-beacon`
with the `dapp-development-goerli` tag.
We changed the version range for `@tenderly/hardhat-tenderly` in
#3454 (ecdsa package) and
CI build fails on tenderly verification. The tenderly verification
passes in random-beacon package because we use a fixed `1.0.12` version.
Since this is a `dapp-development` branch, we do not actually need the
tenderly verification at least for now so here we remove the `tenderly`
tag for `goerli` network to skip the tenderly verification.
We're switching deployment to the Sepolia testnet due to planned deprecation of
the Goerli testnet. In a previous commit we've updated the `dapp-development`
branch with the recent changes from `main` (among them were the changes adding
Sepolia to the list of supported networks). Now we're updating the
`dapp-development` branch to create `dapp-dev-sepolia` packages.
We're switching deployment to the Sepolia testnet due to planned deprecation of
the Goerli testnet. In a previous commit we've updated the `dapp-development`
branch with the recent changes from `main` (among them were the changes adding
Sepolia to the list of supported networks). Now we're updating the
`dapp-development` branch to create `dapp-dev-sepolia` packages.
Copy link

github-actions bot commented Nov 7, 2023

Solidity API documentation preview available in the artifacts of the https://github.com/keep-network/keep-core/actions/runs/6786867212 check.

Copy link

github-actions bot commented Nov 7, 2023

Solidity API documentation preview available in the artifacts of the https://github.com/keep-network/keep-core/actions/runs/6786867235 check.

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

Successfully merging this pull request may close these issues.

4 participants