-
Notifications
You must be signed in to change notification settings - Fork 0
added a optimistic block confirmations logic in explorer endpoint #174
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
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -104,7 +104,7 @@ export class ExecutorProcessor implements Processor<ExecutorJob> { | |
| const transactionReceipt = await withTrace( | ||
| "executionPhase.defaultBlockTxReceiptForPreviousTxHash", | ||
| async () => { | ||
| // Fallback RPC providers are skipped here to avoid timeout retries on all fallbacks which is time consuming | ||
| // Tx receipt is always fetched from primary RPC provider to make sure to avoid RPC node state sync issues in confirmations | ||
| const { client } = | ||
| this.rpcManagerService.getPrimaryRpcProvider(chainId); | ||
|
|
||
|
|
@@ -1050,6 +1050,9 @@ export class ExecutorProcessor implements Processor<ExecutorJob> { | |
| this.storageService.updateUserOpCustomFields(meeUserOpHash, { | ||
| txHash, | ||
| isConfirmed, | ||
| confirmations: isConfirmed | ||
| ? BigInt(this.chainsService.chainSettings.waitConfirmations) | ||
| : 1n, | ||
| executionFinishedAt: Date.now(), | ||
| }); | ||
| } | ||
|
|
@@ -1085,6 +1088,11 @@ export class ExecutorProcessor implements Processor<ExecutorJob> { | |
| // TODO: If there are any ways to match these fee number, we should explore this in the future. | ||
| actualGasCost, | ||
| isConfirmed, | ||
| confirmations: isConfirmed | ||
| ? BigInt( | ||
| this.chainsService.chainSettings.waitConfirmations, | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here? |
||
| ) | ||
| : 1n, | ||
| ...(success | ||
| ? {} | ||
| : { | ||
|
|
@@ -1140,6 +1148,9 @@ export class ExecutorProcessor implements Processor<ExecutorJob> { | |
| this.storageService.updateUserOpCustomFields(meeUserOpHash, { | ||
| txHash, | ||
| isConfirmed, | ||
| confirmations: isConfirmed | ||
| ? BigInt(this.chainsService.chainSettings.waitConfirmations) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here? |
||
| : 1n, | ||
| executionFinishedAt: Date.now(), | ||
| error: "Failed to execute userOp", | ||
| }); | ||
|
|
||
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.
shouldnt we fetch chain specific waitConfirmations parameter?
this.chainsService.getChainSettings(chainId).waitConfirmations