Skip to content

[sdk]: align sdk with latest ABI changes, add docs, fix tests#911

Merged
Wizdave97 merged 28 commits into
mainfrom
roy/hft-and-intent-gateway-v2
May 27, 2026
Merged

[sdk]: align sdk with latest ABI changes, add docs, fix tests#911
Wizdave97 merged 28 commits into
mainfrom
roy/hft-and-intent-gateway-v2

Conversation

@royvardhan
Copy link
Copy Markdown
Collaborator

@royvardhan royvardhan commented May 25, 2026

Summary

Docs

  • New Bandwidth section under docs/content/developers/evm/bandwidth/ — overview, purchasing, governance, configuration. Documents the subscription model, BandwidthManager / pallet-bandwidth / BandwidthGate loop, end-to-end flow, and per-chain bring-up checklist.
  • Refreshed mainnet contract addresses page (Polkadot Hub added, Unichain dropped).

SDK

  • Drop removed perByteFee from EvmHost.quote() (now returns 0n) and from the exported HostParams type.
  • HFT: drop call to nonexistent quoteNative(); quote() is treated as native cost. Fixes a latent bug where paying in native was silently no-op because totalNativeCost was always 0.
  • stateCalls.test.ts sources the BSC Chapel host from chainConfigs[97] instead of process.env.BSC_ISMP_HOST_ADDRESS.
  • Hash POST/GET request commitments with abi.encode to match the V3 host (SolValue::abi_encode parity instead of abi_encode_params).
  • Pass tuple values as named objects to encodeAbiParameters.

Simplex

  • Align ABIs with IntentGatewayV2 ([evm]: IntentGatewayV2 fixes #897): OrderPlaced.source/destinationstring, NewDeploymentAddedDeploymentAdded, DestinationProtocolFeeUpdated carries string chain.
  • Drop dead perByteFee cache + initCache fetch loop now that bandwidth replaces per-byte pricing.

Indexer

  • Same ABI realignment as simplex (IntentGatewayV2 [evm]: IntentGatewayV2 fixes #897).
  • Drop PostResponse handling — handlers, services, types, ABI entries (the protocol no longer carries PostResponse).
  • Drop protocol-fee indexing entirely (bandwidth subscriptions replace the old per-byte protocol fee). Removes DailyProtocolFeesStats, protocolFeesEarned, related compute helpers.
  • Rename HyperBridgeChainStatsHyperBridgeStats (entity, service, file).
  • Refresh EthereumHost.abi.json against the new EvmHost; fix GetRequestEvent topic in YAML codegen.
  • Drop TokenGateway code, services, and migration scripts (no longer indexed).
  • Rename UserActivityUserActivityV2.
  • Remove gnosis-chiado from testnet/local/nexus-ci configs (no longer supported on testnet).
  • Update testnet & mainnet ISMP host / handler addresses to reflect redeployment.

Wizdave97 and others added 6 commits May 18, 2026 16:31
Point the EVM registry, SDK chain configs, and indexer testnet config at
the redeployed Gargantua V3 IsmpHost and HandlerV2 addresses.
Delete the TokenGateway/asset-teleport handlers, services, ABI, schema
entities and config entries, plus the one-off entity-data migration
script and its test.
Update erc6160ext20 to the redeployed testnet fee token across the
indexer configs, and skip the IntentGateway integration tests in the
SDK and simplex since those contracts were not redeployed.
Version the entity that lost its teleport fields so it gets a fresh
table, and restore the TOKEN_TELEPORTED_POINTS enum value to avoid
downstream changes.
Point the HyperFungibleToken test at the redeployed host, faucet, and
token addresses, and skip the suite until the host's uniswapV2Router is
configured and the test account is funded.
@royvardhan royvardhan changed the title align indexer + simplex ABIs with IntentGatewayV2 #897; fix HFT SDK quote fallback [sdk]: align indexer + simplex ABIs with IntentGatewayV2 and fix HFT quote fallback May 25, 2026
Comment thread sdk/packages/sdk/src/protocols/hyperFungibleToken.ts Outdated
@royvardhan royvardhan force-pushed the roy/hft-and-intent-gateway-v2 branch from 5c9460f to c86a86b Compare May 25, 2026 08:25
royvardhan and others added 6 commits May 25, 2026 14:37
…d-intent-gateway-v2

# Conflicts:
#	sdk/packages/indexer/src/configs/abis/TokenGateway.abi.json
#	sdk/packages/indexer/src/mappings/mappingHandlers.ts
- Point tesseract registry, SDK chain configs, and indexer mainnet config
  at the new mainnet IsmpHost (0x6201...) and HandlerV2 (0x2a18...).
- Add Polkadot Hub mainnet (EVM-420420419) to tesseract, SDK, and indexer.
- Remove Unichain (130) from tesseract, SDK, and indexer mainnet configs.
- Update indexer startBlocks to the host deployment blocks for both
  testnet and mainnet.
- Re-enable the @hyperbridge/sdk test workflow.
@royvardhan royvardhan changed the title [sdk]: align indexer + simplex ABIs with IntentGatewayV2 and fix HFT quote fallback [sdk]: align sdk with latest ABI changes, add docs, fix tests May 26, 2026
@royvardhan
Copy link
Copy Markdown
Collaborator Author

royvardhan commented May 26, 2026

@Wizdave97 perByteFee was used across the codebase, now we have app-sponsored bandwidth. What should be the ideal change for these perByteFee refs? For now, I am returning 0.

Comment thread docs/content/developers/evm/bandwidth/overview.mdx Outdated
Comment thread docs/content/developers/evm/bandwidth/overview.mdx Outdated
Comment thread docs/content/developers/evm/bandwidth/overview.mdx
@Wizdave97 Wizdave97 marked this pull request as draft May 26, 2026 11:39
@Wizdave97 Wizdave97 marked this pull request as ready for review May 26, 2026 11:39
Wizdave97 and others added 7 commits May 26, 2026 15:00
The indexer's RequestService.computeRequestCommitment and the SDK's
post/getRequestCommitment were hashing the packed encoding of request
fields in the wrong field order. The V3 EVM host commits with
keccak256(abi.encode(PostRequest)) using the struct's tuple layout, so
every SDK lookup against the indexer (and every mmr_queryProof) missed.

Switch both to encodeAbiParameters with the outer tuple wrapper and
fields in struct order:
  PostRequest: source, dest, nonce, from, to, timeoutTimestamp, body
  GetRequest:  source, dest, nonce, from, timeoutTimestamp, keys, height, context

End-to-end verified: lock-bsc HFT test now runs SOURCE -> SOURCE_FINALIZED
-> HYPERBRIDGE_DELIVERED -> HYPERBRIDGE_FINALIZED -> DESTINATION.
tsup's dts build rejected the positional-array form against viem's tuple
component types. Switch post/getRequestCommitment to the named-object
form to satisfy the inferred TS types; encoding result is unchanged.
The test hardcoded "POL0" for chain 80002, but the SDK's defaults map
and the published Gargantua deployment both use "POLY". For lock-bsc
Polygon is the destination so the mismatch never bit, but for
burn-polygon Polygon is the source — SDK calls like
latestStateMachineHeight and the on-chain proof submission key off this
id, so SOURCE_FINALIZED / proof construction never finds a match and
the test never reaches DESTINATION.
@Wizdave97 Wizdave97 merged commit 76514f7 into main May 27, 2026
11 checks passed
@Wizdave97 Wizdave97 deleted the roy/hft-and-intent-gateway-v2 branch May 27, 2026 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants