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

Add router management #60

Closed
wants to merge 5 commits into from
Closed

Add router management #60

wants to merge 5 commits into from

Conversation

BriungRi
Copy link
Contributor

@BriungRi BriungRi commented Aug 9, 2023

Depends on #57

@BriungRi BriungRi marked this pull request as ready for review August 9, 2023 01:51
@BriungRi BriungRi changed the base branch from bl/router to bl/rew August 9, 2023 19:08
const ENO_PENDING_ADMIN: u64 = 1;
/// Caller is not the pending admin
const ENOT_PENDING_ADMIN: u64 = 2;
/// Provided mode is not supported
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: two spaces :P

Comment on lines 146 to 157
public entry fun set_subdomain_expiration_policy(
_user: &signer,
_domain_name: String,
_subdomain_name: String,
) {}

public entry fun set_subdomain_expiration(
_user: &signer,
_subdomain_name: String,
_domain_name: String,
) {}

Copy link
Contributor

Choose a reason for hiding this comment

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

should this be under domain admin section?

Copy link
Contributor Author

@BriungRi BriungRi Aug 11, 2023

Choose a reason for hiding this comment

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

Good catch, I will move these in a different PR

@BriungRi BriungRi closed this Aug 11, 2023
BriungRi added a commit that referenced this pull request Aug 11, 2023
BriungRi added a commit that referenced this pull request Aug 11, 2023
BriungRi added a commit that referenced this pull request Oct 3, 2023
* making target address optioonal and adding test for non domain owner tranfer

* set subdomain renew policy

* adding asserts and rename

* switch the order of two policies

* use default policy

* Add router skeleton (#57)

* Add router skeleton

* Add transfer_name

* rename name_address to target_address

* fix unit test

* rename some variables

* Remove v1 dependency from core_v2 (#66)

* Add router skeleton

* Add transfer_name

* Add router management

* Fewer modes s + better tests

* Update dependency for v1 to point to `main`

* Remove dependency of v1 from core_v2

* adding invalid subdomain string unit test

* remove_unused_errors

* adding force funciton

* set expiration for names

* Add registration, migration, and other functions for router (#67)

* Add router skeleton

* Add transfer_name

* Add router management

* Fewer modes s + better tests

* Update dependency for v1 to point to `main`

* Remove dependency of v1 from core_v2

* Add registration, migration, and other functions for router

* Remove `entry` from core_v2 registration

* Address comments from #60 (#76)

* Add primary name functionality to router (#68)

* Add router skeleton

* Add transfer_name

* Add router management

* Fewer modes s + better tests

* Update dependency for v1 to point to `main`

* Remove dependency of v1 from core_v2

* Add registration, migration, and other functions for router

* Add primary name functionality to router

* Add stubs for domain_admin functions (#69)

* Add router skeleton

* Add transfer_name

* Add router management

* Fewer modes s + better tests

* Update dependency for v1 to point to `main`

* Remove dependency of v1 from core_v2

* Add registration, migration, and other functions for router

* Add primary name functionality to router

* Add stubs for domain_admin functions

* Allow target_addr and to_addr in registration (#78)

* Allow target_addr and to_addr in registration

* Address comments

* Add bulk_migrate directory + script (#77)

* Add bulk_migrate directory + script

* Fix names

* fix domain subdomain order (#72)

* Fix register_subdomain interface and add missing domain_admin_* (#82)

to fns

* add enable and disable subdomain owner transfer

* fix unit test

* add test for enable / disable owner transfer

* simplify

* fix rebase

* fix unit test

* nit

* Implement domain_admin_transfer_subdomain in router (#81)

* merge subdomain owner transfer

* Fix test

* Implement domain renewal in router (#79)

* Implement domain renewal in router

* Fix

* Remove entry from renew_domain

* fix unit test

* wip

* remove_register_with_sig

* wip

* Revert "wip"

This reverts commit 3bd18c6.

* wip

* wip

* fixeddddd

* remove debug log

* format

* Implement get + set expiration policy in router (#85)

* Implement domain_admin_set_subdomain_expiration (#86)

* Implement get + set expiration policy in router

* Rename set_subdomain_renewal_policy =>
set_subdomain_expiration_policy

* Rename sign as domain_admin

* Implement domain_admin_set_subdomain_expiration

* address comment to improve readbility

* Add reregistration_grace_sec to core_v1 (#89)

* Add reregistration_grace_sec to core_v1

* Apply reregistration to domain only

* Add #[view] to reregistration_grace_sec()

* Update subdomain expiration migration logic (#90)

* Remove usages of v1 in core_v2 (#87)

* [ans] add clear target addr func to router

* [ans] rename functions

* [ans] use prefix test_ to all tests

* [ans] remove unused

* [ans] domain/subdomain order

* [ans] more rename

* [ans] remove unused layer of function

* [ans] more reorder

* [ans] more reorder domain/subdomain

* Merge pull request #101 from aptos-labs/angie/order-22

[ans] more reorder domain/subdomain

* wip

* [ans] set primary name in router

* wip

* auto migrate for set and clear target address

* remove debug

* remove wip code for auto migrate when primary name change

* nit

* nit

* do not make inline func public

* fix test and use better error code

* address comment

* check owner after auto migration

* throw error when set not exist name as primary name

* auto migrate domain when during set primary name

* nit

* Use expiration_policy in router::register_subdomain (#108)

* Use expiration_policy in router::register_subdomain

* Better comment message for test

* move common code to helper

* Keep subdomain expiration during migration (#109)

* Update reverse lookup events to emit prev_* (#91)

* Update reverse lookup events to emit prev_*

Also, for clearing reverse lookups, set next_* to option::none()

* Simplify clear_reverse_lookup_internal

* Address feedback

* More docs

* Add comment

* wip

* auto migrate previous primary name when it's domain

* fix typo

* Clear the v1 primary name during migration if the migrated name was the primary name (#110)

* simplify

* auto migrate name when renew domain

* delete transfer name entry function

* nit

* fix test

* nit

* [ans] remove the set primary name after register name

* Rename core_v2 contracts (#115)

* Rename core_v2 contracts

* Debug

* Use ./aptos

* Remove debug

* Add support for force_set_exp (#116)

* Add support for force_set_exp

* One more test

* Fix reregistration_gap_sec (#118)

* add reregistration grace period to v2

* refactor

* fix

* remove burn signer in v2

* Add functionality to clear v1 registration (#122)

* Add functionality to clear v1 registration

* Extra assertions for router migration

* Address comment

* Clear updates (#123)

* Revert "Add functionality to clear v1 registration (#122)"

This reverts commit 124ad36.

* Clear updates

 - Delete clear_registration
 - Add test for repeated registration/clear
 - Clear registration upon migration and registration

* Clear primary name in force_clear_registration

* Update get_v1_target_addr

* add bulk migrate endpoint to router

* nit

* fix test

* move bulk migrate to its own package

* optimize

* add publish script

* use placeholder

* nit

* add deployment instruction to readme

* derived expiration date

* Checkout core from main

* make migrate subdomain before domain error clear

* nit

* add new error for migrate twice

* Add bulk_migrate_domain and bulk_migrate subdomain (#128)

* deprecate is_owner_of_name in v1

* fix

* update router

* fix

* nit

* keep is_owner_of_name check in test

* nit

* fix

* fix

* nit

* remove unused

* Reset subdomains on domain re-registration (#130)

- Add `registration_time_sec` that gets assigned to current time during registration
 - Add `is_subdomain_registered_before_domain`. This gets used when checking if a name has expired. `is_name_registerable` relies on `is_name_expired` so this also gets accounted for
 - Add test to ensure subdomains can be re-registered if the domain gets re-registered

* wip

* refactor is_owner_of_name in v2

* nit

* remove query helper

* support renew or migrate in grace period

* make v1 read only except for admin

* [ans] expiry check

* add view decorator to name price

* fix test

* Add bulk/ project for bulk migrate and bulk renew (#131)

* Add bulk/ project for bulk migrate and bulk renew

* Update test

* Add renew test

* Add bulk_migrate_and_renew_domain

* Delete bulk_migrate

* Fix

* Fix test and add more migrations

* Update move_publish.sh

* Remove unncessary type (#137)

* Set subdomain_ext with if/else (#138)

* Move router tests to own directory (#140)

* Remove wrong const comment about SECONDS_PER_YEAR (#143)

* Move SubdomainExt to be its own resource in the object (#139)

* Use proper error codes for get_fully_qualified_domain_name (#141)

* Remove unnecessary copy in combin_sub_and_domain_str (#142)

* [ans] split get_name_props

* Delete scale_price_for_years in v2_price_model (#145)

* Delete v2_time_helper (#146)

* Delete v2_time_helper

* Update v2_test_helper.move

* Change visibility of fn in v2_token_helper to friend only (#147)

* Rename v2_utf8_utils and change visibility to friend (#148)

* remove unused config

* fix

* use max seconds instead of years

* nit

* nit

* wip

* save

* nit

* fix test

* remove unused config key

* [ans] adding readme

* save

* fix

* Rename framework => deployer in v2_config (#156)

* Inline `has_primary_name` (#158)

* Add migration expiration logic doc (#160)

* Inline renew_domain_internal (#161)

* Return &signer from `get_router_signer` (#162)

* Update router/sources/readme.md

* Remove extraneous check in `can_register_in_v2` (#159)

* Remove extraneous check in `can_register_in_v2`

* Use grace for `can_register_in_v2`

* merge latest

* Document public entry functions in the router (#157)

* Document public entry functions in the router

* Address comments

* Simplify pending admin

* Remove unnecessary inline designation

* Simplify some logic

* Revert struct layout changes

* Use object for ANS v2 contract management (#149)

* Use object for ANS v2 contract management

* Use a contract specific ObjectGroup

* Store `App` at the object addr

* Address Kevin comments

* Set max_number_of_years to 2

* fix test

* save

* save

* fix merge conflict

* rename in script

* nit

* set target address to sender by default

* fix test

* nit

* nit

* Update config (#170)

* check primary name is always cleared in v1 after set in v2

* Add disabled to UT (#172)

* Add disabled to UT

* Reproduce

* Fix failing test

* Kill line

* Revert some

* Fix comment

* Change primary name only during explicit action (#173)

* Add disabled to UT

* Reproduce

* Revert some

* Fix comment

* Change primary name only during explicit action

* Add comment

* Fix rebase

* make is registerable view

* nit

---------

Co-authored-by: angieyth <[email protected]>
Co-authored-by: Angie Huang <[email protected]>
Co-authored-by: 0xaptosj <[email protected]>
Co-authored-by: David Wolinsky <[email protected]>
Co-authored-by: Kevin <[email protected]>
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