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

Release v0.15.9 #851

Merged
merged 17 commits into from
Dec 18, 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
14 changes: 14 additions & 0 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@ 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.9 - 2024-12-18

### Added

- Standard Ignition UI can now be enabled when deploying via Hardhat scripts by setting `displayUi: true` in the `deploy` function options, @zoeyTM ([#843](https://github.com/NomicFoundation/hardhat-ignition/pull/843))
- Ignition modules can now be set as a dependency in the `after` option of futures, @zoeyTM ([#828](https://github.com/NomicFoundation/hardhat-ignition/pull/828))
- The `ignition transactions` command output will now include a link to view each transaction on the configured block explorer, @zoeyTM ([#849](https://github.com/NomicFoundation/hardhat-ignition/pull/849))
- Module parameters can now be directly imported from a JSON file when deploying via Hardhat scripts by passing an absolute path to the file to the `parameters` option, @zoeyTM ([#850](https://github.com/NomicFoundation/hardhat-ignition/pull/850))

### Fixed

- Properly handle errors when verifying deployments that use external artifacts, @zoeyTM ([#848](https://github.com/NomicFoundation/hardhat-ignition/pull/848))
- Fix issue with `ignition status` command not working with deployments that use external artifacts, @zoeyTM ([#846](https://github.com/NomicFoundation/hardhat-ignition/pull/846))

## 0.15.8 - 2024-11-22

### Fixed
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.8",
"version": "0.15.9",
"license": "MIT",
"author": "Nomic Foundation",
"homepage": "https://hardhat.org",
Expand Down
59 changes: 45 additions & 14 deletions packages/core/src/ignition-module-serializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ export class IgnitionModuleSerializer {
moduleId: future.module.id,
type: future.type,
dependencies: Array.from(future.dependencies).map((d) =>
this._convertFutureToFutureToken(d)
isFuture(d)
? this._convertFutureToFutureToken(d)
: this._convertModuleToModuleToken(d)
),
contractName: future.contractName,
constructorArgs: future.constructorArgs.map((arg) =>
Expand All @@ -161,7 +163,9 @@ export class IgnitionModuleSerializer {
moduleId: future.module.id,
type: future.type,
dependencies: Array.from(future.dependencies).map((d) =>
this._convertFutureToFutureToken(d)
isFuture(d)
? this._convertFutureToFutureToken(d)
: this._convertModuleToModuleToken(d)
),
contractName: future.contractName,
artifact: future.artifact,
Expand All @@ -187,7 +191,9 @@ export class IgnitionModuleSerializer {
moduleId: future.module.id,
type: future.type,
dependencies: Array.from(future.dependencies).map((d) =>
this._convertFutureToFutureToken(d)
isFuture(d)
? this._convertFutureToFutureToken(d)
: this._convertModuleToModuleToken(d)
),
contractName: future.contractName,
from: isRuntimeValue(future.from)
Expand All @@ -204,7 +210,9 @@ export class IgnitionModuleSerializer {
moduleId: future.module.id,
type: future.type,
dependencies: Array.from(future.dependencies).map((d) =>
this._convertFutureToFutureToken(d)
isFuture(d)
? this._convertFutureToFutureToken(d)
: this._convertModuleToModuleToken(d)
),
contractName: future.contractName,
artifact: future.artifact,
Expand All @@ -222,7 +230,9 @@ export class IgnitionModuleSerializer {
moduleId: future.module.id,
type: future.type,
dependencies: Array.from(future.dependencies).map((d) =>
this._convertFutureToFutureToken(d)
isFuture(d)
? this._convertFutureToFutureToken(d)
: this._convertModuleToModuleToken(d)
),
contract: this._convertFutureToFutureToken(future.contract),
functionName: future.functionName,
Expand All @@ -245,7 +255,9 @@ export class IgnitionModuleSerializer {
moduleId: future.module.id,
type: future.type,
dependencies: Array.from(future.dependencies).map((d) =>
this._convertFutureToFutureToken(d)
isFuture(d)
? this._convertFutureToFutureToken(d)
: this._convertModuleToModuleToken(d)
),
contract: this._convertFutureToFutureToken(future.contract),
functionName: future.functionName,
Expand All @@ -264,7 +276,9 @@ export class IgnitionModuleSerializer {
moduleId: future.module.id,
type: future.type,
dependencies: Array.from(future.dependencies).map((d) =>
this._convertFutureToFutureToken(d)
isFuture(d)
? this._convertFutureToFutureToken(d)
: this._convertModuleToModuleToken(d)
),
contract: this._convertFutureToFutureToken(future.contract),
functionName: future.functionName,
Expand All @@ -279,7 +293,9 @@ export class IgnitionModuleSerializer {
moduleId: future.module.id,
type: future.type,
dependencies: Array.from(future.dependencies).map((d) =>
this._convertFutureToFutureToken(d)
isFuture(d)
? this._convertFutureToFutureToken(d)
: this._convertModuleToModuleToken(d)
),
contractName: future.contractName,
address: isFuture(future.address)
Expand All @@ -298,7 +314,9 @@ export class IgnitionModuleSerializer {
moduleId: future.module.id,
type: future.type,
dependencies: Array.from(future.dependencies).map((d) =>
this._convertFutureToFutureToken(d)
isFuture(d)
? this._convertFutureToFutureToken(d)
: this._convertModuleToModuleToken(d)
),
contractName: future.contractName,
artifact: future.artifact,
Expand All @@ -318,7 +336,9 @@ export class IgnitionModuleSerializer {
moduleId: future.module.id,
type: future.type,
dependencies: Array.from(future.dependencies).map((d) =>
this._convertFutureToFutureToken(d)
isFuture(d)
? this._convertFutureToFutureToken(d)
: this._convertModuleToModuleToken(d)
),
futureToReadFrom: this._convertFutureToFutureToken(
future.futureToReadFrom
Expand All @@ -336,7 +356,9 @@ export class IgnitionModuleSerializer {
moduleId: future.module.id,
type: future.type,
dependencies: Array.from(future.dependencies).map((d) =>
this._convertFutureToFutureToken(d)
isFuture(d)
? this._convertFutureToFutureToken(d)
: this._convertModuleToModuleToken(d)
),
to: isFuture(future.to)
? this._convertFutureToFutureToken(future.to)
Expand Down Expand Up @@ -475,7 +497,14 @@ export class IgnitionModuleDeserializer {
);

for (const dependencyId of serializedFuture.dependencies) {
const dependency = this._lookup(futuresLookup, dependencyId.futureId);
let dependency: Future | IgnitionModule;

if (dependencyId._kind === "FutureToken") {
dependency = this._lookup(futuresLookup, dependencyId.futureId);
} else {
dependency = this._lookup(modulesLookup, dependencyId.moduleId);
}

future.dependencies.add(dependency);
}

Expand Down Expand Up @@ -548,8 +577,10 @@ export class IgnitionModuleDeserializer {

for (const serializedFuture of serializedFutures) {
for (const dependencyToken of serializedFuture.dependencies) {
const dependency = serializedFuturesMap[dependencyToken.futureId];
graph.get(dependency)!.add(serializedFuture);
if (dependencyToken._kind === "FutureToken") {
const dependency = serializedFuturesMap[dependencyToken.futureId];
graph.get(dependency)!.add(serializedFuture);
}
}
}

Expand Down
24 changes: 23 additions & 1 deletion packages/core/src/internal/batcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,29 @@ export class Batcher {
): boolean {
const dependencies = batchState.adjacencyList.getDependenciesFor(futureId);

return [...dependencies].every(
return [...dependencies].every((depId) => {
// We distinguish between module and future ids here, as the future's always have `#` and the modules don't.
if (/#/.test(depId)) {
return batchState.visitState[depId] === VisitStatus.VISITED;
}

return this._checkModuleDependencyIsComplete(depId, batchState);
});
}

/**
* This is needed because moduleIds are not present in the visit state
* causing an infinite loop when checking whether a depenedency is visited if that dependency is a module.
*/
private static _checkModuleDependencyIsComplete(
moduleId: string,
batchState: BatchState
) {
const dependencies = Object.keys(batchState.visitState).filter((futureId) =>
futureId.startsWith(moduleId)
);

return dependencies.every(
(depId) => batchState.visitState[depId] === VisitStatus.VISITED
);
}
Expand Down
40 changes: 40 additions & 0 deletions packages/core/src/internal/module-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,10 @@ class IgnitionModuleBuilderImplementation<

for (const afterFuture of options.after ?? []) {
future.dependencies.add(afterFuture);

if (!isFuture(afterFuture)) {
this._module.submodules.add(afterFuture);
}
}

for (const libraryFuture of Object.values(options.libraries)) {
Expand Down Expand Up @@ -356,6 +360,10 @@ class IgnitionModuleBuilderImplementation<

for (const afterFuture of options.after ?? []) {
future.dependencies.add(afterFuture);

if (!isFuture(afterFuture)) {
this._module.submodules.add(afterFuture);
}
}

for (const libraryFuture of Object.values(options.libraries)) {
Expand Down Expand Up @@ -426,6 +434,10 @@ class IgnitionModuleBuilderImplementation<

for (const afterFuture of options.after ?? []) {
future.dependencies.add(afterFuture);

if (!isFuture(afterFuture)) {
this._module.submodules.add(afterFuture);
}
}

for (const libraryFuture of Object.values(options.libraries)) {
Expand Down Expand Up @@ -470,6 +482,10 @@ class IgnitionModuleBuilderImplementation<

for (const afterFuture of options.after ?? []) {
future.dependencies.add(afterFuture);

if (!isFuture(afterFuture)) {
this._module.submodules.add(afterFuture);
}
}

for (const libraryFuture of Object.values(options.libraries)) {
Expand Down Expand Up @@ -543,6 +559,10 @@ class IgnitionModuleBuilderImplementation<

for (const afterFuture of options.after ?? []) {
future.dependencies.add(afterFuture);

if (!isFuture(afterFuture)) {
this._module.submodules.add(afterFuture);
}
}

this._module.futures.add(future);
Expand Down Expand Up @@ -607,6 +627,10 @@ class IgnitionModuleBuilderImplementation<

for (const afterFuture of options.after ?? []) {
future.dependencies.add(afterFuture);

if (!isFuture(afterFuture)) {
this._module.submodules.add(afterFuture);
}
}

this._module.futures.add(future);
Expand Down Expand Up @@ -669,6 +693,10 @@ class IgnitionModuleBuilderImplementation<

for (const afterFuture of options.after ?? []) {
future.dependencies.add(afterFuture);

if (!isFuture(afterFuture)) {
this._module.submodules.add(afterFuture);
}
}

this._module.futures.add(future);
Expand Down Expand Up @@ -774,6 +802,10 @@ class IgnitionModuleBuilderImplementation<

for (const afterFuture of options.after ?? []) {
future.dependencies.add(afterFuture);

if (!isFuture(afterFuture)) {
this._module.submodules.add(afterFuture);
}
}

if (isFuture(address)) {
Expand Down Expand Up @@ -819,6 +851,10 @@ class IgnitionModuleBuilderImplementation<

for (const afterFuture of options.after ?? []) {
future.dependencies.add(afterFuture);

if (!isFuture(afterFuture)) {
this._module.submodules.add(afterFuture);
}
}

if (isFuture(address)) {
Expand Down Expand Up @@ -953,6 +989,10 @@ class IgnitionModuleBuilderImplementation<

for (const afterFuture of options.after ?? []) {
future.dependencies.add(afterFuture);

if (!isFuture(afterFuture)) {
this._module.submodules.add(afterFuture);
}
}

this._module.futures.add(future);
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/internal/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
const customInspectSymbol = Symbol.for("util.inspect.custom");

abstract class BaseFutureImplementation<FutureTypeT extends FutureType> {
public readonly dependencies: Set<Future> = new Set();
public readonly dependencies: Set<Future | IgnitionModule> = new Set();

constructor(
public readonly id: string,
Expand Down
13 changes: 8 additions & 5 deletions packages/core/src/internal/utils/adjacency-list-converter.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { isFuture } from "../../type-guards";
import { Future } from "../../types/module";

import { AdjacencyList } from "./adjacency-list";
Expand All @@ -12,11 +13,13 @@ export class AdjacencyListConverter {
for (const dependency of future.dependencies) {
dependencyGraph.addDependency({ from: future.id, to: dependency.id });

this._optionallyAddDependenciesSubmoduleSiblings(
dependencyGraph,
future,
dependency
);
if (isFuture(dependency)) {
this._optionallyAddDependenciesSubmoduleSiblings(
dependencyGraph,
future,
dependency
);
}
}
}

Expand Down
8 changes: 8 additions & 0 deletions packages/core/src/list-transactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type { ArtifactResolver } from "./types/artifact";
import findLastIndex from "lodash/findLastIndex";

import { IgnitionError } from "./errors";
import { builtinChains } from "./internal/chain-config";
import { FileDeploymentLoader } from "./internal/deployment-loader/file-deployment-loader";
import { ERRORS } from "./internal/errors-list";
import { loadDeploymentState } from "./internal/execution/deployment-state-helpers";
Expand Down Expand Up @@ -50,6 +51,10 @@ export async function listTransactions(

const transactions: ListTransactionsResult = [];

const browserUrl = builtinChains.find(
({ chainId }) => chainId === deploymentState.chainId
);

for await (const message of deploymentLoader.readFromJournal()) {
if (message.type !== JournalMessageType.TRANSACTION_SEND) {
continue;
Expand Down Expand Up @@ -97,6 +102,7 @@ export async function listTransactions(
: undefined,
params: exState.constructorArgs,
value: networkInteraction.value,
browserUrl: browserUrl?.urls.browserURL,
});

break;
Expand All @@ -118,6 +124,7 @@ export async function listTransactions(
to: networkInteraction.to,
params: exState.args,
value: networkInteraction.value,
browserUrl: browserUrl?.urls.browserURL,
});

break;
Expand All @@ -133,6 +140,7 @@ export async function listTransactions(
),
to: networkInteraction.to,
value: networkInteraction.value,
browserUrl: browserUrl?.urls.browserURL,
});

break;
Expand Down
Loading
Loading