# Provide on-chain and off-chain information for Spork information

**URL:** <https://forum.flow.com/t/provide-on-chain-and-off-chain-information-for-spork-information/3523>\
**Category:** 🛠 Developer Tools\
**Created:** [August 25, 2022, 5:40am UTC](https://forum.flow.com/t/provide-on-chain-and-off-chain-information-for-spork-information/3523 "2022-08-25T05:40:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yagop](https://avatars.discourse-cdn.com/v4/letter/y/a4c791/32.png) [@yagop](https://forum.flow.com/u/yagop)\
**Post date:** [August 25, 2022, 5:40am UTC](https://forum.flow.com/t/provide-on-chain-and-off-chain-information-for-spork-information/3523/1 "2022-08-25T05:40:12Z")

</div>

There is lack of information needed related to Sporks.

First of all, the previous Mainnet must stop generating blocks, we can see how Mainnet 18 is still producing blocks while Mainnet 19 is still active. That creates a hardfork.

```
flow blocks get 35858812 --host access-001.mainnet18.nodes.onflow.org:9000
Block ID 357c8f53d725e7b356fe43570e5b6235cd64dbd6019935af01216f47ef732c0f
Parent ID c318dc350d31270ef8969df8e83cd828cb5e4723ede2ead1400e5df565c66bf3
Timestamp 2022-08-24 15:00:05.014643817 +0000 UTC
Height 35858812

flow blocks get 35858812 --host access-001.mainnet19.nodes.onflow.org:9000
Block ID a8a0b1f620f37fd7960541e34d99a958b829b1ed560bcc3471f725e59f849c8f
Parent ID 5690a5f4a21f565ac7416eca7302f2cb1aa4dd9b1baf0b0873901a776ee7f7c4
Timestamp 2022-08-24 15:07:07 +0000 UTC
Height 35858812

```

To avoid that happen there must be a on-chain mechanism to determine when a mainnet stop. For example the Mainnet X will stop at block Y.

To make things easier for developers to consume the blocks there must be a HTTP endpoint with the block information Something like:

```
curl https://rest-mainnet.onflow.org/v1/sporks

[
    {
        "spork": 1,
        "block_start: 1,
        "block_end: 999
    },
    {
        "spork": 2,
        "block_start: 1000,
        "block_end: 1999
    }
]
```

---

<div class="post-metadata">

**Author:** ![flowjosh](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.flow.com/flowjosh/32/362_2.png) [@flowjosh](https://forum.flow.com/u/flowjosh)\
**Post date:** [August 25, 2022, 4:18pm UTC](https://forum.flow.com/t/provide-on-chain-and-off-chain-information-for-spork-information/3523/2 "2022-08-25T16:18:47Z")

</div>

Thank you for this suggestion! I’m gonna pass it around to get more eyes on it,

---

<div class="post-metadata">

**Author:** ![vishal](https://avatars.discourse-cdn.com/v4/letter/v/49beb7/32.png) [@vishal](https://forum.flow.com/u/vishal)\
**Post date:** [August 31, 2022, 10:51pm UTC](https://forum.flow.com/t/provide-on-chain-and-off-chain-information-for-spork-information/3523/3 "2022-08-31T22:51:09Z")

</div>

Thanks @yagop for flagging these issues!

You are right, we are unfortunately generating finalized blocks on the old chain which are abandoned.  
This happens because we stop the old network at a `sealed` block, say at height X but there are always some blocks beyond that sealed block which have been `finalized` but yet to be sealed at height X+1, X+2 etc. Then, after the spork, when we start the new network at block height X+1, there ends up being sealed blocks at X+1, X+2 different from the finalized blocks on the old chain at the same height.

We are working on figuring out a long term solution for this.

However, in the interim, we plan to do the following to address this:

1. Changes to Flow CLI - Flow CLI currently returns the latest **finalized** block when used to query a block by height. It also does not report the status of the block, one of - `finalized`, `executed`, `sealed`. We have created this [issue](https://github.com/onflow/flow-cli/issues/576) to address that problem. Flow CLI could then be used to follow the chain and stop at the last sealed block height (optionally) on the old chain after a spork.

2. Change to the Access API - Similar to the Flow CLI change to additionally provide the block status, this [issue](https://github.com/onflow/flow-go/issues/3106) will make all the Access API block responses to also additionally include the block status to help the client differentiate between a finalized and a sealed block.

Finally, you mentioned about publishing the sporks heights. We do maintain this [JSON file](https://github.com/onflow/flow/blob/master/sporks.json) which provides the spork height. That can be used to determine the start and end of a spork.

Hope this helps in addressing your concerns.

Let us know what you think.
