diff --git a/.gitignore b/.gitignore index 8f51387af..8be5e8e94 100644 --- a/.gitignore +++ b/.gitignore @@ -55,7 +55,6 @@ mir-event-logs devgen.car *.log fx.dot -genesis.car # The following files are checked into git and result diff --git a/Dockerfile b/Dockerfile index a2b2fb68d..7c51bc555 100644 --- a/Dockerfile +++ b/Dockerfile @@ -116,6 +116,7 @@ COPY --from=lotus-builder /opt/filecoin/eudico /usr/local/bin/ # Copy subnets genesis template COPY --from=lotus-builder /opt/filecoin/eudico-core/genesis/genesis.json / +COPY --from=lotus-builder /opt/filecoin/eudico-core/genesis/genesis-test.json / # Copy ipc scripts COPY --from=lotus-builder /opt/filecoin/scripts/ipc /scripts/ipc diff --git a/build/actors/ipc-actors.car b/build/actors/ipc-actors.car index 26f4aa7ce..14e992973 100644 Binary files a/build/actors/ipc-actors.car and b/build/actors/ipc-actors.car differ diff --git a/build/genesis/spacenet.car b/build/genesis/spacenet.car index cbacd08fe..975e93e1a 100644 Binary files a/build/genesis/spacenet.car and b/build/genesis/spacenet.car differ diff --git a/chain/consensus/compute_state.go b/chain/consensus/compute_state.go index d26b64943..cf2ac4673 100644 --- a/chain/consensus/compute_state.go +++ b/chain/consensus/compute_state.go @@ -223,7 +223,7 @@ func (t *TipSetExecutor) ApplyBlocks(ctx context.Context, if membership.IsConfigMsg(DefaultGatewayAddr, m) { r, err := vmi.ApplyImplicitMessage(ctx, m) // nolint if err != nil { - return cid.Undef, cid.Undef, xerrors.Errorf("running cron: %w", err) + return cid.Undef, cid.Undef, xerrors.Errorf("applying Mir config message: %w", err) } if em != nil { diff --git a/eudico-core/genesis/genesis-test.json b/eudico-core/genesis/genesis-test.json new file mode 100644 index 000000000..a0208e11e --- /dev/null +++ b/eudico-core/genesis/genesis-test.json @@ -0,0 +1,127 @@ +{ + "NetworkVersion": 18, + "Timestamp": 42, + "Accounts": [ + { + "Type": "account", + "Balance": "50000000000000000000000000", + "Meta": { + "Owner": "t3tat272hqg2h6fuokkun4xx742flp72iwvnsao5z4ba7c5qwhjlumyuklcnudg74phfvxaqd52ncb5vhutu2a" + } + }, + { + "Type": "account", + "Balance": "50000000000000000000000000", + "Meta": { + "Owner": "t1jlm55oqkdalh2l3akqfsaqmpjxgjd36pob34dqy" + } + }, + { + "Type": "account", + "Balance": "5000000000000000000000", + "Meta": { + "Owner": "t1cp4q4lqsdhob23ysywffg2tvbmar5cshia4rweq" + } + } + ], + "Miners": [ + { + "ID": "t01000", + "Owner": "t3tat272hqg2h6fuokkun4xx742flp72iwvnsao5z4ba7c5qwhjlumyuklcnudg74phfvxaqd52ncb5vhutu2a", + "Worker": "t3tat272hqg2h6fuokkun4xx742flp72iwvnsao5z4ba7c5qwhjlumyuklcnudg74phfvxaqd52ncb5vhutu2a", + "PeerId": "12D3KooWGnEaQeRxwJtvBQ7bNNYSP5XyFL2TZVyuswkbAJ3MakFB", + "MarketBalance": "0", + "PowerBalance": "0", + "SectorSize": 2048, + "Sectors": [ + { + "CommR": { + "/": "bagboea4b5abcbf33kvktdrl4vipsv5n2uwo3cuhagx4ldcfra4a3d3c26hxzy4b4" + }, + "CommD": { + "/": "baga6ea4seaqlikortzuo455iu3ggem62veye2kpeenftkvn4isxmgrkmxlotcma" + }, + "SectorID": 0, + "Deal": { + "PieceCID": { + "/": "baga6ea4seaqlikortzuo455iu3ggem62veye2kpeenftkvn4isxmgrkmxlotcma" + }, + "PieceSize": 2048, + "VerifiedDeal": false, + "Client": "t3tat272hqg2h6fuokkun4xx742flp72iwvnsao5z4ba7c5qwhjlumyuklcnudg74phfvxaqd52ncb5vhutu2a", + "Provider": "t01000", + "Label": "0", + "StartEpoch": 0, + "EndEpoch": 9001, + "StoragePricePerEpoch": "0", + "ProviderCollateral": "0", + "ClientCollateral": "0" + }, + "DealClientKey": { + "Type": "bls", + "PrivateKey": "oAQEUxvkaogDLfgCR69XseQjDra0KdDHjzrW8UDl5Vs=", + "PublicKey": "mCev6PA2j+LRylUby9/80Vb/6RarZAd3PAg+LsLHSujMUUsTaDN/jzlrcEB900Qe", + "Address": "t3tat272hqg2h6fuokkun4xx742flp72iwvnsao5z4ba7c5qwhjlumyuklcnudg74phfvxaqd52ncb5vhutu2a" + }, + "ProofType": 5 + }, + { + "CommR": { + "/": "bagboea4b5abcbckyfnyxbq2vdk4bifzsiyygi3qd6cir6fxt76gyfjmroqrdhztd" + }, + "CommD": { + "/": "baga6ea4seaqebwwnv3ltxshq6mvub2jtpb7ujwdae37y3i5tybnzs6plvtwo2bq" + }, + "SectorID": 1, + "Deal": { + "PieceCID": { + "/": "baga6ea4seaqebwwnv3ltxshq6mvub2jtpb7ujwdae37y3i5tybnzs6plvtwo2bq" + }, + "PieceSize": 2048, + "VerifiedDeal": false, + "Client": "t3tat272hqg2h6fuokkun4xx742flp72iwvnsao5z4ba7c5qwhjlumyuklcnudg74phfvxaqd52ncb5vhutu2a", + "Provider": "t01000", + "Label": "1", + "StartEpoch": 0, + "EndEpoch": 9001, + "StoragePricePerEpoch": "0", + "ProviderCollateral": "0", + "ClientCollateral": "0" + }, + "DealClientKey": { + "Type": "bls", + "PrivateKey": "oAQEUxvkaogDLfgCR69XseQjDra0KdDHjzrW8UDl5Vs=", + "PublicKey": "mCev6PA2j+LRylUby9/80Vb/6RarZAd3PAg+LsLHSujMUUsTaDN/jzlrcEB900Qe", + "Address": "t3tat272hqg2h6fuokkun4xx742flp72iwvnsao5z4ba7c5qwhjlumyuklcnudg74phfvxaqd52ncb5vhutu2a" + }, + "ProofType": 5 + } + ] + } + ], + "NetworkName": "localnet-059bb756-cde4-41ca-a3f8-3576866c469f", + "VerifregRootKey": { + "Type": "multisig", + "Balance": "0", + "Meta": { + "Signers": [ + "t1ceb34gnsc6qk5dt6n7xg6ycwzasjhbxm3iylkiy" + ], + "Threshold": 1, + "VestingDuration": 0, + "VestingStart": 0 + } + }, + "RemainderAccount": { + "Type": "multisig", + "Balance": "0", + "Meta": { + "Signers": [ + "t1ceb34gnsc6qk5dt6n7xg6ycwzasjhbxm3iylkiy" + ], + "Threshold": 1, + "VestingDuration": 0, + "VestingStart": 0 + } + } +} diff --git a/eudico-core/genesis/genesis.json b/eudico-core/genesis/genesis.json index a0208e11e..e7f7fc9e3 100644 --- a/eudico-core/genesis/genesis.json +++ b/eudico-core/genesis/genesis.json @@ -15,13 +15,6 @@ "Meta": { "Owner": "t1jlm55oqkdalh2l3akqfsaqmpjxgjd36pob34dqy" } - }, - { - "Type": "account", - "Balance": "5000000000000000000000", - "Meta": { - "Owner": "t1cp4q4lqsdhob23ysywffg2tvbmar5cshia4rweq" - } } ], "Miners": [ diff --git a/scripts/ipc/src/subnet-daemon.sh b/scripts/ipc/src/subnet-daemon.sh index 5df82ef9e..293b7497a 100755 --- a/scripts/ipc/src/subnet-daemon.sh +++ b/scripts/ipc/src/subnet-daemon.sh @@ -19,6 +19,11 @@ echo ' ' > $LOTUS_PATH/config.toml echo "[*] Generate genesis for subnet deterministically" -eudico genesis new --subnet-id=$SUBNETID --template=/genesis.json --out=subnet.car +if [[ "$SUBNETID" == "/root" ]]; then + eudico genesis new --subnet-id=$SUBNETID --template=/genesis-test.json --out=subnet.car +else + eudico genesis new --subnet-id=$SUBNETID --template=/genesis.json --out=subnet.car +fi + echo "[*] Starting daemon" eudico mir daemon --genesis=subnet.car --bootstrap=false diff --git a/scripts/mir/daemon.sh b/scripts/mir/daemon.sh index 7d67c8ee3..73ac71c7c 100755 --- a/scripts/mir/daemon.sh +++ b/scripts/mir/daemon.sh @@ -30,5 +30,5 @@ rm -rf $LOTUS_PATH # rm ./scripts/mir/devgen.car # ./eudico mir daemon --eudico-make-genesis=./scripts/mir/devgen.car --genesis-template=./scripts/mir/localnet.json --bootstrap=false --api=123$INDEX # else -./eudico mir daemon --genesis=./build/genesis/spacenet.car --bootstrap=false --api=123$INDEX +./eudico mir daemon --genesis=./scripts/mir/genesis.car --bootstrap=false --api=123$INDEX # fi diff --git a/scripts/mir/genesis.car b/scripts/mir/genesis.car new file mode 100644 index 000000000..0a5e9d383 Binary files /dev/null and b/scripts/mir/genesis.car differ diff --git a/scripts/spacenet-genesis.sh b/scripts/spacenet-genesis.sh new file mode 100755 index 000000000..494978470 --- /dev/null +++ b/scripts/spacenet-genesis.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +echo "[*] Re-compiling" +make spacenet +echo "[*] Generating spacenet genesis" +./eudico genesis new --template=./eudico-core/genesis/genesis.json --out=./build/genesis/spacenet.car +echo "[*] Generating test genesis" +./eudico genesis new --template=./eudico-core/genesis/genesis-test.json --out=./scripts/mir/genesis.car