What is the shell and can it be upgraded?

What is the Tezos shell? I have heard it is used for low level protocol communication? What does that mean - is that to communicate time so blocks can be ordered?

Can the shell be upgraded and is tezos really upgradeable if it can not?

The shell (aka Octez) is updated far more frequently than Tezos protocol. Yes, they are independent. No, their versions do not match (ie: you can run protocol 10 Granada with shell/Octez 9.7)

Octez is the name of the Tezos shell hosted at Tezos / tezos · GitLab, it is written in OCaml. There is also a Tezos shell written in Rust called TezEdge.

Here is the relevant documentation page: Tezos Software Architecture — Tezos (master branch, 2021/08/27 16:50) documentation. See also the white paper.

The Tezos protocol is the part of the node which:

  • can be amended by on-chain votes,
  • needs to be agreed upon by all the nodes of the network.

The Tezos shell is the part of the node which can vary from a node to another. Since there is no need for all the nodes to agree on this part, there is no point in voting for the shell. Node operators update their shells by simply downloading a new version and run it instead of the old one.

I have heard it is used for low level protocol communication?

Not only, the role of the protocol is to validate operations and blocks while choosing which block should be validated is part of the role of the shell.

Thanks. Some more questions.
What happens if someone wants to change protocol communication?

And how is the next block selected - is that carried out by the Shell?

This can be changed too. For example the changelog for Octez v8.0~rc2 contains “Added six messages to the distributed database protocol and bumped its version from 0 to 1. […]”.

Yes, the shell is always following the longest known chain.

More precisely, when the shell asks the protocol to validate a block, the protocol does not only says if the block is valid or not. Among other data it provides a score for the block called the fitness. The shell only switches branch if it sees a block with a higher fitness than on its current head. Since Babylon, the fitness of the block is its level so the shell always follows the longest chain.