From 73dfabfbe60a2f411300ae1e2688843c10237fe5 Mon Sep 17 00:00:00 2001 From: Thoralf-M <46689931+Thoralf-M@users.noreply.github.com> Date: Mon, 26 Aug 2024 11:06:27 +0200 Subject: [PATCH] feat!(crates): remove iota name service (#1722) * feat!(crates): remove iota name service * Update openrpc.json * Add #[cfg(test)] for method that's only used in tests * Update snapshot_tests__schema_sdl_export.snap * Update snapshot_tests__populated_genesis_snapshot_matches-2.snap * Remove object_connection * Make error enums #[non_exhaustive]; restore object_connection.graphql --- crates/iota-config/src/node.rs | 11 +- crates/iota-graphql-rpc/docs/examples.md | 205 +++--- .../name_service/name_service.graphql | 18 - .../object_connection.graphql | 2 +- .../schema/current_progress_schema.graphql | 265 -------- .../schema/draft_target_schema.graphql | 35 - crates/iota-graphql-rpc/src/config.rs | 7 +- crates/iota-graphql-rpc/src/error.rs | 7 +- .../iota-graphql-rpc/src/functional_group.rs | 11 - crates/iota-graphql-rpc/src/server/builder.rs | 2 - crates/iota-graphql-rpc/src/types/address.rs | 26 - .../iota-graphql-rpc/src/types/checkpoint.rs | 18 - crates/iota-graphql-rpc/src/types/coin.rs | 28 - .../src/types/coin_metadata.rs | 28 - .../src/types/iota_address.rs | 1 + .../src/types/iotans_registration.rs | 638 ------------------ crates/iota-graphql-rpc/src/types/mod.rs | 1 - .../iota-graphql-rpc/src/types/move_object.rs | 48 -- .../src/types/move_package.rs | 31 - crates/iota-graphql-rpc/src/types/object.rs | 27 - crates/iota-graphql-rpc/src/types/owner.rs | 95 +-- crates/iota-graphql-rpc/src/types/query.rs | 20 - crates/iota-graphql-rpc/src/types/stake.rs | 28 - .../snapshot_tests__schema_sdl_export.snap | 265 -------- crates/iota-indexer/src/apis/indexer_api.rs | 76 +-- crates/iota-indexer/src/errors.rs | 5 +- crates/iota-json-rpc-api/src/indexer.rs | 23 +- .../tests/name_service_tests.rs | 115 ---- crates/iota-json-rpc/src/error.rs | 25 +- crates/iota-json-rpc/src/indexer_api.rs | 148 +--- crates/iota-json-rpc/src/lib.rs | 1 - crates/iota-json-rpc/src/name_service.rs | 400 ----------- crates/iota-node/src/lib.rs | 16 - crates/iota-open-rpc/spec/openrpc.json | 162 +---- crates/iota-open-rpc/src/examples.rs | 41 +- .../src/node_config_builder.rs | 6 - ..._populated_genesis_snapshot_matches-2.snap | 28 +- .../src/queries/nameService.graphql | 23 - 38 files changed, 128 insertions(+), 2758 deletions(-) delete mode 100644 crates/iota-graphql-rpc/examples/name_service/name_service.graphql delete mode 100644 crates/iota-graphql-rpc/src/types/iotans_registration.rs delete mode 100644 crates/iota-json-rpc-tests/tests/name_service_tests.rs delete mode 100644 crates/iota-json-rpc/src/name_service.rs delete mode 100644 sdk/graphql-transport/src/queries/nameService.graphql diff --git a/crates/iota-config/src/node.rs b/crates/iota-config/src/node.rs index a191afe94f4..058fb51baee 100644 --- a/crates/iota-config/src/node.rs +++ b/crates/iota-config/src/node.rs @@ -15,7 +15,7 @@ use anyhow::Result; use iota_keys::keypair_file::{read_authority_keypair_from_file, read_keypair_from_file}; use iota_protocol_config::{Chain, SupportedProtocolVersions}; use iota_types::{ - base_types::{IotaAddress, ObjectID}, + base_types::IotaAddress, committee::EpochId, crypto::{ get_key_pair_from_rng, AccountKeyPair, AuthorityKeyPair, AuthorityPublicKeyBytes, @@ -127,15 +127,6 @@ pub struct NodeConfig { #[serde(default)] pub expensive_safety_check_config: ExpensiveSafetyCheckConfig, - #[serde(skip_serializing_if = "Option::is_none")] - pub name_service_package_address: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub name_service_registry_id: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub name_service_reverse_registry_id: Option, - #[serde(default)] pub transaction_deny_config: TransactionDenyConfig, diff --git a/crates/iota-graphql-rpc/docs/examples.md b/crates/iota-graphql-rpc/docs/examples.md index 1ba129a1ee2..8e40b75ead8 100644 --- a/crates/iota-graphql-rpc/docs/examples.md +++ b/crates/iota-graphql-rpc/docs/examples.md @@ -34,48 +34,45 @@ ####   [Filter By Sender](#524282) ### [Iota System State Summary](#9) ####   [Iota System State Summary](#589815) -### [Name Service](#10) -####   [Name Service](#655350) -### [Object](#11) -####   [Object](#720885) -### [Object Connection](#12) -####   [Filter Object Ids](#786420) -####   [Filter On Generic Type](#786421) -####   [Filter On Type](#786422) -####   [Filter Owner](#786423) -####   [Object Connection](#786424) -### [Owner](#13) -####   [Dynamic Field](#851955) -####   [Dynamic Field Connection](#851956) -####   [Dynamic Object Field](#851957) -####   [Owner](#851958) -### [Protocol Configs](#14) -####   [Key Value](#917490) -####   [Key Value Feature Flag](#917491) -####   [Specific Config](#917492) -####   [Specific Feature Flag](#917493) -### [Service Config](#15) -####   [Service Config](#983025) -### [Stake Connection](#16) -####   [Stake Connection](#1048560) -### [Transaction Block](#17) -####   [Transaction Block](#1114095) -####   [Transaction Block Kind](#1114096) -### [Transaction Block Connection](#18) -####   [Before After Checkpoint](#1179630) -####   [Changed Object Filter](#1179631) -####   [Input Object Filter](#1179632) -####   [Input Object Sign Addr Filter](#1179633) -####   [Package Filter](#1179634) -####   [Package Module Filter](#1179635) -####   [Package Module Func Filter](#1179636) -####   [Recv Addr Filter](#1179637) -####   [Sign Addr Filter](#1179638) -####   [Tx Ids Filter](#1179639) -####   [Tx Kind Filter](#1179640) -####   [With Defaults Ascending](#1179641) -### [Transaction Block Effects](#19) -####   [Transaction Block Effects](#1245165) +### [Object](#10) +####   [Object](#655350) +### [Object Connection](#11) +####   [Filter Object Ids](#720885) +####   [Filter On Generic Type](#720886) +####   [Filter On Type](#720887) +####   [Filter Owner](#720888) +### [Owner](#12) +####   [Dynamic Field](#786420) +####   [Dynamic Field Connection](#786421) +####   [Dynamic Object Field](#786422) +####   [Owner](#786423) +### [Protocol Configs](#13) +####   [Key Value](#851955) +####   [Key Value Feature Flag](#851956) +####   [Specific Config](#851957) +####   [Specific Feature Flag](#851958) +### [Service Config](#14) +####   [Service Config](#917490) +### [Stake Connection](#15) +####   [Stake Connection](#983025) +### [Transaction Block](#16) +####   [Transaction Block](#1048560) +####   [Transaction Block Kind](#1048561) +### [Transaction Block Connection](#17) +####   [Before After Checkpoint](#1114095) +####   [Changed Object Filter](#1114096) +####   [Input Object Filter](#1114097) +####   [Input Object Sign Addr Filter](#1114098) +####   [Package Filter](#1114099) +####   [Package Module Filter](#1114100) +####   [Package Module Func Filter](#1114101) +####   [Recv Addr Filter](#1114102) +####   [Sign Addr Filter](#1114103) +####   [Tx Ids Filter](#1114104) +####   [Tx Kind Filter](#1114105) +####   [With Defaults Ascending](#1114106) +### [Transaction Block Effects](#18) +####   [Transaction Block Effects](#1179630) ## ## Address ### @@ -782,32 +779,8 @@ >} ## -## Name Service -### -### Name Service - ->
{
->  resolveIotansAddress(domain: "example.iota") {
->    address
->  }
->  address(
->    address: "0x0b86be5d779fac217b41d484b8040ad5145dc9ba0cba099d083c6cbda50d983e"
->  ) {
->    address
->    balance(type: "0x2::iota::IOTA") {
->      coinType {
->        repr
->      }
->      coinObjectCount
->      totalBalance
->    }
->    defaultIotansName
->  }
->}
- -## ## Object -### +### ### Object >
{
@@ -842,9 +815,9 @@
 >  }
 >}
-## +## ## Object Connection -### +### ### Filter Object Ids #### Filter on objectIds @@ -878,7 +851,7 @@ > } >} -### +### ### Filter On Generic Type >
{
@@ -895,7 +868,7 @@
 >  }
 >}
-### +### ### Filter On Type >
{
@@ -914,7 +887,7 @@
 >  }
 >}
-### +### ### Filter Owner #### Filter on owner @@ -948,33 +921,9 @@ > } >} -### -### Object Connection - ->
{
->  objects {
->    nodes {
->      version
->      digest
->      storageRebate
->      previousTransactionBlock {
->        digest
->        sender { defaultIotansName }
->        gasInput {
->          gasPrice
->          gasBudget
->        }
->      }
->    }
->    pageInfo {
->      endCursor
->    }
->  }
->}
- -## +## ## Owner -### +### ### Dynamic Field >
fragment DynamicFieldValueSelection on DynamicFieldValue {
@@ -1029,7 +978,7 @@
 >  }
 >}
-### +### ### Dynamic Field Connection >
fragment DynamicFieldValueSelection on DynamicFieldValue {
@@ -1086,7 +1035,7 @@
 >  }
 >}
-### +### ### Dynamic Object Field >
fragment DynamicFieldValueSelection on DynamicFieldValue {
@@ -1138,7 +1087,7 @@
 >  }
 >}
-### +### ### Owner >
{
@@ -1149,9 +1098,9 @@
 >  }
 >}
-## +## ## Protocol Configs -### +### ### Key Value #### Select the key and value of the protocol configuration @@ -1164,7 +1113,7 @@ > } >} -### +### ### Key Value Feature Flag #### Select the key and value of the feature flag @@ -1177,7 +1126,7 @@ > } >} -### +### ### Specific Config #### Select the key and value of the specific protocol configuration, in this case `max_move_identifier_len` @@ -1190,7 +1139,7 @@ > } >} -### +### ### Specific Feature Flag >
{
@@ -1202,9 +1151,9 @@
 >  }
 >}
-## +## ## Service Config -### +### ### Service Config #### Get the configuration of the running service @@ -1222,9 +1171,9 @@ > } >} -## +## ## Stake Connection -### +### ### Stake Connection #### Get all the staked objects for this address and all the active validators at the epoch when the stake became active @@ -1266,9 +1215,9 @@ > } >} -## +## ## Transaction Block -### +### ### Transaction Block #### Get the data for a TransactionBlock by its digest @@ -1303,7 +1252,7 @@ > } >} -### +### ### Transaction Block Kind >
{
@@ -1341,9 +1290,9 @@
 >  }
 >}
-## +## ## Transaction Block Connection -### +### ### Before After Checkpoint #### Filter on before_ and after_checkpoint. If both are provided, before must be greater than after @@ -1363,7 +1312,7 @@ > } >} -### +### ### Changed Object Filter #### Filter on changedObject @@ -1385,7 +1334,7 @@ > } >} -### +### ### Input Object Filter #### Filter on inputObject @@ -1407,7 +1356,7 @@ > } >} -### +### ### Input Object Sign Addr Filter #### multiple filters @@ -1437,7 +1386,7 @@ > } >} -### +### ### Package Filter #### Filtering on package @@ -1455,7 +1404,7 @@ > } >} -### +### ### Package Module Filter #### Filtering on package and module @@ -1477,7 +1426,7 @@ > } >} -### +### ### Package Module Func Filter #### Filtering on package, module and function @@ -1499,7 +1448,7 @@ > } >} -### +### ### Recv Addr Filter #### Filter on recvAddress @@ -1521,7 +1470,7 @@ > } >} -### +### ### Sign Addr Filter #### Filter on signing address @@ -1543,7 +1492,7 @@ > } >} -### +### ### Tx Ids Filter #### Filter on transactionIds @@ -1563,7 +1512,7 @@ > } >} -### +### ### Tx Kind Filter #### Filter on TransactionKind (only SYSTEM_TX or PROGRAMMABLE_TX) @@ -1581,7 +1530,7 @@ > } >} -### +### ### With Defaults Ascending #### Fetch some default amount of transactions, ascending @@ -1618,9 +1567,9 @@ > } >} -## +## ## Transaction Block Effects -### +### ### Transaction Block Effects >
{
diff --git a/crates/iota-graphql-rpc/examples/name_service/name_service.graphql b/crates/iota-graphql-rpc/examples/name_service/name_service.graphql
deleted file mode 100644
index e9ea2546931..00000000000
--- a/crates/iota-graphql-rpc/examples/name_service/name_service.graphql
+++ /dev/null
@@ -1,18 +0,0 @@
-{
-  resolveIotansAddress(domain: "example.iota") {
-    address
-  }
-  address(
-    address: "0x0b86be5d779fac217b41d484b8040ad5145dc9ba0cba099d083c6cbda50d983e"
-  ) {
-    address
-    balance(type: "0x2::iota::IOTA") {
-      coinType {
-        repr
-      }
-      coinObjectCount
-      totalBalance
-    }
-    defaultIotansName
-  }
-}
diff --git a/crates/iota-graphql-rpc/examples/object_connection/object_connection.graphql b/crates/iota-graphql-rpc/examples/object_connection/object_connection.graphql
index d7537077588..e967e858fb2 100644
--- a/crates/iota-graphql-rpc/examples/object_connection/object_connection.graphql
+++ b/crates/iota-graphql-rpc/examples/object_connection/object_connection.graphql
@@ -6,7 +6,7 @@
       storageRebate
       previousTransactionBlock {
         digest
-        sender { defaultIotansName }
+        sender { address }
         gasInput {
           gasPrice
           gasBudget
diff --git a/crates/iota-graphql-rpc/schema/current_progress_schema.graphql b/crates/iota-graphql-rpc/schema/current_progress_schema.graphql
index d8b738085b0..b9956a84c1c 100644
--- a/crates/iota-graphql-rpc/schema/current_progress_schema.graphql
+++ b/crates/iota-graphql-rpc/schema/current_progress_schema.graphql
@@ -90,16 +90,6 @@ type Address implements IOwner {
 	"""
 	stakedIotas(first: Int, after: String, last: Int, before: String): StakedIotaConnection!
 	"""
-	The domain explicitly configured as the default domain pointing to this
-	address.
-	"""
-	defaultIotansName(format: DomainFormat): String
-	"""
-	The IotansRegistration NFTs owned by this address. These grant the owner
-	the capability to manage the associated domain.
-	"""
-	iotansRegistrations(first: Int, after: String, last: Int, before: String): IotansRegistrationConnection!
-	"""
 	Similar behavior to the `transactionBlocks` in Query but supporting the
 	additional `AddressTransactionBlockRelationship` filter, which
 	defaults to `SIGN`.
@@ -490,16 +480,6 @@ type Coin implements IMoveObject & IObject & IOwner {
 	The `0x3::staking_pool::StakedIota` objects owned by this object.
 	"""
 	stakedIotas(first: Int, after: String, last: Int, before: String): StakedIotaConnection!
-	"""
-	The domain explicitly configured as the default domain pointing to this
-	object.
-	"""
-	defaultIotansName(format: DomainFormat): String
-	"""
-	The IotansRegistration NFTs owned by this object. These grant the owner
-	the capability to manage the associated domain.
-	"""
-	iotansRegistrations(first: Int, after: String, last: Int, before: String): IotansRegistrationConnection!
 	version: Int!
 	"""
 	The current status of the object as read from the off-chain store. The
@@ -657,16 +637,6 @@ type CoinMetadata implements IMoveObject & IObject & IOwner {
 	The `0x3::staking_pool::StakedIota` objects owned by this object.
 	"""
 	stakedIotas(first: Int, after: String, last: Int, before: String): StakedIotaConnection!
-	"""
-	The domain explicitly configured as the default domain pointing to this
-	object.
-	"""
-	defaultIotansName(format: DomainFormat): String
-	"""
-	The IotansRegistration NFTs owned by this object. These grant the owner
-	the capability to manage the associated domain.
-	"""
-	iotansRegistrations(first: Int, after: String, last: Int, before: String): IotansRegistrationConnection!
 	version: Int!
 	"""
 	The current status of the object as read from the off-chain store. The
@@ -855,11 +825,6 @@ type DisplayEntry {
 	error: String
 }
 
-enum DomainFormat {
-	AT
-	DOT
-}
-
 type DryRunEffect {
 	"""
 	Changes made to arguments that were mutably borrowed by each command in
@@ -1281,10 +1246,6 @@ enum Feature {
 	"""
 	DYNAMIC_FIELDS
 	"""
-	IotaNS name and reverse name look-up.
-	"""
-	NAME_SERVICE
-	"""
 	Transaction and Event subscriptions.
 	"""
 	SUBSCRIPTIONS
@@ -1485,14 +1446,6 @@ interface IOwner {
 	The `0x3::staking_pool::StakedIota` objects owned by this object or address.
 	"""
 	stakedIotas(first: Int, after: String, last: Int, before: String): StakedIotaConnection!
-	"""
-	The domain explicitly configured as the default domain pointing to this object or address.
-	"""
-	defaultIotansName(format: DomainFormat): String
-	"""
-	The IotansRegistration NFTs owned by this object or address. These grant the owner the capability to manage the associated domain.
-	"""
-	iotansRegistrations(first: Int, after: String, last: Int, before: String): IotansRegistrationConnection!
 }
 
 """
@@ -1520,163 +1473,6 @@ String containing 32B hex-encoded address, with a leading "0x". Leading zeroes c
 """
 scalar IotaAddress
 
-type IotansRegistration implements IMoveObject & IObject & IOwner {
-	address: IotaAddress!
-	"""
-	Objects owned by this object, optionally `filter`-ed.
-	"""
-	objects(first: Int, after: String, last: Int, before: String, filter: ObjectFilter): MoveObjectConnection!
-	"""
-	Total balance of all coins with marker type owned by this object. If
-	type is not supplied, it defaults to `0x2::iota::IOTA`.
-	"""
-	balance(type: String): Balance
-	"""
-	The balances of all coin types owned by this object.
-	"""
-	balances(first: Int, after: String, last: Int, before: String): BalanceConnection!
-	"""
-	The coin objects for this object.
-	
-	`type` is a filter on the coin's type parameter, defaulting to
-	`0x2::iota::IOTA`.
-	"""
-	coins(first: Int, after: String, last: Int, before: String, type: String): CoinConnection!
-	"""
-	The `0x3::staking_pool::StakedIota` objects owned by this object.
-	"""
-	stakedIotas(first: Int, after: String, last: Int, before: String): StakedIotaConnection!
-	"""
-	The domain explicitly configured as the default domain pointing to this
-	object.
-	"""
-	defaultIotansName(format: DomainFormat): String
-	"""
-	The IotansRegistration NFTs owned by this object. These grant the owner
-	the capability to manage the associated domain.
-	"""
-	iotansRegistrations(first: Int, after: String, last: Int, before: String): IotansRegistrationConnection!
-	version: Int!
-	"""
-	The current status of the object as read from the off-chain store. The
-	possible states are: NOT_INDEXED, the object is loaded from
-	serialized data, such as the contents of a genesis or system package
-	upgrade transaction. LIVE, the version returned is the most recent for
-	the object, and it is not deleted or wrapped at that version.
-	HISTORICAL, the object was referenced at a specific version or
-	checkpoint, so is fetched from historical tables and may not be the
-	latest version of the object. WRAPPED_OR_DELETED, the object is deleted
-	or wrapped and only partial information can be loaded."
-	"""
-	status: ObjectKind!
-	"""
-	32-byte hash that identifies the object's contents, encoded as a Base58
-	string.
-	"""
-	digest: String
-	"""
-	The owner type of this object: Immutable, Shared, Parent, Address
-	"""
-	owner: ObjectOwner
-	"""
-	The transaction block that created this version of the object.
-	"""
-	previousTransactionBlock: TransactionBlock
-	"""
-	The amount of IOTA we would rebate if this object gets deleted or
-	mutated. This number is recalculated based on the present storage
-	gas price.
-	"""
-	storageRebate: BigInt
-	"""
-	The transaction blocks that sent objects to this object.
-	"""
-	receivedTransactionBlocks(first: Int, after: String, last: Int, before: String, filter: TransactionBlockFilter): TransactionBlockConnection!
-	"""
-	The Base64-encoded BCS serialization of the object's content.
-	"""
-	bcs: Base64
-	"""
-	Displays the contents of the Move object in a JSON string and through
-	GraphQL types. Also provides the flat representation of the type
-	signature, and the BCS of the corresponding data.
-	"""
-	contents: MoveValue
-	"""
-	Determines whether a transaction can transfer this object, using the
-	TransferObjects transaction command or
-	`iota::transfer::public_transfer`, both of which require the object to
-	have the `key` and `store` abilities.
-	"""
-	hasPublicTransfer: Boolean!
-	"""
-	The set of named templates defined on-chain for the type of this object,
-	to be handled off-chain. The server substitutes data from the object
-	into these templates to generate a display string per template.
-	"""
-	display: [DisplayEntry!]
-	"""
-	Access a dynamic field on an object using its name. Names are arbitrary
-	Move values whose type have `copy`, `drop`, and `store`, and are
-	specified using their type, and their BCS contents, Base64 encoded.
-	
-	Dynamic fields on wrapped objects can be accessed by using the same API
-	under the Owner type.
-	"""
-	dynamicField(name: DynamicFieldName!): DynamicField
-	"""
-	Access a dynamic object field on an object using its name. Names are
-	arbitrary Move values whose type have `copy`, `drop`, and `store`,
-	and are specified using their type, and their BCS contents, Base64
-	encoded. The value of a dynamic object field can also be accessed
-	off-chain directly via its address (e.g. using `Query.object`).
-	
-	Dynamic fields on wrapped objects can be accessed by using the same API
-	under the Owner type.
-	"""
-	dynamicObjectField(name: DynamicFieldName!): DynamicField
-	"""
-	The dynamic fields and dynamic object fields on an object.
-	
-	Dynamic fields on wrapped objects can be accessed by using the same API
-	under the Owner type.
-	"""
-	dynamicFields(first: Int, after: String, last: Int, before: String): DynamicFieldConnection!
-	"""
-	Domain name of the IotansRegistration object
-	"""
-	domain: String!
-}
-
-type IotansRegistrationConnection {
-	"""
-	Information to aid in pagination.
-	"""
-	pageInfo: PageInfo!
-	"""
-	A list of edges.
-	"""
-	edges: [IotansRegistrationEdge!]!
-	"""
-	A list of nodes.
-	"""
-	nodes: [IotansRegistration!]!
-}
-
-"""
-An edge in a connection.
-"""
-type IotansRegistrationEdge {
-	"""
-	The item at the end of the edge
-	"""
-	node: IotansRegistration!
-	"""
-	A cursor for use in pagination
-	"""
-	cursor: String!
-}
-
 """
 Arbitrary JSON data.
 """
@@ -1989,16 +1785,6 @@ type MoveObject implements IMoveObject & IObject & IOwner {
 	The `0x3::staking_pool::StakedIota` objects owned by this object.
 	"""
 	stakedIotas(first: Int, after: String, last: Int, before: String): StakedIotaConnection!
-	"""
-	The domain explicitly configured as the default domain pointing to this
-	object.
-	"""
-	defaultIotansName(format: DomainFormat): String
-	"""
-	The IotansRegistration NFTs owned by this object. These grant the owner
-	the capability to manage the associated domain.
-	"""
-	iotansRegistrations(first: Int, after: String, last: Int, before: String): IotansRegistrationConnection!
 	version: Int!
 	"""
 	The current status of the object as read from the off-chain store. The
@@ -2098,10 +1884,6 @@ type MoveObject implements IMoveObject & IObject & IOwner {
 	Attempts to convert the Move object into a `0x2::coin::CoinMetadata`.
 	"""
 	asCoinMetadata: CoinMetadata
-	"""
-	Attempts to convert the Move object into a `IotansRegistration` object.
-	"""
-	asIotansRegistration: IotansRegistration
 }
 
 type MoveObjectConnection {
@@ -2179,19 +1961,6 @@ type MovePackage implements IObject & IOwner {
 	are immutable and cannot be owned by an address.
 	"""
 	stakedIotas(first: Int, after: String, last: Int, before: String): StakedIotaConnection!
-	"""
-	The domain explicitly configured as the default domain pointing to this
-	object.
-	"""
-	defaultIotansName(format: DomainFormat): String
-	"""
-	The IotansRegistration NFTs owned by this package. These grant the owner
-	the capability to manage the associated domain.
-	
-	Note that objects owned by a package are inaccessible, because packages
-	are immutable and cannot be owned by an address.
-	"""
-	iotansRegistrations(first: Int, after: String, last: Int, before: String): IotansRegistrationConnection!
 	version: Int!
 	"""
 	The current status of the object as read from the off-chain store. The
@@ -2527,16 +2296,6 @@ type Object implements IObject & IOwner {
 	The `0x3::staking_pool::StakedIota` objects owned by this object.
 	"""
 	stakedIotas(first: Int, after: String, last: Int, before: String): StakedIotaConnection!
-	"""
-	The domain explicitly configured as the default domain pointing to this
-	object.
-	"""
-	defaultIotansName(format: DomainFormat): String
-	"""
-	The IotansRegistration NFTs owned by this object. These grant the owner
-	the capability to manage the associated domain.
-	"""
-	iotansRegistrations(first: Int, after: String, last: Int, before: String): IotansRegistrationConnection!
 	version: Int!
 	"""
 	The current status of the object as read from the off-chain store. The
@@ -2886,16 +2645,6 @@ type Owner implements IOwner {
 	address.
 	"""
 	stakedIotas(first: Int, after: String, last: Int, before: String): StakedIotaConnection!
-	"""
-	The domain explicitly configured as the default domain pointing to this
-	object or address.
-	"""
-	defaultIotansName(format: DomainFormat): String
-	"""
-	The IotansRegistration NFTs owned by this object or address. These grant
-	the owner the capability to manage the associated domain.
-	"""
-	iotansRegistrations(first: Int, after: String, last: Int, before: String): IotansRegistrationConnection!
 	asAddress: Address
 	asObject: Object
 	"""
@@ -3179,10 +2928,6 @@ type Query {
 	"""
 	protocolConfig(protocolVersion: Int): ProtocolConfigs!
 	"""
-	Resolves a IotaNS `domain` name to an address, if it has been bound.
-	"""
-	resolveIotansAddress(domain: String!): Address
-	"""
 	The coin metadata associated with the given coin type.
 	"""
 	coinMetadata(coinType: String!): CoinMetadata
@@ -3507,16 +3252,6 @@ type StakedIota implements IMoveObject & IObject & IOwner {
 	The `0x3::staking_pool::StakedIota` objects owned by this object.
 	"""
 	stakedIotas(first: Int, after: String, last: Int, before: String): StakedIotaConnection!
-	"""
-	The domain explicitly configured as the default domain pointing to this
-	object.
-	"""
-	defaultIotansName(format: DomainFormat): String
-	"""
-	The IotansRegistration NFTs owned by this object. These grant the owner
-	the capability to manage the associated domain.
-	"""
-	iotansRegistrations(first: Int, after: String, last: Int, before: String): IotansRegistrationConnection!
 	version: Int!
 	"""
 	The current status of the object as read from the off-chain store. The
diff --git a/crates/iota-graphql-rpc/schema/draft_target_schema.graphql b/crates/iota-graphql-rpc/schema/draft_target_schema.graphql
index dab8ef54ca6..202260f0109 100644
--- a/crates/iota-graphql-rpc/schema/draft_target_schema.graphql
+++ b/crates/iota-graphql-rpc/schema/draft_target_schema.graphql
@@ -116,8 +116,6 @@ type Query {
     filter: ObjectFilter,
   ): ObjectConnection!
 
-  resolveIotansAddress(name: String!): Address
-
   # NB. Will be moved into a private, explorer-specific extension.
   networkMetrics: NetworkMetrics
   moveCallMetrics: MoveCallMetrics
@@ -433,7 +431,6 @@ enum Feature {
   ANALYTICS
   COINS
   DYNAMIC_FIELDS
-  NAME_SERVICE
   SUBSCRIPTIONS
   SYSTEM_STATE
 }
@@ -484,14 +481,6 @@ interface IOwner {
     # Enhancement (post-MVP) to filter dynamic fields by type.
     filter: DynamicFieldFilter,
   ): DynamicFieldConnection!
-
-  defaultIotansName: String
-  iotansRegistrations(
-    first: Int,
-    after: String,
-    last: Int,
-    before: String,
-  ): IotansRegistrationConnection!
 }
 
 union ObjectOwner = Immutable | Shared | Parent | AddressOwner
@@ -1110,7 +1099,6 @@ type MoveObject implements IOwner & IObject & IMoveObject {
   asCoin: Coin
   asStakedIota: StakedIota
   asCoinMetadata: CoinMetadata
-  asIotansRegistration: IotansRegistration
 }
 
 type MovePackage implements IOwner & IObject {
@@ -1517,29 +1505,6 @@ type MoveModuleEdge {
   node: MoveModule!
 }
 
-# IotansRegistrationConnection
-type IotansRegistrationConnection {
-  edges: [IotansRegistrationEdge!]!
-  nodes: [IotansRegistration!]!
-  pageInfo: PageInfo!
-}
-
-type IotansRegistrationEdge {
-  cursor: String
-  node: IotansRegistration
-}
-
-type IotansRegistration {
-	"""
-	Domain name of the IotansRegistration object
-	"""
-	domain: String!
-	"""
-	Convert the IotansRegistration object into a Move object
-	"""
-	asMoveObject: MoveObject!
-}
-
 # AddressMetricsConnection
 type AddressMetricsConnection {
   edges: [AddressMetricEdge!]!
diff --git a/crates/iota-graphql-rpc/src/config.rs b/crates/iota-graphql-rpc/src/config.rs
index e6e6ed7a889..c06fb0341ad 100644
--- a/crates/iota-graphql-rpc/src/config.rs
+++ b/crates/iota-graphql-rpc/src/config.rs
@@ -6,7 +6,6 @@ use std::{collections::BTreeSet, fmt::Display, time::Duration};
 
 use async_graphql::*;
 use fastcrypto_zkp::bn254::zk_login_api::ZkLoginEnv;
-use iota_json_rpc::name_service::NameServiceConfig;
 use serde::{Deserialize, Serialize};
 
 use crate::{functional_group::FunctionalGroup, types::big_int::BigInt};
@@ -93,9 +92,6 @@ pub struct ServiceConfig {
     #[serde(default)]
     pub(crate) experiments: Experiments,
 
-    #[serde(default)]
-    pub(crate) name_service: NameServiceConfig,
-
     #[serde(default)]
     pub(crate) background_tasks: BackgroundTasksConfig,
 
@@ -557,7 +553,6 @@ mod tests {
         let actual = ServiceConfig::read(
             r#" disabled-features = [
                   "coins",
-                  "name-service",
                 ]
             "#,
         )
@@ -565,7 +560,7 @@ mod tests {
 
         use FunctionalGroup as G;
         let expect = ServiceConfig {
-            disabled_features: BTreeSet::from([G::Coins, G::NameService]),
+            disabled_features: BTreeSet::from([G::Coins]),
             ..Default::default()
         };
 
diff --git a/crates/iota-graphql-rpc/src/error.rs b/crates/iota-graphql-rpc/src/error.rs
index a281f85e3c3..707d3b60795 100644
--- a/crates/iota-graphql-rpc/src/error.rs
+++ b/crates/iota-graphql-rpc/src/error.rs
@@ -5,7 +5,6 @@
 use async_graphql::{ErrorExtensionValues, ErrorExtensions, Pos, Response, ServerError};
 use async_graphql_axum::GraphQLResponse;
 use iota_indexer::errors::IndexerError;
-use iota_json_rpc::name_service::NameServiceError;
 
 /// Error codes for the `extensions.code` field of a GraphQL error that
 /// originates from outside GraphQL.
@@ -65,11 +64,10 @@ pub(crate) fn graphql_error_at_pos(
 }
 
 #[derive(Clone, Debug, thiserror::Error)]
+#[non_exhaustive]
 pub enum Error {
     #[error("Unsupported protocol version requested. Min supported: {0}, max supported: {1}")]
     ProtocolVersionUnsupported(u64, u64),
-    #[error(transparent)]
-    NameService(#[from] NameServiceError),
     #[error("'first' and 'last' must not be used together")]
     CursorNoFirstLast,
     #[error("Connection's page size of {0} exceeds max of {1}")]
@@ -84,8 +82,7 @@ pub enum Error {
 impl ErrorExtensions for Error {
     fn extend(&self) -> async_graphql::Error {
         async_graphql::Error::new(format!("{}", self)).extend_with(|_err, e| match self {
-            Error::NameService(_)
-            | Error::CursorNoFirstLast
+            Error::CursorNoFirstLast
             | Error::PageTooLarge(_, _)
             | Error::ProtocolVersionUnsupported(_, _)
             | Error::Client(_) => {
diff --git a/crates/iota-graphql-rpc/src/functional_group.rs b/crates/iota-graphql-rpc/src/functional_group.rs
index 5d25f5a5b0a..90852ec0602 100644
--- a/crates/iota-graphql-rpc/src/functional_group.rs
+++ b/crates/iota-graphql-rpc/src/functional_group.rs
@@ -25,9 +25,6 @@ pub(crate) enum FunctionalGroup {
     /// Querying an object's dynamic fields.
     DynamicFields,
 
-    /// IotaNS name and reverse name look-up.
-    NameService,
-
     /// Transaction and Event subscriptions.
     Subscriptions,
 
@@ -51,7 +48,6 @@ impl FunctionalGroup {
             G::Analytics,
             G::Coins,
             G::DynamicFields,
-            G::NameService,
             G::Subscriptions,
             G::SystemState,
         ];
@@ -73,8 +69,6 @@ fn functional_groups() -> &'static BTreeMap<(&'static str, &'static str), Functi
             (("Address", "balance"), G::Coins),
             (("Address", "balances"), G::Coins),
             (("Address", "coins"), G::Coins),
-            (("Address", "defaultIotansName"), G::NameService),
-            (("Address", "iotansRegistrations"), G::NameService),
             (("Checkpoint", "addressMetrics"), G::Analytics),
             (("Checkpoint", "networkTotalTransactions"), G::Analytics),
             (("Epoch", "protocolConfigs"), G::SystemState),
@@ -83,24 +77,19 @@ fn functional_groups() -> &'static BTreeMap<(&'static str, &'static str), Functi
             (("Object", "balance"), G::Coins),
             (("Object", "balances"), G::Coins),
             (("Object", "coins"), G::Coins),
-            (("Object", "defaultIotansName"), G::NameService),
             (("Object", "dynamicField"), G::DynamicFields),
             (("Object", "dynamicObjectField"), G::DynamicFields),
             (("Object", "dynamicFields"), G::DynamicFields),
-            (("Object", "iotansRegistrations"), G::NameService),
             (("Owner", "balance"), G::Coins),
             (("Owner", "balances"), G::Coins),
             (("Owner", "coins"), G::Coins),
-            (("Owner", "defaultIotansName"), G::NameService),
             (("Owner", "dynamicField"), G::DynamicFields),
             (("Owner", "dynamicObjectField"), G::DynamicFields),
             (("Owner", "dynamicFields"), G::DynamicFields),
-            (("Owner", "iotansRegistrations"), G::NameService),
             (("Query", "coinMetadata"), G::Coins),
             (("Query", "moveCallMetrics"), G::Analytics),
             (("Query", "networkMetrics"), G::Analytics),
             (("Query", "protocolConfig"), G::SystemState),
-            (("Query", "resolveIotansAddress"), G::NameService),
             (("Subscription", "events"), G::Subscriptions),
             (("Subscription", "transactions"), G::Subscriptions),
             (("SystemStateSummary", "safeMode"), G::SystemState),
diff --git a/crates/iota-graphql-rpc/src/server/builder.rs b/crates/iota-graphql-rpc/src/server/builder.rs
index b33e39fcff6..a21b0a277bf 100644
--- a/crates/iota-graphql-rpc/src/server/builder.rs
+++ b/crates/iota-graphql-rpc/src/server/builder.rs
@@ -380,7 +380,6 @@ impl ServerBuilder {
         );
         let mut builder = ServerBuilder::new(state);
 
-        let name_service_config = config.service.name_service.clone();
         let zklogin_config = config.service.zklogin.clone();
         let reader = PgManager::reader_with_config(
             config.connection.db_url.clone(),
@@ -427,7 +426,6 @@ impl ServerBuilder {
                 config.service.limits.package_resolver_limits(),
             ))
             .context_data(iota_sdk_client)
-            .context_data(name_service_config)
             .context_data(zklogin_config)
             .context_data(metrics.clone())
             .context_data(config.clone());
diff --git a/crates/iota-graphql-rpc/src/types/address.rs b/crates/iota-graphql-rpc/src/types/address.rs
index 4dda5827987..c790f24b89f 100644
--- a/crates/iota-graphql-rpc/src/types/address.rs
+++ b/crates/iota-graphql-rpc/src/types/address.rs
@@ -9,7 +9,6 @@ use super::{
     coin::Coin,
     cursor::Page,
     iota_address::IotaAddress,
-    iotans_registration::{DomainFormat, IotansRegistration},
     move_object::MoveObject,
     object::{self, ObjectFilter},
     owner::OwnerImpl,
@@ -115,31 +114,6 @@ impl Address {
             .await
     }
 
-    /// The domain explicitly configured as the default domain pointing to this
-    /// address.
-    pub(crate) async fn default_iotans_name(
-        &self,
-        ctx: &Context<'_>,
-        format: Option,
-    ) -> Result> {
-        OwnerImpl::from(self).default_iotans_name(ctx, format).await
-    }
-
-    /// The IotansRegistration NFTs owned by this address. These grant the owner
-    /// the capability to manage the associated domain.
-    pub(crate) async fn iotans_registrations(
-        &self,
-        ctx: &Context<'_>,
-        first: Option,
-        after: Option,
-        last: Option,
-        before: Option,
-    ) -> Result> {
-        OwnerImpl::from(self)
-            .iotans_registrations(ctx, first, after, last, before)
-            .await
-    }
-
     /// Similar behavior to the `transactionBlocks` in Query but supporting the
     /// additional `AddressTransactionBlockRelationship` filter, which
     /// defaults to `SIGN`.
diff --git a/crates/iota-graphql-rpc/src/types/checkpoint.rs b/crates/iota-graphql-rpc/src/types/checkpoint.rs
index 7bf2e2d8dd6..ed2124669b4 100644
--- a/crates/iota-graphql-rpc/src/types/checkpoint.rs
+++ b/crates/iota-graphql-rpc/src/types/checkpoint.rs
@@ -288,24 +288,6 @@ impl Checkpoint {
         }))
     }
 
-    /// Look up a `Checkpoint` in the database and retrieve its `timestamp_ms`
-    /// field. This method takes a connection, so that it can be used within
-    /// a transaction.
-    pub(crate) fn query_timestamp(
-        conn: &mut Conn,
-        seq_num: u64,
-    ) -> Result {
-        use checkpoints::dsl;
-
-        let stored: i64 = conn.first(move || {
-            dsl::checkpoints
-                .select(dsl::timestamp_ms)
-                .filter(dsl::sequence_number.eq(seq_num as i64))
-        })?;
-
-        Ok(stored as u64)
-    }
-
     pub(crate) async fn query_latest_checkpoint_sequence_number(db: &Db) -> Result {
         db.execute(move |conn| Checkpoint::latest_checkpoint_sequence_number(conn))
             .await
diff --git a/crates/iota-graphql-rpc/src/types/coin.rs b/crates/iota-graphql-rpc/src/types/coin.rs
index ca966ce37c5..71fe97e8a96 100644
--- a/crates/iota-graphql-rpc/src/types/coin.rs
+++ b/crates/iota-graphql-rpc/src/types/coin.rs
@@ -17,7 +17,6 @@ use super::{
     display::DisplayEntry,
     dynamic_field::{DynamicField, DynamicFieldName},
     iota_address::IotaAddress,
-    iotans_registration::{DomainFormat, IotansRegistration},
     move_object::{MoveObject, MoveObjectImpl},
     move_value::MoveValue,
     object::{self, Object, ObjectFilter, ObjectImpl, ObjectOwner, ObjectStatus},
@@ -129,33 +128,6 @@ impl Coin {
             .await
     }
 
-    /// The domain explicitly configured as the default domain pointing to this
-    /// object.
-    pub(crate) async fn default_iotans_name(
-        &self,
-        ctx: &Context<'_>,
-        format: Option,
-    ) -> Result> {
-        OwnerImpl::from(&self.super_.super_)
-            .default_iotans_name(ctx, format)
-            .await
-    }
-
-    /// The IotansRegistration NFTs owned by this object. These grant the owner
-    /// the capability to manage the associated domain.
-    pub(crate) async fn iotans_registrations(
-        &self,
-        ctx: &Context<'_>,
-        first: Option,
-        after: Option,
-        last: Option,
-        before: Option,
-    ) -> Result> {
-        OwnerImpl::from(&self.super_.super_)
-            .iotans_registrations(ctx, first, after, last, before)
-            .await
-    }
-
     pub(crate) async fn version(&self) -> u64 {
         ObjectImpl(&self.super_.super_).version().await
     }
diff --git a/crates/iota-graphql-rpc/src/types/coin_metadata.rs b/crates/iota-graphql-rpc/src/types/coin_metadata.rs
index 0c42b8165d9..e52fd9cc7eb 100644
--- a/crates/iota-graphql-rpc/src/types/coin_metadata.rs
+++ b/crates/iota-graphql-rpc/src/types/coin_metadata.rs
@@ -17,7 +17,6 @@ use super::{
     display::DisplayEntry,
     dynamic_field::{DynamicField, DynamicFieldName},
     iota_address::IotaAddress,
-    iotans_registration::{DomainFormat, IotansRegistration},
     move_object::{MoveObject, MoveObjectImpl},
     move_value::MoveValue,
     object::{self, Object, ObjectFilter, ObjectImpl, ObjectOwner, ObjectStatus},
@@ -118,33 +117,6 @@ impl CoinMetadata {
             .await
     }
 
-    /// The domain explicitly configured as the default domain pointing to this
-    /// object.
-    pub(crate) async fn default_iotans_name(
-        &self,
-        ctx: &Context<'_>,
-        format: Option,
-    ) -> Result> {
-        OwnerImpl::from(&self.super_.super_)
-            .default_iotans_name(ctx, format)
-            .await
-    }
-
-    /// The IotansRegistration NFTs owned by this object. These grant the owner
-    /// the capability to manage the associated domain.
-    pub(crate) async fn iotans_registrations(
-        &self,
-        ctx: &Context<'_>,
-        first: Option,
-        after: Option,
-        last: Option,
-        before: Option,
-    ) -> Result> {
-        OwnerImpl::from(&self.super_.super_)
-            .iotans_registrations(ctx, first, after, last, before)
-            .await
-    }
-
     pub(crate) async fn version(&self) -> u64 {
         ObjectImpl(&self.super_.super_).version().await
     }
diff --git a/crates/iota-graphql-rpc/src/types/iota_address.rs b/crates/iota-graphql-rpc/src/types/iota_address.rs
index 2930794ff65..dd691453ee4 100644
--- a/crates/iota-graphql-rpc/src/types/iota_address.rs
+++ b/crates/iota-graphql-rpc/src/types/iota_address.rs
@@ -49,6 +49,7 @@ impl IotaAddress {
         self.0.to_vec()
     }
 
+    #[cfg(test)]
     pub fn as_slice(&self) -> &[u8] {
         &self.0
     }
diff --git a/crates/iota-graphql-rpc/src/types/iotans_registration.rs b/crates/iota-graphql-rpc/src/types/iotans_registration.rs
deleted file mode 100644
index 42a823be817..00000000000
--- a/crates/iota-graphql-rpc/src/types/iotans_registration.rs
+++ /dev/null
@@ -1,638 +0,0 @@
-// Copyright (c) Mysten Labs, Inc.
-// Modifications Copyright (c) 2024 IOTA Stiftung
-// SPDX-License-Identifier: Apache-2.0
-
-use std::str::FromStr;
-
-use async_graphql::{connection::Connection, *};
-use iota_indexer::models::objects::StoredHistoryObject;
-use iota_json_rpc::name_service::{
-    Domain as NativeDomain, NameRecord, NameServiceConfig, NameServiceError,
-};
-use iota_types::{base_types::IotaAddress as NativeIotaAddress, dynamic_field::Field, id::UID};
-use move_core_types::{ident_str, identifier::IdentStr, language_storage::StructTag};
-use serde::{Deserialize, Serialize};
-
-use super::{
-    balance::{self, Balance},
-    base64::Base64,
-    big_int::BigInt,
-    checkpoint::Checkpoint,
-    coin::Coin,
-    cursor::Page,
-    display::DisplayEntry,
-    dynamic_field::{DynamicField, DynamicFieldName},
-    iota_address::IotaAddress,
-    move_object::{MoveObject, MoveObjectImpl},
-    move_value::MoveValue,
-    object::{self, Object, ObjectFilter, ObjectImpl, ObjectLookupKey, ObjectOwner, ObjectStatus},
-    owner::OwnerImpl,
-    stake::StakedIota,
-    string_input::impl_string_input,
-    transaction_block::{self, TransactionBlock, TransactionBlockFilter},
-    type_filter::ExactTypeFilter,
-};
-use crate::{
-    consistency::{build_objects_query, consistent_range, View},
-    data::{Db, DbConnection, QueryExecutor},
-    error::Error,
-};
-
-const MOD_REGISTRATION: &IdentStr = ident_str!("iotans_registration");
-const TYP_REGISTRATION: &IdentStr = ident_str!("IotansRegistration");
-
-/// Represents the "core" of the name service (e.g. the on-chain registry and
-/// reverse registry). It doesn't contain any fields because we look them up
-/// based on the `NameServiceConfig`.
-pub(crate) struct NameService;
-
-/// Wrap IotaNS Domain type to expose as a string scalar in GraphQL.
-#[derive(Debug)]
-pub(crate) struct Domain(NativeDomain);
-
-#[derive(Enum, Copy, Clone, Eq, PartialEq)]
-#[graphql(remote = "iota_json_rpc::name_service::DomainFormat")]
-pub enum DomainFormat {
-    At,
-    Dot,
-}
-
-#[derive(Clone, Serialize, Deserialize)]
-pub(crate) struct NativeIotansRegistration {
-    pub id: UID,
-    pub domain: NativeDomain,
-    pub domain_name: String,
-    pub expiration_timestamp_ms: u64,
-    pub image_url: String,
-}
-
-#[derive(Clone)]
-pub(crate) struct IotansRegistration {
-    /// Representation of this IotansRegistration as a generic Move object.
-    pub super_: MoveObject,
-
-    /// The deserialized representation of the Move object's contents.
-    pub native: NativeIotansRegistration,
-}
-
-/// Represents the results of a query for a domain's `NameRecord` and its
-/// parent's `NameRecord`. The `expiration_timestamp_ms` on the name records are
-/// compared to the checkpoint's timestamp to check that the domain is not
-/// expired.
-pub(crate) struct DomainExpiration {
-    /// The domain's `NameRecord`.
-    pub name_record: Option,
-    /// The parent's `NameRecord`, populated only if the domain is a subdomain.
-    pub parent_name_record: Option,
-    /// The timestamp of the checkpoint at which the query was made. This is
-    /// used to check if the `expiration_timestamp_ms` on the name records
-    /// are expired.
-    pub checkpoint_timestamp_ms: u64,
-}
-
-pub(crate) enum IotansRegistrationDowncastError {
-    NotAIotansRegistration,
-    Bcs(bcs::Error),
-}
-
-#[Object]
-impl IotansRegistration {
-    pub(crate) async fn address(&self) -> IotaAddress {
-        OwnerImpl::from(&self.super_.super_).address().await
-    }
-
-    /// Objects owned by this object, optionally `filter`-ed.
-    pub(crate) async fn objects(
-        &self,
-        ctx: &Context<'_>,
-        first: Option,
-        after: Option,
-        last: Option,
-        before: Option,
-        filter: Option,
-    ) -> Result> {
-        OwnerImpl::from(&self.super_.super_)
-            .objects(ctx, first, after, last, before, filter)
-            .await
-    }
-
-    /// Total balance of all coins with marker type owned by this object. If
-    /// type is not supplied, it defaults to `0x2::iota::IOTA`.
-    pub(crate) async fn balance(
-        &self,
-        ctx: &Context<'_>,
-        type_: Option,
-    ) -> Result> {
-        OwnerImpl::from(&self.super_.super_)
-            .balance(ctx, type_)
-            .await
-    }
-
-    /// The balances of all coin types owned by this object.
-    pub(crate) async fn balances(
-        &self,
-        ctx: &Context<'_>,
-        first: Option,
-        after: Option,
-        last: Option,
-        before: Option,
-    ) -> Result> {
-        OwnerImpl::from(&self.super_.super_)
-            .balances(ctx, first, after, last, before)
-            .await
-    }
-
-    /// The coin objects for this object.
-    ///
-    /// `type` is a filter on the coin's type parameter, defaulting to
-    /// `0x2::iota::IOTA`.
-    pub(crate) async fn coins(
-        &self,
-        ctx: &Context<'_>,
-        first: Option,
-        after: Option,
-        last: Option,
-        before: Option,
-        type_: Option,
-    ) -> Result> {
-        OwnerImpl::from(&self.super_.super_)
-            .coins(ctx, first, after, last, before, type_)
-            .await
-    }
-
-    /// The `0x3::staking_pool::StakedIota` objects owned by this object.
-    pub(crate) async fn staked_iotas(
-        &self,
-        ctx: &Context<'_>,
-        first: Option,
-        after: Option,
-        last: Option,
-        before: Option,
-    ) -> Result> {
-        OwnerImpl::from(&self.super_.super_)
-            .staked_iotas(ctx, first, after, last, before)
-            .await
-    }
-
-    /// The domain explicitly configured as the default domain pointing to this
-    /// object.
-    pub(crate) async fn default_iotans_name(
-        &self,
-        ctx: &Context<'_>,
-        format: Option,
-    ) -> Result> {
-        OwnerImpl::from(&self.super_.super_)
-            .default_iotans_name(ctx, format)
-            .await
-    }
-
-    /// The IotansRegistration NFTs owned by this object. These grant the owner
-    /// the capability to manage the associated domain.
-    pub(crate) async fn iotans_registrations(
-        &self,
-        ctx: &Context<'_>,
-        first: Option,
-        after: Option,
-        last: Option,
-        before: Option,
-    ) -> Result> {
-        OwnerImpl::from(&self.super_.super_)
-            .iotans_registrations(ctx, first, after, last, before)
-            .await
-    }
-
-    pub(crate) async fn version(&self) -> u64 {
-        ObjectImpl(&self.super_.super_).version().await
-    }
-
-    /// The current status of the object as read from the off-chain store. The
-    /// possible states are: NOT_INDEXED, the object is loaded from
-    /// serialized data, such as the contents of a genesis or system package
-    /// upgrade transaction. LIVE, the version returned is the most recent for
-    /// the object, and it is not deleted or wrapped at that version.
-    /// HISTORICAL, the object was referenced at a specific version or
-    /// checkpoint, so is fetched from historical tables and may not be the
-    /// latest version of the object. WRAPPED_OR_DELETED, the object is deleted
-    /// or wrapped and only partial information can be loaded."
-    pub(crate) async fn status(&self) -> ObjectStatus {
-        ObjectImpl(&self.super_.super_).status().await
-    }
-
-    /// 32-byte hash that identifies the object's contents, encoded as a Base58
-    /// string.
-    pub(crate) async fn digest(&self) -> Option {
-        ObjectImpl(&self.super_.super_).digest().await
-    }
-
-    /// The owner type of this object: Immutable, Shared, Parent, Address
-    pub(crate) async fn owner(&self, ctx: &Context<'_>) -> Option {
-        ObjectImpl(&self.super_.super_).owner(ctx).await
-    }
-
-    /// The transaction block that created this version of the object.
-    pub(crate) async fn previous_transaction_block(
-        &self,
-        ctx: &Context<'_>,
-    ) -> Result> {
-        ObjectImpl(&self.super_.super_)
-            .previous_transaction_block(ctx)
-            .await
-    }
-
-    /// The amount of IOTA we would rebate if this object gets deleted or
-    /// mutated. This number is recalculated based on the present storage
-    /// gas price.
-    pub(crate) async fn storage_rebate(&self) -> Option {
-        ObjectImpl(&self.super_.super_).storage_rebate().await
-    }
-
-    /// The transaction blocks that sent objects to this object.
-    pub(crate) async fn received_transaction_blocks(
-        &self,
-        ctx: &Context<'_>,
-        first: Option,
-        after: Option,
-        last: Option,
-        before: Option,
-        filter: Option,
-    ) -> Result> {
-        ObjectImpl(&self.super_.super_)
-            .received_transaction_blocks(ctx, first, after, last, before, filter)
-            .await
-    }
-
-    /// The Base64-encoded BCS serialization of the object's content.
-    pub(crate) async fn bcs(&self) -> Result> {
-        ObjectImpl(&self.super_.super_).bcs().await
-    }
-
-    /// Displays the contents of the Move object in a JSON string and through
-    /// GraphQL types. Also provides the flat representation of the type
-    /// signature, and the BCS of the corresponding data.
-    pub(crate) async fn contents(&self) -> Option {
-        MoveObjectImpl(&self.super_).contents().await
-    }
-
-    /// Determines whether a transaction can transfer this object, using the
-    /// TransferObjects transaction command or
-    /// `iota::transfer::public_transfer`, both of which require the object to
-    /// have the `key` and `store` abilities.
-    pub(crate) async fn has_public_transfer(&self, ctx: &Context<'_>) -> Result {
-        MoveObjectImpl(&self.super_).has_public_transfer(ctx).await
-    }
-
-    /// The set of named templates defined on-chain for the type of this object,
-    /// to be handled off-chain. The server substitutes data from the object
-    /// into these templates to generate a display string per template.
-    pub(crate) async fn display(&self, ctx: &Context<'_>) -> Result>> {
-        ObjectImpl(&self.super_.super_).display(ctx).await
-    }
-
-    /// Access a dynamic field on an object using its name. Names are arbitrary
-    /// Move values whose type have `copy`, `drop`, and `store`, and are
-    /// specified using their type, and their BCS contents, Base64 encoded.
-    ///
-    /// Dynamic fields on wrapped objects can be accessed by using the same API
-    /// under the Owner type.
-    pub(crate) async fn dynamic_field(
-        &self,
-        ctx: &Context<'_>,
-        name: DynamicFieldName,
-    ) -> Result> {
-        OwnerImpl::from(&self.super_.super_)
-            .dynamic_field(ctx, name, Some(self.super_.super_.version_impl()))
-            .await
-    }
-
-    /// Access a dynamic object field on an object using its name. Names are
-    /// arbitrary Move values whose type have `copy`, `drop`, and `store`,
-    /// and are specified using their type, and their BCS contents, Base64
-    /// encoded. The value of a dynamic object field can also be accessed
-    /// off-chain directly via its address (e.g. using `Query.object`).
-    ///
-    /// Dynamic fields on wrapped objects can be accessed by using the same API
-    /// under the Owner type.
-    pub(crate) async fn dynamic_object_field(
-        &self,
-        ctx: &Context<'_>,
-        name: DynamicFieldName,
-    ) -> Result> {
-        OwnerImpl::from(&self.super_.super_)
-            .dynamic_object_field(ctx, name, Some(self.super_.super_.version_impl()))
-            .await
-    }
-
-    /// The dynamic fields and dynamic object fields on an object.
-    ///
-    /// Dynamic fields on wrapped objects can be accessed by using the same API
-    /// under the Owner type.
-    pub(crate) async fn dynamic_fields(
-        &self,
-        ctx: &Context<'_>,
-        first: Option,
-        after: Option,
-        last: Option,
-        before: Option,
-    ) -> Result> {
-        OwnerImpl::from(&self.super_.super_)
-            .dynamic_fields(
-                ctx,
-                first,
-                after,
-                last,
-                before,
-                Some(self.super_.super_.version_impl()),
-            )
-            .await
-    }
-
-    /// Domain name of the IotansRegistration object
-    async fn domain(&self) -> &str {
-        &self.native.domain_name
-    }
-}
-
-impl NameService {
-    /// Lookup the IotaNS NameRecord for the given `domain` name. `config`
-    /// specifies where to find the domain name registry, and its type.
-    ///
-    /// `checkpoint_viewed_at` represents the checkpoint sequence number at
-    /// which this was queried for, or `None` if the data was requested at
-    /// the latest checkpoint.
-    ///
-    /// The `NameRecord` is returned only if it has not expired as of the
-    /// `checkpoint_viewed_at` or latest checkpoint's timestamp.
-    ///
-    /// For leaf domains, the `NameRecord` is returned only if its parent is
-    /// valid and not expired.
-    pub(crate) async fn resolve_to_record(
-        ctx: &Context<'_>,
-        domain: &Domain,
-        checkpoint_viewed_at: Option,
-    ) -> Result, Error> {
-        // Query for the domain's NameRecord and parent NameRecord if applicable. The
-        // checkpoint's timestamp is also fetched. These values are used to
-        // determine if the domain is expired.
-        let Some(domain_expiration) =
-            Self::query_domain_expiration(ctx, domain, checkpoint_viewed_at).await?
-        else {
-            return Ok(None);
-        };
-
-        // Get the name_record from the query. If we didn't find it, we return as it
-        // means that the requested name is not registered.
-        let Some(name_record) = domain_expiration.name_record else {
-            return Ok(None);
-        };
-
-        // If name record is SLD, or Node subdomain, we can check the expiration and
-        // return the record if not expired.
-        if !name_record.is_leaf_record() {
-            return if !name_record.is_node_expired(domain_expiration.checkpoint_timestamp_ms) {
-                Ok(Some(name_record))
-            } else {
-                Err(Error::NameService(NameServiceError::NameExpired))
-            };
-        }
-
-        // If we cannot find the parent, then the name is expired.
-        let Some(parent_name_record) = domain_expiration.parent_name_record else {
-            return Err(Error::NameService(NameServiceError::NameExpired));
-        };
-
-        // If the parent is valid for this leaf, and not expired, then we can return the
-        // name record. Otherwise, the name is expired.
-        if parent_name_record.is_valid_leaf_parent(&name_record)
-            && !parent_name_record.is_node_expired(domain_expiration.checkpoint_timestamp_ms)
-        {
-            Ok(Some(name_record))
-        } else {
-            Err(Error::NameService(NameServiceError::NameExpired))
-        }
-    }
-
-    /// Lookup the IotaNS Domain for the given `address`. `config` specifies
-    /// where to find the domain name registry, and its type.
-    ///
-    /// `checkpoint_viewed_at` represents the checkpoint sequence number at
-    /// which this was queried for, or `None` if the data was requested at
-    /// the latest checkpoint.
-    pub(crate) async fn reverse_resolve_to_name(
-        ctx: &Context<'_>,
-        address: IotaAddress,
-        checkpoint_viewed_at: Option,
-    ) -> Result, Error> {
-        let config = ctx.data_unchecked::();
-
-        let reverse_record_id = config.reverse_record_field_id(address.as_slice());
-
-        let Some(object) = MoveObject::query(
-            ctx.data_unchecked(),
-            reverse_record_id.into(),
-            match checkpoint_viewed_at {
-                Some(checkpoint_viewed_at) => ObjectLookupKey::LatestAt(checkpoint_viewed_at),
-                None => ObjectLookupKey::Latest,
-            },
-        )
-        .await?
-        else {
-            return Ok(None);
-        };
-
-        let field: Field = object
-            .native
-            .to_rust()
-            .ok_or_else(|| Error::Internal("Malformed Iotans Domain".to_string()))?;
-
-        let domain = Domain(field.value);
-
-        // We attempt to resolve the domain to a record, and if it fails, we return
-        // None. That way we can validate that the name has not expired and is
-        // still valid.
-        let Some(_) = Self::resolve_to_record(ctx, &domain, checkpoint_viewed_at).await? else {
-            return Ok(None);
-        };
-
-        Ok(Some(domain.0))
-    }
-
-    /// Query for a domain's NameRecord, its parent's NameRecord if supplied,
-    /// and the timestamp of the checkpoint bound.
-    async fn query_domain_expiration(
-        ctx: &Context<'_>,
-        domain: &Domain,
-        checkpoint_viewed_at: Option,
-    ) -> Result, Error> {
-        let config = ctx.data_unchecked::();
-        let db: &crate::data::pg::PgExecutor = ctx.data_unchecked::();
-        // Construct the list of `object_id`s to look up. The first element is the
-        // domain's `NameRecord`. If the domain is a subdomain, there will be a
-        // second element for the parent's `NameRecord`.
-        let mut object_ids = vec![IotaAddress::from(config.record_field_id(&domain.0))];
-        if domain.0.is_subdomain() {
-            object_ids.push(IotaAddress::from(
-                config.record_field_id(&domain.0.parent()),
-            ));
-        }
-
-        // Create a page with a bound of `object_ids` length to fetch the relevant
-        // `NameRecord`s.
-        let page: Page = Page::from_params(
-            ctx.data_unchecked(),
-            Some(object_ids.len() as u64),
-            None,
-            None,
-            None,
-        )
-        .map_err(|_| {
-            Error::Internal("Page size of 2 is incompatible with configured limits".to_string())
-        })?;
-
-        // prepare the filter for the query.
-        let filter = ObjectFilter {
-            object_ids: Some(object_ids.clone()),
-            ..Default::default()
-        };
-
-        let response = db
-            .execute_repeatable(move |conn| {
-                let Some((lhs, rhs)) = consistent_range(conn, checkpoint_viewed_at)? else {
-                    return Ok::<_, diesel::result::Error>(None);
-                };
-
-                let timestamp_ms = Checkpoint::query_timestamp(conn, rhs)?;
-
-                let sql = build_objects_query(
-                    View::Consistent,
-                    lhs as i64,
-                    rhs as i64,
-                    &page,
-                    move |query| filter.apply(query),
-                    move |newer| newer,
-                );
-
-                let objects: Vec =
-                    conn.results(move || sql.clone().into_boxed())?;
-
-                Ok(Some((timestamp_ms, objects)))
-            })
-            .await?;
-
-        let Some((checkpoint_timestamp_ms, results)) = response else {
-            return Err(Error::Client(
-                "Requested data is outside the available range".to_string(),
-            ));
-        };
-
-        let mut domain_expiration = DomainExpiration {
-            parent_name_record: None,
-            name_record: None,
-            checkpoint_timestamp_ms,
-        };
-
-        // Max size of results is 2. We loop through them, convert to objects, and then
-        // parse name_record. We then assign it to the correct field on
-        // `domain_expiration` based on the address.
-        for result in results {
-            let object = Object::try_from_stored_history_object(result, None)?;
-            let move_object = MoveObject::try_from(&object).map_err(|_| {
-                Error::Internal(format!(
-                    "Expected {0} to be a NameRecord, but it's not a Move Object.",
-                    object.address
-                ))
-            })?;
-
-            let record = NameRecord::try_from(move_object.native)?;
-
-            if object.address == object_ids[0] {
-                domain_expiration.name_record = Some(record);
-            } else if Some(&object.address) == object_ids.get(1) {
-                domain_expiration.parent_name_record = Some(record);
-            }
-        }
-
-        Ok(Some(domain_expiration))
-    }
-}
-
-impl IotansRegistration {
-    /// Query the database for a `page` of IotaNS registrations. The page uses
-    /// the same cursor type as is used for `Object`, and is further
-    /// filtered to a particular `owner`. `config` specifies where to find
-    /// the domain name registry and its type.
-    ///
-    /// `checkpoint_viewed_at` represents the checkpoint sequence number at
-    /// which this page was queried for, or `None` if the data was requested
-    /// at the latest checkpoint. Each entity returned in the connection
-    /// will inherit this checkpoint, so that when viewing that entity's
-    /// state, it will be as if it was read at the same checkpoint.
-    pub(crate) async fn paginate(
-        db: &Db,
-        config: &NameServiceConfig,
-        page: Page,
-        owner: IotaAddress,
-        checkpoint_viewed_at: Option,
-    ) -> Result, Error> {
-        let type_ = IotansRegistration::type_(config.package_address.into());
-
-        let filter = ObjectFilter {
-            type_: Some(type_.clone().into()),
-            owner: Some(owner),
-            ..Default::default()
-        };
-
-        Object::paginate_subtype(db, page, filter, checkpoint_viewed_at, |object| {
-            let address = object.address;
-            let move_object = MoveObject::try_from(&object).map_err(|_| {
-                Error::Internal(format!(
-                    "Expected {address} to be a IotansRegistration, but it's not a Move Object.",
-                ))
-            })?;
-
-            IotansRegistration::try_from(&move_object, &type_).map_err(|_| {
-                Error::Internal(format!(
-                    "Expected {address} to be a IotansRegistration, but it is not."
-                ))
-            })
-        })
-        .await
-    }
-
-    /// Return the type representing a `IotansRegistration` on chain. This can
-    /// change from chain to chain (mainnet, testnet, devnet etc).
-    pub(crate) fn type_(package: IotaAddress) -> StructTag {
-        StructTag {
-            address: package.into(),
-            module: MOD_REGISTRATION.to_owned(),
-            name: TYP_REGISTRATION.to_owned(),
-            type_params: vec![],
-        }
-    }
-
-    // Because the type of the IotansRegistration object is not constant,
-    // we need to take it in as a param.
-    pub(crate) fn try_from(
-        move_object: &MoveObject,
-        tag: &StructTag,
-    ) -> Result {
-        if !move_object.native.is_type(tag) {
-            return Err(IotansRegistrationDowncastError::NotAIotansRegistration);
-        }
-
-        Ok(Self {
-            super_: move_object.clone(),
-            native: bcs::from_bytes(move_object.native.contents())
-                .map_err(IotansRegistrationDowncastError::Bcs)?,
-        })
-    }
-}
-
-impl_string_input!(Domain);
-
-impl FromStr for Domain {
-    type Err = ::Err;
-
-    fn from_str(s: &str) -> Result {
-        Ok(Domain(NativeDomain::from_str(s)?))
-    }
-}
diff --git a/crates/iota-graphql-rpc/src/types/mod.rs b/crates/iota-graphql-rpc/src/types/mod.rs
index bc7d250b44e..f3c936fd301 100644
--- a/crates/iota-graphql-rpc/src/types/mod.rs
+++ b/crates/iota-graphql-rpc/src/types/mod.rs
@@ -24,7 +24,6 @@ pub(crate) mod execution_result;
 pub(crate) mod gas;
 pub(crate) mod intersect;
 pub(crate) mod iota_address;
-pub(crate) mod iotans_registration;
 pub(crate) mod json;
 pub(crate) mod move_function;
 pub(crate) mod move_module;
diff --git a/crates/iota-graphql-rpc/src/types/move_object.rs b/crates/iota-graphql-rpc/src/types/move_object.rs
index fe4ad9fbf20..3ec3e51542b 100644
--- a/crates/iota-graphql-rpc/src/types/move_object.rs
+++ b/crates/iota-graphql-rpc/src/types/move_object.rs
@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0
 
 use async_graphql::{connection::Connection, *};
-use iota_json_rpc::name_service::NameServiceConfig;
 use iota_types::{
     object::{Data, MoveObject as NativeMoveObject},
     TypeTag,
@@ -19,7 +18,6 @@ use super::{
     display::DisplayEntry,
     dynamic_field::{DynamicField, DynamicFieldName},
     iota_address::IotaAddress,
-    iotans_registration::{DomainFormat, IotansRegistration, IotansRegistrationDowncastError},
     move_type::MoveType,
     move_value::MoveValue,
     object::{self, Object, ObjectFilter, ObjectImpl, ObjectLookupKey, ObjectOwner, ObjectStatus},
@@ -114,7 +112,6 @@ pub(crate) enum IMoveObject {
     Coin(Coin),
     CoinMetadata(CoinMetadata),
     StakedIota(StakedIota),
-    IotansRegistration(IotansRegistration),
 }
 
 /// The representation of an object as a Move Object, which exposes additional
@@ -197,33 +194,6 @@ impl MoveObject {
             .await
     }
 
-    /// The domain explicitly configured as the default domain pointing to this
-    /// object.
-    pub(crate) async fn default_iotans_name(
-        &self,
-        ctx: &Context<'_>,
-        format: Option,
-    ) -> Result> {
-        OwnerImpl::from(&self.super_)
-            .default_iotans_name(ctx, format)
-            .await
-    }
-
-    /// The IotansRegistration NFTs owned by this object. These grant the owner
-    /// the capability to manage the associated domain.
-    pub(crate) async fn iotans_registrations(
-        &self,
-        ctx: &Context<'_>,
-        first: Option,
-        after: Option,
-        last: Option,
-        before: Option,
-    ) -> Result> {
-        OwnerImpl::from(&self.super_)
-            .iotans_registrations(ctx, first, after, last, before)
-            .await
-    }
-
     pub(crate) async fn version(&self) -> u64 {
         ObjectImpl(&self.super_).version().await
     }
@@ -404,24 +374,6 @@ impl MoveObject {
             .extend(),
         }
     }
-
-    /// Attempts to convert the Move object into a `IotansRegistration` object.
-    async fn as_iotans_registration(
-        &self,
-        ctx: &Context<'_>,
-    ) -> Result> {
-        let cfg: &NameServiceConfig = ctx.data_unchecked();
-        let tag = IotansRegistration::type_(cfg.package_address.into());
-
-        match IotansRegistration::try_from(self, &tag) {
-            Ok(registration) => Ok(Some(registration)),
-            Err(IotansRegistrationDowncastError::NotAIotansRegistration) => Ok(None),
-            Err(IotansRegistrationDowncastError::Bcs(e)) => Err(Error::Internal(format!(
-                "Failed to deserialize IotansRegistration: {e}",
-            )))
-            .extend(),
-        }
-    }
 }
 
 impl MoveObjectImpl<'_> {
diff --git a/crates/iota-graphql-rpc/src/types/move_package.rs b/crates/iota-graphql-rpc/src/types/move_package.rs
index a1b91c4d3e0..ad875412cd4 100644
--- a/crates/iota-graphql-rpc/src/types/move_package.rs
+++ b/crates/iota-graphql-rpc/src/types/move_package.rs
@@ -16,7 +16,6 @@ use super::{
     coin::Coin,
     cursor::{JsonCursor, Page},
     iota_address::IotaAddress,
-    iotans_registration::{DomainFormat, IotansRegistration},
     move_module::MoveModule,
     move_object::MoveObject,
     object::{self, Object, ObjectFilter, ObjectImpl, ObjectLookupKey, ObjectOwner, ObjectStatus},
@@ -170,36 +169,6 @@ impl MovePackage {
             .await
     }
 
-    /// The domain explicitly configured as the default domain pointing to this
-    /// object.
-    pub(crate) async fn default_iotans_name(
-        &self,
-        ctx: &Context<'_>,
-        format: Option,
-    ) -> Result> {
-        OwnerImpl::from(&self.super_)
-            .default_iotans_name(ctx, format)
-            .await
-    }
-
-    /// The IotansRegistration NFTs owned by this package. These grant the owner
-    /// the capability to manage the associated domain.
-    ///
-    /// Note that objects owned by a package are inaccessible, because packages
-    /// are immutable and cannot be owned by an address.
-    pub(crate) async fn iotans_registrations(
-        &self,
-        ctx: &Context<'_>,
-        first: Option,
-        after: Option,
-        last: Option,
-        before: Option,
-    ) -> Result> {
-        OwnerImpl::from(&self.super_)
-            .iotans_registrations(ctx, first, after, last, before)
-            .await
-    }
-
     pub(crate) async fn version(&self) -> u64 {
         ObjectImpl(&self.super_).version().await
     }
diff --git a/crates/iota-graphql-rpc/src/types/object.rs b/crates/iota-graphql-rpc/src/types/object.rs
index 14e65a3f0ae..71eed20b841 100644
--- a/crates/iota-graphql-rpc/src/types/object.rs
+++ b/crates/iota-graphql-rpc/src/types/object.rs
@@ -39,7 +39,6 @@ use super::{
     display::{Display, DisplayEntry},
     dynamic_field::{DynamicField, DynamicFieldName},
     iota_address::IotaAddress,
-    iotans_registration::{DomainFormat, IotansRegistration},
     move_object::MoveObject,
     move_package::MovePackage,
     owner::{Owner, OwnerImpl},
@@ -285,7 +284,6 @@ pub(crate) enum IObject {
     Coin(Coin),
     CoinMetadata(CoinMetadata),
     StakedIota(StakedIota),
-    IotansRegistration(IotansRegistration),
 }
 
 /// An object in Iota is a package (set of Move bytecode modules) or object
@@ -369,31 +367,6 @@ impl Object {
             .await
     }
 
-    /// The domain explicitly configured as the default domain pointing to this
-    /// object.
-    pub(crate) async fn default_iotans_name(
-        &self,
-        ctx: &Context<'_>,
-        format: Option,
-    ) -> Result> {
-        OwnerImpl::from(self).default_iotans_name(ctx, format).await
-    }
-
-    /// The IotansRegistration NFTs owned by this object. These grant the owner
-    /// the capability to manage the associated domain.
-    pub(crate) async fn iotans_registrations(
-        &self,
-        ctx: &Context<'_>,
-        first: Option,
-        after: Option,
-        last: Option,
-        before: Option,
-    ) -> Result> {
-        OwnerImpl::from(self)
-            .iotans_registrations(ctx, first, after, last, before)
-            .await
-    }
-
     pub(crate) async fn version(&self) -> u64 {
         ObjectImpl(self).version().await
     }
diff --git a/crates/iota-graphql-rpc/src/types/owner.rs b/crates/iota-graphql-rpc/src/types/owner.rs
index 136ebef4357..50c2f98d0e7 100644
--- a/crates/iota-graphql-rpc/src/types/owner.rs
+++ b/crates/iota-graphql-rpc/src/types/owner.rs
@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0
 
 use async_graphql::{connection::Connection, *};
-use iota_json_rpc::name_service::NameServiceConfig;
 use iota_types::{dynamic_field::DynamicFieldType, gas_coin::GAS};
 
 use super::{
@@ -11,21 +10,17 @@ use super::{
     coin_metadata::CoinMetadata,
     cursor::Page,
     dynamic_field::{DynamicField, DynamicFieldName},
-    iotans_registration::{DomainFormat, IotansRegistration, NameService},
     move_package::MovePackage,
     object::ObjectLookupKey,
     stake::StakedIota,
 };
-use crate::{
-    data::Db,
-    types::{
-        balance::{self, Balance},
-        coin::Coin,
-        iota_address::IotaAddress,
-        move_object::MoveObject,
-        object::{self, Object, ObjectFilter},
-        type_filter::ExactTypeFilter,
-    },
+use crate::types::{
+    balance::{self, Balance},
+    coin::Coin,
+    iota_address::IotaAddress,
+    move_object::MoveObject,
+    object::{self, Object, ObjectFilter},
+    type_filter::ExactTypeFilter,
 };
 
 #[derive(Clone, Debug)]
@@ -99,23 +94,6 @@ pub(crate) struct OwnerImpl {
         arg(name = "before", ty = "Option"),
         ty = "Connection",
         desc = "The `0x3::staking_pool::StakedIota` objects owned by this object or address."
-    ),
-    field(
-        name = "default_iotans_name",
-        arg(name = "format", ty = "Option"),
-        ty = "Option",
-        desc = "The domain explicitly configured as the default domain pointing to this object or \
-                address."
-    ),
-    field(
-        name = "iotans_registrations",
-        arg(name = "first", ty = "Option"),
-        arg(name = "after", ty = "Option"),
-        arg(name = "last", ty = "Option"),
-        arg(name = "before", ty = "Option"),
-        ty = "Connection",
-        desc = "The IotansRegistration NFTs owned by this object or address. These grant the owner \
-                the capability to manage the associated domain."
     )
 )]
 pub(crate) enum IOwner {
@@ -127,7 +105,6 @@ pub(crate) enum IOwner {
     Coin(Coin),
     CoinMetadata(CoinMetadata),
     StakedIota(StakedIota),
-    IotansRegistration(IotansRegistration),
 }
 
 /// An Owner is an entity that can own an object. Each Owner is identified by a
@@ -212,31 +189,6 @@ impl Owner {
             .await
     }
 
-    /// The domain explicitly configured as the default domain pointing to this
-    /// object or address.
-    pub(crate) async fn default_iotans_name(
-        &self,
-        ctx: &Context<'_>,
-        format: Option,
-    ) -> Result> {
-        OwnerImpl::from(self).default_iotans_name(ctx, format).await
-    }
-
-    /// The IotansRegistration NFTs owned by this object or address. These grant
-    /// the owner the capability to manage the associated domain.
-    pub(crate) async fn iotans_registrations(
-        &self,
-        ctx: &Context<'_>,
-        first: Option,
-        after: Option,
-        last: Option,
-        before: Option,
-    ) -> Result> {
-        OwnerImpl::from(self)
-            .iotans_registrations(ctx, first, after, last, before)
-            .await
-    }
-
     async fn as_address(&self) -> Option
{ // For now only addresses can be owners Some(Address { @@ -422,39 +374,6 @@ impl OwnerImpl { .extend() } - pub(crate) async fn default_iotans_name( - &self, - ctx: &Context<'_>, - format: Option, - ) -> Result> { - Ok( - NameService::reverse_resolve_to_name(ctx, self.address, self.checkpoint_viewed_at) - .await - .extend()? - .map(|d| d.format(format.unwrap_or(DomainFormat::Dot).into())), - ) - } - - pub(crate) async fn iotans_registrations( - &self, - ctx: &Context<'_>, - first: Option, - after: Option, - last: Option, - before: Option, - ) -> Result> { - let page = Page::from_params(ctx.data_unchecked(), first, after, last, before)?; - IotansRegistration::paginate( - ctx.data_unchecked::(), - ctx.data_unchecked::(), - page, - self.address, - self.checkpoint_viewed_at, - ) - .await - .extend() - } - // Dynamic field related functions are part of the `IMoveObject` interface, but // are provided here to implement convenience functions on `Owner` and // `Object` to access dynamic fields. diff --git a/crates/iota-graphql-rpc/src/types/query.rs b/crates/iota-graphql-rpc/src/types/query.rs index 8dab918f351..bbed991b604 100644 --- a/crates/iota-graphql-rpc/src/types/query.rs +++ b/crates/iota-graphql-rpc/src/types/query.rs @@ -29,7 +29,6 @@ use super::{ epoch::Epoch, event::{self, Event, EventFilter}, iota_address::IotaAddress, - iotans_registration::{Domain, NameService}, move_type::MoveType, object::{self, Object, ObjectFilter, ObjectLookupKey}, owner::Owner, @@ -425,25 +424,6 @@ impl Query { .extend() } - /// Resolves a IotaNS `domain` name to an address, if it has been bound. - async fn resolve_iotans_address( - &self, - ctx: &Context<'_>, - domain: Domain, - ) -> Result> { - let CheckpointViewedAt(checkpoint_viewed_at) = *ctx.data()?; - Ok( - NameService::resolve_to_record(ctx, &domain, Some(checkpoint_viewed_at)) - .await - .extend()? - .and_then(|r| r.target_address) - .map(|a| Address { - address: a.into(), - checkpoint_viewed_at: Some(checkpoint_viewed_at), - }), - ) - } - /// The coin metadata associated with the given coin type. async fn coin_metadata( &self, diff --git a/crates/iota-graphql-rpc/src/types/stake.rs b/crates/iota-graphql-rpc/src/types/stake.rs index 2ba23cf6cb7..c88a4f2287c 100644 --- a/crates/iota-graphql-rpc/src/types/stake.rs +++ b/crates/iota-graphql-rpc/src/types/stake.rs @@ -17,7 +17,6 @@ use super::{ dynamic_field::{DynamicField, DynamicFieldName}, epoch::Epoch, iota_address::IotaAddress, - iotans_registration::{DomainFormat, IotansRegistration}, move_object::{MoveObject, MoveObjectImpl}, move_value::MoveValue, object, @@ -135,33 +134,6 @@ impl StakedIota { .await } - /// The domain explicitly configured as the default domain pointing to this - /// object. - pub(crate) async fn default_iotans_name( - &self, - ctx: &Context<'_>, - format: Option, - ) -> Result> { - OwnerImpl::from(&self.super_.super_) - .default_iotans_name(ctx, format) - .await - } - - /// The IotansRegistration NFTs owned by this object. These grant the owner - /// the capability to manage the associated domain. - pub(crate) async fn iotans_registrations( - &self, - ctx: &Context<'_>, - first: Option, - after: Option, - last: Option, - before: Option, - ) -> Result> { - OwnerImpl::from(&self.super_.super_) - .iotans_registrations(ctx, first, after, last, before) - .await - } - pub(crate) async fn version(&self) -> u64 { ObjectImpl(&self.super_.super_).version().await } diff --git a/crates/iota-graphql-rpc/tests/snapshots/snapshot_tests__schema_sdl_export.snap b/crates/iota-graphql-rpc/tests/snapshots/snapshot_tests__schema_sdl_export.snap index 2fbb3fae204..5e4113e1ede 100644 --- a/crates/iota-graphql-rpc/tests/snapshots/snapshot_tests__schema_sdl_export.snap +++ b/crates/iota-graphql-rpc/tests/snapshots/snapshot_tests__schema_sdl_export.snap @@ -94,16 +94,6 @@ type Address implements IOwner { """ stakedIotas(first: Int, after: String, last: Int, before: String): StakedIotaConnection! """ - The domain explicitly configured as the default domain pointing to this - address. - """ - defaultIotansName(format: DomainFormat): String - """ - The IotansRegistration NFTs owned by this address. These grant the owner - the capability to manage the associated domain. - """ - iotansRegistrations(first: Int, after: String, last: Int, before: String): IotansRegistrationConnection! - """ Similar behavior to the `transactionBlocks` in Query but supporting the additional `AddressTransactionBlockRelationship` filter, which defaults to `SIGN`. @@ -494,16 +484,6 @@ type Coin implements IMoveObject & IObject & IOwner { The `0x3::staking_pool::StakedIota` objects owned by this object. """ stakedIotas(first: Int, after: String, last: Int, before: String): StakedIotaConnection! - """ - The domain explicitly configured as the default domain pointing to this - object. - """ - defaultIotansName(format: DomainFormat): String - """ - The IotansRegistration NFTs owned by this object. These grant the owner - the capability to manage the associated domain. - """ - iotansRegistrations(first: Int, after: String, last: Int, before: String): IotansRegistrationConnection! version: Int! """ The current status of the object as read from the off-chain store. The @@ -661,16 +641,6 @@ type CoinMetadata implements IMoveObject & IObject & IOwner { The `0x3::staking_pool::StakedIota` objects owned by this object. """ stakedIotas(first: Int, after: String, last: Int, before: String): StakedIotaConnection! - """ - The domain explicitly configured as the default domain pointing to this - object. - """ - defaultIotansName(format: DomainFormat): String - """ - The IotansRegistration NFTs owned by this object. These grant the owner - the capability to manage the associated domain. - """ - iotansRegistrations(first: Int, after: String, last: Int, before: String): IotansRegistrationConnection! version: Int! """ The current status of the object as read from the off-chain store. The @@ -859,11 +829,6 @@ type DisplayEntry { error: String } -enum DomainFormat { - AT - DOT -} - type DryRunEffect { """ Changes made to arguments that were mutably borrowed by each command in @@ -1285,10 +1250,6 @@ enum Feature { """ DYNAMIC_FIELDS """ - IotaNS name and reverse name look-up. - """ - NAME_SERVICE - """ Transaction and Event subscriptions. """ SUBSCRIPTIONS @@ -1489,14 +1450,6 @@ interface IOwner { The `0x3::staking_pool::StakedIota` objects owned by this object or address. """ stakedIotas(first: Int, after: String, last: Int, before: String): StakedIotaConnection! - """ - The domain explicitly configured as the default domain pointing to this object or address. - """ - defaultIotansName(format: DomainFormat): String - """ - The IotansRegistration NFTs owned by this object or address. These grant the owner the capability to manage the associated domain. - """ - iotansRegistrations(first: Int, after: String, last: Int, before: String): IotansRegistrationConnection! } """ @@ -1524,163 +1477,6 @@ String containing 32B hex-encoded address, with a leading "0x". Leading zeroes c """ scalar IotaAddress -type IotansRegistration implements IMoveObject & IObject & IOwner { - address: IotaAddress! - """ - Objects owned by this object, optionally `filter`-ed. - """ - objects(first: Int, after: String, last: Int, before: String, filter: ObjectFilter): MoveObjectConnection! - """ - Total balance of all coins with marker type owned by this object. If - type is not supplied, it defaults to `0x2::iota::IOTA`. - """ - balance(type: String): Balance - """ - The balances of all coin types owned by this object. - """ - balances(first: Int, after: String, last: Int, before: String): BalanceConnection! - """ - The coin objects for this object. - - `type` is a filter on the coin's type parameter, defaulting to - `0x2::iota::IOTA`. - """ - coins(first: Int, after: String, last: Int, before: String, type: String): CoinConnection! - """ - The `0x3::staking_pool::StakedIota` objects owned by this object. - """ - stakedIotas(first: Int, after: String, last: Int, before: String): StakedIotaConnection! - """ - The domain explicitly configured as the default domain pointing to this - object. - """ - defaultIotansName(format: DomainFormat): String - """ - The IotansRegistration NFTs owned by this object. These grant the owner - the capability to manage the associated domain. - """ - iotansRegistrations(first: Int, after: String, last: Int, before: String): IotansRegistrationConnection! - version: Int! - """ - The current status of the object as read from the off-chain store. The - possible states are: NOT_INDEXED, the object is loaded from - serialized data, such as the contents of a genesis or system package - upgrade transaction. LIVE, the version returned is the most recent for - the object, and it is not deleted or wrapped at that version. - HISTORICAL, the object was referenced at a specific version or - checkpoint, so is fetched from historical tables and may not be the - latest version of the object. WRAPPED_OR_DELETED, the object is deleted - or wrapped and only partial information can be loaded." - """ - status: ObjectKind! - """ - 32-byte hash that identifies the object's contents, encoded as a Base58 - string. - """ - digest: String - """ - The owner type of this object: Immutable, Shared, Parent, Address - """ - owner: ObjectOwner - """ - The transaction block that created this version of the object. - """ - previousTransactionBlock: TransactionBlock - """ - The amount of IOTA we would rebate if this object gets deleted or - mutated. This number is recalculated based on the present storage - gas price. - """ - storageRebate: BigInt - """ - The transaction blocks that sent objects to this object. - """ - receivedTransactionBlocks(first: Int, after: String, last: Int, before: String, filter: TransactionBlockFilter): TransactionBlockConnection! - """ - The Base64-encoded BCS serialization of the object's content. - """ - bcs: Base64 - """ - Displays the contents of the Move object in a JSON string and through - GraphQL types. Also provides the flat representation of the type - signature, and the BCS of the corresponding data. - """ - contents: MoveValue - """ - Determines whether a transaction can transfer this object, using the - TransferObjects transaction command or - `iota::transfer::public_transfer`, both of which require the object to - have the `key` and `store` abilities. - """ - hasPublicTransfer: Boolean! - """ - The set of named templates defined on-chain for the type of this object, - to be handled off-chain. The server substitutes data from the object - into these templates to generate a display string per template. - """ - display: [DisplayEntry!] - """ - Access a dynamic field on an object using its name. Names are arbitrary - Move values whose type have `copy`, `drop`, and `store`, and are - specified using their type, and their BCS contents, Base64 encoded. - - Dynamic fields on wrapped objects can be accessed by using the same API - under the Owner type. - """ - dynamicField(name: DynamicFieldName!): DynamicField - """ - Access a dynamic object field on an object using its name. Names are - arbitrary Move values whose type have `copy`, `drop`, and `store`, - and are specified using their type, and their BCS contents, Base64 - encoded. The value of a dynamic object field can also be accessed - off-chain directly via its address (e.g. using `Query.object`). - - Dynamic fields on wrapped objects can be accessed by using the same API - under the Owner type. - """ - dynamicObjectField(name: DynamicFieldName!): DynamicField - """ - The dynamic fields and dynamic object fields on an object. - - Dynamic fields on wrapped objects can be accessed by using the same API - under the Owner type. - """ - dynamicFields(first: Int, after: String, last: Int, before: String): DynamicFieldConnection! - """ - Domain name of the IotansRegistration object - """ - domain: String! -} - -type IotansRegistrationConnection { - """ - Information to aid in pagination. - """ - pageInfo: PageInfo! - """ - A list of edges. - """ - edges: [IotansRegistrationEdge!]! - """ - A list of nodes. - """ - nodes: [IotansRegistration!]! -} - -""" -An edge in a connection. -""" -type IotansRegistrationEdge { - """ - The item at the end of the edge - """ - node: IotansRegistration! - """ - A cursor for use in pagination - """ - cursor: String! -} - """ Arbitrary JSON data. """ @@ -1993,16 +1789,6 @@ type MoveObject implements IMoveObject & IObject & IOwner { The `0x3::staking_pool::StakedIota` objects owned by this object. """ stakedIotas(first: Int, after: String, last: Int, before: String): StakedIotaConnection! - """ - The domain explicitly configured as the default domain pointing to this - object. - """ - defaultIotansName(format: DomainFormat): String - """ - The IotansRegistration NFTs owned by this object. These grant the owner - the capability to manage the associated domain. - """ - iotansRegistrations(first: Int, after: String, last: Int, before: String): IotansRegistrationConnection! version: Int! """ The current status of the object as read from the off-chain store. The @@ -2102,10 +1888,6 @@ type MoveObject implements IMoveObject & IObject & IOwner { Attempts to convert the Move object into a `0x2::coin::CoinMetadata`. """ asCoinMetadata: CoinMetadata - """ - Attempts to convert the Move object into a `IotansRegistration` object. - """ - asIotansRegistration: IotansRegistration } type MoveObjectConnection { @@ -2183,19 +1965,6 @@ type MovePackage implements IObject & IOwner { are immutable and cannot be owned by an address. """ stakedIotas(first: Int, after: String, last: Int, before: String): StakedIotaConnection! - """ - The domain explicitly configured as the default domain pointing to this - object. - """ - defaultIotansName(format: DomainFormat): String - """ - The IotansRegistration NFTs owned by this package. These grant the owner - the capability to manage the associated domain. - - Note that objects owned by a package are inaccessible, because packages - are immutable and cannot be owned by an address. - """ - iotansRegistrations(first: Int, after: String, last: Int, before: String): IotansRegistrationConnection! version: Int! """ The current status of the object as read from the off-chain store. The @@ -2531,16 +2300,6 @@ type Object implements IObject & IOwner { The `0x3::staking_pool::StakedIota` objects owned by this object. """ stakedIotas(first: Int, after: String, last: Int, before: String): StakedIotaConnection! - """ - The domain explicitly configured as the default domain pointing to this - object. - """ - defaultIotansName(format: DomainFormat): String - """ - The IotansRegistration NFTs owned by this object. These grant the owner - the capability to manage the associated domain. - """ - iotansRegistrations(first: Int, after: String, last: Int, before: String): IotansRegistrationConnection! version: Int! """ The current status of the object as read from the off-chain store. The @@ -2890,16 +2649,6 @@ type Owner implements IOwner { address. """ stakedIotas(first: Int, after: String, last: Int, before: String): StakedIotaConnection! - """ - The domain explicitly configured as the default domain pointing to this - object or address. - """ - defaultIotansName(format: DomainFormat): String - """ - The IotansRegistration NFTs owned by this object or address. These grant - the owner the capability to manage the associated domain. - """ - iotansRegistrations(first: Int, after: String, last: Int, before: String): IotansRegistrationConnection! asAddress: Address asObject: Object """ @@ -3183,10 +2932,6 @@ type Query { """ protocolConfig(protocolVersion: Int): ProtocolConfigs! """ - Resolves a IotaNS `domain` name to an address, if it has been bound. - """ - resolveIotansAddress(domain: String!): Address - """ The coin metadata associated with the given coin type. """ coinMetadata(coinType: String!): CoinMetadata @@ -3511,16 +3256,6 @@ type StakedIota implements IMoveObject & IObject & IOwner { The `0x3::staking_pool::StakedIota` objects owned by this object. """ stakedIotas(first: Int, after: String, last: Int, before: String): StakedIotaConnection! - """ - The domain explicitly configured as the default domain pointing to this - object. - """ - defaultIotansName(format: DomainFormat): String - """ - The IotansRegistration NFTs owned by this object. These grant the owner - the capability to manage the associated domain. - """ - iotansRegistrations(first: Int, after: String, last: Int, before: String): IotansRegistrationConnection! version: Int! """ The current status of the object as read from the off-chain store. The diff --git a/crates/iota-indexer/src/apis/indexer_api.rs b/crates/iota-indexer/src/apis/indexer_api.rs index 5edb575239a..9f22f49ae0d 100644 --- a/crates/iota-indexer/src/apis/indexer_api.rs +++ b/crates/iota-indexer/src/apis/indexer_api.rs @@ -3,10 +3,7 @@ // SPDX-License-Identifier: Apache-2.0 use async_trait::async_trait; -use iota_json_rpc::{ - name_service::{Domain, NameRecord, NameServiceConfig}, - IotaRpcModule, -}; +use iota_json_rpc::IotaRpcModule; use iota_json_rpc_api::{cap_page_limit, internal_error, IndexerApiServer}; use iota_json_rpc_types::{ DynamicFieldPage, EventFilter, EventPage, IotaObjectData, IotaObjectDataOptions, @@ -17,7 +14,7 @@ use iota_open_rpc::Module; use iota_types::{ base_types::{IotaAddress, ObjectID}, digests::TransactionDigest, - dynamic_field::{DynamicFieldName, Field}, + dynamic_field::DynamicFieldName, error::IotaObjectResponseError, event::EventID, object::ObjectRead, @@ -25,20 +22,15 @@ use iota_types::{ }; use jsonrpsee::{core::RpcResult, PendingSubscriptionSink, RpcModule}; -use crate::{indexer_reader::IndexerReader, IndexerError}; +use crate::indexer_reader::IndexerReader; pub(crate) struct IndexerApi { inner: IndexerReader, - name_service_config: NameServiceConfig, } impl IndexerApi { pub fn new(inner: IndexerReader) -> Self { - Self { - inner, - // TODO allow configuring for other networks - name_service_config: Default::default(), - } + Self { inner } } async fn get_owned_objects_internal( @@ -305,66 +297,6 @@ impl IndexerApiServer for IndexerApi { _filter: TransactionFilter, ) { } - - async fn resolve_name_service_address(&self, name: String) -> RpcResult> { - // TODO(manos): Implement new logic. - let domain = name - .parse::() - .map_err(IndexerError::NameServiceError)?; - - let record_id = self.name_service_config.record_field_id(&domain); - - let field_record_object = match self.inner.get_object_in_blocking_task(record_id).await? { - Some(o) => o, - None => return Ok(None), - }; - - let record = NameRecord::try_from(field_record_object) - .map_err(|e| IndexerError::PersistentStorageDataCorruptionError(e.to_string()))?; - - Ok(record.target_address) - } - - async fn resolve_name_service_names( - &self, - address: IotaAddress, - _cursor: Option, - _limit: Option, - ) -> RpcResult> { - let reverse_record_id = self - .name_service_config - .reverse_record_field_id(address.as_ref()); - - let field_reverse_record_object = match self - .inner - .get_object_in_blocking_task(reverse_record_id) - .await? - { - Some(o) => o, - None => { - return Ok(Page { - data: vec![], - next_cursor: None, - has_next_page: false, - }); - } - }; - - let domain = field_reverse_record_object - .to_rust::>() - .ok_or_else(|| { - IndexerError::PersistentStorageDataCorruptionError(format!( - "Malformed Object {reverse_record_id}" - )) - })? - .value; - - Ok(Page { - data: vec![domain.to_string()], - next_cursor: None, - has_next_page: false, - }) - } } impl IotaRpcModule for IndexerApi { diff --git a/crates/iota-indexer/src/errors.rs b/crates/iota-indexer/src/errors.rs index 64226abd85d..c4ed5a29bfd 100644 --- a/crates/iota-indexer/src/errors.rs +++ b/crates/iota-indexer/src/errors.rs @@ -3,7 +3,6 @@ // SPDX-License-Identifier: Apache-2.0 use fastcrypto::error::FastCryptoError; -use iota_json_rpc::name_service::NameServiceError; use iota_json_rpc_api::{error_object_from_rpc, internal_error}; use iota_types::{ base_types::ObjectIDParseError, @@ -29,6 +28,7 @@ impl std::fmt::Display for DataDownloadError { } #[derive(Debug, Error)] +#[non_exhaustive] pub enum IndexerError { #[error("Indexer failed to convert timestamp to NaiveDateTime with error: `{0}`")] DateTimeParsingError(String), @@ -130,9 +130,6 @@ pub enum IndexerError { #[error("Indexer failed to send item to channel with error: `{0}`")] MpscChannelError(String), - - #[error(transparent)] - NameServiceError(#[from] NameServiceError), } pub trait Context { diff --git a/crates/iota-json-rpc-api/src/indexer.rs b/crates/iota-json-rpc-api/src/indexer.rs index 2552e384d9d..64c780d0231 100644 --- a/crates/iota-json-rpc-api/src/indexer.rs +++ b/crates/iota-json-rpc-api/src/indexer.rs @@ -5,7 +5,7 @@ use iota_json_rpc_types::{ DynamicFieldPage, EventFilter, EventPage, IotaEvent, IotaObjectResponse, IotaObjectResponseQuery, IotaTransactionBlockEffects, IotaTransactionBlockResponseQuery, - ObjectsPage, Page, TransactionBlocksPage, TransactionFilter, + ObjectsPage, TransactionBlocksPage, TransactionFilter, }; use iota_open_rpc_macros::open_rpc; use iota_types::{ @@ -106,25 +106,4 @@ pub trait IndexerApi { /// The Name of the dynamic field name: DynamicFieldName, ) -> RpcResult; - - /// Return the resolved address given resolver and name - #[rustfmt::skip] - #[method(name = "resolveNameServiceAddress")] - async fn resolve_name_service_address( - &self, - /// The name to resolve - name: String, - ) -> RpcResult>; - - /// Return the resolved names given address, - /// if multiple names are resolved, the first one is the primary name. - #[rustfmt::skip] - #[method(name = "resolveNameServiceNames")] - async fn resolve_name_service_names( - &self, - /// The address to resolve - address: IotaAddress, - cursor: Option, - limit: Option, - ) -> RpcResult>; } diff --git a/crates/iota-json-rpc-tests/tests/name_service_tests.rs b/crates/iota-json-rpc-tests/tests/name_service_tests.rs deleted file mode 100644 index ad9a9e678b6..00000000000 --- a/crates/iota-json-rpc-tests/tests/name_service_tests.rs +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use std::str::FromStr; - -use iota_json_rpc::name_service::{self, Domain}; -use iota_types::{ - base_types::{IotaAddress, ObjectID}, - collection_types::VecMap, -}; - -#[test] -fn test_parent_extraction() { - let mut name = Domain::from_str("leaf.node.test.iota").unwrap(); - - assert_eq!(name.parent().to_string(), "node.test.iota"); - - name = Domain::from_str("node.test.iota").unwrap(); - - assert_eq!(name.parent().to_string(), "test.iota"); -} - -#[test] -fn test_expirations() { - let system_time: u64 = 100; - - let mut name = name_service::NameRecord { - nft_id: iota_types::id::ID::new(ObjectID::random()), - data: VecMap { contents: vec![] }, - target_address: Some(IotaAddress::random_for_testing_only()), - expiration_timestamp_ms: system_time + 10, - }; - - assert!(!name.is_node_expired(system_time)); - - name.expiration_timestamp_ms = system_time - 10; - - assert!(name.is_node_expired(system_time)); -} - -#[test] -fn test_name_service_outputs() { - assert_eq!("@test".parse::().unwrap().to_string(), "test.iota"); - assert_eq!( - "test.iota".parse::().unwrap().to_string(), - "test.iota" - ); - assert_eq!( - "test@sld".parse::().unwrap().to_string(), - "test.sld.iota" - ); - assert_eq!( - "test.test@example".parse::().unwrap().to_string(), - "test.test.example.iota" - ); - assert_eq!( - "iota@iota".parse::().unwrap().to_string(), - "iota.iota.iota" - ); - - assert_eq!("@iota".parse::().unwrap().to_string(), "iota.iota"); - - assert_eq!( - "test*test@test".parse::().unwrap().to_string(), - "test.test.test.iota" - ); - assert_eq!( - "test.test.iota".parse::().unwrap().to_string(), - "test.test.iota" - ); - assert_eq!( - "test.test.test.iota".parse::().unwrap().to_string(), - "test.test.test.iota" - ); -} - -#[test] -fn test_different_wildcard() { - assert_eq!("test.iota".parse::(), "test*iota".parse::(),); - - assert_eq!("@test".parse::(), "test*iota".parse::(),); -} - -#[test] -fn test_invalid_inputs() { - assert!("*".parse::().is_err()); - assert!(".".parse::().is_err()); - assert!("@".parse::().is_err()); - assert!("@inner.iota".parse::().is_err()); - assert!("@inner*iota".parse::().is_err()); - assert!("test@".parse::().is_err()); - assert!("iota".parse::().is_err()); - assert!("test.test@example.iota".parse::().is_err()); - assert!("test@test@example".parse::().is_err()); -} - -#[test] -fn output_tests() { - let mut domain = "test.iota".parse::().unwrap(); - assert!(domain.format(name_service::DomainFormat::Dot) == "test.iota"); - assert!(domain.format(name_service::DomainFormat::At) == "@test"); - - domain = "test.test.iota".parse::().unwrap(); - assert!(domain.format(name_service::DomainFormat::Dot) == "test.test.iota"); - assert!(domain.format(name_service::DomainFormat::At) == "test@test"); - - domain = "test.test.test.iota".parse::().unwrap(); - assert!(domain.format(name_service::DomainFormat::Dot) == "test.test.test.iota"); - assert!(domain.format(name_service::DomainFormat::At) == "test.test@test"); - - domain = "test.test.test.test.iota".parse::().unwrap(); - assert!(domain.format(name_service::DomainFormat::Dot) == "test.test.test.test.iota"); - assert!(domain.format(name_service::DomainFormat::At) == "test.test.test@test"); -} diff --git a/crates/iota-json-rpc/src/error.rs b/crates/iota-json-rpc/src/error.rs index 0d21d5e8c71..dff46a65485 100644 --- a/crates/iota-json-rpc/src/error.rs +++ b/crates/iota-json-rpc/src/error.rs @@ -24,11 +24,12 @@ use jsonrpsee::{ use thiserror::Error; use tokio::task::JoinError; -use crate::{authority_state::StateReadError, name_service::NameServiceError}; +use crate::authority_state::StateReadError; pub type RpcInterimResult = Result; #[derive(Debug, Error)] +#[non_exhaustive] pub enum Error { #[error(transparent)] IotaError(IotaError), @@ -76,9 +77,6 @@ pub enum Error { #[error("Unsupported Feature: {0}")] UnsupportedFeature(String), - - #[error("transparent")] - NameServiceError(#[from] NameServiceError), } impl From for Error { @@ -119,25 +117,6 @@ impl From for RpcError { None, )), }, - Error::NameServiceError(err) => match err { - NameServiceError::ExceedsMaxLength { .. } - | NameServiceError::InvalidHyphens { .. } - | NameServiceError::InvalidLength { .. } - | NameServiceError::InvalidUnderscore { .. } - | NameServiceError::LabelsEmpty { .. } - | NameServiceError::InvalidSeparator { .. } => { - RpcError::Call(ErrorObject::owned::<()>( - ErrorCode::InvalidParams.code(), - err.to_string(), - None, - )) - } - _ => RpcError::Call(ErrorObject::owned::<()>( - CALL_EXECUTION_FAILED_CODE, - err.to_string(), - None, - )), - }, Error::IotaRpcInputError(err) => RpcError::Call(ErrorObject::owned::<()>( ErrorCode::InvalidParams.code(), err.to_string(), diff --git a/crates/iota-json-rpc/src/indexer_api.rs b/crates/iota-json-rpc/src/indexer_api.rs index aae2497f44f..4b90b3137d1 100644 --- a/crates/iota-json-rpc/src/indexer_api.rs +++ b/crates/iota-json-rpc/src/indexer_api.rs @@ -6,7 +6,7 @@ use std::{sync::Arc, time::Duration}; use anyhow::{anyhow, bail}; use async_trait::async_trait; -use futures::{future, Stream, StreamExt}; +use futures::{Stream, StreamExt}; use iota_core::authority::AuthorityState; use iota_json::IotaJsonValue; use iota_json_rpc_api::{ @@ -24,7 +24,7 @@ use iota_storage::key_value_store::TransactionKeyValueStore; use iota_types::{ base_types::{IotaAddress, ObjectID}, digests::TransactionDigest, - dynamic_field::{DynamicFieldName, Field}, + dynamic_field::DynamicFieldName, error::IotaObjectResponseError, event::EventID, }; @@ -38,10 +38,9 @@ use tokio::sync::{OwnedSemaphorePermit, Semaphore}; use tracing::{debug, instrument}; use crate::{ - authority_state::{StateRead, StateReadResult}, + authority_state::StateRead, error::{Error, IotaRpcInputError}, logger::with_tracing, - name_service::{Domain, NameRecord, NameServiceConfig, NameServiceError}, IotaRpcModule, }; @@ -102,7 +101,6 @@ pub struct IndexerApi { state: Arc, read_api: R, transaction_kv_store: Arc, - name_service_config: NameServiceConfig, pub metrics: Arc, subscription_semaphore: Arc, } @@ -112,7 +110,6 @@ impl IndexerApi { state: Arc, read_api: R, transaction_kv_store: Arc, - name_service_config: NameServiceConfig, metrics: Arc, max_subscriptions: Option, ) -> Self { @@ -121,7 +118,6 @@ impl IndexerApi { state, transaction_kv_store, read_api, - name_service_config, metrics, subscription_semaphore: Arc::new(Semaphore::new(max_subscriptions)), } @@ -148,16 +144,6 @@ impl IndexerApi { Err(_) => bail!("Resources exhausted"), } } - - fn get_latest_checkpoint_timestamp_ms(&self) -> StateReadResult { - let latest_checkpoint = self.state.get_latest_checkpoint_sequence_number()?; - - let checkpoint = self - .state - .get_verified_checkpoint_by_sequence_number(latest_checkpoint)?; - - Ok(checkpoint.timestamp_ms) - } } #[async_trait] @@ -423,134 +409,6 @@ impl IndexerApiServer for IndexerApi { ) .await } - - #[instrument(skip(self))] - async fn resolve_name_service_address(&self, name: String) -> RpcResult> { - with_tracing( - async move { - // prepare the requested domain's field id. - let domain = name.parse::().map_err(Error::from)?; - let record_id = self.name_service_config.record_field_id(&domain); - - // prepare the parent's field id. - let parent_domain = domain.parent(); - let parent_record_id = self.name_service_config.record_field_id(&parent_domain); - - let current_timestamp_ms = self.get_latest_checkpoint_timestamp_ms()?; - - // Do these two reads in parallel. - let mut requests = vec![self.state.get_object(&record_id)]; - - // Also add the parent in the DB reads if the requested domain is a subdomain. - if domain.is_subdomain() { - requests.push(self.state.get_object(&parent_record_id)); - } - - // Couldn't find a `multi_get_object` for this crate (looks like it uses a k,v - // db) Always fetching both parent + child at the same time (even - // for node subdomains), to avoid sequential db reads. We do this - // because we do not know if the requested domain is a node - // subdomain or a leaf subdomain, and we can save a trip to the db. - let mut results = future::try_join_all(requests).await?; - - // Removing without checking vector len, since it is known (== 1 or 2 depending - // on whether it is a subdomain or not). - let Some(object) = results.remove(0) else { - return Ok(None); - }; - - let name_record = NameRecord::try_from(object)?; - - // Handling SLD names & node subdomains is the same (we handle them as `node` - // records) We check their expiration, and and if not expired, - // return the target address. - if !name_record.is_leaf_record() { - return if !name_record.is_node_expired(current_timestamp_ms) { - Ok(name_record.target_address) - } else { - Err(Error::from(NameServiceError::NameExpired)) - }; - } - - // == Handle leaf subdomains case == - // We can remove since we know that if we're here, we have a parent - // (which also means we queried it in the future above). - let Some(parent_object) = results.remove(0) else { - return Err(Error::from(NameServiceError::NameExpired)); - }; - - let parent_name_record = NameRecord::try_from(parent_object)?; - - // For a leaf record, we check that: - // 1. The parent is a valid parent for that leaf record - // 2. The parent is not expired - if parent_name_record.is_valid_leaf_parent(&name_record) - && !parent_name_record.is_node_expired(current_timestamp_ms) - { - Ok(name_record.target_address) - } else { - Err(Error::from(NameServiceError::NameExpired)) - } - }, - None, - ) - .await - } - - #[instrument(skip(self))] - async fn resolve_name_service_names( - &self, - address: IotaAddress, - _cursor: Option, - _limit: Option, - ) -> RpcResult> { - with_tracing( - async move { - let reverse_record_id = self - .name_service_config - .reverse_record_field_id(address.as_ref()); - - let mut result = Page { - data: vec![], - next_cursor: None, - has_next_page: false, - }; - - let Some(field_reverse_record_object) = - self.state.get_object(&reverse_record_id).await? - else { - return Ok(result); - }; - - let domain = field_reverse_record_object - .to_rust::>() - .ok_or_else(|| { - Error::UnexpectedError(format!("Malformed Object {reverse_record_id}")) - })? - .value; - - let domain_name = domain.to_string(); - - let resolved_address = self - .resolve_name_service_address(domain_name.clone()) - .await - .map_err(|e| Error::InternalError(anyhow!(e)))?; - - // If looking up the domain returns an empty result, we return an empty result. - if resolved_address.is_none() { - return Ok(result); - } - - // TODO(manos): Discuss why is this even a paginated response. - // This API is always going to return a single domain name. - result.data.push(domain_name); - - Ok(result) - }, - None, - ) - .await - } } impl IotaRpcModule for IndexerApi { diff --git a/crates/iota-json-rpc/src/lib.rs b/crates/iota-json-rpc/src/lib.rs index 5cf6b40810a..b2ceec949c2 100644 --- a/crates/iota-json-rpc/src/lib.rs +++ b/crates/iota-json-rpc/src/lib.rs @@ -44,7 +44,6 @@ pub mod indexer_api; pub mod logger; mod metrics; pub mod move_utils; -pub mod name_service; mod object_changes; pub mod read_api; mod routing_layer; diff --git a/crates/iota-json-rpc/src/name_service.rs b/crates/iota-json-rpc/src/name_service.rs deleted file mode 100644 index bdda125ef4c..00000000000 --- a/crates/iota-json-rpc/src/name_service.rs +++ /dev/null @@ -1,400 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -use std::{fmt, marker::PhantomData, str::FromStr}; - -use iota_types::{ - base_types::{IotaAddress, ObjectID}, - collection_types::VecMap, - dynamic_field::Field, - id::{ID, UID}, - object::{MoveObject, Object}, - TypeTag, -}; -use move_core_types::{ident_str, identifier::IdentStr, language_storage::StructTag}; -use serde::{Deserialize, Serialize}; - -const NAME_SERVICE_DOMAIN_MODULE: &IdentStr = ident_str!("domain"); -const NAME_SERVICE_DOMAIN_STRUCT: &IdentStr = ident_str!("Domain"); -const NAME_SERVICE_DEFAULT_PACKAGE_ADDRESS: &str = - "0xd22b24490e0bae52676651b4f56660a5ff8022a2576e0089f79b3c88d44e08f0"; -const NAME_SERVICE_DEFAULT_REGISTRY: &str = - "0xe64cd9db9f829c6cc405d9790bd71567ae07259855f4fba6f02c84f52298c106"; -const NAME_SERVICE_DEFAULT_REVERSE_REGISTRY: &str = - "0x2fd099e17a292d2bc541df474f9fafa595653848cbabb2d7a4656ec786a1969f"; -const _NAME_SERVICE_OBJECT_ADDRESS: &str = - "0x6e0ddefc0ad98889c04bab9639e512c21766c5e6366f89e696956d9be6952871"; -const LEAF_EXPIRATION_TIMESTAMP: u64 = 0; -const DEFAULT_TLD: &str = "iota"; -const ACCEPTED_SEPARATORS: [char; 2] = ['.', '*']; -const IOTA_NEW_FORMAT_SEPARATOR: char = '@'; - -/// Two different view options for a domain. -/// `At` -> `test@example` | `Dot` -> `test.example.iota` -#[derive(Clone, Eq, PartialEq, Debug)] -pub enum DomainFormat { - At, - Dot, -} - -#[derive(Debug, Serialize, Deserialize, Clone)] -pub struct Registry { - /// The `registry` table maps `Domain` to `NameRecord`. - /// Added / replaced in the `add_record` function. - registry: Table, - /// The `reverse_registry` table maps `address` to `domain_name`. - /// Updated in the `set_reverse_lookup` function. - reverse_registry: Table, -} - -/// Rust version of the Move iota::table::Table type. -#[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq)] -pub struct Table { - pub id: ObjectID, - pub size: u64, - - #[serde(skip)] - _key: PhantomData, - #[serde(skip)] - _value: PhantomData, -} - -#[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq)] -pub struct Domain { - labels: Vec, -} - -impl Domain { - pub fn type_(package_address: IotaAddress) -> StructTag { - StructTag { - address: package_address.into(), - module: NAME_SERVICE_DOMAIN_MODULE.to_owned(), - name: NAME_SERVICE_DOMAIN_STRUCT.to_owned(), - type_params: vec![], - } - } - - /// Derive the parent domain for a given domain - /// E.g. `test.example.iota` -> `example.iota` - /// - /// SAFETY: This is a safe operation because we only allow a - /// domain's label vector size to be >= 2 (see `Domain::from_str`) - pub fn parent(&self) -> Domain { - Domain { - labels: self.labels[0..(self.labels.len() - 1)].to_vec(), - } - } - - pub fn is_subdomain(&self) -> bool { - self.depth() >= 3 - } - - /// Returns the depth for a name. - /// Depth is defined by the amount of labels in a domain, including TLD. - /// E.g. `test.example.iota` -> `3` - /// - /// SAFETY: We can safely cast to a u8 as the max depth is 235. - pub fn depth(&self) -> u8 { - self.labels.len() as u8 - } - - /// Formats a domain into a string based on the available output formats. - /// The default separator is `.` - pub fn format(&self, format: DomainFormat) -> String { - let mut labels = self.labels.clone(); - let sep = &ACCEPTED_SEPARATORS[0].to_string(); - labels.reverse(); - - if format == DomainFormat::Dot { - return labels.join(sep); - }; - - // SAFETY: This is a safe operation because we only allow a - // domain's label vector size to be >= 2 (see `Domain::from_str`) - let _tld = labels.pop(); - let sld = labels.pop().unwrap(); - - format!("{}{IOTA_NEW_FORMAT_SEPARATOR}{sld}", labels.join(sep)) - } -} - -#[derive(Clone, Debug, Serialize, Deserialize, Eq, PartialEq)] -#[serde(rename_all = "kebab-case")] -pub struct NameServiceConfig { - pub package_address: IotaAddress, - pub registry_id: ObjectID, - pub reverse_registry_id: ObjectID, -} - -impl NameServiceConfig { - pub fn new( - package_address: IotaAddress, - registry_id: ObjectID, - reverse_registry_id: ObjectID, - ) -> Self { - Self { - package_address, - registry_id, - reverse_registry_id, - } - } - - pub fn record_field_id(&self, domain: &Domain) -> ObjectID { - let domain_type_tag = Domain::type_(self.package_address); - let domain_bytes = bcs::to_bytes(domain).unwrap(); - - iota_types::dynamic_field::derive_dynamic_field_id( - self.registry_id, - &TypeTag::Struct(Box::new(domain_type_tag)), - &domain_bytes, - ) - .unwrap() - } - - pub fn reverse_record_field_id(&self, address: &[u8]) -> ObjectID { - iota_types::dynamic_field::derive_dynamic_field_id( - self.reverse_registry_id, - &TypeTag::Address, - address, - ) - .unwrap() - } -} - -impl Default for NameServiceConfig { - fn default() -> Self { - let package_address = IotaAddress::from_str(NAME_SERVICE_DEFAULT_PACKAGE_ADDRESS).unwrap(); - let registry_id = ObjectID::from_str(NAME_SERVICE_DEFAULT_REGISTRY).unwrap(); - let reverse_registry_id = - ObjectID::from_str(NAME_SERVICE_DEFAULT_REVERSE_REGISTRY).unwrap(); - Self::new(package_address, registry_id, reverse_registry_id) - } -} - -impl FromStr for Domain { - type Err = NameServiceError; - - fn from_str(s: &str) -> Result { - /// The maximum length of a full domain - const MAX_DOMAIN_LENGTH: usize = 200; - - if s.len() > MAX_DOMAIN_LENGTH { - return Err(NameServiceError::ExceedsMaxLength( - s.len(), - MAX_DOMAIN_LENGTH, - )); - } - let separator = separator(s)?; - - let formatted_string = convert_from_new_format(s, &separator)?; - - let labels = formatted_string - .split(separator) - .rev() - .map(validate_label) - .collect::, Self::Err>>()?; - - // A valid domain in our system has at least a TLD and an SLD (len == 2). - if labels.len() < 2 { - return Err(NameServiceError::LabelsEmpty); - } - - let labels = labels.into_iter().map(ToOwned::to_owned).collect(); - Ok(Domain { labels }) - } -} - -/// Parses a separator from the domain string input. -/// E.g. `example.iota` -> `.` | example*iota -> `@` | `example*iota` -> `*` -fn separator(s: &str) -> Result { - let mut domain_separator: Option = None; - - for separator in ACCEPTED_SEPARATORS.iter() { - if s.contains(*separator) { - if domain_separator.is_some() { - return Err(NameServiceError::InvalidSeparator); - } - - domain_separator = Some(*separator); - } - } - - match domain_separator { - Some(separator) => Ok(separator), - None => Ok(ACCEPTED_SEPARATORS[0]), - } -} - -/// Converts @label ending to label{separator}iota ending. -/// -/// E.g. `@example` -> `example.iota` | `test@example` -> `test.example.iota` -fn convert_from_new_format(s: &str, separator: &char) -> Result { - let mut splits = s.split(IOTA_NEW_FORMAT_SEPARATOR); - - let Some(before) = splits.next() else { - return Err(NameServiceError::InvalidSeparator); - }; - - let Some(after) = splits.next() else { - return Ok(before.to_string()); - }; - - if splits.next().is_some() || after.contains(*separator) || after.is_empty() { - return Err(NameServiceError::InvalidSeparator); - } - - let mut parts = vec![]; - - if !before.is_empty() { - parts.push(before); - } - - parts.push(after); - parts.push(DEFAULT_TLD); - - Ok(parts.join(&separator.to_string())) -} - -fn validate_label(label: &str) -> Result<&str, NameServiceError> { - const MIN_LABEL_LENGTH: usize = 1; - const MAX_LABEL_LENGTH: usize = 63; - let bytes = label.as_bytes(); - let len = bytes.len(); - - if !(MIN_LABEL_LENGTH..=MAX_LABEL_LENGTH).contains(&len) { - return Err(NameServiceError::InvalidLength( - len, - MIN_LABEL_LENGTH, - MAX_LABEL_LENGTH, - )); - } - - for (i, character) in bytes.iter().enumerate() { - let is_valid_character = match character { - b'a'..=b'z' => true, - b'0'..=b'9' => true, - b'-' if i != 0 && i != len - 1 => true, - _ => false, - }; - - if !is_valid_character { - match character { - b'-' => return Err(NameServiceError::InvalidHyphens), - _ => return Err(NameServiceError::InvalidUnderscore), - } - }; - } - Ok(label) -} - -impl fmt::Display for Domain { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - // We use to_string() to check on-chain state and parse on-chain data - // so we should always default to DOT format. - let output = self.format(DomainFormat::Dot); - f.write_str(&output)?; - - Ok(()) - } -} - -/// A single record in the registry. -#[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq)] -pub struct NameRecord { - /// The ID of the `RegistrationNFT` assigned to this record. - /// - /// The owner of the corrisponding `RegistrationNFT` has the rights to - /// be able to change and adjust the `target_address` of this domain. - /// - /// It is possible that the ID changes if the record expires and is - /// purchased by someone else. - pub nft_id: ID, - /// Timestamp in milliseconds when the record expires. - pub expiration_timestamp_ms: u64, - /// The target address that this domain points to - pub target_address: Option, - /// Additional data which may be stored in a record - pub data: VecMap, -} - -impl NameRecord { - /// Leaf records expire when their parent expires. - /// The `expiration_timestamp_ms` is set to `0` (on-chain) to indicate this. - pub fn is_leaf_record(&self) -> bool { - self.expiration_timestamp_ms == LEAF_EXPIRATION_TIMESTAMP - } - - /// Validate that a `NameRecord` is a valid parent of a child `NameRecord`. - /// - /// WARNING: This only applies for `leaf` records - pub fn is_valid_leaf_parent(&self, child: &NameRecord) -> bool { - self.nft_id == child.nft_id - } - - /// Checks if a `node` name record has expired. - /// Expects the latest checkpoint's timestamp. - pub fn is_node_expired(&self, checkpoint_timestamp_ms: u64) -> bool { - self.expiration_timestamp_ms < checkpoint_timestamp_ms - } -} - -impl TryFrom for NameRecord { - type Error = NameServiceError; - - fn try_from(object: Object) -> Result { - object - .to_rust::>() - .map(|record| record.value) - .ok_or_else(|| NameServiceError::MalformedObject(object.id())) - } -} - -impl TryFrom for NameRecord { - type Error = NameServiceError; - - fn try_from(object: MoveObject) -> Result { - object - .to_rust::>() - .map(|record| record.value) - .ok_or_else(|| NameServiceError::MalformedObject(object.id())) - } -} - -#[derive(thiserror::Error, Debug, Serialize, Deserialize, Clone, Eq, PartialEq)] -pub enum NameServiceError { - #[error("Name Service: String length: {0} exceeds maximum allowed length: {1}")] - ExceedsMaxLength(usize, usize), - #[error("Name Service: String length: {0} outside of valid range: [{1}, {2}]")] - InvalidLength(usize, usize, usize), - #[error("Name Service: Hyphens are not allowed as the first or last character")] - InvalidHyphens, - #[error("Name Service: Only lowercase letters, numbers, and hyphens are allowed")] - InvalidUnderscore, - #[error("Name Service: Domain must contain at least one label")] - LabelsEmpty, - #[error("Name Service: Domain must include only one separator")] - InvalidSeparator, - - #[error("Name Service: Name has expired.")] - NameExpired, - #[error("Name Service: Malformed object for {0}")] - MalformedObject(ObjectID), -} - -/// A IotansRegistration object to manage an SLD -#[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq)] -pub struct IotansRegistration { - pub id: UID, - pub domain: Domain, - pub domain_name: String, - pub expiration_timestamp_ms: u64, - pub image_url: String, -} - -/// A SubDomainRegistration object to manage a subdomain. -#[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq)] -pub struct SubDomainRegistration { - pub id: UID, - pub nft: IotansRegistration, -} diff --git a/crates/iota-node/src/lib.rs b/crates/iota-node/src/lib.rs index aa0d3019a31..de95d008cd9 100644 --- a/crates/iota-node/src/lib.rs +++ b/crates/iota-node/src/lib.rs @@ -1967,26 +1967,10 @@ pub async fn build_http_server( ))?; } - let name_service_config = - if let (Some(package_address), Some(registry_id), Some(reverse_registry_id)) = ( - config.name_service_package_address, - config.name_service_registry_id, - config.name_service_reverse_registry_id, - ) { - iota_json_rpc::name_service::NameServiceConfig::new( - package_address, - registry_id, - reverse_registry_id, - ) - } else { - iota_json_rpc::name_service::NameServiceConfig::default() - }; - server.register_module(IndexerApi::new( state.clone(), ReadApi::new(state.clone(), kv_store.clone(), metrics.clone()), kv_store, - name_service_config, metrics, config.indexer_max_subscriptions, ))?; diff --git a/crates/iota-open-rpc/spec/openrpc.json b/crates/iota-open-rpc/spec/openrpc.json index d6c21b5750a..1990c6b492e 100644 --- a/crates/iota-open-rpc/spec/openrpc.json +++ b/crates/iota-open-rpc/spec/openrpc.json @@ -3034,11 +3034,11 @@ "name": "past_objects", "value": [ { - "objectId": "0x5056aa3325512c8af40b9f5fd7065c83ded900657eac70a7979c2541646fa449", + "objectId": "0x70f2d83f980fe0996a92d351d6749a0a0b47998aaf3d11da24c49e014d4ccb1d", "version": "4" }, { - "objectId": "0xe81109dc075f537067726d63dd5287100e177404a969989215da2abfbfc098cf", + "objectId": "0x7d0cd09d3cc1679290f1df2803b32b76ba0395dbb635e3fb7390f04e6567f739", "version": "12" } ] @@ -3062,14 +3062,14 @@ { "status": "VersionFound", "details": { - "objectId": "0x5056aa3325512c8af40b9f5fd7065c83ded900657eac70a7979c2541646fa449", + "objectId": "0x70f2d83f980fe0996a92d351d6749a0a0b47998aaf3d11da24c49e014d4ccb1d", "version": "4", - "digest": "F34PCnEHm5GAP5ksDKPSdRMKz49JiqrvLUTZsiojqJS2", + "digest": "GcteyqtLYTc7Fig8CKtspCafwf6muuDgMtDUA1jrYKae", "type": "0x2::coin::Coin<0x2::iota::IOTA>", "owner": { - "AddressOwner": "0xfde53941b2a08a8bf752c20979842732ac019f52835282744318d6d84f3c52b3" + "AddressOwner": "0xb01f2f3f227a90090e6777f19aa10fd9e64e29dd4e8da119481d1a7c3c050dc5" }, - "previousTransaction": "EMLrFqmDkZtFvidxKy1T8bwAiHnUiLqramE58kSUcAf8", + "previousTransaction": "6QcGEYeKTxceVnzLrGuMT2XfPyvsh56cfhXA3ofKtYxY", "storageRebate": "100", "content": { "dataType": "moveObject", @@ -3078,7 +3078,7 @@ "fields": { "balance": "10000", "id": { - "id": "0x5056aa3325512c8af40b9f5fd7065c83ded900657eac70a7979c2541646fa449" + "id": "0x70f2d83f980fe0996a92d351d6749a0a0b47998aaf3d11da24c49e014d4ccb1d" } } } @@ -3087,14 +3087,14 @@ { "status": "VersionFound", "details": { - "objectId": "0xe81109dc075f537067726d63dd5287100e177404a969989215da2abfbfc098cf", + "objectId": "0x7d0cd09d3cc1679290f1df2803b32b76ba0395dbb635e3fb7390f04e6567f739", "version": "12", - "digest": "FvrqyqH5yA85sziA2NoPGJ8N23kmTxeXQh4HyJAbB7c2", + "digest": "F34PCnEHm5GAP5ksDKPSdRMKz49JiqrvLUTZsiojqJS2", "type": "0x2::coin::Coin<0x2::iota::IOTA>", "owner": { - "AddressOwner": "0x13090a95287cde98d711fc27217b81e08d494bdb70c3b42f0fe27be8eb500568" + "AddressOwner": "0xfde53941b2a08a8bf752c20979842732ac019f52835282744318d6d84f3c52b3" }, - "previousTransaction": "6XEirxRenmgbeg4tviP43bAKsosqgySXwoBxGEWQVTii", + "previousTransaction": "EMLrFqmDkZtFvidxKy1T8bwAiHnUiLqramE58kSUcAf8", "storageRebate": "100", "content": { "dataType": "moveObject", @@ -3103,7 +3103,7 @@ "fields": { "balance": "20000", "id": { - "id": "0x5056aa3325512c8af40b9f5fd7065c83ded900657eac70a7979c2541646fa449" + "id": "0x70f2d83f980fe0996a92d351d6749a0a0b47998aaf3d11da24c49e014d4ccb1d" } } } @@ -4435,115 +4435,6 @@ } ] }, - { - "name": "iotax_resolveNameServiceAddress", - "tags": [ - { - "name": "Extended API" - } - ], - "description": "Return the resolved address given resolver and name", - "params": [ - { - "name": "name", - "description": "The name to resolve", - "required": true, - "schema": { - "type": "string" - } - } - ], - "result": { - "name": "IotaAddress", - "schema": { - "$ref": "#/components/schemas/IotaAddress" - } - }, - "examples": [ - { - "name": "Returns the resolved address for the name the request provides.", - "params": [ - { - "name": "name", - "value": "example.iota" - } - ], - "result": { - "name": "Result", - "value": "0x70f2d83f980fe0996a92d351d6749a0a0b47998aaf3d11da24c49e014d4ccb1d" - } - } - ] - }, - { - "name": "iotax_resolveNameServiceNames", - "tags": [ - { - "name": "Extended API" - } - ], - "description": "Return the resolved names given address, if multiple names are resolved, the first one is the primary name.", - "params": [ - { - "name": "address", - "description": "The address to resolve", - "required": true, - "schema": { - "$ref": "#/components/schemas/IotaAddress" - } - }, - { - "name": "cursor", - "schema": { - "$ref": "#/components/schemas/ObjectID" - } - }, - { - "name": "limit", - "schema": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - } - } - ], - "result": { - "name": "Page", - "required": true, - "schema": { - "$ref": "#/components/schemas/Page_for_String_and_ObjectID" - } - }, - "examples": [ - { - "name": "Returns the IotaNS name for the address the request provides. Currently, the API returns only the first name in cases where there are multiple. Future support will use the cursor ID and limit values in the request to control pagination of the response for addresses with multiple names.", - "params": [ - { - "name": "address", - "value": "0xb01f2f3f227a90090e6777f19aa10fd9e64e29dd4e8da119481d1a7c3c050dc5" - }, - { - "name": "cursor", - "value": "0x7d0cd09d3cc1679290f1df2803b32b76ba0395dbb635e3fb7390f04e6567f739" - }, - { - "name": "limit", - "value": 3 - } - ], - "result": { - "name": "Result", - "value": { - "data": [ - "example.iota" - ], - "nextCursor": "0x7d0cd09d3cc1679290f1df2803b32b76ba0395dbb635e3fb7390f04e6567f739", - "hasNextPage": false - } - } - } - ] - }, { "name": "iotax_subscribeEvent", "tags": [ @@ -9803,35 +9694,6 @@ } } }, - "Page_for_String_and_ObjectID": { - "description": "`next_cursor` points to the last item in the page; Reading with `next_cursor` will start from the next item after `next_cursor` if `next_cursor` is `Some`, otherwise it will start from the first item.", - "type": "object", - "required": [ - "data", - "hasNextPage" - ], - "properties": { - "data": { - "type": "array", - "items": { - "type": "string" - } - }, - "hasNextPage": { - "type": "boolean" - }, - "nextCursor": { - "anyOf": [ - { - "$ref": "#/components/schemas/ObjectID" - }, - { - "type": "null" - } - ] - } - } - }, "Page_for_TransactionBlockResponse_and_TransactionDigest": { "description": "`next_cursor` points to the last item in the page; Reading with `next_cursor` will start from the next item after `next_cursor` if `next_cursor` is `Some`, otherwise it will start from the first item.", "type": "object", diff --git a/crates/iota-open-rpc/src/examples.rs b/crates/iota-open-rpc/src/examples.rs index cd3af447738..ef776b49078 100644 --- a/crates/iota-open-rpc/src/examples.rs +++ b/crates/iota-open-rpc/src/examples.rs @@ -25,7 +25,7 @@ use iota_json_rpc_types::{ IotaTransactionBlockResponseQuery, IotaTypeTag, MoveCallParams, MoveFunctionArgType, ObjectChange, ObjectValueKind::{ByImmutableReference, ByMutableReference, ByValue}, - ObjectsPage, OwnedObjectRef, Page, ProtocolConfigResponse, RPCTransactionRequestParams, Stake, + ObjectsPage, OwnedObjectRef, ProtocolConfigResponse, RPCTransactionRequestParams, Stake, StakeStatus, TransactionBlockBytes, TransactionBlocksPage, TransactionFilter, TransferObjectParams, ValidatorApy, ValidatorApys, }; @@ -133,8 +133,6 @@ impl RpcExampleProvider { self.iota_get_chain_identifier(), self.iotax_get_stakes(), self.iotax_get_stakes_by_ids(), - self.iotax_resolve_name_service_address(), - self.iotax_resolve_name_service_names(), self.iota_try_multi_get_past_objects(), ] .into_iter() @@ -1484,43 +1482,6 @@ impl RpcExampleProvider { ) } - fn iotax_resolve_name_service_address(&mut self) -> Examples { - let result = ObjectID::new(self.rng.gen()); - Examples::new( - "iotax_resolveNameServiceAddress", - vec![ExamplePairing::new( - "Returns the resolved address for the name the request provides.", - vec![("name", json!("example.iota".to_string()))], - json!(result), - )], - ) - } - - fn iotax_resolve_name_service_names(&mut self) -> Examples { - let next_cursor = Some(ObjectID::new(self.rng.gen())); - let object_id = ObjectID::new(self.rng.gen()); - let result = Page { - data: vec!["example.iota".to_string()], - next_cursor, - has_next_page: false, - }; - Examples::new( - "iotax_resolveNameServiceNames", - vec![ExamplePairing::new( - "Returns the IotaNS name for the address the request provides. \ - Currently, the API returns only the first name in cases where there are multiple. \ - Future support will use the cursor ID and limit values in the request to control \ - pagination of the response for addresses with multiple names.", - vec![ - ("address", json!(object_id)), - ("cursor", json!(next_cursor)), - ("limit", json!(3)), - ], - json!(result), - )], - ) - } - fn iota_try_multi_get_past_objects(&mut self) -> Examples { let object_id = ObjectID::new(self.rng.gen()); let object_id2 = ObjectID::new(self.rng.gen()); diff --git a/crates/iota-swarm-config/src/node_config_builder.rs b/crates/iota-swarm-config/src/node_config_builder.rs index 907865b1f27..0b0d0a4a3f3 100644 --- a/crates/iota-swarm-config/src/node_config_builder.rs +++ b/crates/iota-swarm-config/src/node_config_builder.rs @@ -181,9 +181,6 @@ impl ValidatorConfigBuilder { // By default, expensive checks will be enabled in debug build, but not in release // build. expensive_safety_check_config: ExpensiveSafetyCheckConfig::default(), - name_service_package_address: None, - name_service_registry_id: None, - name_service_reverse_registry_id: None, transaction_deny_config: Default::default(), certificate_deny_config: Default::default(), state_debug_dump_config: Default::default(), @@ -443,9 +440,6 @@ impl FullnodeConfigBuilder { expensive_safety_check_config: self .expensive_safety_check_config .unwrap_or_else(ExpensiveSafetyCheckConfig::new_enable_all), - name_service_package_address: None, - name_service_registry_id: None, - name_service_reverse_registry_id: None, transaction_deny_config: Default::default(), certificate_deny_config: Default::default(), state_debug_dump_config: Default::default(), diff --git a/crates/iota-swarm-config/tests/snapshots/snapshot_tests__populated_genesis_snapshot_matches-2.snap b/crates/iota-swarm-config/tests/snapshots/snapshot_tests__populated_genesis_snapshot_matches-2.snap index a25b55f501b..a4da17638c5 100644 --- a/crates/iota-swarm-config/tests/snapshots/snapshot_tests__populated_genesis_snapshot_matches-2.snap +++ b/crates/iota-swarm-config/tests/snapshots/snapshot_tests__populated_genesis_snapshot_matches-2.snap @@ -8,7 +8,7 @@ system_state_version: 1 iota_treasury_cap: inner: id: - id: "0x3e2f7d1d26f3d94f8be18d0e3356fa702e334244e1731be70db6d6537efb94cb" + id: "0x91c5cb86a8f5ca83e5d6c98364ae466b61f30988c84c5aaa4f1deac9f1309f92" total_supply: value: "751500000000000000" validators: @@ -246,13 +246,13 @@ validators: next_epoch_worker_address: ~ extra_fields: id: - id: "0xe5350d62968644c8df8ec8e7b665d4321ce455026466f6e9de9a27241b81a7ee" + id: "0xab831c65cae3ffe2a0ff502f2d29f370e6d5c8a843c1e6a621fddfa739320d95" size: 0 voting_power: 10000 - operation_cap_id: "0x9359fe9a2560ec754b04003a97c5187e70341155052bdfcfe3cd350dbb334cc9" + operation_cap_id: "0x4b07c5ab7d10588c63752f0d80b8e3393bbc8243b7b334ec8b13f11df4ee1cb4" gas_price: 1000 staking_pool: - id: "0xf1c8333a54f569a43534eb89c47d67018e8e3a2c19bf0c7ccaefd3d5d79e8182" + id: "0x7c51fa796b41f372feb9e9eb22cd1772d3f90d996870d11d116e7ef8f36b42ba" activation_epoch: 0 deactivation_epoch: ~ iota_balance: 1500000000000000 @@ -260,14 +260,14 @@ validators: value: 0 pool_token_balance: 1500000000000000 exchange_rates: - id: "0xe35e69f3e31f2700efaa7c656b1aba51109a7a54dc368ea7c6103c4720873ec4" + id: "0x2dae55d1c8585028bbf2c35fd2e404c33f1b9fda65461467701ac29f6c05f281" size: 1 pending_stake: 0 pending_total_iota_withdraw: 0 pending_pool_token_withdraw: 0 extra_fields: id: - id: "0x8513c7b4e769ce35bae25317f38fca34c97e435bb0310d1931b594ac35cc1e7b" + id: "0x0a6906507273edad07142eab0cb264cd16e876a349e9090f042cf11f1fbd2cc4" size: 0 commission_rate: 200 next_epoch_stake: 1500000000000000 @@ -275,27 +275,27 @@ validators: next_epoch_commission_rate: 200 extra_fields: id: - id: "0xf1dba5a8cb0785c207b6d3a04395636ad61d99e98815d7165c77406395c209c9" + id: "0xde0f7d304ad58014fe97f98d90c18401bdc99f288dcfe5dc1625802c00da783f" size: 0 pending_active_validators: contents: - id: "0x350c14b87abe377e2217ec552e0f96ae8533b187d23411202b2a5bee201b3508" + id: "0xd8dc8b186b2f6e094c404b8ae2716bf9cbc640b8bb4ff2fd9a966891c3dd1abd" size: 0 pending_removals: [] staking_pool_mappings: - id: "0x196b0c9496f73100408450648be2d2fe5d7921084ce62281e4e3e3d3102b9303" + id: "0xcb479f1e45cbadcc69f9d243c7cff1fd7bccd431376306791bddc31e49498900" size: 1 inactive_validators: - id: "0xedf8b88c2d612deec19bb45d450af4f067f0a0d77d8d56ea8ad27fb441ce4499" + id: "0xe75d96b690f4ed2a3bcd69c75cbb977f20150eda937f46b98192573859d52b46" size: 0 validator_candidates: - id: "0x273862d974448f91c9673a7eff7b423f6f1e9aca533ca4793cc256edff4a776a" + id: "0x84497848af5f75ab7bb3e92897d0cbae5d034b36799cab34f51211f7b84133c3" size: 0 at_risk_validators: contents: [] extra_fields: id: - id: "0xa2446bbd18953945032a7e72237272749536b1e83395757424741d7d53d3de73" + id: "0xdd8d92c8e2b262be52086337a2ece8ac79453ccf7255e6fa7bc840f8c7da577a" size: 0 storage_fund: total_object_storage_rebates: @@ -311,7 +311,7 @@ parameters: validator_low_stake_grace_period: 7 extra_fields: id: - id: "0x98dcee75b4d98a7abdb8267f168db976c6f24c0376095a2fc71163b39427817c" + id: "0x092aed0eca8850a736986de201e8f40378c5fcb7b0466001dd12c7056a278f94" size: 0 reference_gas_price: 1000 validator_report_records: @@ -326,5 +326,5 @@ safe_mode_non_refundable_storage_fee: 0 epoch_start_timestamp_ms: 10 extra_fields: id: - id: "0xb2d037cb77e804228b6d2d9a135cfda241a65b1b80cba7edb05edd6fdbe4bdf0" + id: "0x8a30ba6139256c363c4eb6b92fae8b7da6c34b747b47b8cc909b6f5366438e69" size: 0 diff --git a/sdk/graphql-transport/src/queries/nameService.graphql b/sdk/graphql-transport/src/queries/nameService.graphql deleted file mode 100644 index ebd7234f1c1..00000000000 --- a/sdk/graphql-transport/src/queries/nameService.graphql +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright (c) Mysten Labs, Inc. -# Modifications Copyright (c) 2024 IOTA Stiftung -# SPDX-License-Identifier: Apache-2.0 - -query resolveNameServiceAddress($domain: String!) { - resolveIotansAddress(domain: $domain) { - address - } -} - -query resolveNameServiceNames($address: IotaAddress!, $limit: Int, $cursor: String) { - address(address: $address) { - iotansRegistrations(first: $limit, after: $cursor) { - pageInfo { - hasNextPage - endCursor - } - nodes { - domain - } - } - } -}