|
53 | 53 | _ block.BatchedChainVM = (*VM)(nil)
|
54 | 54 | _ block.StateSyncableVM = (*VM)(nil)
|
55 | 55 |
|
56 |
| - // TODO: remove after the X-chain supports height indexing. |
57 |
| - mainnetXChainID = ids.FromStringOrPanic("2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM") |
58 |
| - fujiXChainID = ids.FromStringOrPanic("2JVSBoinj9C2J33VntvzYtVJNZdN2NKiwwKjcumHUWEb5DbBrm") |
59 |
| - |
60 | 56 | dbPrefix = []byte("proposervm")
|
61 | 57 | )
|
62 | 58 |
|
@@ -214,7 +210,7 @@ func (vm *VM) Initialize(
|
214 | 210 | return err
|
215 | 211 | }
|
216 | 212 |
|
217 |
| - forkHeight, err := vm.getForkHeight() |
| 213 | + forkHeight, err := vm.GetForkHeight() |
218 | 214 | switch err {
|
219 | 215 | case nil:
|
220 | 216 | chainCtx.Log.Info("initialized proposervm",
|
@@ -575,26 +571,6 @@ func (vm *VM) getBlock(ctx context.Context, id ids.ID) (Block, error) {
|
575 | 571 | return vm.getPreForkBlock(ctx, id)
|
576 | 572 | }
|
577 | 573 |
|
578 |
| -// TODO: remove after the P-chain and X-chain support height indexing. |
579 |
| -func (vm *VM) getForkHeight() (uint64, error) { |
580 |
| - // The fork block can be easily identified with the provided links because |
581 |
| - // the `Parent Hash` is equal to the `Proposer Parent ID`. |
582 |
| - switch vm.ctx.ChainID { |
583 |
| - case constants.PlatformChainID: |
584 |
| - switch vm.ctx.NetworkID { |
585 |
| - case constants.MainnetID: |
586 |
| - return 805732, nil // https://subnets.avax.network/p-chain/block/805732 |
587 |
| - case constants.FujiID: |
588 |
| - return 47529, nil // https://subnets-test.avax.network/p-chain/block/47529 |
589 |
| - } |
590 |
| - case mainnetXChainID: |
591 |
| - return 1, nil // https://subnets.avax.network/x-chain/block/1 |
592 |
| - case fujiXChainID: |
593 |
| - return 1, nil // https://subnets-test.avax.network/x-chain/block/1 |
594 |
| - } |
595 |
| - return vm.GetForkHeight() |
596 |
| -} |
597 |
| - |
598 | 574 | func (vm *VM) getPostForkBlock(ctx context.Context, blkID ids.ID) (PostForkBlock, error) {
|
599 | 575 | block, exists := vm.verifiedBlocks[blkID]
|
600 | 576 | if exists {
|
|
0 commit comments