Misc formatting fixes

This commit is contained in:
Luke Parker
2022-12-08 22:10:12 -05:00
parent cc917a217d
commit d32c865c9a
8 changed files with 41 additions and 42 deletions

View File

@@ -59,7 +59,7 @@ fn digest_yield<D: Digest, F: PrimeField>(digest: D, i: usize) -> F {
)) ))
} }
/// Aggregate Schnorr signature as defined in https://eprint.iacr.org/2021/350. /// Aggregate Schnorr signature as defined in <https://eprint.iacr.org/2021/350>.
#[allow(non_snake_case)] #[allow(non_snake_case)]
#[derive(Clone, PartialEq, Eq, Debug, Zeroize)] #[derive(Clone, PartialEq, Eq, Debug, Zeroize)]
pub struct SchnorrAggregate<C: Ciphersuite> { pub struct SchnorrAggregate<C: Ciphersuite> {

View File

@@ -7,18 +7,17 @@ ENV BITCOIN_DATA=/home/bitcoin/.bitcoin
WORKDIR /home/bitcoin WORKDIR /home/bitcoin
RUN apk update \ RUN apk update \
&& apk --no-cache add ca-certificates gnupg bash su-exec && apk --no-cache add ca-certificates gnupg bash su-exec
# Get Binary # Get Binary
# TODO: When bitcoin.org publishes 23.0, retrieve checksums from there. # TODO: When bitcoin.org publishes 23.0, retrieve checksums from there.
RUN wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-x86_64-linux-gnu.tar.gz \ RUN wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-x86_64-linux-gnu.tar.gz \
&& wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS \ && wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS \
&& wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS.asc && wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS.asc
# Verify Binary # Verify Binary
# For the PGP keys of builders and developers, refer to # For the PGP keys of builders and developers, refer to
# https://github.com/bitcoin/bitcoin/tree/master/contrib/builder-keys # https://github.com/bitcoin/bitcoin/tree/master/contrib/builder-keys
# Serai recognizes the builder keys for 16/17 signatures # Serai recognizes the builder keys for 16/17 signatures
# from the 23.0 release # from the 23.0 release
@@ -27,10 +26,10 @@ ENV KEYS2 4DAF18FE948E7A965B30F9457E296D555E7F63A7 28E72909F1717FE9607754F8A7BEB
# Use hardcoded prints to get keys from servers. 2 Different servers used. # Use hardcoded prints to get keys from servers. 2 Different servers used.
RUN gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys ${KEYS} \ RUN gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys ${KEYS} \
&& gpg --keyserver hkp://keys.openpgp.org:80 --recv-keys ${KEYS2} && gpg --keyserver hkp://keys.openpgp.org:80 --recv-keys ${KEYS2}
# verify all sigs and check for valid signature from laanwj -- 71A3 # verify all sigs and check for valid signature from laanwj -- 71A3
RUN gpg --verify --status-fd 1 --verify SHA256SUMS.asc SHA256SUMS | grep "^\[GNUPG:\] VALIDSIG.*71A3B16735405025D447E8F274810B012346C9A6" RUN gpg --verify --status-fd 1 --verify SHA256SUMS.asc SHA256SUMS | grep "^\[GNUPG:\] VALIDSIG.*71A3B16735405025D447E8F274810B012346C9A6"
RUN grep bitcoin-${BITCOIN_VERSION}-x86_64-linux-gnu.tar.gz SHA256SUMS | sha256sum -c RUN grep bitcoin-${BITCOIN_VERSION}-x86_64-linux-gnu.tar.gz SHA256SUMS | sha256sum -c

View File

@@ -13,8 +13,8 @@ bitcoind -regtest -txindex -fallbackfee=0.000001 -rpcuser=$RPC_USER -rpcpassword
# give time to bitcoind to start # give time to bitcoind to start
while true while true
do do
bitcoin-cli -regtest -rpcuser=$RPC_USER -rpcpassword=$RPC_PASS generatetoaddress 100 $MINER && break bitcoin-cli -regtest -rpcuser=$RPC_USER -rpcpassword=$RPC_PASS generatetoaddress 100 $MINER && break
sleep 5 sleep 5
done done
bitcoin-cli -regtest -rpcuser=$RPC_USER -rpcpassword=$RPC_PASS createwallet "miner" false false $RPC_PASS false false true && bitcoin-cli -regtest -rpcuser=$RPC_USER -rpcpassword=$RPC_PASS createwallet "miner" false false $RPC_PASS false false true &&
@@ -24,6 +24,6 @@ bitcoin-cli -regtest -rpcuser=$RPC_USER -rpcpassword=$RPC_PASS importprivkey $PR
# mine a new block every BLOCK_TIME # mine a new block every BLOCK_TIME
while true while true
do do
bitcoin-cli -regtest -rpcuser=$RPC_USER -rpcpassword=$RPC_PASS generatetoaddress 1 $MINER bitcoin-cli -regtest -rpcuser=$RPC_USER -rpcpassword=$RPC_PASS generatetoaddress 1 $MINER
sleep $BLOCK_TIME sleep $BLOCK_TIME
done done

View File

@@ -6,11 +6,11 @@ ENV GETH_VERSION=1.10.23-d901d853
WORKDIR /home/ethereum WORKDIR /home/ethereum
RUN apk update \ RUN apk update \
&& apk --no-cache add ca-certificates gnupg bash su-exec && apk --no-cache add ca-certificates gnupg bash su-exec
# Get Binary # Get Binary
RUN wget https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-${GETH_VERSION}.tar.gz\ RUN wget https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-${GETH_VERSION}.tar.gz\
&& wget https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-${GETH_VERSION}.tar.gz.asc && wget https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-${GETH_VERSION}.tar.gz.asc
# Verify Binary # Verify Binary
# refer to https://geth.ethereum.org/downloads/#openpgp_signatures # refer to https://geth.ethereum.org/downloads/#openpgp_signatures

View File

@@ -4,7 +4,7 @@ FROM alpine:latest as builder
# Verification will fail if MONERO_VERSION doesn't match the latest # Verification will fail if MONERO_VERSION doesn't match the latest
# due to the way monero publishes releases. They overwrite a single hashes.txt file # due to the way monero publishes releases. They overwrite a single hashes.txt file
# each release, meaning we can only grab the SHA256 of the latest release. # each release, meaning we can only grab the SHA256 of the latest release.
# Most publish a asc file for each release / build architecture ¯\_(ツ)_/¯ # Most publish a asc file for each release / build architecture ¯\_(ツ)_/¯
ENV MONERO_VERSION=0.18.1.0 ENV MONERO_VERSION=0.18.1.0
# monero-linux-x64-v0.18.1.0.tar.bz2 - https://github.com/monero-project/monero-site/commit/9dda1e3ccb84aa14dc09ed598a6d438c18363833 # monero-linux-x64-v0.18.1.0.tar.bz2 - https://github.com/monero-project/monero-site/commit/9dda1e3ccb84aa14dc09ed598a6d438c18363833
ENV GLIBC_VERSION=2.28-r0 ENV GLIBC_VERSION=2.28-r0
@@ -12,7 +12,7 @@ ENV GLIBC_VERSION=2.28-r0
WORKDIR /home/monero WORKDIR /home/monero
RUN apk update \ RUN apk update \
&& apk --no-cache add ca-certificates gnupg bash su-exec && apk --no-cache add ca-certificates gnupg bash su-exec
# Get Binary # Get Binary
RUN wget https://downloads.getmonero.org/cli/monero-linux-x64-v${MONERO_VERSION}.tar.bz2 RUN wget https://downloads.getmonero.org/cli/monero-linux-x64-v${MONERO_VERSION}.tar.bz2
@@ -23,7 +23,7 @@ RUN gpg --keyserver hkp://keyserver.ubuntu.com:80 --keyserver-options no-self-si
ADD ./temp/hashes-v${MONERO_VERSION}.txt . ADD ./temp/hashes-v${MONERO_VERSION}.txt .
RUN gpg --verify hashes-v${MONERO_VERSION}.txt \ RUN gpg --verify hashes-v${MONERO_VERSION}.txt \
&& cat hashes-v${MONERO_VERSION}.txt | grep "$(sha256sum monero-linux-x64-v${MONERO_VERSION}.tar.bz2 | cut -c 1-64)" && cat hashes-v${MONERO_VERSION}.txt | grep "$(sha256sum monero-linux-x64-v${MONERO_VERSION}.tar.bz2 | cut -c 1-64)"
# Cleanup # Cleanup
RUN tar -xvjf monero-linux-x64-v${MONERO_VERSION}.tar.bz2 --strip-components=1 RUN tar -xvjf monero-linux-x64-v${MONERO_VERSION}.tar.bz2 --strip-components=1

View File

@@ -7,12 +7,12 @@ BLOCK_TIME=${BLOCK_TIME:=5}
# Run Monero # Run Monero
# TODO: Restore Auth # TODO: Restore Auth
monerod --regtest --rpc-access-control-origins * --confirm-external-bind \ monerod --regtest --rpc-access-control-origins * --confirm-external-bind \
--rpc-bind-ip=0.0.0.0 --offline --fixed-difficulty=1 \ --rpc-bind-ip=0.0.0.0 --offline --fixed-difficulty=1 \
--non-interactive --mining-threads 1 --detach --non-interactive --mining-threads 1 --detach
# give time to monerod to start # give time to monerod to start
while true; do while true; do
sleep 5 sleep 5
done done
# Create wallet from PRIV_KEY in monero wallet # Create wallet from PRIV_KEY in monero wallet

View File

@@ -19,31 +19,31 @@ RUN rustup update
# Install Solc @ 0.8.16 # Install Solc @ 0.8.16
RUN --mount=type=cache,target=/root/.cache/ \ RUN --mount=type=cache,target=/root/.cache/ \
--mount=type=cache,target=/root/.local/ \ --mount=type=cache,target=/root/.local/ \
--mount=type=cache,target=/root/.solc-select \ --mount=type=cache,target=/root/.solc-select \
pip3 install solc-select==0.2.1 pip3 install solc-select==0.2.1
RUN --mount=type=cache,target=/root/.cache/ \ RUN --mount=type=cache,target=/root/.cache/ \
--mount=type=cache,target=/root/.local/ \ --mount=type=cache,target=/root/.local/ \
--mount=type=cache,target=/root/.solc-select \ --mount=type=cache,target=/root/.solc-select \
solc-select install 0.8.16 solc-select install 0.8.16
RUN --mount=type=cache,target=/root/.cache/ \ RUN --mount=type=cache,target=/root/.cache/ \
--mount=type=cache,target=/root/.local/ \ --mount=type=cache,target=/root/.local/ \
--mount=type=cache,target=/root/.solc-select \ --mount=type=cache,target=/root/.solc-select \
solc-select use 0.8.16 solc-select use 0.8.16
# Mount cargo and serai cache for Cache & Build # Mount cargo and serai cache for Cache & Build
RUN --mount=type=cache,target=/root/.local/ \ RUN --mount=type=cache,target=/root/.local/ \
--mount=type=cache,target=/root/.solc-select \ --mount=type=cache,target=/root/.solc-select \
--mount=type=cache,target=/root/.cache/ \ --mount=type=cache,target=/root/.cache/ \
--mount=type=cache,target=/usr/local/cargo/git \ --mount=type=cache,target=/usr/local/cargo/git \
--mount=type=cache,target=/usr/local/cargo/registry \ --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/serai/target/release/build \ --mount=type=cache,target=/serai/target/release/build \
--mount=type=cache,target=/serai/target/release/deps \ --mount=type=cache,target=/serai/target/release/deps \
--mount=type=cache,target=/serai/target/release/.fingerprint \ --mount=type=cache,target=/serai/target/release/.fingerprint \
--mount=type=cache,target=/serai/target/release/incremental \ --mount=type=cache,target=/serai/target/release/incremental \
--mount=type=cache,target=/serai/target/release/wbuild \ --mount=type=cache,target=/serai/target/release/wbuild \
--mount=type=cache,target=/serai/target/release/lib* \ --mount=type=cache,target=/serai/target/release/lib* \
cargo build --release cargo build --release
# Prepare Image # Prepare Image
FROM ubuntu:latest as image FROM ubuntu:latest as image

View File

@@ -2,7 +2,7 @@
export GENESIS=$(cat /temp/genesis) export GENESIS=$(cat /temp/genesis)
if [[ -z $VALIDATOR ]]; then if [[ -z $VALIDATOR ]]; then
serai-node --tmp --chain $CHAIN --name $NAME serai-node --tmp --chain $CHAIN --name $NAME
else else
serai-node --tmp --chain $CHAIN --$NAME serai-node --tmp --chain $CHAIN --$NAME
fi fi