-
Notifications
You must be signed in to change notification settings - Fork 17
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
Transfer existing subdomains to new addresses #88
Conversation
Codecov Report
@@ Coverage Diff @@
## master #88 +/- ##
==========================================
- Coverage 58.40% 57.53% -0.87%
==========================================
Files 8 8
Lines 666 756 +90
==========================================
+ Hits 389 435 +46
- Misses 277 321 +44
Continue to review full report at Codecov.
|
cc @pradel |
Is there any way we can set up a mainnet-configured instance of the registrar with this functionality so we can "test in prod" so to speak? It doesn't appear that @pradel or Hiro has relevant testnet-based usernames to use for testing here. |
Hey there, any update? |
@saralab could you coordinate w/ tintash and devops, if we want/need a mainnet-beta instance to test this branch and next steps? |
This PR is deployed to https://registrar-beta.stacks.co/index/ ! |
Thanks @CharlieC3 I couldn't try it for now as it looks like the cli function is not working properly hirosystems/stacks.js#1226 (comment) |
Thanks @CharlieC3 for hosting the new instance. 🙏 @asimm241 is the subdomain data only stored in the database or is a hash/tx sent to the blockchain for each username? I ask because the registrar and registrar-beta are not "in-sync", e.g.
In other words: is this something that will sync at some point / somehow (because, for example, we only poll from the chain every so often), or is this service so off-chain that the two registrar instances will always have separate databases/states? If the latter holds true, is it possible to clone the prod data from registrar to registrar-beta? @CharlieC3 |
@janniks the two deployments are using separate databases, and my understanding is that the registrar DB gets written to by a processor behind btc.us (correct me if I'm wrong). Since the processor is not pointing to registrar-beta, it will not change state after initial boot. If you need this re-synced, can we coordinate on a day/time you're available to use it soon after it's complete to conduct your testing? |
Got it. 🙏 I tried a few different things now, and replayed some sniffed traffic locally to generate some data on beta — this should be enough for a test-case. Will let you know if we need more 😉 |
During testing for hirosystems/stacks.js#1226 I came across this issue: To reproduce we can use the alpha CLI build: npm install @stacks/[email protected] -g
stx migrate_subdomains "parrot guitar tomorrow old burst grant champion require orbit slush cycle chimney" https://registrar-beta.stacks.co This command generates the following op: Subdomain Operation Payload = {
subdomains_list: [
{
subdomainName: 'migration_test_02',
owner: 'SP1JCBTBSVHSGEFJ6T08567DTRVDSD7CHC6YRHRPD',
zonefile: '$ORIGIN migration_test_02.id.stx\n' +
'$TTL 3600\n' +
'_http._tcp\tIN\tURI\t10\t1\t"https://gaia.blockstack.org/hub/19cBN1PUh9bZay5HV1HAzvU8Ehg9CfosRu/profile.json"\n' +
'\n',
sequenceNumber: 1,
signature: '007608f0ba332b477ab8e1de1250d75a33c30c0940319af3e534d141b6ada88a1204389cd630167488bbe8b5884409b0ac2905fe1ae4114c202a3655a6bf4f8e20'
}
]
} ...and fails (I believe on this line) with:
@asimm241 Can you check the cause for this? |
@janniks how did you create signature? |
|
I finally found the discrepancy. Both the CLI and the registrar use a method The CLI has an additional first line including only the subdomain name. I'm not sure why this was added, but I'm assuming the CLI is incorrect, as it was never merged and is only added in the current feature branch. @kantai can you confirm? I'll go ahead and stick with the registrar implementation for the next tests. |
Also pushed a tiny fix in f577b6b. @CharlieC3 what's the process for deploying this branch to registrar-beta? |
@janniks The branch is already deployed, to run the latest image the pod just needs to be killed so it can be pulled down again. It should be running now! |
Perfect thanks 🙏🏻 |
src/server.js
Outdated
} | ||
let address = '' | ||
|
||
if (this.regtest) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we'll leave regtest
since it isn't used. But this check seems incorrect. I'll move to comparing with the set network in ENV variablesbskConfig
Ah yes, that's what I meant. Can I get a kill+redeploy? Also, are the ENV settings otherwise the same as on prod? |
@janniks Done |
bc944e9
to
498905d
Compare
omg, it works! i almost can't believe it 🎉
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- added some fixes
- added a very basic test that triggers validation and storage
@kantai i left the commits as history (we can rebase or sqaush-merge later), so it's more clear what behavior i changed — since i can't completely tell what the state should look like during/after a transfer... should be reviewable as a whole, but if unsure you can also check out the individual changes, in-case i removed something important.
there is still some weird naming/structure from the original change, but i can't prioritize this too much atm, so i'm for keeping the technical debt. (if we want to focus on removing debt, we should start by moving to typescript)
Awesome thanks, will take a look! I missed that one 🙏🏻 |
@kantai Awaiting your review, can you take a peek please? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM
Looks good — I did a final test and am happy 👍 CC @stacks-network/devops — Anybody feel free to merge |
Hey there, is anyone able to merge this one? :) @CharlieC3 |
# [1.2.0](v1.1.3...v1.2.0) (2022-08-02) ### Features * transfer existing subdomains to new addresses ([#88](#88)) ([0bf15a6](0bf15a6))
🎉 This PR is included in version 1.2.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
@pradel Deployed to both mainnet and testnet! |
Use the following template to create your pull request
This PR implements a new endpoint
/transfer
that enables users to transfer subdomains to the new addresses.For further details #79 , hirosystems/stacks.js#1209
Type of Change
Does this introduce a breaking change?
No, it should not
Testing information
unit tests are yet to be added
Checklist
npm run test
passes