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

Relayers OFAC #1313

Merged
merged 20 commits into from
Oct 19, 2024
Merged

Relayers OFAC #1313

merged 20 commits into from
Oct 19, 2024

Conversation

claravanstaden
Copy link
Contributor

@claravanstaden claravanstaden commented Oct 16, 2024

Resolves: SNO-1156

TODO remaining for a follow-up PR: SNO-1214

@claravanstaden claravanstaden marked this pull request as ready for review October 17, 2024 06:53
if err != nil {
return "", fmt.Errorf("failed to decode destination: %v", err)
}
return account32.Hex(), nil
Copy link
Contributor

Choose a reason for hiding this comment

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

So in the UI we do not post the hex version of the account. We post the SS58 version. Not sure what the correct thing to do there is?

Copy link
Contributor Author

@claravanstaden claravanstaden Oct 17, 2024

Choose a reason for hiding this comment

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

Just saw here Chainalysis does not support non-EVM chains. 😬 https://go.chainalysis.com/chainalysis-oracle-docs.html Compatible networks Edit: Nevermind, I see this is not the API but an oracle.

Checking to see which Polkadot addresses they support...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The SS58 version is probably right, will add it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed in 1e9558e.

"destination": destination,
"payload": common.Bytes2Hex(ev.Payload),
}).Info("extracted destination from message")
banned, err := r.ofac.IsBanned(ev.Raw.Address.Hex(), destination)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is ev.Raw.Address.Hex() equivalent to msg.sender or tx.origin. Because I think we need the latter. The original signer is OFAC banned.

Copy link
Contributor

@yrong yrong Oct 17, 2024

Choose a reason for hiding this comment

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

Yeah, I would assume it's actually Gateway address, not the original sender supposed to check.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed in 1e9558e.

isBanned, err := s.IsBanned(m)
if err != nil {
//return nil, fmt.Errorf("banned check: %w", err)
log.WithError(err).Fatal("error checking banned address found")
Copy link
Contributor

Choose a reason for hiding this comment

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

Return error after logging.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

return true, err
}

return s.ofac.IsBanned(destination, "")
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe add a comment that we will in a follow up ban the source address.

Copy link
Contributor

Choose a reason for hiding this comment

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

Does that require AliasOrigin with V2 first?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Does that require AliasOrigin with V2 first?

To extract it from the on-chain message, yes. In the interim we can fetch the event from Subscan and pull out the source from there.

@yrong
Copy link
Contributor

yrong commented Oct 17, 2024

When OFAC banned detected, since it's ordered channel the message can't be skipped, I would assume the bridge is actually bricked?

So do we plan to add an governance call to reset the nonce/message which is banned? Or we wait for V2 with non-order messaging be ready first?

@vgeddes
Copy link
Collaborator

vgeddes commented Oct 19, 2024

When OFAC banned detected, since it's ordered channel the message can't be skipped, I would assume the bridge is actually bricked?

So do we plan to add an governance call to reset the nonce/message which is banned? Or we wait for V2 with non-order messaging be ready first?

We will work around this with an off-chain process/policy until V2 ships.

@claravanstaden claravanstaden merged commit e87ddb2 into main Oct 19, 2024
1 check passed
@claravanstaden claravanstaden deleted the relayers-ofac branch October 19, 2024 17:00
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.

4 participants