-
Notifications
You must be signed in to change notification settings - Fork 24
Add EIP-1559 gas mode, nonce reservation, and exposed asset creation phases #269
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
Conversation
Lexpeartha
left a comment
There was a problem hiding this 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
| const requestedGasMode = | ||
| options.blockchain?.gasMode ?? | ||
| this.config.blockchain?.gasMode ?? | ||
| envGasMode ?? | ||
| DEFAULT_PARAMETERS.GAS_MODE; |
There was a problem hiding this comment.
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
| const supportsEip1559 = | ||
| feeHistory.supported && | ||
| feeHistory.baseFeePerGas?.length && | ||
| feeHistory.priorityFees?.length; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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?
Body: