Skip to content

Conversation

@lupuszr
Copy link
Contributor

@lupuszr lupuszr commented Dec 26, 2025

Body:

  • add GAS_MODE (env DKG_GAS_MODE) to choose legacy or EIP-1559 gas fields, defaulting to EIP-1559 when supported with fallback to legacy
  • resolve gas fees via feeHistory where available and apply to tx prep (maxFeePerGas/maxPriorityFeePerGas) or legacy gasPrice; retry bumping remains disabled by design
  • add nonce reservation in node blockchain service to prevent concurrent nonce collisions; include gas-mode selection tests; improve publish error logging
  • split asset creation into publish, mint, and finality phases to surface intermediate states and reuse publish outputs

Copy link
Contributor

@Lexpeartha Lexpeartha left a comment

Choose a reason for hiding this comment

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

Good separation of concerns I would say. Did not dive too deeply, but from my perspective I can read it easily and make sense out of it.

Also we should double check with tests if there was any accidental regression made, to me it looks alright but we should double check

Comment on lines 198 to 202
const requestedGasMode =
options.blockchain?.gasMode ??
this.config.blockchain?.gasMode ??
envGasMode ??
DEFAULT_PARAMETERS.GAS_MODE;
Copy link
Contributor

Choose a reason for hiding this comment

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

I like the env setting, makes it easier for folks who are not super familiar with dkg.js
Though I think env should overwrite options and config then

Comment on lines +1533 to +1536
const supportsEip1559 =
feeHistory.supported &&
feeHistory.baseFeePerGas?.length &&
feeHistory.priorityFees?.length;
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you check for neuroweb here? I'm not 100% sure but I remember baseFeePerGas and priorityFees were returned for it too even though it doesn't support the eip1559 smart gas pricing

Copy link
Contributor

Choose a reason for hiding this comment

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

It just aggregates them together later to form the gasPrice

);
previousTxGasPrice = tx.gasPrice;
const nonce = await this.allocateNonce(blockchain);
previousTxGasPrice = tx.gasPrice ?? tx.maxFeePerGas;
Copy link
Contributor

Choose a reason for hiding this comment

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

with eip1559 we could probably get the real gasPrice after the tx is executed instead of using maxFeePerGas

return blockchain?.publicKey;
}

async allocateNonce(blockchain) {
Copy link
Contributor

Choose a reason for hiding this comment

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

can you add some comments about this function?

@lupuszr lupuszr merged commit 4327d03 into v8/develop Dec 29, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants