go icon indicating copy to clipboard operation
go copied to clipboard

Ensure stellar-core version is compatible with Horizon

Open bartekn opened this issue 8 years ago • 4 comments

Horizon should check on init stage if the connected stellar-core version is compatible. Otherwise it should print error and exit. See: https://github.com/stellar/go/issues/371 #455.

To discuss: do we need Horizon-Core protocol version? Is major part of core version (XDR) version enough?

Another dev falling into this: https://stellar.stackexchange.com/questions/801/receiving-error-when-posting-a-transaction-to-horizon

bartekn avatar Mar 29 '18 09:03 bartekn

Failing on startup may be too aggressive. Also, stellar-core can be updated while Horizon is running, so tying this to ingestion is probably a better bet.

I think the simplest check is probably on the current protocol version, not the supported protocol version and this is something done at ingestion time.

   "info" : {
      "build" : "v10.0.0",
      "ledger" : {
         "age" : 4,
         "baseFee" : 100,
         "baseReserve" : 5000000,
         "closeTime" : 1528222881,
         "hash" : "2de38db3acbce4ac87fd8921138c0f4c80fc32cdc553ea5d644ca617364cb64f",
         "num" : 9343930,
         "version" : 9
      },
      "network" : "Test SDF Network ; September 2015",
      "peers" : {
         "authenticated_count" : 67,
         "pending_count" : 0
      },
      "protocol_version" : 10,
      "quorum" : {
         "9343929" : {
            "agree" : 3,
            "disagree" : 0,
            "fail_at" : 2,
            "hash" : "273af2",
            "missing" : 0,
            "phase" : "EXTERNALIZE"
         }
      },
      "state" : "Synced!"
   }

So in this example, Horizon must be able to understand protocol 9 (and should fail to ingest) even though core can generate version 10 at some point (you may want to have a warning in there though as Horizon will fail as soon as the new protocol version is voted by validators).

Something to consider as this gets changed: I know that many people don't necessarily update Horizon (Stronghold for example) even though they are running a newer version of core, because often the protocol changes don't break Horizon - I think that this is dangerous and we should push people to stop doing this. It may just mean that we need to have more stable Horizon releases more often and people would be expected to always upgrade to the latest version of Horizon every time they want to upgrade their stellar-core.

MonsieurNicolas avatar Jun 05 '18 18:06 MonsieurNicolas

So in this example, Horizon must be able to understand protocol 9 (and should fail to ingest) even though core can generate version 10 at some point (you may want to have a warning in there though as Horizon will fail as soon as the new protocol version is voted by validators).

Sounds like a perfect behaviour would be to have a support for current and the next protocol version in Horizon. Then there will be no downtime when the protocol upgrade happens. Later, in one of the following Horizon releases we can drop support for the previous protocol version.

bartekn avatar Jun 05 '18 19:06 bartekn

you can never drop support for old versions of the protocol as to allow catchup complete; also requiring the next version is not necessary as it's not technically active yet, and it makes sequencing upgrades of horizon and core more complicated

MonsieurNicolas avatar Jun 05 '18 20:06 MonsieurNicolas

I think this combination is incompatible

  • STELLAR_CORE==15.2.0-440
  • HORIZON==1.14.0-44

Horizon starts up fine, but when I want to submit a transaction I get:

{
  "type": "https://stellar.org/horizon-errors/server_error",
  "title": "Internal Server Error",
  "status": 500,
  "detail": "An error occurred while processing this request.  This is usually due to a bug within the server software.  Trying this request again may succeed if the bug is transient. Otherwise, please contact the system administrator."
}

martin-thoma avatar Feb 10 '22 10:02 martin-thoma