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

ignition: port ignition plugin #6227

Open
wants to merge 88 commits into
base: v-next
Choose a base branch
from
Open

Conversation

kanej
Copy link
Member

@kanej kanej commented Feb 5, 2025

This migrates hardhat-ignition the Ignition Hardhat plugin to Hardhat 3.

image

The following tasks have been ported:

  • deploy
  • status
  • deployments
  • transactions
  • wipe
  • visualize
  • verify

The verify task shows a message that it has not been implemented:

image

Running Manually

The Ignition plugin has been added to the example project, along with an Ignition module. You can run a deploy with:

pnpm hardhat3 ignition deploy ./ignition/modules/Apollo.ts

Tests

The tests are all passing. Three are skipped:

  • should deploy user interfered transaction on second run - which is skipped in Hardhat 2 Ignition
  • two verify tests

Known bugs

There is a known bug in the visualize report. This will be addressed in a follow up PR.

  • Text is not appearing on visualize mermaid diagram

Review points

My apologies to the reviewer. The commits are targeted. Moving through them one at a time should be possible.

The commits split down into:

  1. Code formatting and linting updates to the latest eslint/typescript/prettier
  2. Many individual commits turn on tests one test a time
  3. A small number of updates to the logic of the plugin, these have been individually commented upon - see my comments for the details.

Follow-up tasks

  • Rework Ignition UI to be based off of the HH3 hook api
  • Rewire the ledger checks to work with user interruptions
  • Review config setup
  • Revisit test fixture setup - can we improve on performance with precompiled artifacts
  • Deal with task default values like deploymentId where currently we are using "" to represent no option given by user
  • Bring back verify task
  • Convert tests to Node Test Runner
  • Get rid of hardhat_setLedgerOutputEnabled - Method not supported message on the node
  • Re-enable all eslint rules
  • Add an integration test to ensure that if the user sets the ignition path, that is coming through in the config
  • Revisit the visualization test - it requires a vite build of the ui which significantly slows down the dev flow of testing

Copy link

changeset-bot bot commented Feb 5, 2025

⚠️ No Changeset found

Latest commit: e5dd73f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Feb 5, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hardhat ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 13, 2025 10:37pm

@github-actions github-actions bot added the status:ready This issue is ready to be worked on label Feb 5, 2025
Copy link
Contributor

github-actions bot commented Feb 5, 2025

hardhat

Total size of the bundle: 214M
Total number of dependencies (including transitive): 54

List of dependencies (sorted by size)
209M	total
29M	@ignored/edr-optimism-linux-x64-musl
29M	@ignored/edr-optimism-linux-x64-gnu
26M	@ignored/edr-optimism-linux-arm64-musl
26M	@ignored/edr-optimism-linux-arm64-gnu
22M	@ignored/edr-optimism-win32-x64-msvc
20M	esbuild
20M	@ignored/edr-optimism-darwin-x64
19M	@ignored/edr-optimism-darwin-arm64
2.8M	@sentry/tracing
2.5M	micro-eth-signer
1.9M	@noble/curves
1.7M	undici
1.2M	@sentry/types
1.2M	@noble/hashes
932K	@sentry/node
920K	@sentry/utils
856K	zod
844K	@ignored/hardhat-vnext-utils
624K	micro-packed
576K	tsx
548K	@sentry/core
544K	fast-equals
492K	@scure/bip39
368K	ethereum-cryptography
348K	@ignored/hardhat-vnext-errors
344K	@sentry/hub
336K	@ignored/edr
320K	enquirer
288K	semver
280K	@ignored/edr-optimism
192K	ws
168K	@scure/base
136K	get-tsconfig
136K	adm-zip
96K	@scure/bip32
92K	chalk
88K	tslib
88K	@sentry/minimal
76K	agent-base
72K	@nomicfoundation/solidity-analyzer
68K	debug
64K	lru_map
64K	https-proxy-agent
60K	@ignored/hardhat-vnext-zod-utils
56K	rfdc
48K	ansi-colors
44K	resolve.exports
40K	resolve-pkg-maps
36K	p-map
32K	cookie
24K	strip-ansi
24K	env-paths
24K	ansi-regex
20K	ms

@kanej kanej added no changeset needed This PR doesn't require a changeset v-next A Hardhat v3 development task labels Feb 5, 2025
@kanej kanej linked an issue Feb 5, 2025 that may be closed by this pull request
@kanej kanej force-pushed the feat/port-ignition-ui branch 2 times, most recently from cc6c292 to 4edf391 Compare February 5, 2025 14:15
@kanej kanej force-pushed the feat/port-ignition-plugin branch from 1679340 to 0003363 Compare February 5, 2025 15:56
Base automatically changed from feat/port-ignition-ui to v-next February 6, 2025 11:29
@kanej kanej force-pushed the feat/port-ignition-plugin branch from 816df90 to d6150c4 Compare February 6, 2025 13:07
@kanej kanej force-pushed the feat/port-ignition-plugin branch from 5a55b98 to b0a6c56 Compare February 6, 2025 16:20
@kanej kanej force-pushed the feat/port-ignition-plugin branch from b0a6c56 to 90d7b95 Compare February 6, 2025 22:36
kanej added 24 commits February 13, 2025 22:14
In Hardhat 3 we will not expose a default `hre.ignition` object. Instead
the Ignition object will only be added by the `ethers`/`viem` Ignition
plugins.
Get balances was working against the wrong connection.
This was not explicitly needed before. We should investigate if
something has changed in our default EDR setup.
I am unsure here as to why the addresses have changed. Maybe we are
compiling with a different version of solc?
To match the rule that exports should be in the public file structure we
move out those files from internal to a top level `./helpers` folder.
Swap to a single `./type-extensions.ts` file. We only add config in the
plugin.
This is a direct port. There appear to be no related tests.
The visualize test requires the report to have been built. The project
ref in the tsconfig is not enough, so for the moment, lets build before
running the tests.

This is slow. Really slow. But we can revisit this.
This is the same as set in the Hardhat 2 version.
In HH2 we interacted with the ledger plugin with events. In HH3 we will
leverage the hook system and user interruptions.

`hardhat-ledger` has not yet been ported to HH3. We will rework the
ledger integration for Ignition then.

Until then we are removing the ledger related code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no changeset needed This PR doesn't require a changeset status:ready This issue is ready to be worked on v-next A Hardhat v3 development task
Projects
Status: Backlog
Development

Successfully merging this pull request may close these issues.

Migrate hardhat-ignition to v-next
2 participants