@nomicfoundation/ignition-core
Advanced tools
Comparing version 0.15.1 to 0.15.2
@@ -7,2 +7,14 @@ # Changelog | ||
## 0.15.2 - 2024-05-02 | ||
### Added | ||
- Support `maxPriorityFeePerGas` as a configuration parameter ([#728](https://github.com/NomicFoundation/hardhat-ignition/issues/728)) | ||
- Use RPC call `eth_maxPriorityFeePerGas` in gas fee calculations when available ([#743](https://github.com/NomicFoundation/hardhat-ignition/issues/743)) | ||
- Support zero gas fee chains (like private Besu chains), thanks @jimthematrix ([#730](https://github.com/NomicFoundation/hardhat-ignition/pull/730)) | ||
### Fixed | ||
- Use pre-EIP-1559 transactions for Polygon to avoid dropped transactions ([#735](https://github.com/NomicFoundation/hardhat-ignition/issues/735)) | ||
## 0.15.1 - 2024-04-04 | ||
@@ -9,0 +21,0 @@ |
@@ -11,3 +11,3 @@ import { ArtifactResolver } from "./types/artifact"; | ||
*/ | ||
export declare function deploy<ModuleIdT extends string, ContractNameT extends string, IgnitionModuleResultsT extends IgnitionModuleResult<ContractNameT>, StrategyT extends keyof StrategyConfig = "basic">({ config, artifactResolver, provider, executionEventListener, deploymentDir, ignitionModule, deploymentParameters, accounts, defaultSender: givenDefaultSender, strategy, strategyConfig, maxFeePerGasLimit, }: { | ||
export declare function deploy<ModuleIdT extends string, ContractNameT extends string, IgnitionModuleResultsT extends IgnitionModuleResult<ContractNameT>, StrategyT extends keyof StrategyConfig = "basic">({ config, artifactResolver, provider, executionEventListener, deploymentDir, ignitionModule, deploymentParameters, accounts, defaultSender: givenDefaultSender, strategy, strategyConfig, maxFeePerGasLimit, maxPriorityFeePerGas, }: { | ||
config?: Partial<DeployConfig>; | ||
@@ -25,3 +25,4 @@ artifactResolver: ArtifactResolver; | ||
maxFeePerGasLimit?: bigint; | ||
maxPriorityFeePerGas?: bigint; | ||
}): Promise<DeploymentResult>; | ||
//# sourceMappingURL=deploy.d.ts.map |
@@ -22,3 +22,3 @@ "use strict"; | ||
*/ | ||
async function deploy({ config = {}, artifactResolver, provider, executionEventListener, deploymentDir, ignitionModule, deploymentParameters, accounts, defaultSender: givenDefaultSender, strategy, strategyConfig, maxFeePerGasLimit, }) { | ||
async function deploy({ config = {}, artifactResolver, provider, executionEventListener, deploymentDir, ignitionModule, deploymentParameters, accounts, defaultSender: givenDefaultSender, strategy, strategyConfig, maxFeePerGasLimit, maxPriorityFeePerGas, }) { | ||
const executionStrategy = (0, resolve_strategy_1.resolveStrategy)(strategy, strategyConfig); | ||
@@ -51,2 +51,3 @@ if (executionEventListener !== undefined) { | ||
maxFeePerGasLimit, | ||
maxPriorityFeePerGas, | ||
}); | ||
@@ -53,0 +54,0 @@ const isAutominedNetwork = await (0, check_automined_network_1.checkAutominedNetwork)(provider); |
@@ -8,4 +8,4 @@ "use strict"; | ||
exports.defaultConfig = { | ||
blockPollingInterval: 1000, | ||
timeBeforeBumpingFees: 3 * 60 * 1000, | ||
blockPollingInterval: 1_000, | ||
timeBeforeBumpingFees: 3 * 60 * 1_000, | ||
maxFeeBumps: 4, | ||
@@ -12,0 +12,0 @@ requiredConfirmations: 5, |
@@ -31,3 +31,3 @@ "use strict"; | ||
NextAction["MONITOR_ONCHAIN_INTERACTION"] = "MONITOR_ONCHAIN_INTERACTION"; | ||
})(NextAction = exports.NextAction || (exports.NextAction = {})); | ||
})(NextAction || (exports.NextAction = NextAction = {})); | ||
/** | ||
@@ -34,0 +34,0 @@ * Returns the next action to be run for an execution state. |
@@ -149,2 +149,3 @@ import { EIP1193Provider } from "../../types/provider"; | ||
maxFeePerGasLimit?: bigint | undefined; | ||
maxPriorityFeePerGas?: bigint | undefined; | ||
} | undefined); | ||
@@ -165,3 +166,14 @@ getChainId(): Promise<number>; | ||
private _getNetworkFees; | ||
/** | ||
* The max fee per gas is needed in the max fee calculation. | ||
* | ||
* It is resolved from config if present, falling back to | ||
* the `eth_maxPriorityFeePerGas` RPC call if supported by the chain, | ||
* and finally falling back to the default max fee per gas. | ||
* | ||
* @returns a max fee per gas based on the config, RPC call, or default value. | ||
*/ | ||
private _resolveMaxPriorityFeePerGas; | ||
private _getMaxPrioirtyFeePerGas; | ||
} | ||
//# sourceMappingURL=jsonrpc-client.d.ts.map |
@@ -8,2 +8,3 @@ "use strict"; | ||
const address_1 = require("./utils/address"); | ||
const DEFAULT_MAX_PRIORITY_FEE_PER_GAS = 1000000000n; | ||
/** | ||
@@ -278,7 +279,19 @@ * A JsonRpcClient that uses an EIP-1193 provider to make the calls. | ||
async _getNetworkFees() { | ||
const latestBlock = await this.getLatestBlock(); | ||
// We prioritize EIP-1559 fees over legacy gasPrice fees | ||
if (latestBlock.baseFeePerGas !== undefined) { | ||
const [latestBlock, chainId] = await Promise.all([ | ||
this.getLatestBlock(), | ||
this.getChainId(), | ||
]); | ||
// 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 | ||
if (latestBlock.baseFeePerGas !== undefined && chainId !== 137) { | ||
if (latestBlock.baseFeePerGas === 0n) { | ||
// Support zero gas fee chains, such as a private instances | ||
// of blockchains using Besu. | ||
return { | ||
maxFeePerGas: 0n, | ||
maxPriorityFeePerGas: 0n, | ||
}; | ||
} | ||
const maxPriorityFeePerGas = await this._resolveMaxPriorityFeePerGas(); | ||
// Logic copied from ethers v6 | ||
const maxPriorityFeePerGas = 1000000000n; // 1gwei | ||
const maxFeePerGas = latestBlock.baseFeePerGas * 2n + maxPriorityFeePerGas; | ||
@@ -297,2 +310,31 @@ return { | ||
} | ||
/** | ||
* The max fee per gas is needed in the max fee calculation. | ||
* | ||
* It is resolved from config if present, falling back to | ||
* the `eth_maxPriorityFeePerGas` RPC call if supported by the chain, | ||
* and finally falling back to the default max fee per gas. | ||
* | ||
* @returns a max fee per gas based on the config, RPC call, or default value. | ||
*/ | ||
async _resolveMaxPriorityFeePerGas() { | ||
if (this._config?.maxPriorityFeePerGas !== undefined) { | ||
return this._config?.maxPriorityFeePerGas; | ||
} | ||
try { | ||
return await this._getMaxPrioirtyFeePerGas(); | ||
} | ||
catch { | ||
// the max priority fee RPC call is not supported by | ||
// this chain | ||
} | ||
return DEFAULT_MAX_PRIORITY_FEE_PER_GAS; | ||
} | ||
async _getMaxPrioirtyFeePerGas() { | ||
const fee = await this._provider.request({ | ||
method: "eth_maxPriorityFeePerGas", | ||
}); | ||
assertResponseType("eth_maxPriorityFeePerGas", fee, typeof fee === "string"); | ||
return jsonRpcQuantityToBigInt(fee); | ||
} | ||
} | ||
@@ -299,0 +341,0 @@ exports.EIP1193JsonRpcClient = EIP1193JsonRpcClient; |
@@ -18,3 +18,3 @@ "use strict"; | ||
EvmExecutionResultTypes["REVERT_WITH_INVALID_DATA_OR_UNKNOWN_CUSTOM_ERROR"] = "REVERT_WITH_INVALID_DATA_OR_UNKNOWN_CUSTOM_ERROR"; | ||
})(EvmExecutionResultTypes = exports.EvmExecutionResultTypes || (exports.EvmExecutionResultTypes = {})); | ||
})(EvmExecutionResultTypes || (exports.EvmExecutionResultTypes = EvmExecutionResultTypes = {})); | ||
//# sourceMappingURL=evm-execution.js.map |
@@ -16,3 +16,3 @@ "use strict"; | ||
ExecutionResultType["STRATEGY_HELD"] = "STRATEGY_HELD"; | ||
})(ExecutionResultType = exports.ExecutionResultType || (exports.ExecutionResultType = {})); | ||
})(ExecutionResultType || (exports.ExecutionResultType = ExecutionResultType = {})); | ||
//# sourceMappingURL=execution-result.js.map |
@@ -14,3 +14,3 @@ "use strict"; | ||
ExecutionStatus["FAILED"] = "FAILED"; | ||
})(ExecutionStatus = exports.ExecutionStatus || (exports.ExecutionStatus = {})); | ||
})(ExecutionStatus || (exports.ExecutionStatus = ExecutionStatus = {})); | ||
/** | ||
@@ -27,3 +27,3 @@ * The different kinds of execution states. | ||
ExecutionSateType["SEND_DATA_EXECUTION_STATE"] = "SEND_DATA_EXECUTION_STATE"; | ||
})(ExecutionSateType = exports.ExecutionSateType || (exports.ExecutionSateType = {})); | ||
})(ExecutionSateType || (exports.ExecutionSateType = ExecutionSateType = {})); | ||
//# sourceMappingURL=execution-state.js.map |
@@ -12,3 +12,3 @@ "use strict"; | ||
OnchainInteractionResponseType["SIMULATION_RESULT"] = "SIMULATION_RESULT"; | ||
})(OnchainInteractionResponseType = exports.OnchainInteractionResponseType || (exports.OnchainInteractionResponseType = {})); | ||
})(OnchainInteractionResponseType || (exports.OnchainInteractionResponseType = OnchainInteractionResponseType = {})); | ||
/** | ||
@@ -15,0 +15,0 @@ * The type of a SimulationSuccessSignal |
@@ -11,3 +11,3 @@ "use strict"; | ||
TransactionReceiptStatus["SUCCESS"] = "SUCCESS"; | ||
})(TransactionReceiptStatus = exports.TransactionReceiptStatus || (exports.TransactionReceiptStatus = {})); | ||
})(TransactionReceiptStatus || (exports.TransactionReceiptStatus = TransactionReceiptStatus = {})); | ||
//# sourceMappingURL=jsonrpc.js.map |
@@ -33,3 +33,3 @@ "use strict"; | ||
JournalMessageType["ONCHAIN_INTERACTION_TIMEOUT"] = "ONCHAIN_INTERACTION_TIMEOUT"; | ||
})(JournalMessageType = exports.JournalMessageType || (exports.JournalMessageType = {})); | ||
})(JournalMessageType || (exports.JournalMessageType = JournalMessageType = {})); | ||
//# sourceMappingURL=messages.js.map |
@@ -11,3 +11,3 @@ "use strict"; | ||
NetworkInteractionType["STATIC_CALL"] = "STATIC_CALL"; | ||
})(NetworkInteractionType = exports.NetworkInteractionType || (exports.NetworkInteractionType = {})); | ||
})(NetworkInteractionType || (exports.NetworkInteractionType = NetworkInteractionType = {})); | ||
//# sourceMappingURL=network-interaction.js.map |
@@ -32,3 +32,3 @@ "use strict"; | ||
DeploymentResultType["SUCCESSFUL_DEPLOYMENT"] = "SUCCESSFUL_DEPLOYMENT"; | ||
})(DeploymentResultType = exports.DeploymentResultType || (exports.DeploymentResultType = {})); | ||
})(DeploymentResultType || (exports.DeploymentResultType = DeploymentResultType = {})); | ||
//# sourceMappingURL=deploy.js.map |
@@ -39,3 +39,3 @@ "use strict"; | ||
ExecutionEventType["SET_STRATEGY"] = "SET_STRATEGY"; | ||
})(ExecutionEventType = exports.ExecutionEventType || (exports.ExecutionEventType = {})); | ||
})(ExecutionEventType || (exports.ExecutionEventType = ExecutionEventType = {})); | ||
/** | ||
@@ -50,3 +50,3 @@ * The types of network interactions that can be requested by a future. | ||
ExecutionEventNetworkInteractionType["STATIC_CALL"] = "STATIC_CALL"; | ||
})(ExecutionEventNetworkInteractionType = exports.ExecutionEventNetworkInteractionType || (exports.ExecutionEventNetworkInteractionType = {})); | ||
})(ExecutionEventNetworkInteractionType || (exports.ExecutionEventNetworkInteractionType = ExecutionEventNetworkInteractionType = {})); | ||
/** | ||
@@ -62,3 +62,3 @@ * The status of a future's completed execution. | ||
ExecutionEventResultType["HELD"] = "HELD"; | ||
})(ExecutionEventResultType = exports.ExecutionEventResultType || (exports.ExecutionEventResultType = {})); | ||
})(ExecutionEventResultType || (exports.ExecutionEventResultType = ExecutionEventResultType = {})); | ||
//# sourceMappingURL=execution-events.js.map |
@@ -21,3 +21,3 @@ "use strict"; | ||
FutureType["SEND_DATA"] = "SEND_DATA"; | ||
})(FutureType = exports.FutureType || (exports.FutureType = {})); | ||
})(FutureType || (exports.FutureType = FutureType = {})); | ||
/** | ||
@@ -32,3 +32,3 @@ * The different runtime values supported by Ignition. | ||
RuntimeValueType["MODULE_PARAMETER"] = "MODULE_PARAMETER"; | ||
})(RuntimeValueType = exports.RuntimeValueType || (exports.RuntimeValueType = {})); | ||
})(RuntimeValueType || (exports.RuntimeValueType = RuntimeValueType = {})); | ||
//# sourceMappingURL=module.js.map |
{ | ||
"name": "@nomicfoundation/ignition-core", | ||
"version": "0.15.1", | ||
"version": "0.15.2", | ||
"license": "MIT", | ||
@@ -32,18 +32,2 @@ "author": "Nomic Foundation", | ||
}, | ||
"scripts": { | ||
"build": "tsc --build", | ||
"lint": "npm run prettier -- --check && npm run eslint && npm run api-extractor", | ||
"lint:fix": "npm run prettier -- --write && npm run eslint -- --fix", | ||
"eslint": "eslint \"src/**/*.{ts,tsx}\" \"test/**/*.{ts,tsx}\" \"test-integrations/**/*.{ts,tsx}\"", | ||
"prettier": "prettier \"**/*.{js,ts,md,json}\"", | ||
"preapi-extractor": "npm run build", | ||
"api-extractor": "api-extractor run --local --verbose", | ||
"test": "mocha --recursive \"test/**/*.ts\"", | ||
"test:debug": "DEBUG='ignition:*' npm run test", | ||
"test:build": "tsc --project ./test/", | ||
"test:coverage": "nyc mocha --recursive \"test/**/*.ts\" \"test-integrations/**/*.ts\"", | ||
"test:integrations": "mocha --recursive \"test-integrations/**/*.ts\"", | ||
"clean": "rimraf .nyc_output coverage dist tsconfig.tsbuildinfo", | ||
"prepack": "npm run build" | ||
}, | ||
"devDependencies": { | ||
@@ -64,3 +48,18 @@ "@types/chai": "^4.2.22", | ||
"ndjson": "2.0.0" | ||
}, | ||
"scripts": { | ||
"build": "tsc --build", | ||
"lint": "pnpm prettier --check && pnpm eslint && pnpm api-extractor", | ||
"lint:fix": "pnpm prettier --write && pnpm eslint --fix", | ||
"eslint": "eslint \"src/**/*.{ts,tsx}\" \"test/**/*.{ts,tsx}\" \"test-integrations/**/*.{ts,tsx}\"", | ||
"prettier": "prettier \"**/*.{js,ts,md,json}\"", | ||
"preapi-extractor": "pnpm build", | ||
"api-extractor": "api-extractor run --local --verbose", | ||
"test": "mocha --recursive \"test/**/*.ts\"", | ||
"test:debug": "DEBUG='ignition:*' pnpm test", | ||
"test:build": "tsc --project ./test/", | ||
"test:coverage": "nyc mocha --recursive \"test/**/*.ts\" \"test-integrations/**/*.ts\"", | ||
"test:integrations": "mocha --recursive \"test-integrations/**/*.ts\"", | ||
"clean": "rimraf .nyc_output coverage dist tsconfig.tsbuildinfo" | ||
} | ||
} | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1351268
616
18829