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: bump version to 0.15.3 #757

Merged
merged 4 commits into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## 0.15.3 - 2024-05-09

### Fixed

- Exclude BNB Chain from zero fee configuration in gas fee logic, thanks @magicsih ([#755](https://github.com/NomicFoundation/hardhat-ignition/pull/755))

## 0.15.2 - 2024-05-02

### Added
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nomicfoundation/ignition-core",
"version": "0.15.2",
"version": "0.15.3",
"license": "MIT",
"author": "Nomic Foundation",
"homepage": "https://hardhat.org",
Expand Down
11 changes: 7 additions & 4 deletions packages/core/src/internal/execution/jsonrpc-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -638,11 +638,14 @@ export class EIP1193JsonRpcClient implements JsonRpcClient {
]);

// We prioritize EIP-1559 fees over legacy gasPrice fees, however,
// polygon (chainId 137) requires legacy gasPrice fees so we skip EIP-1559 logic in that case
// polygon (chainId 137) requires legacy gasPrice fees
// so we skip EIP-1559 logic in that case
if (latestBlock.baseFeePerGas !== undefined && chainId !== 137) {
if (latestBlock.baseFeePerGas === 0n) {
// Support zero gas fee chains, such as a private instances
// of blockchains using Besu.
// Support zero gas fee chains, such as a private instances
// of blockchains using Besu. We explicitly exclude BNB
// Smartchain (chainId 56) from this logic as it is EIP-1559
// compliant but only sets a maxPriorityFeePerGas.
if (latestBlock.baseFeePerGas === 0n && chainId !== 56) {
return {
maxFeePerGas: 0n,
maxPriorityFeePerGas: 0n,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,41 @@ describe("JSON-RPC client", function () {
});
});

it("Should not return zero gas fees for BNB Chain even with a zero base fee", async function () {
const bnbClient = new EIP1193JsonRpcClient({
request: async (req) => {
if (req.method === "eth_chainId") {
return "0x38"; // BNB Chain ID
}

if (req.method === "eth_getBlockByNumber") {
return {
number: "0x0",
hash: "0x0",
baseFeePerGas: "0x0", // Set the base fee to zero, testing the exception
};
}

if (req.method === "eth_gasPrice") {
return "0x1";
}

throw new Error(`Unimplemented mock for ${req.method}`);
},
});

const fees = await bnbClient.getNetworkFees();

assert.deepStrictEqual(
fees,
{
maxFeePerGas: 1_000_000_000n,
maxPriorityFeePerGas: 1_000_000_000n,
},
"Both max fee and max priority fee should be 1 gwei, as the base fee is 0 for BNB Chain"
);
});

it("Should use the `maxPriorityFeePerGas` from the node if `eth_maxPriorityFeePerGas` is present (and there is no config)", async function () {
// TODO: Hardhat does not support `eth_maxPriorityFeePerGas` yet, when it does, this
// can be removed.
Expand Down
6 changes: 6 additions & 0 deletions packages/hardhat-plugin-ethers/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## 0.15.3 - 2024-05-09

### Fixed

- Exclude BNB Chain from zero fee configuration in gas fee logic, thanks @magicsih ([#755](https://github.com/NomicFoundation/hardhat-ignition/pull/755))

## 0.15.2 - 2024-05-02

### Added
Expand Down
2 changes: 1 addition & 1 deletion packages/hardhat-plugin-ethers/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nomicfoundation/hardhat-ignition-ethers",
"version": "0.15.2",
"version": "0.15.3",
"license": "MIT",
"author": "Nomic Foundation",
"homepage": "https://hardhat.org",
Expand Down
6 changes: 6 additions & 0 deletions packages/hardhat-plugin-viem/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## 0.15.3 - 2024-05-09

### Fixed

- Exclude BNB Chain from zero fee configuration in gas fee logic, thanks @magicsih ([#755](https://github.com/NomicFoundation/hardhat-ignition/pull/755))

## 0.15.2 - 2024-05-02

### Added
Expand Down
2 changes: 1 addition & 1 deletion packages/hardhat-plugin-viem/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nomicfoundation/hardhat-ignition-viem",
"version": "0.15.2",
"version": "0.15.3",
"license": "MIT",
"author": "Nomic Foundation",
"homepage": "https://hardhat.org",
Expand Down
6 changes: 6 additions & 0 deletions packages/hardhat-plugin/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## 0.15.3 - 2024-05-09

### Fixed

- Exclude BNB Chain from zero fee configuration in gas fee logic, thanks @magicsih ([#755](https://github.com/NomicFoundation/hardhat-ignition/pull/755))

## 0.15.2 - 2024-05-02

### Added
Expand Down
2 changes: 1 addition & 1 deletion packages/hardhat-plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nomicfoundation/hardhat-ignition",
"version": "0.15.2",
"version": "0.15.3",
"license": "MIT",
"author": "Nomic Foundation",
"homepage": "https://hardhat.org",
Expand Down
Loading