Skip to content
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

feat: support retrying sending inbound vote with higher gas limit #1591

Closed
wants to merge 11 commits into from

Conversation

lumtis
Copy link
Member

@lumtis lumtis commented Jan 17, 2024

Description

Decrease the default gas limit for inbound vote and increase it when the tx failed with a out of gas error.
The tx result is checked in another Go routine

Add the same functionality for outbound vote. (When processing outbound when reverting the gas limit must be higher because of the swaps to pay for the gas on the sending chain)

Also do some renaming and create new files for the different Post functions:

  • PostSend => PostVoteInbound
  • PostReceiveConfirmation => PostVoteOutbound

Closes: #1579

Copy link

github-actions bot commented Jan 17, 2024

!!!WARNING!!!
nosec detected in the following files: zetaclient/bitcoin_client.go, zetaclient/broadcast.go

Be very careful about using #nosec in code. It can be a quick way to suppress security warnings and move forward with development, it should be employed with caution. Suppressing warnings with #nosec can hide potentially serious vulnerabilities. Only use #nosec when you're absolutely certain that the security issue is either a false positive or has been mitigated in another way.

Only suppress a single rule (or a specific set of rules) within a section of code, while continuing to scan for other problems. To do this, you can list the rule(s) to be suppressed within the #nosec annotation, e.g: /* #nosec G401 */ or //#nosec G201 G202 G203
Broad #nosec annotations should be avoided, as they can hide other vulnerabilities. The CI will block you from merging this PR until you remove #nosec annotations that do not target specific rules.

Pay extra attention to the way #nosec is being used in the files listed above.

@github-actions github-actions bot added the nosec label Jan 17, 2024
@lumtis lumtis marked this pull request as ready for review January 17, 2024 01:09
Copy link
Contributor

@ws4charlie ws4charlie left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -48,8 +48,8 @@ type ChainSigner interface {

// ZetaCoreBridger is the interface to interact with ZetaCore
type ZetaCoreBridger interface {
PostSend(zetaGasLimit uint64, msg *crosschaintypes.MsgVoteOnObservedInboundTx) (string, string, error)
PostReceiveConfirmation(
PostVoteInbound(gasLimit, retryGasLimit uint64, msg *crosschaintypes.MsgVoteOnObservedInboundTx) (string, string, error)
Copy link
Contributor

@kevinssgh kevinssgh Jan 18, 2024

Choose a reason for hiding this comment

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

retryGasLimit - I see you're passing the execution gas limit here. Should the name be retry gas limit instead of execution gas limit?

@lumtis
Copy link
Member Author

lumtis commented Jan 19, 2024

Closing in favor of #1601
We can cherry pick changes from 12.1 afterward

@lumtis lumtis closed this Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support lower gas limit for voting inbounds
3 participants