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

feat(script): add dev deploy and config scripts #2

Merged
merged 23 commits into from
Oct 30, 2024

Conversation

PierrickGT
Copy link
Member

No description provided.

@PierrickGT PierrickGT requested a review from 0xIryna October 3, 2024 01:10
Copy link

github-actions bot commented Oct 3, 2024

LCOV of commit bfcd720 during Forge Coverage #83

Summary coverage rate:
  lines......: 95.6% (194 of 203 lines)
  functions..: 90.4% (66 of 73 functions)
  branches...: 80.9% (38 of 47 branches)

Files changed coverage rate:
                                 |Lines       |Functions  |Branches    
  Filename                       |Rate     Num|Rate    Num|Rate     Num
  =====================================================================
  src/SpokePortal.sol            |90.6%     32|88.9%     9| 100%     10
  src/SpokeVault.sol             | 100%     15| 100%     4| 100%      6
  src/governance/Configurator.sol|87.0%     23|80.0%    10|55.6%      9
  src/governance/Governor.sol    | 100%     22| 100%     9| 100%      7
  src/governance/Migrator.sol    |75.0%      8|60.0%     5| 0.0%      2
  src/libs/RegistrarReader.sol   | 100%      3| 100%     3|    -      0

@PierrickGT PierrickGT force-pushed the feat/WEB3-1200-add-deploy-scripts branch 4 times, most recently from 76646e0 to e82ed1e Compare October 10, 2024 19:27
@PierrickGT PierrickGT force-pushed the feat/WEB3-1200-add-deploy-scripts branch 2 times, most recently from f8643fd to b4221bc Compare October 10, 2024 22:06
@PierrickGT PierrickGT force-pushed the feat/WEB3-1200-add-deploy-scripts branch from b4221bc to 2d36bb9 Compare October 10, 2024 22:59
Base automatically changed from wormhole-ntt-integration to main October 10, 2024 23:28
@PierrickGT PierrickGT force-pushed the feat/WEB3-1200-add-deploy-scripts branch from bcd7b3d to ea158dc Compare October 15, 2024 23:22
Copy link

github-actions bot commented Oct 15, 2024

Changes to gas cost

Generated at commit: 806a1785f4047f2e88fd7694bd3cf68d19ea6f05, compared to commit: 7212f883e61152642646333a2e9279181141a551

🧾 Summary (20% most significant diffs)

Contract Method Avg (+/-) %
HubPortal initialize
setPeer
+8 ❌
-173 ✅
+0.01%
-0.32%

Full diff report 👇
Contract Deployment Cost (+/-) Method Min (+/-) % Avg (+/-) % Median (+/-) % Max (+/-) % # Calls (+/-)
HubPortal 5,554,374 (0) initialize
setPeer
127,584 (0)
49,762 (-4,454)
0.00%
-8.22%
127,592 (+8)
54,043 (-173)
+0.01%
-0.32%
127,584 (0)
54,216 (0)
0.00%
0.00%
127,630 (+46)
54,262 (+46)
+0.04%
+0.08%
26 (+5)
25 (+4)

@PierrickGT PierrickGT force-pushed the feat/WEB3-1200-add-deploy-scripts branch 2 times, most recently from 8b6dd2c to 55a447f Compare October 18, 2024 21:20
Copy link
Collaborator

@0xIryna 0xIryna left a comment

Choose a reason for hiding this comment

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

Fixing submodules must be done in a separate PR

@PierrickGT
Copy link
Member Author

Fixing submodules must be done in a separate PR

Done in this PR: #5

@PierrickGT PierrickGT force-pushed the feat/WEB3-1200-add-deploy-scripts branch from bb8adbc to f8d4238 Compare October 21, 2024 19:25
@PierrickGT PierrickGT force-pushed the feat/WEB3-1200-add-deploy-scripts branch from a8ce4b3 to e3bf133 Compare October 21, 2024 19:38
@PierrickGT PierrickGT requested a review from 0xIryna October 21, 2024 19:47
@toninorair toninorair self-requested a review October 22, 2024 15:58
@PierrickGT PierrickGT force-pushed the feat/WEB3-1200-add-deploy-scripts branch from 131d27e to 4130092 Compare October 30, 2024 21:31

import { ICreateXLike } from "../deploy/interfaces/ICreateXLike.sol";

contract Utils {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could be a library

deploy-local-spoke:
FOUNDRY_PROFILE=production forge script script/deploy/dev/DeployDevSpoke.s.sol:DeployDevSpoke --private-key $(DEV_PRIVATE_KEY) --rpc-url localhost --skip test --non-interactive --broadcast -v

deploy-dev-sepolia:
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm concerned about this approach. It doesn't scale well since adding a new chain requires to duplicate all those commands and it's easy to make a copy-paste mistake.
Is it possible to just pass a chain name and read all the required information from json config?

Copy link
Member Author

Choose a reason for hiding this comment

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

We can refactor later but we should still keep one command per network.


import { Utils } from "../helpers/Utils.sol";

contract CastBase is Script, Utils {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think it's should be called Cast. cast is just a command-line tool, and we're not using it to call the script. Since it sends cross-chain transactions Send is more descriptive name

@PierrickGT PierrickGT merged commit aad42f1 into main Oct 30, 2024
4 checks passed
@PierrickGT PierrickGT deleted the feat/WEB3-1200-add-deploy-scripts branch October 30, 2024 23:02
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.

3 participants