Try   HackMD

Oracles v1.8 Upgrade Guide

Disclaimer: These instructions are made for Ubuntu 20.04. The commands may not match 100% on other distros, nor is there any guarantee that it will work.

Changelog

  • New pair: WSTETH/USD
  • New origins: Balancer v2 and Curve via Ethereum RPC requests
  • splitter-agent to cross-validate ethereum RPC answers and provide redundancy
  • For relayers, EIP-1559 support and improved gas price estimates

Prerequisites

These instructions are for those running 1.7

Ethereum node
Starting from this release, feeds require access to Ethereum RPC nodes. Because running its own Ethereum node can be challenging, and using third-party nodes expose feed to potentially compromised or malicious providers, we built a mechanism to cross-validate RPC responses. This allows two configuration options:

One trusted node
If you run your own Ethereum node, you may configure it as your single RPC source. Because you run your own node, you do not need to trust any third party to provide correct data, and the risk of MITM attacks is mitigated. If you don't operate the node yourself, please pick one of the other options.

Three nodes
Identify three reliable nodes, which can be a mix of nodes operated by you or by third parties. splitter-agent will query every node and compare their output. If there is a discrepancy, an error will be generated and your feed will not publish a price update for some pairs. The third node adds redundancy, so if one node is unreachable or falls behind, splitter-agent will compare the output of the remaining two nodes.

To encourage a diversity in the configuration of the feeds, we will not provide list of RPC URL for the use by every feed, and request that each feed operator select their own nodes.

Suggestions for nodes:

  • Your own node is always preferable. geth and erigon are popular options.
  • Another feed: You may exchange node access with other feeds, to gain redundancy.
  • Infura (Free plan ok at current usage level, i.e. ~9k requests per day)
  • Alchemy (Free plan ok at current usage level)
  • Quicknode (Paid $9/month plan)
  • Maker Techops: The techops CU runs a node with an IP allow-list: https://geth2.mainnet.makerops.services/rpc . Reach out to @marcandu to gain access

Upgrade

Optional: cleanup nix storage
This might free up several gigabytes of storage.
nix-collect-garbage

Upgrade Omnia and Dependencies to version 1.8.1

nix-env --install --verbose --file https://github.com/makerdao/oracles-v2/tarball/stable

Configure Gofer, Spire, Scuttlebot and Omniainstall-omnia feed --ssb-caps ~/caps.json --ssb-external <your external ip here> --eth-rpc <https://node1[:port]/path> --eth-rpc <https://node2[:port]/path> --eth-rpc <https://node3[:port]/path>

Configure the RPC splitter agentsplitter-agent is used for both 1 node and 3 node configurations

sudo systemctl daemon-reload
sudo systemctl enable splitter-agent.service
sudo systemctl start splitter-agent.service

Restart services

sudo systemctl restart gofer-agent
sudo systemctl restart spire-agent
sudo systemctl restart ssb-server
sudo systemctl restart omnia

note: restarting spire-agent can take a few minutes

node reconfiguration:
If you need to change the node list, run the following command to override the rpc node configuration:
install-omnia feed --eth-rpc <https://node1[:port]/path> --eth-rpc <https://node2[:port]/path> --eth-rpc <https://node3[:port]/path>
and restart splitter-agent:

sudo systemctl restart spire-agent

Final steps

Check that gofer returns a price for WSTETH/ETH

gofer -c /etc/gofer.json  prices WSTETH/USD --format=trace

note: if you get the error not enough sources to calculate median, wait two minutes and try again

Check Status of Omnia and Scuttlebot

sudo systemctl status ssb-server
sudo systemctl status omnia
sudo systemctl status gofer-agent
sudo systemctl status spire-agent

Recommended: cleanup temporary ssb files
Your /tmp directory may contain hundreds of thousands of uncessary files that may be safely removed
find /tmp -name "multiserver*" -delete

Notify

Let @marcandu on Keybase know that you completed the upgrade, so they can confirm that your feed is properly broadcasting messages on both Spire and Scuttlebot.