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

🚬 Ethereum compatibility #420

Merged
merged 4 commits into from
Jan 16, 2025
Merged

🚬 Ethereum compatibility #420

merged 4 commits into from
Jan 16, 2025

Conversation

JuaniRios
Copy link
Contributor

@JuaniRios JuaniRios commented Oct 14, 2024

What?

  • Add support for Ethereum based projects by letting users define the ethereum account that receives the tokens at the moment of participation.

How?

  • Participation info structs now have a receiving_account field which is an XCM Junction. This has to be either AccountKey20 or AccountId32
  • Issuers now define at project creation if they expect one or the other account Junction.
  • Existing participation extrinsics now call the inner participation functions with AccountId32 == caller
  • New participation extrinsics now accept a junction, and a signature. The signature will be checked against the account defined in the signature to prove ownership.

Testing?

In the next PR: #425

Anything Else?

@JuaniRios JuaniRios force-pushed the 10-14-ethereum_compatibility branch 6 times, most recently from 7ceed6e to 06d2a5f Compare October 22, 2024 12:52
@JuaniRios JuaniRios force-pushed the 10-14-ethereum_compatibility branch 4 times, most recently from 5654180 to 3b1c965 Compare October 24, 2024 09:19
@JuaniRios JuaniRios self-assigned this Oct 24, 2024
@JuaniRios JuaniRios force-pushed the 10-14-ethereum_compatibility branch 2 times, most recently from dcf98bd to 1cc1e7b Compare October 24, 2024 09:37
@JuaniRios JuaniRios force-pushed the 10-14-ethereum_compatibility branch 4 times, most recently from 252f99a to 85c8505 Compare October 24, 2024 11:00
@JuaniRios JuaniRios changed the title Ethereum compatibility 🚬 Ethereum compatibility Oct 24, 2024
@JuaniRios JuaniRios marked this pull request as ready for review October 30, 2024 14:46
@lrazovic lrazovic requested a review from vstam1 November 5, 2024 08:37
Copy link
Collaborator

@vstam1 vstam1 left a comment

Choose a reason for hiding this comment

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

Lgtm. Cannot verify signature verification, but logic looks solid

Copy link
Collaborator

@Lederstrumpf Lederstrumpf left a comment

Choose a reason for hiding this comment

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

Act I.

🚬 [...] #420

Clown

Act II.

2024-11-07T11:11:40,474664775+01:00

Superclown

Act III.

Testing?

In the next PR

Gigaclown :D


LGTM 👍 - follows EIP-191 well. Just note my comments re. recid value in sigs. I'm aware ethers still uses "legacy" by default - it's a minor adjustment.

integration-tests/src/tests/ethereum_support.rs Outdated Show resolved Hide resolved
pallets/funding/src/lib.rs Outdated Show resolved Hide resolved
pallets/funding/src/lib.rs Outdated Show resolved Hide resolved
pallets/funding/src/runtime_api.rs Outdated Show resolved Hide resolved
pallets/funding/src/functions/misc.rs Outdated Show resolved Hide resolved
@JuaniRios JuaniRios marked this pull request as draft November 26, 2024 10:34
@JuaniRios JuaniRios force-pushed the 10-14-ethereum_compatibility branch from 049c598 to 7f4bc03 Compare November 27, 2024 13:30
@JuaniRios JuaniRios force-pushed the 10-14-ethereum_compatibility branch 3 times, most recently from 6e95419 to 098e693 Compare November 28, 2024 11:52
@JuaniRios JuaniRios marked this pull request as ready for review November 28, 2024 12:00
@JuaniRios JuaniRios force-pushed the 10-14-ethereum_compatibility branch from 098e693 to e12717a Compare November 28, 2024 12:06
This was referenced Nov 29, 2024
This was referenced Dec 9, 2024
@JuaniRios JuaniRios force-pushed the 10-14-ethereum_compatibility branch from e12717a to d4e8393 Compare December 20, 2024 13:48
@JuaniRios JuaniRios force-pushed the 10-14-ethereum_compatibility branch from d4e8393 to 70882fb Compare January 10, 2025 11:49
Copy link
Member

@lrazovic lrazovic left a comment

Choose a reason for hiding this comment

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

The logic looks good! I proposed few improvements on the EIP-712 side, so we can get rid of the Vec. Also, we should add benchmarks for the new receiving account extrinsics since we're doing extra computation for the signature verification (ECDSA/sr25519) in there.

pallets/funding/src/functions/misc.rs Outdated Show resolved Hide resolved
pallets/funding/src/functions/misc.rs Outdated Show resolved Hide resolved
pallets/funding/src/functions/misc.rs Show resolved Hide resolved
pallets/funding/src/functions/misc.rs Show resolved Hide resolved
@JuaniRios JuaniRios force-pushed the 10-14-ethereum_compatibility branch from 70882fb to 64849ec Compare January 16, 2025 09:46
@JuaniRios JuaniRios requested a review from lrazovic January 16, 2025 10:29
Copy link
Contributor Author

JuaniRios commented Jan 16, 2025

Merge activity

  • Jan 16, 7:09 AM EST: A user started a stack merge that includes this pull request via Graphite.
  • Jan 16, 7:09 AM EST: A user merged this pull request with Graphite.

@JuaniRios JuaniRios merged commit 55d9c23 into main Jan 16, 2025
1 check passed
@JuaniRios JuaniRios deleted the 10-14-ethereum_compatibility branch January 16, 2025 12:09
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