From ed96e6162c2f8b2fca9bcaf01889ca035fc37205 Mon Sep 17 00:00:00 2001 From: Liam Fitzgerald Date: Wed, 26 Oct 2022 13:01:32 +1000 Subject: [PATCH] arvo: retool for goerli instead of deprecated ropsten --- Makefile | 6 +++--- default.nix | 4 ++-- nix/pkgs/arvo/default.nix | 8 ++++---- nix/pkgs/marsSources/default.nix | 14 +++++++------- nix/pkgs/pill/brass.nix | 8 ++++---- nix/pkgs/pill/ivory.nix | 8 ++++---- pkg/arvo/app/claz.hoon | 2 +- pkg/arvo/app/roller.hoon | 4 ++-- pkg/arvo/gen/azimuth/watch.hoon | 2 +- pkg/arvo/gen/roller/endpoint.hoon | 2 +- pkg/arvo/gen/roller/goerli.hoon | 10 ++++++++++ pkg/arvo/gen/roller/ropsten.hoon | 10 ---------- pkg/arvo/lib/claz.hoon | 2 +- pkg/arvo/lib/dice.hoon | 4 ++-- pkg/arvo/sur/claz.hoon | 2 +- pkg/arvo/sur/dice.hoon | 2 +- pkg/arvo/ted/naive-csv.hoon | 2 +- pkg/base-dev/lib/azimuth.hoon | 18 +++++++++--------- sh/create-goerli-pills | 21 +++++++++++++++++++++ sh/create-ropsten-pills | 21 --------------------- 20 files changed, 75 insertions(+), 75 deletions(-) create mode 100644 pkg/arvo/gen/roller/goerli.hoon delete mode 100644 pkg/arvo/gen/roller/ropsten.hoon create mode 100755 sh/create-goerli-pills delete mode 100755 sh/create-ropsten-pills diff --git a/Makefile b/Makefile index dbadd5cd7..52aec5e1b 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: build build-all install cross release test pills ropsten-pills clean +.PHONY: build build-all install cross release test pills goerli-pills clean build: nix-build -A urbit --no-out-link @@ -17,8 +17,8 @@ pills: sh/update-brass-pill sh/update-ivory-pill -ropsten-pills: - sh/create-ropsten-pills +goerli-pills: + sh/create-goerli-pills interface: sh/build-interface diff --git a/default.nix b/default.nix index 3161c5363..f84a2e9d1 100644 --- a/default.nix +++ b/default.nix @@ -117,8 +117,8 @@ let pill = solid.lfs; }; - ivory-ropsten = ivory.override { arvo = arvo.ropsten; }; - brass-ropsten = brass.override { arvo = arvo.ropsten; }; + ivory-goerli = ivory.override { arvo = arvo.goerli; }; + brass-goerli = brass.override { arvo = arvo.goerli; }; # Create a .tgz of the primary binaries. tarball = let diff --git a/nix/pkgs/arvo/default.nix b/nix/pkgs/arvo/default.nix index 9d9d10806..502d2847a 100644 --- a/nix/pkgs/arvo/default.nix +++ b/nix/pkgs/arvo/default.nix @@ -5,16 +5,16 @@ stdenvNoCC.mkDerivation { src = marsSources; - outputs = [ "out" "ropsten" ]; + outputs = [ "out" "goerli" ]; - phases = [ "mainnetPhase" "ropstenPhase" ]; + phases = [ "mainnetPhase" "goerliPhase" ]; mainnetPhase = '' ln -s ${marsSources.out}/arvo $out ''; - ropstenPhase = '' - ln -s ${marsSources.ropsten}/arvo $ropsten + goerliPhase = '' + ln -s ${marsSources.goerli}/arvo $goerli ''; preferLocalBuild = true; diff --git a/nix/pkgs/marsSources/default.nix b/nix/pkgs/marsSources/default.nix index 80bbf303b..5811e19e5 100644 --- a/nix/pkgs/marsSources/default.nix +++ b/nix/pkgs/marsSources/default.nix @@ -6,16 +6,16 @@ stdenvNoCC.mkDerivation { buildInputs = [ bc ]; - outputs = [ "out" "ropsten" ]; + outputs = [ "out" "goerli" ]; - phases = [ "mainnetPhase" "ropstenPhase" ]; + phases = [ "mainnetPhase" "goerliPhase" ]; mainnetPhase = '' cp -r $src $out chmod -R u+w $out ''; - ropstenPhase = '' + goerliPhase = '' cp -r $src tmp chmod -R u+w tmp @@ -23,9 +23,9 @@ stdenvNoCC.mkDerivation { AMES=tmp/arvo/sys/vane/ames.hoon ACME=tmp/arvo/app/acme.hoon - # Replace the mainnet azimuth contract with the ropsten contract + # Replace the mainnet azimuth contract with the goerli contract sed --in-place \ - 's/\(\+\+ contracts \)mainnet\-contracts/\1ropsten-contracts/' \ + 's/\(\+\+ contracts \)mainnet\-contracts/\1goerli-contracts/' \ $ZUSE # Increment the %ames protocol version @@ -38,8 +38,8 @@ stdenvNoCC.mkDerivation { 's_https://acme-v02.api.letsencrypt.org/directory_https://acme-staging-v02.api.letsencrypt.org/directory_' \ $ACME - cp -r tmp $ropsten - chmod -R u+w $ropsten + cp -r tmp $goerli + chmod -R u+w $goerli ''; preferLocalBuild = true; diff --git a/nix/pkgs/pill/brass.nix b/nix/pkgs/pill/brass.nix index 36b18dd9a..6aa1c5dcf 100644 --- a/nix/pkgs/pill/brass.nix +++ b/nix/pkgs/pill/brass.nix @@ -1,5 +1,5 @@ { lib, stdenvNoCC, fetchGitHubLFS, bootFakeShip, solid, urbit, arvo, curl -, withRopsten ? false }: +, withGoerli ? false }: let @@ -9,9 +9,9 @@ in { build = import ./builder.nix { inherit stdenvNoCC urbit curl; - name = "brass" + lib.optionalString withRopsten "-ropsten"; + name = "brass" + lib.optionalString withGoerli "-goerli"; builder = ./brass.sh; - arvo = if withRopsten then arvo.ropsten else arvo; + arvo = if withGoerli then arvo.goerli else arvo; pier = bootFakeShip { inherit urbit; @@ -19,4 +19,4 @@ in { ship = "zod"; }; }; -} // lib.optionalAttrs (!withRopsten) { inherit lfs; } +} // lib.optionalAttrs (!withGoerli) { inherit lfs; } diff --git a/nix/pkgs/pill/ivory.nix b/nix/pkgs/pill/ivory.nix index 9eceef109..b4881909c 100644 --- a/nix/pkgs/pill/ivory.nix +++ b/nix/pkgs/pill/ivory.nix @@ -1,5 +1,5 @@ { lib, stdenvNoCC, fetchGitHubLFS, bootFakeShip, solid, urbit, arvo, curl, xxd -, withRopsten ? false }: +, withGoerli ? false }: let @@ -9,9 +9,9 @@ in { build = import ./builder.nix { inherit stdenvNoCC urbit curl; - name = "ivory" + lib.optionalString withRopsten "-ropsten"; + name = "ivory" + lib.optionalString withGoerli "-goerli"; builder = ./ivory.sh; - arvo = if withRopsten then arvo.ropsten else arvo; + arvo = if withGoerli then arvo.goerli else arvo; pier = bootFakeShip { inherit urbit; @@ -39,4 +39,4 @@ in { preferLocalBuild = true; }; -} // lib.optionalAttrs (!withRopsten) { inherit lfs; } +} // lib.optionalAttrs (!withGoerli) { inherit lfs; } diff --git a/pkg/arvo/app/claz.hoon b/pkg/arvo/app/claz.hoon index a8f1f42ce..64c20abcc 100644 --- a/pkg/arvo/app/claz.hoon +++ b/pkg/arvo/app/claz.hoon @@ -185,7 +185,7 @@ :: ?- network %mainnet 0x1 - %ropsten 0x3 + %goerli 0x5 %fakenet `@ux``@`1.337 [%other *] id.network == diff --git a/pkg/arvo/app/roller.hoon b/pkg/arvo/app/roller.hoon index a83d6d925..cb7ffb9fa 100644 --- a/pkg/arvo/app/roller.hoon +++ b/pkg/arvo/app/roller.hoon @@ -65,7 +65,7 @@ :: frequency: time to wait between sending batches (TODO fancier) :: endpoint: ethereum rpc endpoint to use :: contract: ethereum contract address - :: chain-id: mainnet, ropsten, local (https://chainid.network/) + :: chain-id: mainnet, goerli, local (https://chainid.network/) :: resend-time: time to resend a batch with higher gas prie :: update-rate: frequency to update the roller's predicted state :: fallback-gas-price: default batch gas price @@ -1019,7 +1019,7 @@ =, azimuth ?- net.config %mainnet mainnet-contracts - %ropsten ropsten-contracts + %goerli goerli-contracts %local local-contracts %default contracts == diff --git a/pkg/arvo/gen/azimuth/watch.hoon b/pkg/arvo/gen/azimuth/watch.hoon index 97c0d74b0..b46d32811 100644 --- a/pkg/arvo/gen/azimuth/watch.hoon +++ b/pkg/arvo/gen/azimuth/watch.hoon @@ -1,5 +1,5 @@ :: Change node url and network for azimuth :: :- %say -|= [* [url=@ta net=?(%mainnet %ropsten %local %default) ~] ~] +|= [* [url=@ta net=?(%mainnet %goerli %local %default) ~] ~] [%azimuth-poke %watch url net] diff --git a/pkg/arvo/gen/roller/endpoint.hoon b/pkg/arvo/gen/roller/endpoint.hoon index ce59f3073..26e271d6f 100644 --- a/pkg/arvo/gen/roller/endpoint.hoon +++ b/pkg/arvo/gen/roller/endpoint.hoon @@ -1,4 +1,4 @@ :: :- %say -|= [* [url=@t net=?(%mainnet %ropsten %local) ~] ~] +|= [* [url=@t net=?(%mainnet %goerli %local) ~] ~] [%roller-action %config %endpoint url net] diff --git a/pkg/arvo/gen/roller/goerli.hoon b/pkg/arvo/gen/roller/goerli.hoon new file mode 100644 index 000000000..4dacaf99a --- /dev/null +++ b/pkg/arvo/gen/roller/goerli.hoon @@ -0,0 +1,10 @@ +:: Configures /app/roller to listen to a Goerli Infura node +:: +:- %say +|= * +:* %roller-action + %config + %endpoint + 'https://goerli.infura.io/v3/2599df54929b47099bda360958d75aaf' + %goerli +== diff --git a/pkg/arvo/gen/roller/ropsten.hoon b/pkg/arvo/gen/roller/ropsten.hoon deleted file mode 100644 index af363f0dd..000000000 --- a/pkg/arvo/gen/roller/ropsten.hoon +++ /dev/null @@ -1,10 +0,0 @@ -:: Configures /app/roller to listen to a Ropsten Infura node -:: -:- %say -|= * -:* %roller-action - %config - %endpoint - 'https://ropsten.infura.io/v3/2599df54929b47099bda360958d75aaf' - %ropsten -== diff --git a/pkg/arvo/lib/claz.hoon b/pkg/arvo/lib/claz.hoon index 1a34ae9ff..3f7f40067 100644 --- a/pkg/arvo/lib/claz.hoon +++ b/pkg/arvo/lib/claz.hoon @@ -25,7 +25,7 @@ |= =network ?+ network ~&(%careful-fallback-contracts mainnet-contracts:azimuth) %mainnet mainnet-contracts:azimuth - %ropsten ropsten-contracts:azimuth + %goerli goerli-contracts:azimuth == :: ++ encode-claz-call diff --git a/pkg/arvo/lib/dice.hoon b/pkg/arvo/lib/dice.hoon index c59b7907b..4f5f44a3b 100644 --- a/pkg/arvo/lib/dice.hoon +++ b/pkg/arvo/lib/dice.hoon @@ -32,9 +32,9 @@ ^- [azimuth=@ux naive=@ux chain-id=@ launch=@] =< [azimuth naive chain-id launch] =, azimuth - ?- net + ?+ net !! %mainnet mainnet-contracts - %ropsten ropsten-contracts + %goerli goerli-contracts %local local-contracts %default contracts == diff --git a/pkg/arvo/sur/claz.hoon b/pkg/arvo/sur/claz.hoon index 2b3677ed8..88c3b246c 100644 --- a/pkg/arvo/sur/claz.hoon +++ b/pkg/arvo/sur/claz.hoon @@ -11,7 +11,7 @@ :: ++ network $? %mainnet - %ropsten + %goerli %fakenet [%other id=@] == diff --git a/pkg/arvo/sur/dice.hoon b/pkg/arvo/sur/dice.hoon index 239d0691b..5cde151aa 100644 --- a/pkg/arvo/sur/dice.hoon +++ b/pkg/arvo/sur/dice.hoon @@ -8,7 +8,7 @@ +$ sponsors (map ship [residents=(set ship) requests=(set ship)]) +$ history (map address:ethereum (tree hist-tx)) +$ events (list event-log:rpc:ethereum) -+$ net ?(%mainnet %ropsten %local %default) ++$ net ?(%mainnet %ropsten %goerli %local %default) +$ snap-state [%0 =id:block:jael nas=^state:naive =owners =sponsors] :: +$ config diff --git a/pkg/arvo/ted/naive-csv.hoon b/pkg/arvo/ted/naive-csv.hoon index 3ce3029eb..59745acbd 100644 --- a/pkg/arvo/ted/naive-csv.hoon +++ b/pkg/arvo/ted/naive-csv.hoon @@ -50,7 +50,7 @@ +$ address address:naive :: @ux +$ keccak @ux :: used for transaction and roll hashes +$ blocknum number:block :: @udblocknumber - +$ net net:dice :: ?(%mainnet %ropsten %local %default) + +$ net net:dice :: ?(%mainnet %goerli %local %default) +$ roll-dat :: all data required for each roll [[gas=@ud sender=address] =effects:naive] +$ block-dat :: all data required for each block diff --git a/pkg/base-dev/lib/azimuth.hoon b/pkg/base-dev/lib/azimuth.hoon index d9c6a1b2e..2bd907766 100644 --- a/pkg/base-dev/lib/azimuth.hoon +++ b/pkg/base-dev/lib/azimuth.hoon @@ -114,29 +114,29 @@ :: :: Testnet contract addresses :: - ++ ropsten-contracts + ++ goerli-contracts |% ++ azimuth - 0x308a.b6a6.024c.f198.b57e.008d.0ac9.ad02.1988.6579 + 0xbb61.fa68.3e4b.9104.18e2.7b00.a143.8a93.6234.df52 :: ++ ecliptic - 0x8b9f.86a2.8921.d9c7.05b3.113a.755f.b979.e1bd.1bce + 0xe129.0a32.9014.5e63.e6a8.ec1e.f661.6906.856d.0c8f :: ++ linear-star-release - 0x1f8e.dd03.1ee4.1474.0aed.b39b.84fb.8f2f.66ca.422f + 0x0 :: ++ conditional-star-release 0x0 :: ++ delegated-sending - 0x3e8c.a510.354b.c2fd.bbd6.1502.52d9.3105.c9c2.7bbe + 0x0 :: ++ naive - 0xe7cf.4b83.06d3.11ba.ca15.585f.e3f0.7cd0.441c.21d1 + 0x56e3.7137.cdaf.c026.a732.e8e8.40cd.621e.d50b.d210 :: - ++ launch 4.601.630 - ++ public launch - ++ chain-id 3 + ++ launch 7.834.742 + ++ public 7.834.800 + ++ chain-id 5 -- :: :: Local contract addresses diff --git a/sh/create-goerli-pills b/sh/create-goerli-pills new file mode 100755 index 000000000..f8e04add7 --- /dev/null +++ b/sh/create-goerli-pills @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +# Usage: create-goerli-pills + +# Build the ivory and brass goerli pills, copying them to the local directory, +# named with the current give revision + +set -xeuo pipefail + +cd "${0%/*}/.." + +rev="$(git rev-parse HEAD)" +sha="${rev:0:5}" + +brass="brass-goerli-${sha}.pill" +ivory="ivory-goerli-${sha}.pill" + +cp -f "$(nix-build -A brass-goerli.build --no-out-link)" "$brass" +cp -f "$(nix-build -A ivory-goerli.build --no-out-link)" "$ivory" + +chmod 0644 "$brass" "$ivory" diff --git a/sh/create-ropsten-pills b/sh/create-ropsten-pills deleted file mode 100755 index d288795f3..000000000 --- a/sh/create-ropsten-pills +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env bash - -# Usage: create-ropsten-pills - -# Build the ivory and brass ropsten pills, copying them to the local directory, -# named with the current give revision - -set -xeuo pipefail - -cd "${0%/*}/.." - -rev="$(git rev-parse HEAD)" -sha="${rev:0:5}" - -brass="brass-ropsten-${sha}.pill" -ivory="ivory-ropsten-${sha}.pill" - -cp -f "$(nix-build -A brass-ropsten.build --no-out-link)" "$brass" -cp -f "$(nix-build -A ivory-ropsten.build --no-out-link)" "$ivory" - -chmod 0644 "$brass" "$ivory"