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

chore: do not send hardhat_setLedgerOutputEnabled over http #5578

Merged
merged 2 commits into from
Aug 7, 2024

Conversation

galargh
Copy link
Member

@galargh galargh commented Aug 6, 2024

  • Because this PR includes a bug fix, relevant tests have been included.
  • Because this PR includes a new feature, the change was previously discussed on an Issue or with someone from the team.
  • I didn't do anything of this.

Resolves #5406

The goal of this PR is to suppress hardhat_setLedgerOutputEnabled - Method not supported warnings from the local hardhat node logs. They appear there when one performs a deployment against a node and does not use hardhat-ledger plugin.

The approach presented in this PR is a "quick fix". It assumes that if a message with hardhat_setLedgerOutputEnabled method reaches an HTTP provider, it should be treated as an error and not processed further (otherwise, it would have been consumed by the ledger provider before it could reach the http provider). This ensures that if hardhat-ledger plugin is not used, the hardhat_setLedgerOutputEnabled message will never reach a running node. Hence, a warning will not be printed out by the node.

This is not an ideal solution as it exposes plugin context in the core package further. Some alternatives that I was thinking about in no particular order:

  • modify the ignition not to send out hardhat_setLedgerOutputEnabled at all if a ledger provider is not present in the chain (the challenge being identifying a ledger provider)
  • make outputEnabled a configuration option of the ledger plugin (I'm not sure whether completely enabling/disabling output is valid for the plugin; during deployment, we only disable it temporarily)
  • suppress the message at a different layer (but the alternatives don't seem much better than the http provider as far as I can tell)

Copy link

vercel bot commented Aug 6, 2024

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 Aug 7, 2024 2:42pm

Copy link

changeset-bot bot commented Aug 6, 2024

🦋 Changeset detected

Latest commit: d144d83

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
hardhat Patch

Not sure what this means? Click here to learn what changesets are.

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

@github-actions github-actions bot added the status:ready This issue is ready to be worked on label Aug 6, 2024
@galargh galargh force-pushed the galargh/set-ledger-output-enabled branch from dbe99af to 8a96f1d Compare August 7, 2024 09:15
Copy link
Member

@schaable schaable left a comment

Choose a reason for hiding this comment

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

LGTM, just a small typo in the changeset

@galargh galargh merged commit 5aa1774 into main Aug 7, 2024
105 checks passed
@galargh galargh deleted the galargh/set-ledger-output-enabled branch August 7, 2024 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:ready This issue is ready to be worked on
Projects
Archived in project
3 participants