Skip to content
This repository has been archived by the owner on May 22, 2023. It is now read-only.

TBTC extension optimizations #600

Merged
merged 8 commits into from
Nov 13, 2020
Merged

TBTC extension optimizations #600

merged 8 commits into from
Nov 13, 2020

Conversation

lukasz-zimnoch
Copy link
Member

@lukasz-zimnoch lukasz-zimnoch commented Nov 12, 2020

Refs: #574
Depends on: #592

Here we add some TBTC extension optimizations that should reduce costs related to Ethereum integration. Specifically:

  • We introduce a time cache for the monitoring filter. Determining whether a deposit should be tracked requires two ETH calls. This check is performed for each deposit multiple times as a response to monitored state transition events and all duplicates of those events. This can result in a significant number of unnecessary ETH calls. Introducing a time cache here should greatly reduce the number of calls.
  • We implement a signer-based action delay factor. Currently, all monitoring signers act at the same time. As result, only the first transaction is always successful while the rest revert and burn some amount of gas by the way. The change introduced here forces each signer to wait an additional time, according to its signer index, before acting. This should prevent other signers to act if a successful action has been already made.

Introduced a time cache which allows to limit
the number of ETH calls performed during the
monitoring filter execution.
Base automatically changed from monitoring-confirmations to master November 12, 2020 14:39
Added a signer-based delay factor for the
monitoring timeout. This should prevent the
situation when all signers performs the
action in the same time and only the first
succeeds while others loose their tx fees
due to reverted transactions.
@pdyraga pdyraga added this to the v1.5.0 milestone Nov 13, 2020
@lukasz-zimnoch lukasz-zimnoch marked this pull request as ready for review November 13, 2020 10:17
pkg/extensions/tbtc/tbtc.go Outdated Show resolved Hide resolved
pkg/extensions/tbtc/tbtc.go Outdated Show resolved Hide resolved
pkg/extensions/tbtc/tbtc.go Outdated Show resolved Hide resolved
pkg/extensions/tbtc/tbtc.go Show resolved Hide resolved
pkg/extensions/tbtc/tbtc.go Show resolved Hide resolved
pkg/extensions/tbtc/tbtc.go Show resolved Hide resolved
pkg/extensions/tbtc/tbtc.go Outdated Show resolved Hide resolved
pkg/extensions/tbtc/tbtc.go Outdated Show resolved Hide resolved
Copy link
Member

@pdyraga pdyraga left a comment

Choose a reason for hiding this comment

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

🚀

@pdyraga pdyraga merged commit b658b02 into master Nov 13, 2020
@pdyraga pdyraga deleted the tbtc-optimizations branch November 13, 2020 11:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants