Allow to configure worst-case-processor in inbound queue plus refund #10688
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR allows to configure a
worst_case_message_processor_weightforsnowbridge-inbound-queue-v2. In the case several processors are added, this allows to indicate the weight annotation to take the worst case, and refund the weight if the worst-case-processor has not been used.For what is worth I added an optional weight parameter that
process_messagecan return now. If set to None, this indicates the willingness of not correcting the annotated weight. If set to some weight, this weight will be used to refund the relayer for using the non-worst-case-processor.The default implementation for
worst_case_message_processor_weightis set 0 weight. This might be a valid use case for runtimes (like bridgehub) that have a single processor, and whose benchmark already indicates the worst_case.