Skip to content
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

Abstract Engine (MiniMina) for integration tests #14621

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
30bb4ab
Add network id ivar
Isaac-DeFrain Jul 25, 2023
43a8791
Add abstract engine skeleton
Isaac-DeFrain Jul 25, 2023
f11cb50
Add ci interactions for abstract engine
Isaac-DeFrain Jul 25, 2023
a8bbc59
Add abstract network with some ci interactions
Isaac-DeFrain Jul 25, 2023
5379a85
Fix formatting
Isaac-DeFrain Jul 25, 2023
4f4f446
Pull abstract engine into test_executive
Isaac-DeFrain Jul 26, 2023
a6e1154
Separate platform-specific and platform-agnostic actions
Isaac-DeFrain Jul 26, 2023
ba8225c
Continue adding CI stubs
Isaac-DeFrain Jul 26, 2023
b9687ed
Reformat
Isaac-DeFrain Jul 26, 2023
4cdcea8
Remove capacity check
Isaac-DeFrain Jul 27, 2023
a4e0bd4
Implement http requests
Isaac-DeFrain Jul 27, 2023
89f7672
Unit test network config json
Isaac-DeFrain Jul 27, 2023
1bb1351
Continue abstracting the node functions
Isaac-DeFrain Jul 27, 2023
6f4c02e
(test) Add config path ref
Isaac-DeFrain Jul 30, 2023
281b82e
(test) Update tests and remove intf files
Isaac-DeFrain Jul 30, 2023
715c16b
(test exec) Clean up and handle config path
Isaac-DeFrain Jul 30, 2023
1e6b391
(test exec) Replace http requests with config commands
Isaac-DeFrain Jul 30, 2023
89c6220
(engine) Start writing config-based commands
Isaac-DeFrain Aug 1, 2023
6453f21
(test exec) Config validation for abstract engine
Isaac-DeFrain Aug 2, 2023
014346d
(config) Update parsing and unit tests
Isaac-DeFrain Aug 2, 2023
28127d8
(abstract) Continue removing platform-specific commands from engine
Isaac-DeFrain Aug 2, 2023
f779334
(test exec) Allow use of GCP engine
Isaac-DeFrain Aug 2, 2023
83d09f6
(config) Update network deploy response parsing and unit test
Isaac-DeFrain Aug 2, 2023
e43e568
(config) Refactor netowrk deployed
Isaac-DeFrain Aug 3, 2023
b602951
(test exec) Log use of config with non-abstract engine
Isaac-DeFrain Aug 3, 2023
bbaab35
(config) Add network status response and unit tests
Isaac-DeFrain Aug 3, 2023
c1e9542
(config) Add return spec
Isaac-DeFrain Aug 13, 2023
8527a3c
(util) Add option to extend child process env
Isaac-DeFrain Aug 13, 2023
439d959
(unit test) Update with minimina commands
Isaac-DeFrain Aug 13, 2023
a607576
(mock) Add mock config and test for abstract engine
Isaac-DeFrain Aug 14, 2023
42f90ef
(test exec) Add alias command line arg and substitute in child process
Isaac-DeFrain Aug 14, 2023
6add576
(unit test) Clean up config unit tests
Isaac-DeFrain Aug 14, 2023
b789486
(config) Update configs
Isaac-DeFrain Aug 16, 2023
c0834ba
(config) Fix return types and flag substitutions
Isaac-DeFrain Aug 16, 2023
3c8b5fb
(test exec) Use test config to create Network manager
Isaac-DeFrain Aug 16, 2023
399e504
(test exec) Add mock alias command line arg
Isaac-DeFrain Aug 16, 2023
4b10c18
(unit test) Update network config
Isaac-DeFrain Aug 21, 2023
a54f1b1
(config) Replace temp type t' for type t
Isaac-DeFrain Aug 22, 2023
7f1f504
(git) Add automatation/testnets/
Isaac-DeFrain Aug 23, 2023
26afe47
(test exec) Remove unused abstract engine terraform
Isaac-DeFrain Aug 27, 2023
46a11d6
(intg test) Add runtime config and topology extraction to Test_config…
Isaac-DeFrain Aug 29, 2023
9cbc86e
(unit test) Move config.json to test_data dir
Isaac-DeFrain Aug 29, 2023
b776edc
(config) Update config and return spec fields
Isaac-DeFrain Sep 1, 2023
ad4b8ee
(unit test) Move example config file
Isaac-DeFrain Sep 1, 2023
25bdf73
(intg test) Pull local keyapirs for abstract engine
Isaac-DeFrain Sep 1, 2023
dfc5198
(intg test) Enrich Test_config with topology info for abstract engine
Isaac-DeFrain Sep 1, 2023
ef8b621
(intg test) Enrich tests with topology info
Isaac-DeFrain Sep 1, 2023
1c14bc0
(intg test) Rename Ci_interaction -> Config_util
Isaac-DeFrain Sep 1, 2023
14bd555
(unit test) Sync config file
Isaac-DeFrain Sep 1, 2023
3c37137
(intg test) Use pre-generated keypairs in all engines
Isaac-DeFrain Sep 1, 2023
1ddeab3
(test exec) Cleanup after network setup in mock test
Isaac-DeFrain Sep 3, 2023
e3ad2e1
(intg test) Separate abstract engine network config
Isaac-DeFrain Sep 3, 2023
a6b973e
(intg test) Move libp2p keys from test config to topology
Isaac-DeFrain Sep 4, 2023
b346afa
(intg test) Handle all topology info in network config
Isaac-DeFrain Sep 4, 2023
af9c1ea
(test exec) Clean up file paths
Isaac-DeFrain Sep 4, 2023
783915e
(intg test) Randomize keypairs used in tests
Isaac-DeFrain Sep 4, 2023
7d0094f
(intg test) Rename bp network keypairs
Isaac-DeFrain Sep 5, 2023
d7b14e3
(intg test) Add seed node configs to network config
Isaac-DeFrain Sep 5, 2023
1e1ffa2
(intg test) Write libp2p keyfiles to automation dir
Isaac-DeFrain Sep 5, 2023
7e13e09
(intg test) Separate base, archive, and node topology info
Isaac-DeFrain Sep 6, 2023
e28a127
(intg test) Add libp2p_keyfile path to topology
Isaac-DeFrain Sep 6, 2023
455c50a
(intg test) Add snark coordinator worker_nodes and snark_worker_fee t…
Isaac-DeFrain Sep 6, 2023
b0d0f5b
(intg test) Rename --runtime-config to --genesis-ledger
Isaac-DeFrain Sep 6, 2023
9efd21d
(intg test) Sync keys in genesis ledger and topology
Isaac-DeFrain Sep 6, 2023
784ce3e
(intg test) Small corrections to keypairs and return spec
Isaac-DeFrain Sep 6, 2023
8d4b27b
(intg test) Remove snark worker objects from topology
Isaac-DeFrain Sep 7, 2023
b7ed63c
(intg test) Rework archive and coordinator topology
Isaac-DeFrain Sep 7, 2023
38f27ca
(intg test) Check same keys, different libp2p keys for node with same…
Isaac-DeFrain Sep 7, 2023
fbd0de3
(intg test) Write compatible block producer keys
Isaac-DeFrain Sep 7, 2023
579e3e4
Changed command line argument for key-pair
ejMina226 Sep 8, 2023
c8b07ec
Revert gcp mina_automation back to what it was for key_pair generation
ejMina226 Sep 8, 2023
59e05b3
Fix typo
ejMina226 Sep 8, 2023
0d4e327
Undo spacing changes
ejMina226 Sep 8, 2023
68f0c7c
(intg test) Remove test config arg from Network_manager.create
Isaac-DeFrain Sep 8, 2023
3462270
(intg test) Add snark coordinator libp2p info
Isaac-DeFrain Sep 9, 2023
6131f41
(intg test) Undo function renaming
Isaac-DeFrain Sep 9, 2023
a536e9d
(intg test) Add git build field for commit/tag in topology
Isaac-DeFrain Sep 10, 2023
494d1b7
(intg test) Add node config helpers with default values
Isaac-DeFrain Sep 10, 2023
e89cfd7
(intg test) Update tests with helpers
Isaac-DeFrain Sep 10, 2023
a067b13
Merge branch 'develop' of github.com:MinaProtocol/mina into abstract_…
Isaac-DeFrain Sep 11, 2023
01bcfaa
(intg test) Add --start-slot-since-genesis to node run replayer command
Isaac-DeFrain Sep 11, 2023
026634c
(intg test) Generate unique genesis accounts
Isaac-DeFrain Sep 11, 2023
3468f2c
(intg test) Replace schema_file and zkapp_table fields for schema_files
Isaac-DeFrain Sep 12, 2023
ff9021d
(intg test) Rename network runner arg
Isaac-DeFrain Sep 12, 2023
6b4b092
(intg test) Add minimina config
Isaac-DeFrain Sep 12, 2023
cdcab56
(intg test) Handle general network runner alias
Isaac-DeFrain Sep 15, 2023
0feebc2
(intg test) Remove fake docker images and git build from mock test
Isaac-DeFrain Sep 15, 2023
9e5c6f3
(intg test) Improve logging
Isaac-DeFrain Sep 15, 2023
f910057
Fix payments test
ejMina226 Sep 19, 2023
e6c1edd
Add changes
ejMina226 Sep 25, 2023
9e0b63b
Merge pull request #93 from MinaFoundation/archive-changes
ejMina226 Sep 25, 2023
18e32f5
Add libp2p_keyfile archive changes
ejMina226 Sep 25, 2023
5bbaf69
libp2p keypairs written out for archive node
ejMina226 Sep 25, 2023
850ee45
add --import-accounts flag to start_node
piotr-iohk Oct 3, 2023
c424dbb
add --graphql-filtered-logs to minimina.json
piotr-iohk Oct 4, 2023
64e0fd5
Have default-seed reference a docker image
ejMina226 Oct 6, 2023
3b816cc
Merge remote-tracking branch 'origin/develop' into abstract_engine
joaosreis Nov 9, 2023
e5418b4
Update abstract engine to conform to the latest interface
joaosreis Nov 9, 2023
9ce3e05
Change node config functions. Add missing archive node to tests requi…
joaosreis Nov 26, 2023
8ce4012
Merge remote-tracking branch 'origin/develop' into abstract-engine-de…
joaosreis Nov 27, 2023
0be5681
Restore deleted mli
joaosreis Nov 27, 2023
91962dd
Revert unnecessary changes
joaosreis Nov 28, 2023
5562cb2
Reverted more changes
joaosreis Nov 28, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ automation/*-accounts.csv
automation/block_tree.gv.png
automation/gcloud-keyfile.json
automation/services/watchdog/check_libp2p/check_libp2p
automation/testnets/

*.backup

Expand Down
79 changes: 79 additions & 0 deletions integration_tests/config/minimina.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{
"version": 1,
"actions": [
{
"name": "create_network",
"args": {
"network_id": "string",
"genesis_ledger": "string",
"topology": "string"
},
"command": "MINIMINA network create --network-id {{network_id}} --genesis-ledger {{genesis_ledger}} --topology {{topology}}"
},
{
"name": "start_network",
"args": {
"network_id": "string"
},
"command": "MINIMINA network start --network-id {{network_id}}"
},
{
"name": "delete_network",
"args": {
"network_id": "string"
},
"command": "MINIMINA network delete --network-id {{network_id}}"
},
{
"name": "start_node",
"args": {
"network_id": "string",
"node_id": "string",
"fresh_state": "bool"
},
"command": "MINIMINA node start {{fresh_state}} --network-id {{network_id}} --node-id {{node_id}} --import-accounts --graphql-filtered-logs"
},
{
"name": "stop_node",
"args": {
"network_id": "string",
"node_id": "string"
},
"command": "MINIMINA node stop --network-id {{network_id}} --node-id {{node_id}}"
},
{
"name": "dump_archive_data",
"args": {
"network_id": "string",
"node_id": "string"
},
"command": "MINIMINA node dump-archive-data --network-id {{network_id}} --node-id {{node_id}}"
},
{
"name": "dump_mina_logs",
"args": {
"network_id": "string",
"node_id": "string"
},
"command": "MINIMINA node logs --network-id {{network_id}} --node-id {{node_id}}"
},
{
"name": "dump_precomputed_blocks",
"args": {
"network_id": "string",
"node_id": "string"
},
"command": "MINIMINA node dump-precomputed-blocks --network-id {{network_id}} --node-id {{node_id}}"
},
{
"name": "run_replayer",
"args": {
"network_id": "string",
"node_id": "string",
"start_slot_since_genesis": "int"
},
"command": "MINIMINA node run-replayer --network-id {{network_id}} --node-id {{node_id}} --start-slot-since-genesis {{start_slot_since_genesis}}"
}
]
}

78 changes: 78 additions & 0 deletions integration_tests/config/mock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
"version": 1,
"actions": [
{
"name": "create_network",
"args": {
"network_id": "string",
"genesis_ledger": "string",
"topology": "string"
},
"command": "MOCK_NETWORK network create --network-id {{network_id}} --genesis-ledger {{genesis_ledger}} --topology {{topology}}"
},
{
"name": "start_network",
"args": {
"network_id": "string"
},
"command": "MOCK_NETWORK network start --network-id {{network_id}}"
},
{
"name": "delete_network",
"args": {
"network_id": "string"
},
"command": "MOCK_NETWORK network delete --network-id {{network_id}}"
},
{
"name": "start_node",
"args": {
"network_id": "string",
"node_id": "string",
"fresh_state": "bool"
},
"command": "MOCK_NETWORK node start {{fresh_state}} --network-id {{network_id}} --node-id {{node_id}}"
},
{
"name": "stop_node",
"args": {
"network_id": "string",
"node_id": "string"
},
"command": "MOCK_NETWORK node stop --network-id {{network_id}} --node-id {{node_id}}"
},
{
"name": "dump_archive_data",
"args": {
"network_id": "string",
"node_id": "string"
},
"command": "MOCK_NETWORK node dump-archive-data --network-id {{network_id}} --node-id {{node_id}}"
},
{
"name": "dump_mina_logs",
"args": {
"network_id": "string",
"node_id": "string"
},
"command": "MOCK_NETWORK node dump-mina-logs --network-id {{network_id}} --node-id {{node_id}}"
},
{
"name": "dump_precomputed_blocks",
"args": {
"network_id": "string",
"node_id": "string"
},
"command": "MOCK_NETWORK node dump-precomputed-blocks --network-id {{network_id}} --node-id {{node_id}}"
},
{
"name": "run_replayer",
"args": {
"network_id": "string",
"node_id": "string",
"start_slot_since_genesis": "int"
},
"command": "MOCK_NETWORK node run-replayer --network-id {{network_id}} --node-id {{node_id}} --start-slot-since-genesis {{start_slot_since_genesis}}"
}
]
}
49 changes: 49 additions & 0 deletions integration_tests/return_spec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"version": 1,
"return_spec": {
"create_network": {
"network_id": "string",
"nodes": {
"$node_id": {
"graphql_uri" : "string",
"node_type" : "string",
"private_key" : "string"
}
}
},
"start_network": {
"network_id": "string"
},
"delete_network": {
"network_id": "string"
},
"start_node": {
"network_id": "string",
"node_id": "string"
},
"stop_node": {
"network_id": "string",
"node_id": "string"
},
"dump_archive_data": {
"data": "string",
"network_id": "string",
"node_id": "string"
},
"dump_mina_logs": {
"logs": "string",
"network_id": "string",
"node_id": "string"
},
"dump_precomputed_blocks": {
"blocks": "string",
"network_id": "string",
"node_id": "string"
},
"run_replayer": {
"logs": "string",
"network_id": "string",
"node_id": "string"
}
}
}
47 changes: 15 additions & 32 deletions src/app/test_executive/block_production_priority.ml
Original file line number Diff line number Diff line change
Expand Up @@ -8,50 +8,33 @@ module Make (Inputs : Intf.Test.Inputs_intf) = struct

open Test_common.Make (Inputs)

(* TODO: find a way to avoid this type alias (first class module signatures restrictions make this tricky) *)
type network = Network.t

type node = Network.Node.t

type dsl = Dsl.t

let num_extra_keys = 1000

(* let num_sender_nodes = 4 *)

let test_name = "block-prod-prio"

let config =
let open Test_config in
let open Node_config in
{ default with
requires_graphql = true
; genesis_ledger =
[ { Test_Account.account_name = "receiver-key"
; balance = "9999999"
; timing = Untimed
}
; { account_name = "empty-bp-key"; balance = "0"; timing = Untimed }
; { account_name = "snark-node-key"; balance = "0"; timing = Untimed }
genesis_ledger =
[ test_account "receiver-key" "9999999"
; test_account "empty-bp-key" "0"
; test_account "snark-node-key" "0"
]
@ List.init num_extra_keys ~f:(fun i ->
let i_str = Int.to_string i in
{ Test_Account.account_name =
String.concat [ "sender-account"; i_str ]
; balance = "10000"
; timing = Untimed
} )
test_account ("sender-account" ^ i_str) "10000" )
; block_producers =
[ { node_name = "receiver"; account_name = "receiver-key" }
; { node_name = "empty_node-1"; account_name = "empty-bp-key" }
; { node_name = "empty_node-2"; account_name = "empty-bp-key" }
; { node_name = "empty_node-3"; account_name = "empty-bp-key" }
; { node_name = "empty_node-4"; account_name = "empty-bp-key" }
; { node_name = "observer"; account_name = "empty-bp-key" }
[ bp "receiver"
; bp "empty_node-1" ~account_name:"empty-bp-key"
; bp "empty_node-2" ~account_name:"empty-bp-key"
; bp "empty_node-3" ~account_name:"empty-bp-key"
; bp "empty_node-4" ~account_name:"empty-bp-key"
; bp "observer" ~account_name:"empty-bp-key"
]
; snark_coordinator =
Some
{ node_name = "snark-node"
; account_name = "snark-node-key"
; worker_nodes = 4
}
; snark_coordinator = snark "snark-node" 4
; txpool_max_size = 10_000_000
; snark_worker_fee = "0.0001"
; proof_config =
Expand Down
13 changes: 4 additions & 9 deletions src/app/test_executive/block_reward_test.ml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,15 @@ module Make (Inputs : Intf.Test.Inputs_intf) = struct

open Test_common.Make (Inputs)

(* TODO: find a way to avoid this type alias (first class module signatures restrictions make this tricky) *)
type network = Network.t

type node = Network.Node.t

type dsl = Dsl.t
let test_name = "block-reward"

let config =
let open Test_config in
let open Node_config in
{ default with
requires_graphql = true
; genesis_ledger =
[ { account_name = "node-key"; balance = "1000"; timing = Untimed } ]
; block_producers = [ { node_name = "node"; account_name = "node-key" } ]
; genesis_ledger = [ test_account "node-key" "1000" ]
; block_producers = [ bp "node" ]
}

let run network t =
Expand Down
20 changes: 6 additions & 14 deletions src/app/test_executive/chain_reliability_test.ml
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,19 @@ module Make (Inputs : Intf.Test.Inputs_intf) = struct

open Test_common.Make (Inputs)

(* TODO: find a way to avoid this type alias (first class module signatures restrictions make this tricky) *)
type network = Network.t

type node = Network.Node.t

type dsl = Dsl.t
let test_name = "chain-reliability"

let config =
let open Test_config in
let open Node_config in
{ default with
requires_graphql = true
; genesis_ledger =
[ { account_name = "node-a-key"; balance = "1000"; timing = Untimed }
; { account_name = "node-b-key"; balance = "1000"; timing = Untimed }
; { account_name = "node-c-key"; balance = "0"; timing = Untimed }
]
; block_producers =
[ { node_name = "node-a"; account_name = "node-a-key" }
; { node_name = "node-b"; account_name = "node-b-key" }
; { node_name = "node-c"; account_name = "node-c-key" }
[ test_account "node-a-key" "1000"
; test_account "node-b-key" "1000"
; test_account "node-c-key" "0"
]
; block_producers = [ bp "node-a"; bp "node-b"; bp "node-c" ]
}

let run network t =
Expand Down
1 change: 1 addition & 0 deletions src/app/test_executive/dune
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
currency
mina_runtime_config
secrets
integration_test_abstract_engine
integration_test_cloud_engine
mina_generators
logger
Expand Down
17 changes: 4 additions & 13 deletions src/app/test_executive/gossip_consistency.ml
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,16 @@ module Make (Inputs : Intf.Test.Inputs_intf) = struct

open Test_common.Make (Inputs)

(* TODO: find a way to avoid this type alias (first class module signatures restrictions make this tricky) *)
type network = Network.t

type node = Network.Node.t

type dsl = Dsl.t
let test_name = "gossip-consis"

let config =
let open Test_config in
let open Node_config in
{ default with
requires_graphql = true
; genesis_ledger =
[ { account_name = "node-a-key"; balance = "1000"; timing = Untimed }
; { account_name = "node-b-key"; balance = "1000"; timing = Untimed }
]
; block_producers =
[ { node_name = "node-a"; account_name = "node-a-key" }
; { node_name = "node-b"; account_name = "node-b-key" }
]
[ test_account "node-a-key" "1000"; test_account "node-b-key" "1000" ]
; block_producers = [ bp "node-a"; bp "node-b" ]
}

let run network t =
Expand Down
Loading