Indexer assertion#196
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
shinzo-webapp-staging | f5c9969 | Commit Preview URL Branch Preview URL |
May 15 2026, 08:12 PM |
903b85c to
cdbf344
Compare
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
shinzo-webapp-staging | 8a88e45 | May 06 2026, 08:34 PM |
119dd26 to
8cb652e
Compare
8cb652e to
8a88e45
Compare
| @@ -28,6 +28,25 @@ export const isRegistrationV2 = () => { | |||
| return process.env.NEXT_PUBLIC_SHINZOHUB_V2_REGISTRATION_FLAG === "true"; | |||
| }; | |||
There was a problem hiding this comment.
suggestion: add NEXT_PUBLIC_SHINZOHUB_V2_REGISTRATION_FLAG to env.example to not lose it
| if (!isRegistrationV2()) { | ||
| return redirect("/registration"); | ||
| } | ||
| return <Header />; |
| import { isRegistrationV2 } from "@/shared/lib"; | ||
| import { AddressCopy } from "@/widget"; | ||
|
|
||
| export default function IndexerAssertion() { |
There was a problem hiding this comment.
feedback (ui): it'd be nice to rethink the page structure the way we present and explain the form to users.
- User address could go to header to be a standard connection button that transforms into an address. Copy button is probably redundant as users know their address and can take it from the wallet.
- Subtitle on the page could be more informative and explain what an assertion actually is and why people might need it.
- Delegate address is prefilled automatically on connection – maybe then hide it from UI? Plus, its tooltip says it should accept "shinzo_"-prefixed addresses, and we prefill a EVM address - UI mismatch.
- "Source chain" field - should it have Sepolia/Poligon that we already support?
- Source chain ID is prefilled - can easily be removed
- Consensus public key should probably have a tooltip that explains in simple language what it is
- "Sign and submit" - can it be a non-red button please? :)
| async function getChainId(rpc: string): Promise<string> { | ||
| const res = await fetch(`${rpc}/status`); | ||
| const json = (await res.json()) as any; | ||
| return json.result.node_info.network; | ||
| } |
There was a problem hiding this comment.
question: do we need it? ShinzoHub chain is static and doesn't change often. Can be an env var
There was a problem hiding this comment.
concur: there will be between 2 & 3 different options that we can use for the chain id and can be set in an env var.
There was a problem hiding this comment.
This function is returning the chainId for the Shinzohub, so I have moved that to a constant variable.
There was a problem hiding this comment.
don't see the changes. Did you commit them?
| export async function adminIndexerAssertion( | ||
| opts: AdminIndexerAssertionOptions | ||
| ) { |
There was a problem hiding this comment.
thought: that function seems super complicated and is extremely difficult to read, mostly because the tx encoding is done manually here. Why not use Viem/Wagmi as you had in v1? Creating and sending transaction is much easier with it. At least it could remove much of the logic from the file.
There was a problem hiding this comment.
The registration transactions are evm based transactions that is why we are using viem/wagmi there. But the request for assertion is on cosmos, I have switched all the conversions to use viem but still we need to use cosmos sdk for creating and sending the request.
|
Extra: we are going to need to remove the references to v1 after migrating to v2. Good to keep in mind and not focus on both working at the same time. |
| import { isRegistrationV2 } from "@/shared/lib"; | ||
| import { AddressCopy } from "@/widget"; | ||
|
|
||
| export default function IndexerAssertion() { |
| async function getChainId(rpc: string): Promise<string> { | ||
| const res = await fetch(`${rpc}/status`); | ||
| const json = (await res.json()) as any; | ||
| return json.result.node_info.network; | ||
| } |
There was a problem hiding this comment.
concur: there will be between 2 & 3 different options that we can use for the chain id and can be set in an env var.
| return { | ||
| consensusPubKey: "", | ||
| delegateAddress: connectedAddress, | ||
| sourceChain: "ethereum" as SOURCE_CHAIN, |
There was a problem hiding this comment.
nitpick: should be a env var
| try { | ||
| const preDigest = randomHexString32(); | ||
| const msgBytes = stringToBytes(preDigest); | ||
| const prefix = `\x19Ethereum Signed Message:\n${msgBytes.length}`; |
There was a problem hiding this comment.
use the Ethereum ENV to build this
There was a problem hiding this comment.
As we have discussed, I have added this comment #196 (comment)
| /** Delegate digest is a fixed-length payload (32 characters). */ | ||
| export const DELEGATE_DIGEST_MAX_LENGTH = 32; | ||
|
|
||
| export type SOURCE_CHAIN = "ethereum" | "shinzohub"; |
There was a problem hiding this comment.
removed this type as we can extract the type from SOURCE_CHAIN_ID_MAP
| export const SOURCE_CHAIN_ID_MAP: Record<SOURCE_CHAIN, number> = { | ||
| ethereum: 1, | ||
| shinzohub: 91273002, | ||
| }; |
There was a problem hiding this comment.
nitpick: consider a separate file which can be used across the app
There was a problem hiding this comment.
Moved to constants in shared folder
| "host-registration": { | ||
| title: "/ Register Host on the Shinzo Network", | ||
| description: | ||
| "Sign up your host to be recognized by the Shinzo Network and contribute to the ecosystem.", |
There was a problem hiding this comment.
nitpick: sentence structure is awkward.
suggestion: Register your host to participate within the Shinzo Network
There was a problem hiding this comment.
@soniasingla or @johnnymatthews can you review the grammar/sentences before we deploy? I am going to create an issue.
|
While submitting assertion request, we are including a evm signature along with the digest (string that is used for sigining) and the address, which will be verifies in the cosmos env. In a evm wallet according to EIP-191, the messages that has to signed need to be prefixed with |
31fedd3 to
f0d0b89
Compare
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ❌ Deployment failed View logs |
shinzo-studio | 5e03fff | May 13 2026, 09:26 PM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ❌ Deployment failed View logs |
faucet | 5e03fff | May 13 2026, 09:26 PM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ❌ Deployment failed View logs |
shinzo-explorer | 5e03fff | May 13 2026, 09:26 PM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ❌ Deployment failed View logs |
metrics-dashboard | 5e03fff | May 13 2026, 09:26 PM |
… sign to delegate signature, extract input field to widget
…e to be processed initernally
f0d0b89 to
5e03fff
Compare
| export const getSourceChainMap = () => { | ||
| return JSON.parse(process.env.NEXT_PUBLIC_AVAILABLE_SOURCE_CHAINS ?? "{}"); | ||
| }; |
There was a problem hiding this comment.
chore: add return type to the functions, default value returns, and example of this env in the .env.example
There was a problem hiding this comment.
thought: it's really unexpected to have a stringified JSON as an env. To me it can be a static value
There was a problem hiding this comment.
I made that update based on a review comment. I think whether it is in env or static, we would have to update when we add a new chain.
There was a problem hiding this comment.
Moved chain related constant values to a separate constant file
| label: "Consensus Public Key", | ||
| isTextarea: false, | ||
| isSelect: false, | ||
| description: "The consensus public key of the indexer", |
There was a problem hiding this comment.
chore: update description to make the text useful and let users understand where to get this data from in case they don't come with a link
There was a problem hiding this comment.
I need some help with proper the titles and tooltips texts, so I have created a separate Pr to track that #210.
I have left a message in the fe channel for the same.
There was a problem hiding this comment.
I think we can have @johnnymatthews + @soniasingla review for titles, grammar and general sentence structure. I created a ticket here: #213
008938f to
2f917ec
Compare
| "host-registration": { | ||
| title: "/ Register Host on the Shinzo Network", | ||
| description: | ||
| "Sign up your host to be recognized by the Shinzo Network and contribute to the ecosystem.", |
There was a problem hiding this comment.
@soniasingla or @johnnymatthews can you review the grammar/sentences before we deploy? I am going to create an issue.
| label: "Consensus Public Key", | ||
| isTextarea: false, | ||
| isSelect: false, | ||
| description: "The consensus public key of the indexer", |
There was a problem hiding this comment.
I think we can have @johnnymatthews + @soniasingla review for titles, grammar and general sentence structure. I created a ticket here: #213
Pull Request
Description
Indexer assertion
Registration
Widgets
Related Issue
fixes #184
The landing page is currently blank it will be updated in the next PR.
Steps to Test
Checklist
Notes