Skip to content

Conversation

stevieraykatz
Copy link
Collaborator

@stevieraykatz stevieraykatz commented Apr 28, 2025

To fully support ENSIP-19, two data migrations are needed:

  1. Our users' fwd resolution data needs to be set against the base network-specific cointype (per ENSIP-11).
  2. Our users' reverse resolution data needs to be stored in the ENS deployed L2ReverseRegistrar.

To address number 1, an owner-only hook has been added which allows the basenames admin to write ENSIP-11 data on behalf of existing basenames.

To address number 2 and to ensure data is not lost in the migration process, the reverse data will be written during the migration period to both the legacy resolver and to the new ENS contract.

@cb-heimdall
Copy link
Collaborator

cb-heimdall commented Apr 28, 2025

✅ Heimdall Review Status

Requirement Status More Info
Reviews 1/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

@stevieraykatz stevieraykatz marked this pull request as ready for review April 30, 2025 18:55
@stevieraykatz
Copy link
Collaborator Author

#123 now depends on this contract since we have wrapped the 2-step reverse set in a single call in reverse registrar

Copy link
Collaborator

@ilikesymmetry ilikesymmetry left a comment

Choose a reason for hiding this comment

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

Couldn't find test for setBaseForwardAddr?

Comment on lines 4 to 5
/// @notice Interface for the L2 Reverse Registrar.
interface IL2ReverseRegistrar {
Copy link
Collaborator

Choose a reason for hiding this comment

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

if this is the one defined by ENS, would appreciate a callout and/or link to their repo

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

added link to PR. will update with link to contract when it's merged.

import {Sha3} from "src/lib/Sha3.sol";

contract SetNameForAddrWithSignature is ReverseRegistrarV2Base {
function test_setsNameForAddrWithSignature() public {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would prefer fuzzing on tests. In this case, seems like we could fuzz most args and generate signatures with a util to validate. Ideally we could also have an integration test against the deployed L2ReverseRegistrar but that doesn't exist yet right? For now maybe just having some basic fuzzing would be nice.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Though I generally agree that fuzzing should be applied liberally, I think fuzzing around signature validation is out of scope for this contact. We rely on an external contract to do the signature validation so it doesn't make sense to me to add that validation to this repo's scope.

I agree an integration test would be ideal. We can technically do this against testnet today (with an older version) but I think a more valid integration test would use mainnet's deployment when it goes live. Thoughts on the specifics here?

Copy link
Collaborator

Choose a reason for hiding this comment

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

We can still fuzz the other function arguments though? Aligned that we don't need to test our dependency's signature validation, but it would also be nice to have a test that validates our assumptions of what happens if signature validation does fail on the L2ReverseRegistrar which we could mock.

As for integration tests, I took a look at the ENS PR and one thought could be changing our lib dependency to the branch so we can access their code. This would create future work for us though to eventually set branch back to main or some new feature branch if they merge and then change things.

Another option could be building the raw bytecode for their current sample implementation and etch that code manually. We'd need to update the bytecode manually as they push new updates but would decouple from other logistical weirdness.

Am fine for now adding a todo linear ticket so we don't forget to do something when it's more convenient.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I like the idea of circling back once ENS deploys and writing some fork integration tests around their contract.

@stevieraykatz
Copy link
Collaborator Author

Couldn't find test for setBaseForwardAddr?

Added tests.

Also found a bug where the helper _bytesToAddress reverts for the zero address. Changed the third validation logic step in setBaseForwardAddr.

Copy link
Collaborator

@ilikesymmetry ilikesymmetry left a comment

Choose a reason for hiding this comment

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

lgtm, would appreciate noting somewhere (maybe a linear ticket) that we should follow up with integration tests once ENS has stable bytecode.

import {Sha3} from "src/lib/Sha3.sol";

contract SetNameForAddrWithSignature is ReverseRegistrarV2Base {
function test_setsNameForAddrWithSignature() public {
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can still fuzz the other function arguments though? Aligned that we don't need to test our dependency's signature validation, but it would also be nice to have a test that validates our assumptions of what happens if signature validation does fail on the L2ReverseRegistrar which we could mock.

As for integration tests, I took a look at the ENS PR and one thought could be changing our lib dependency to the branch so we can access their code. This would create future work for us though to eventually set branch back to main or some new feature branch if they merge and then change things.

Another option could be building the raw bytecode for their current sample implementation and etch that code manually. We'd need to update the bytecode manually as they push new updates but would decouple from other logistical weirdness.

Am fine for now adding a todo linear ticket so we don't forget to do something when it's more convenient.

@stevieraykatz
Copy link
Collaborator Author

lgtm, would appreciate noting somewhere (maybe a linear ticket) that we should follow up with integration tests once ENS has stable bytecode.

https://linear.app/coinbase/issue/BA-1952 added to track

@stevieraykatz stevieraykatz merged commit d00f71d into main May 7, 2025
7 checks passed
@stevieraykatz stevieraykatz deleted the reverse-registrar-v2 branch May 7, 2025 17:33
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.

3 participants