You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 20, 2024. It is now read-only.
I think we may need to exclude the removed user operation from consideration for next estimation loop.
file /pkg/modules/relay/relayer.go :
// SendUserOperation returns a BatchHandler that is used by the Bundler to send batches in a regular EOA// transaction.func (r*Relayer) SendUserOperation() modules.BatchHandlerFunc {
returnfunc(ctx*modules.BatchHandlerCtx) error {
opts:= transaction.Opts{
EOA: r.eoa,
Eth: r.eth,
ChainID: ctx.ChainID,
EntryPoint: ctx.EntryPoint,
Batch: ctx.Batch,
Beneficiary: r.beneficiary,
BaseFee: ctx.BaseFee,
Tip: ctx.Tip,
GasPrice: ctx.GasPrice,
GasLimit: 0,
WaitTimeout: r.waitTimeout,
}
// Estimate gas for handleOps() and drop all userOps that cause unexpected reverts.estRev:= []string{}
forlen(ctx.Batch) >0 {
est, revert, err:=transaction.EstimateHandleOpsGas(&opts)
iferr!=nil {
returnerr
} elseifrevert!=nil {
ctx.MarkOpIndexForRemoval(revert.OpIndex)
estRev=append(estRev, revert.Reason)
// Exclude the removed user operation from consideration for next estimation loop.opts.Batch=ctx.Batch
} else {
opts.GasLimit=estbreak
}
}
ctx.Data["estimate_revert_reasons"] =estRev...
}
}```
The text was updated successfully, but these errors were encountered:
Well, I am facing a gas estimation problem and try to figure out how this estimation works. So take a few moment to check the codes, but I didn't try to reproduce it in a test yet. Maybe you can try it.
On second pass, this may not be an issue since opts.Batch is already initialised to point to ctx.Batch. ctx.MarkOpIndexForRemoval will mutate ctx.Batch which mean opts.Batch should reflect that.
Yes, opts.Batch is intialized to be ctx.Batch at fist, andctx.Batch then is assigned to a new slice after ctx.MarkOpIndexForRemoval, so ctx.Batch is updated with new user operations, but I'm pretty sure that opts.Batch would not be updated accordingly.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I think we may need to exclude the removed user operation from consideration for next estimation loop.
file
/pkg/modules/relay/relayer.go
:The text was updated successfully, but these errors were encountered: