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

Allow known transaction types past spam filter #618

Merged
merged 2 commits into from
Sep 16, 2024

Conversation

peachbits
Copy link
Contributor

@peachbits peachbits commented Sep 10, 2024

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

none

Description

none

Copy link
Contributor

@swansontec swansontec left a comment

Choose a reason for hiding this comment

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

I had a sidebar with Sam about this, and we agree that this new logic is more correct. With this change, we will report transactions to the GUI if the engine reports them to us. We no longer care about 0 amounts or any other funny business - if the engine doesn't want a transaction to appear, it shouldn't report it to the core. For token transactions, this includes providing a non-null parentNetworkFee, which will cause the transaction to appear on the parent chain in all cases.

This will probably create a follow-on bug where 0x gasless swaps produce 0-amount, 0-fee transactions on the parent chain. It's up to the engine to fix this, not the core.

Comment on lines 326 to 335
if (
!tx.isSend &&
lt(abs(nativeAmount), spamThreshold) &&
edgeTx.assetAction == null &&
edgeTx.chainAction == null &&
edgeTx.chainAssetAction == null &&
edgeTx.savedAction == null
) {
continue
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This condition is gnarly. Can we do:

const isKnown  =
  tx.isSend ||
  edgeTx.assetAction != null ||
  edgeTx.chainAction != null || 
  edgeTx.chainAssetAction != null ||
  edgeTx.savedAction != null
if (!isKnown && lt(abs(nativeAmount), spamThreshold)) continue

Leave the spamThreshold to filter the amount
@peachbits peachbits force-pushed the matthew/loosen-spam-filter branch from d007afc to edf80bf Compare September 16, 2024 22:22
@peachbits peachbits enabled auto-merge September 16, 2024 22:23
@peachbits peachbits disabled auto-merge September 16, 2024 22:23
@peachbits peachbits force-pushed the matthew/loosen-spam-filter branch from edf80bf to ce3e63e Compare September 16, 2024 22:23
@peachbits peachbits enabled auto-merge September 16, 2024 22:24
@peachbits peachbits merged commit f210cda into master Sep 16, 2024
2 checks passed
@peachbits peachbits deleted the matthew/loosen-spam-filter branch September 16, 2024 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants