-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
3.1.0 flake #947
Draft
manveru
wants to merge
22
commits into
develop
Choose a base branch
from
3.1.0-flake
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
3.1.0 flake #947
Changes from 3 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
dcddff8
flakified KEVM / EVM
craigem 843f141
Fixed the VMs
craigem ccb2dd7
attempt entrypoint fix
manveru a338dcf
also build iele
manveru 571765e
add explorer and faucet packages
manveru 993280b
minor cleanup
manveru 6e0894e
Added mantis-faucet
craigem 6d50a94
Added gnused
craigem 9701978
Set file descriptors limit to 2048
craigem 9e95b1f
Added kevm to the entrypoint
craigem 86d1239
copy faucet key
manveru 24febca
create keystore dir
manveru 7a22643
use original version of secp256k1 for kevm
manveru c775626
[FIX] Update the kevm protobuf submodule to latest
dzajkowski c963bc8
avoid submodule fetching for mantis source
manveru cf748e0
add mantis:2021 image build
manveru b6a26f8
Fix default.nix, refering to mantis flake
jonringer 7849a81
'calculateGasLimit' set to parent value
dzajkowski e8d8911
Revert "use original version of secp256k1 for kevm"
craigem 24b075a
actually revert "use original version of secp256k1 for kevm"
manveru 24f34e1
build kevm with older nixpkgs
manveru a2ddacb
fix mantis referencing the pb version
manveru File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
{ | ||
description = "Mantis flake"; | ||
|
||
inputs = { | ||
flake-utils.url = "github:numtide/flake-utils"; | ||
nixpkgs.url = | ||
"github:nixos/nixpkgs?rev=a98302aa9b9628915878a6ea9776c40a0bb02950"; | ||
nixpkgs-sbt = { | ||
url = "github:nixos/nixpkgs?rev=e2bb73ce5f786b83e984b80199112f86b8a6cc9d"; | ||
flake = false; | ||
}; | ||
sbtix = { | ||
url = | ||
"github:input-output-hk/Sbtix?rev=7b969a5641fce10500ca51cbe88af4ea160d7064"; | ||
flake = false; | ||
}; | ||
}; | ||
|
||
outputs = { self, nixpkgs, flake-utils, nixpkgs-sbt, ... }@inputs: | ||
let | ||
overlay = final: prev: { | ||
inherit (import nixpkgs-sbt { inherit (final) system; }) sbt; | ||
sbtix = final.callPackage ./sbtix.nix { }; | ||
|
||
mantisPkgs = final.callPackage ./nix/pkgs/mantis { | ||
src = builtins.fetchGit { | ||
url = "https://github.com/input-output-hk/mantis"; | ||
rev = self.rev or "482340d5e6ab635e5a5047e9b670d59b4ad366c2"; | ||
ref = "3.1.0-flake"; | ||
submodules = true; | ||
}; | ||
}; | ||
|
||
jdk = prev.openjdk8_headless; | ||
jre = prev.openjdk8_headless.jre; | ||
|
||
inherit (final.mantisPkgs) mantis; | ||
|
||
kevm = final.callPackage ./nix/pkgs/kevm.nix { }; | ||
|
||
mantis-entrypoint = final.callPackage ./nix/entrypoint.nix { }; | ||
}; | ||
|
||
pkgsForSystem = system: | ||
(import nixpkgs) { | ||
inherit system; | ||
overlays = [ overlay ]; | ||
}; | ||
|
||
mkHydraUtils = mkPkgs: | ||
let | ||
# nothing in lib should really depend on the system | ||
libPkgs = mkPkgs "x86_64-linux"; | ||
# [attrset] -> attrset | ||
recursiveMerge = libPkgs.lib.foldr libPkgs.lib.recursiveUpdate { }; | ||
mkHydraJobsForSystem = attrs: system: | ||
recursiveMerge | ||
(map (n: { "${n}"."${system}" = (mkPkgs system)."${n}"; }) attrs); | ||
in { | ||
collectHydraSets = jobSets: { hydraJobs = recursiveMerge jobSets; }; | ||
mkHydraSet = attrs: systems: | ||
recursiveMerge (map (mkHydraJobsForSystem attrs) systems); | ||
}; | ||
|
||
hydraUtils = mkHydraUtils pkgsForSystem; | ||
inherit (hydraUtils) collectHydraSets mkHydraSet; | ||
|
||
in flake-utils.lib.eachDefaultSystem (system: rec { | ||
pkgs = pkgsForSystem system; | ||
legacyPackages = pkgs; | ||
|
||
defaultPackage = pkgs.mantis; | ||
devShell = pkgs.mkShell { nativeBuildInputs = with pkgs; [ solc sbt ]; }; | ||
apps.mantis = flake-utils.lib.mkApp { drv = pkgs.mantis; }; | ||
defaultApp = apps.mantis; | ||
}) // (collectHydraSets [ | ||
(mkHydraSet [ "mantis" ] [ "x86_64-linux" "x86_64-darwin" ]) | ||
(mkHydraSet [ "kevm" ] [ "x86_64-linux" ]) | ||
(mkHydraSet [ "mantis-entrypoint" ] [ "x86_64-linux" ]) | ||
]); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ lib, writeShellScriptBin, awscli, mantis, coreutils, gnugrep }: | ||
writeShellScriptBin "mantis-entrypoint" '' | ||
set -exuo pipefail | ||
|
||
export PATH="${lib.makeBinPath [ coreutils mantis awscli gnugrep ]}" | ||
|
||
${builtins.readFile ./entrypoint.sh} | ||
'' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -exuo pipefail | ||
|
||
mkdir -p /tmp "$NOMAD_TASK_DIR/mantis" | ||
cd "$NOMAD_TASK_DIR" | ||
|
||
if [ -n "${DAG_NAME:-}" ]; then | ||
if [ -f "ethash/$DAG_NAME" ]; then | ||
echo "found existing DAG" | ||
sha256sum "ethash/$DAG_NAME" | ||
else | ||
mkdir -p ethash | ||
aws \ | ||
--endpoint-url "$MONITORING_ADDR" \ | ||
s3 cp \ | ||
"s3://mantis-kevm-dag/$DAG_NAME" \ | ||
"ethash/$DAG_NAME" \ | ||
|| echo "Unable to download DAG, skipping." | ||
fi | ||
fi | ||
|
||
set +x | ||
echo "Waiting for $REQUIRED_PEER_COUNT peers to show up in the config" | ||
until [ "$(grep -c enode mantis.conf)" -ge "$REQUIRED_PEER_COUNT" ]; do | ||
sleep 1 | ||
done | ||
set -x | ||
|
||
ulimit -c unlimited | ||
cp mantis.conf running.conf | ||
|
||
exec mantis "-Duser.home=$NOMAD_TASK_DIR" "$@" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ lib, stdenv, dockerTools, secp256k1, gmp5, mpfr, zlib }: | ||
let libPath = lib.makeLibraryPath [ secp256k1 gmp5 mpfr zlib ]; | ||
in stdenv.mkDerivation { | ||
name = "kevm"; | ||
|
||
src = dockerTools.pullImage { | ||
imageName = "inputoutput/mantis"; | ||
imageDigest = | ||
"sha256:594ed009f1bc1f12b86e11136441602107c3d580476002d9bae58b258a74ac1b"; | ||
sha256 = "sha256-JT+FarGQlgYoO392Ne1ofdqmishZLfH+OwV2CXTYwdA="; | ||
}; | ||
|
||
installPhase = '' | ||
mkdir -p tmp $out/bin | ||
tar --delay-directory-restore -C tmp -xf layer.tar || true | ||
|
||
cp tmp/bin/kevm-vm $out/bin | ||
chmod 0755 $out/bin/kevm-vm | ||
|
||
patchelf \ | ||
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ | ||
--set-rpath "${libPath}" \ | ||
"$out/bin/kevm-vm" | ||
''; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would not use sbtix, but instead sbt-derivation. Mantis is already using it on the
develop
branch