Move to reorg period of 1 for mantapacific (#3126)

### Description

- Moves to a reorg period of 1 for mantapacific instead of 0 - this
should avoid the IGP indexing bugs we're seeing where we first get the
latest block, then make an eth_getLogs RPC, but the node servicing the
latter RPC doesn't yet know of the new latest block

### Drive-by changes

Remove some duplication of the reorg period

### Related issues

n/a

### Backward compatibility

backward compatible

### Testing

none yet, other than deploying
trevor/port-over-addtl-igp-cmds
Trevor Porter 10 months ago committed by GitHub
parent 3339f78537
commit ae4476ad09
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 6
      .changeset/healthy-suits-punch.md
  2. 2
      rust/config/mainnet3_config.json
  3. 30
      typescript/infra/config/environments/mainnet3/validators.ts
  4. 34
      typescript/infra/config/environments/testnet4/validators.ts
  5. 2
      typescript/sdk/src/consts/chainMetadata.ts
  6. 1
      typescript/sdk/src/index.ts
  7. 6
      typescript/sdk/src/metadata/chainMetadataTypes.ts

@ -0,0 +1,6 @@
---
'@hyperlane-xyz/infra': patch
'@hyperlane-xyz/sdk': patch
---
Bumped mantapacific reorgPeriod to 1, a reorg period in chain metadata is now required by infra.

@ -387,7 +387,7 @@
},
"blocks": {
"confirmations": 1,
"reorgPeriod": 0,
"reorgPeriod": 1,
"estimateBlockTime": 3
},
"rpcUrls": [

@ -1,4 +1,4 @@
import { chainMetadata } from '@hyperlane-xyz/sdk';
import { chainMetadata, getReorgPeriod } from '@hyperlane-xyz/sdk';
import { ValidatorBaseChainConfigMap } from '../../../src/config/agent';
import { Contexts } from '../../contexts';
@ -13,7 +13,7 @@ export const validatorChainConfig = (
return {
celo: {
interval: 5,
reorgPeriod: 0,
reorgPeriod: getReorgPeriod(chainMetadata.celo),
validators: validatorsConfig(
{
[Contexts.Hyperlane]: [
@ -29,7 +29,7 @@ export const validatorChainConfig = (
},
ethereum: {
interval: 5,
reorgPeriod: 20,
reorgPeriod: getReorgPeriod(chainMetadata.ethereum),
validators: validatorsConfig(
{
[Contexts.Hyperlane]: [
@ -45,7 +45,7 @@ export const validatorChainConfig = (
},
avalanche: {
interval: 5,
reorgPeriod: 3,
reorgPeriod: getReorgPeriod(chainMetadata.avalanche),
validators: validatorsConfig(
{
[Contexts.Hyperlane]: [
@ -63,7 +63,7 @@ export const validatorChainConfig = (
},
polygon: {
interval: 5,
reorgPeriod: 256,
reorgPeriod: getReorgPeriod(chainMetadata.polygon),
validators: validatorsConfig(
{
[Contexts.Hyperlane]: [
@ -79,7 +79,7 @@ export const validatorChainConfig = (
},
bsc: {
interval: 5,
reorgPeriod: 15,
reorgPeriod: getReorgPeriod(chainMetadata.bsc),
validators: validatorsConfig(
{
[Contexts.Hyperlane]: [
@ -95,7 +95,7 @@ export const validatorChainConfig = (
},
arbitrum: {
interval: 5,
reorgPeriod: 0,
reorgPeriod: getReorgPeriod(chainMetadata.arbitrum),
validators: validatorsConfig(
{
[Contexts.Hyperlane]: [
@ -111,7 +111,7 @@ export const validatorChainConfig = (
},
optimism: {
interval: 5,
reorgPeriod: 0,
reorgPeriod: getReorgPeriod(chainMetadata.optimism),
validators: validatorsConfig(
{
[Contexts.Hyperlane]: [
@ -129,7 +129,7 @@ export const validatorChainConfig = (
},
moonbeam: {
interval: 5,
reorgPeriod: 2,
reorgPeriod: getReorgPeriod(chainMetadata.moonbeam),
validators: validatorsConfig(
{
[Contexts.Hyperlane]: [
@ -145,7 +145,7 @@ export const validatorChainConfig = (
},
gnosis: {
interval: 5,
reorgPeriod: 14,
reorgPeriod: getReorgPeriod(chainMetadata.gnosis),
validators: validatorsConfig(
{
[Contexts.Hyperlane]: [
@ -161,7 +161,7 @@ export const validatorChainConfig = (
},
base: {
interval: 5,
reorgPeriod: 0,
reorgPeriod: getReorgPeriod(chainMetadata.base),
validators: validatorsConfig(
{
[Contexts.Hyperlane]: [
@ -177,7 +177,7 @@ export const validatorChainConfig = (
},
scroll: {
interval: 5,
reorgPeriod: 0,
reorgPeriod: getReorgPeriod(chainMetadata.scroll),
validators: validatorsConfig(
{
[Contexts.Hyperlane]: [
@ -193,7 +193,7 @@ export const validatorChainConfig = (
},
polygonzkevm: {
interval: 5,
reorgPeriod: 0,
reorgPeriod: getReorgPeriod(chainMetadata.polygonzkevm),
validators: validatorsConfig(
{
[Contexts.Hyperlane]: [
@ -209,7 +209,7 @@ export const validatorChainConfig = (
},
neutron: {
interval: 5,
reorgPeriod: 0,
reorgPeriod: getReorgPeriod(chainMetadata.neutron),
validators: validatorsConfig(
{
[Contexts.Hyperlane]: [
@ -225,7 +225,7 @@ export const validatorChainConfig = (
},
mantapacific: {
interval: 5,
reorgPeriod: 0,
reorgPeriod: getReorgPeriod(chainMetadata.mantapacific),
validators: validatorsConfig(
{
[Contexts.Hyperlane]: [

@ -1,4 +1,4 @@
import { chainMetadata } from '@hyperlane-xyz/sdk';
import { chainMetadata, getReorgPeriod } from '@hyperlane-xyz/sdk';
import { ValidatorBaseChainConfigMap } from '../../../src/config/agent';
import { Contexts } from '../../contexts';
@ -13,7 +13,7 @@ export const validatorChainConfig = (
return {
alfajores: {
interval: 5,
reorgPeriod: chainMetadata.alfajores.blocks!.reorgPeriod!,
reorgPeriod: getReorgPeriod(chainMetadata.alfajores),
validators: validatorsConfig(
{
[Contexts.Hyperlane]: [
@ -33,7 +33,7 @@ export const validatorChainConfig = (
},
basegoerli: {
interval: 5,
reorgPeriod: chainMetadata.basegoerli.blocks!.reorgPeriod!,
reorgPeriod: getReorgPeriod(chainMetadata.alfajores),
validators: validatorsConfig(
{
[Contexts.Hyperlane]: [
@ -53,7 +53,7 @@ export const validatorChainConfig = (
},
fuji: {
interval: 5,
reorgPeriod: chainMetadata.fuji.blocks!.reorgPeriod!,
reorgPeriod: getReorgPeriod(chainMetadata.alfajores),
validators: validatorsConfig(
{
[Contexts.Hyperlane]: [
@ -73,7 +73,7 @@ export const validatorChainConfig = (
},
// chiado: {
// interval: 5,
// reorgPeriod: chainMetadata.chiado.blocks!.reorgPeriod!,
// reorgPeriod: getReorgPeriod(chainMetadata.chiado),
// validators: validatorsConfig(
// {
// [Contexts.Hyperlane]: [
@ -92,7 +92,7 @@ export const validatorChainConfig = (
// },
// lineagoerli: {
// interval: 5,
// reorgPeriod: chainMetadata.lineagoerli.blocks!.reorgPeriod!,
// reorgPeriod: getReorgPeriod(chainMetadata.lineagoerli),
// validators: validatorsConfig(
// {
// [Contexts.Hyperlane]: [
@ -111,7 +111,7 @@ export const validatorChainConfig = (
// },
mumbai: {
interval: 5,
reorgPeriod: chainMetadata.mumbai.blocks!.reorgPeriod!,
reorgPeriod: getReorgPeriod(chainMetadata.mumbai),
validators: validatorsConfig(
{
[Contexts.Hyperlane]: [
@ -131,7 +131,7 @@ export const validatorChainConfig = (
},
bsctestnet: {
interval: 5,
reorgPeriod: chainMetadata.bsctestnet.blocks!.reorgPeriod!,
reorgPeriod: getReorgPeriod(chainMetadata.bsctestnet),
validators: validatorsConfig(
{
[Contexts.Hyperlane]: [
@ -151,7 +151,7 @@ export const validatorChainConfig = (
},
goerli: {
interval: 5,
reorgPeriod: chainMetadata.goerli.blocks!.reorgPeriod!,
reorgPeriod: getReorgPeriod(chainMetadata.goerli),
validators: validatorsConfig(
{
[Contexts.Hyperlane]: [
@ -171,7 +171,7 @@ export const validatorChainConfig = (
},
scrollsepolia: {
interval: 5,
reorgPeriod: chainMetadata.scrollsepolia.blocks!.reorgPeriod!,
reorgPeriod: getReorgPeriod(chainMetadata.scrollsepolia),
validators: validatorsConfig(
{
[Contexts.Hyperlane]: [
@ -191,7 +191,7 @@ export const validatorChainConfig = (
},
sepolia: {
interval: 5,
reorgPeriod: chainMetadata.sepolia.blocks!.reorgPeriod!,
reorgPeriod: getReorgPeriod(chainMetadata.sepolia),
validators: validatorsConfig(
{
[Contexts.Hyperlane]: [
@ -211,7 +211,7 @@ export const validatorChainConfig = (
},
moonbasealpha: {
interval: 5,
reorgPeriod: chainMetadata.moonbasealpha.blocks!.reorgPeriod!,
reorgPeriod: getReorgPeriod(chainMetadata.moonbasealpha),
validators: validatorsConfig(
{
[Contexts.Hyperlane]: [
@ -231,7 +231,7 @@ export const validatorChainConfig = (
},
optimismgoerli: {
interval: 5,
reorgPeriod: chainMetadata.optimismgoerli.blocks!.reorgPeriod!,
reorgPeriod: getReorgPeriod(chainMetadata.optimismgoerli),
validators: validatorsConfig(
{
[Contexts.Hyperlane]: [
@ -251,7 +251,7 @@ export const validatorChainConfig = (
},
arbitrumgoerli: {
interval: 5,
reorgPeriod: chainMetadata.arbitrumgoerli.blocks!.reorgPeriod!,
reorgPeriod: getReorgPeriod(chainMetadata.arbitrumgoerli),
validators: validatorsConfig(
{
[Contexts.Hyperlane]: [
@ -271,7 +271,7 @@ export const validatorChainConfig = (
},
polygonzkevmtestnet: {
interval: 5,
reorgPeriod: chainMetadata.polygonzkevmtestnet.blocks!.reorgPeriod!,
reorgPeriod: getReorgPeriod(chainMetadata.polygonzkevmtestnet),
validators: validatorsConfig(
{
[Contexts.Hyperlane]: [
@ -291,7 +291,7 @@ export const validatorChainConfig = (
},
// proteustestnet: {
// interval: 5,
// reorgPeriod: chainMetadata.proteustestnet.blocks!.reorgPeriod!,
// reorgPeriod: getReorgPeriod(chainMetadata.proteustestnet),
// validators: validatorsConfig(
// {
// [Contexts.Hyperlane]: [
@ -308,7 +308,7 @@ export const validatorChainConfig = (
// },
// solanadevnet: {
// interval: 10,
// reorgPeriod: chainMetadata.solanadevnet.blocks!.reorgPeriod!,
// reorgPeriod: getReorgPeriod(chainMetadata.solanadevnet),
// validators: validatorsConfig(
// {
// [Contexts.Hyperlane]: [

@ -451,7 +451,7 @@ export const mantapacific: ChainMetadata = {
blocks: {
confirmations: 1,
estimateBlockTime: 3,
reorgPeriod: 0,
reorgPeriod: 1,
},
chainId: 169,
displayName: 'Manta Pacific',

@ -186,6 +186,7 @@ export {
getChainIdNumber,
getDomainId,
isValidChainMetadata,
getReorgPeriod,
} from './metadata/chainMetadataTypes';
export { ZHash } from './metadata/customZodTypes';
export {

@ -241,3 +241,9 @@ export function getChainIdNumber(chainMetadata: ChainMetadata): number {
if (typeof chainMetadata.chainId === 'number') return chainMetadata.chainId;
else throw new Error('ChainId is not a number, chain may be of Cosmos type');
}
export function getReorgPeriod(chainMetadata: ChainMetadata): number {
if (chainMetadata.blocks?.reorgPeriod !== undefined)
return chainMetadata.blocks.reorgPeriod;
else throw new Error('Chain has no reorg period');
}

Loading…
Cancel
Save