treewide: update etcd to 3.6

This is a fairly large update, containing 4 years of upstream
development. A lot of code has been moved around, requiring a rebase of
all patches and ajustments in code using it.

Upstream requires that upgrades first go through etcd 3.5.20, which is
done in a CL below this one. Other than that upgrades are possible
through normal Monogon node updates, but downgrades (while implemented
for 3.6.0) are still not supported in Monogon until further work is
done.

There are significant issues in etcd synchronization between the
"outside" manager (embed or standalone) and the core (EtcdServer), one
of which affects removal of the ConsensusMember role, causing a panic
due to the client listener not being closed when the server shuts down
on its own. This is triggered by the autopromoter hitting an endpoint on
a shut-down etcd, which accesses a nil backend. This issue existed
before, a full fix will likely involve either significantly rewriting or
getting rid of the embed package, so this just fixes the panic-causing
code path.

Change-Id: If5932a7428a262fde406a5bb652a40d211301734
Reviewed-on: https://review.monogon.dev/c/monogon/+/4394
Tested-by: Jenkins CI
Reviewed-by: Tim Windelschmidt <tim@monogon.tech>
diff --git a/metropolis/node/core/consensus/client/unimplemented.go b/metropolis/node/core/consensus/client/unimplemented.go
index c80bc47..32f384d 100644
--- a/metropolis/node/core/consensus/client/unimplemented.go
+++ b/metropolis/node/core/consensus/client/unimplemented.go
@@ -22,7 +22,7 @@
 type unimplementedCluster struct {
 }
 
-func (c *unimplementedCluster) MemberList(_ context.Context) (*clientv3.MemberListResponse, error) {
+func (c *unimplementedCluster) MemberList(_ context.Context, _ ...clientv3.OpOption) (*clientv3.MemberListResponse, error) {
 	panic(ErrUnimplementedInNamespaced)
 }
 
@@ -146,6 +146,10 @@
 	panic(ErrUnimplementedInNamespaced)
 }
 
+func (c *unimplementedMaintenance) SnapshotWithVersion(ctx context.Context) (*clientv3.SnapshotResponse, error) {
+	panic(ErrUnimplementedInNamespaced)
+}
+
 func (c *unimplementedMaintenance) Snapshot(ctx context.Context) (io.ReadCloser, error) {
 	panic(ErrUnimplementedInNamespaced)
 }
@@ -153,3 +157,7 @@
 func (c *unimplementedMaintenance) MoveLeader(ctx context.Context, transfereeID uint64) (*clientv3.MoveLeaderResponse, error) {
 	panic(ErrUnimplementedInNamespaced)
 }
+
+func (c *unimplementedMaintenance) Downgrade(ctx context.Context, action clientv3.DowngradeAction, version string) (*clientv3.DowngradeResponse, error) {
+	panic(ErrUnimplementedInNamespaced)
+}
diff --git a/metropolis/node/core/consensus/configuration.go b/metropolis/node/core/consensus/configuration.go
index a3379ca..8c4bd06 100644
--- a/metropolis/node/core/consensus/configuration.go
+++ b/metropolis/node/core/consensus/configuration.go
@@ -110,6 +110,8 @@
 	cfg.InitialClusterToken = "METROPOLIS"
 	cfg.Logger = "zap"
 	cfg.LogOutputs = []string{c.Ephemeral.ServerLogsFIFO.FullPath()}
+	cfg.EnableGRPCGateway = false
+	cfg.GRPCOnly = true
 	cfg.ListenMetricsUrls = []url.URL{
 		{Scheme: "http", Host: net.JoinHostPort("127.0.0.1", fmt.Sprintf("%d", etcdPort))},
 	}
diff --git a/metropolis/node/core/consensus/consensus.go b/metropolis/node/core/consensus/consensus.go
index 69ded4f..f6addd8 100644
--- a/metropolis/node/core/consensus/consensus.go
+++ b/metropolis/node/core/consensus/consensus.go
@@ -277,7 +277,7 @@
 
 		isMember := false
 		for _, member := range members.Members {
-			if member.ID != uint64(server.Server.ID()) {
+			if member.ID != uint64(server.Server.MemberID()) {
 				continue
 			}
 			if !member.IsLearner {
@@ -297,7 +297,7 @@
 
 	st := &Status{
 		localPeerURL:  cfg.AdvertisePeerUrls[0].String(),
-		localMemberID: uint64(server.Server.ID()),
+		localMemberID: uint64(server.Server.MemberID()),
 		cl:            cl,
 		ca:            s.ca,
 	}