Skip to content

Commit

Permalink
Merge pull request #1755 from oasislabs/yawning/feature/keymanager-redux
Browse files Browse the repository at this point in the history
Add replication to the key manager
  • Loading branch information
Yawning authored Jun 13, 2019
2 parents 3642a89 + b6d4e92 commit c3eb172
Show file tree
Hide file tree
Showing 57 changed files with 1,844 additions and 288 deletions.
26 changes: 26 additions & 0 deletions .buildkite/scripts/common_e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,16 @@ run_backend_tendermint_committee() {
registry entity init \
--datadir ${entity_dir}

# Provision the key manager runtime.
${EKIDEN_NODE} \
registry runtime init_genesis \
--runtime.id ${EKIDEN_KM_RUNTIME_ID} \
${EKIDEN_TEE_HARDWARE:+--runtime.tee_hardware ${EKIDEN_TEE_HARDWARE}} \
--runtime.kind keymanager \
--runtime.genesis.file keymanager_genesis.json \
--entity ${entity_dir} \
--datadir ${entity_dir}

# Provision the runtime.
${EKIDEN_NODE} \
registry runtime init_genesis \
Expand All @@ -86,6 +96,8 @@ run_backend_tendermint_committee() {
--runtime.storage_group_size ${storage_group_size} \
${runtime_genesis:+--runtime.genesis.state ${runtime_genesis}} \
${EKIDEN_TEE_HARDWARE:+--runtime.tee_hardware ${EKIDEN_TEE_HARDWARE}} \
--runtime.keymanager ${EKIDEN_KM_RUNTIME_ID} \
--runtime.kind compute \
--entity ${entity_dir} \
--datadir ${entity_dir}

Expand All @@ -97,6 +109,7 @@ run_backend_tendermint_committee() {
genesis init \
--genesis_file ${genesis_file} \
--entity ${entity_dir}/entity_genesis.json \
--runtime ${entity_dir}/keymanager_genesis.json \
--runtime ${entity_dir}/runtime_genesis.json \
${roothash_genesis_blocks:+--roothash ${roothash_genesis_blocks}} \
${runtime_genesis:+--storage ${runtime_genesis}} \
Expand Down Expand Up @@ -156,12 +169,14 @@ run_backend_tendermint_committee() {
--scheduler.backend trivial \
--registry.backend tendermint \
--roothash.backend tendermint \
--keymanager.backend tendermint \
--genesis.file ${genesis_file} \
--tendermint.core.listen_address tcp://0.0.0.0:${tm_port} \
--tendermint.consensus.timeout_commit 250ms \
--tendermint.debug.addr_book_lenient \
--tendermint.seeds "${EKIDEN_SEED_NODE_ID}@127.0.0.1:${EKIDEN_SEED_NODE_PORT}" \
--datadir ${datadir} \
--debug.allow_test_keys \
&

# HACK HACK HACK HACK HACK
Expand Down Expand Up @@ -239,6 +254,7 @@ run_compute_node() {
--scheduler.backend trivial \
--registry.backend tendermint \
--roothash.backend tendermint \
--keymanager.backend tendermint \
--genesis.file ${EKIDEN_GENESIS_FILE} \
--tendermint.core.listen_address tcp://0.0.0.0:${tm_port} \
--tendermint.consensus.timeout_commit 250ms \
Expand All @@ -258,6 +274,7 @@ run_compute_node() {
--worker.entity_private_key ${EKIDEN_ENTITY_PRIVATE_KEY} \
--tendermint.seeds "${EKIDEN_SEED_NODE_ID}@127.0.0.1:${EKIDEN_SEED_NODE_PORT}" \
--datadir ${data_dir} \
--debug.allow_test_keys \
${extra_args} 2>&1 | sed "s/^/[compute-node-${id}] /" &
}

Expand Down Expand Up @@ -312,6 +329,7 @@ run_storage_node() {
--scheduler.backend trivial \
--registry.backend tendermint \
--roothash.backend tendermint \
--keymanager.backend tendermint \
--genesis.file ${EKIDEN_GENESIS_FILE} \
--tendermint.core.listen_address tcp://0.0.0.0:${tm_port} \
--tendermint.consensus.timeout_commit 250ms \
Expand All @@ -322,6 +340,7 @@ run_storage_node() {
--worker.p2p.port ${p2p_port} \
--worker.entity_private_key ${EKIDEN_ENTITY_PRIVATE_KEY} \
--datadir ${data_dir} \
--debug.allow_test_keys \
2>&1 | sed "s/^/[storage-node-${id}] /" &
}

Expand Down Expand Up @@ -372,13 +391,15 @@ run_client_node() {
--registry.backend tendermint \
--roothash.backend tendermint \
--roothash.tendermint.index_blocks \
--keymanager.backend tendermint \
--genesis.file ${EKIDEN_GENESIS_FILE} \
--tendermint.core.listen_address tcp://0.0.0.0:${tm_port} \
--tendermint.consensus.timeout_commit 250ms \
--tendermint.debug.addr_book_lenient \
--tendermint.seeds "${EKIDEN_SEED_NODE_ID}@127.0.0.1:${EKIDEN_SEED_NODE_PORT}" \
--client.indexer.runtimes ${EKIDEN_RUNTIME_ID} \
--datadir ${data_dir} \
--debug.allow_test_keys \
2>&1 | sed "s/^/[client-node-${id}] /" &
}

Expand Down Expand Up @@ -451,6 +472,7 @@ run_keymanager_node() {
--scheduler.backend trivial \
--registry.backend tendermint \
--roothash.backend tendermint \
--keymanager.backend tendermint \
--genesis.file ${EKIDEN_GENESIS_FILE} \
--tendermint.core.listen_address tcp://0.0.0.0:${tm_port} \
--tendermint.consensus.timeout_commit 250ms \
Expand All @@ -463,8 +485,10 @@ run_keymanager_node() {
--worker.keymanager.runtime.loader ${EKIDEN_RUNTIME_LOADER} \
--worker.keymanager.runtime.binary ${EKIDEN_ROOT_PATH}/target/${runtime_target}/debug/ekiden-keymanager-runtime${runtime_ext} \
--worker.keymanager.runtime.id ${EKIDEN_KM_RUNTIME_ID} \
--worker.keymanager.may_generate \
--tendermint.seeds "${EKIDEN_SEED_NODE_ID}@127.0.0.1:${EKIDEN_SEED_NODE_PORT}" \
--datadir ${data_dir} \
--debug.allow_test_keys \
${extra_args} 2>&1 | sed "s/^/[key-manager] /" &
}

Expand Down Expand Up @@ -506,10 +530,12 @@ run_seed_node() {
--scheduler.backend trivial \
--registry.backend tendermint \
--roothash.backend tendermint \
--keymanager.backend tendermint \
--tendermint.core.listen_address tcp://0.0.0.0:${EKIDEN_SEED_NODE_PORT} \
--tendermint.seed_mode \
--tendermint.debug.addr_book_lenient \
--datadir ${data_dir} \
--debug.allow_test_keys \
${extra_args} 2>&1 | sed "s/^/[seed-node-${id}] /" &

# 'show-node-id' relies on key file to be present.
Expand Down
3 changes: 2 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ ECHO = echo
endif


.PHONY: all tools runtimes rust go clean fmt test test-unit test-e2e
.PHONY: all tools runtimes rust go clean fmt test test-unit test-e2e regenerate-single-node

all: tools runtimes rust go
@$(ECHO) "$(CYAN)*** Everything built successfully!$(OFF)"
Expand Down Expand Up @@ -85,3 +85,7 @@ test-e2e:
clean:
@$(ECHO) "$(CYAN)*** Cleaning up...$(OFF)"
@cargo clean

regenerate-single-node: go
@$(ECHO) "$(CYAN)*** Regenerating single node config artifacts...$(OFF)"
@./scripts/regenerate_single_node.sh
13 changes: 13 additions & 0 deletions configs/single_node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
#
datadir: /tmp/ekiden-single-node

# Debug.
#
# Enable test keys, and the built in test entity to reduce config maintenance
# burden.
debug:
allow_test_keys: true
test_entity: true

# Logging.
# Per-module log levels are defined below. If you prefer just one unified log level, you can use:
# log:
Expand Down Expand Up @@ -52,6 +60,7 @@ worker:
port: 9100
keymanager:
enabled: true
may_generate: true
runtime:
id: "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
binary: target/debug/ekiden-keymanager-runtime
Expand Down Expand Up @@ -93,6 +102,10 @@ tendermint:
consensus:
timeout_commit: 1s

# Key manager backend configuration.
keymanager:
backend: tendermint

# Client configuration.
client:
indexer:
Expand Down
1 change: 0 additions & 1 deletion configs/single_node/entity.json

This file was deleted.

4 changes: 0 additions & 4 deletions configs/single_node/entity.pem

This file was deleted.

1 change: 0 additions & 1 deletion configs/single_node/entity_genesis.json

This file was deleted.

2 changes: 1 addition & 1 deletion configs/single_node/genesis.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"extra_data":null,"genesis_time":"2019-05-16T10:19:39.086184371Z","registry":{"entities":[{"signature":{"public_key":"4Q+YiP/lflkaGC3RvuZAxgAmaKCV1fdAmBbZNHr5zyw=","signature":"nKNlW2YTlZJprL3V/2f4OTnehvljMgn0xzbdZDX+JFHqTJGDSQAYkr0QABXBxuhCclE/vxD+PfKKu0oLSvT+Bg=="},"untrusted_raw_value":"omJpZFgg4Q+YiP/lflkaGC3RvuZAxgAmaKCV1fdAmBbZNHr5zyxxcmVnaXN0cmF0aW9uX3RpbWUaXFQtfA=="}],"runtimes":[{"signature":{"public_key":"4Q+YiP/lflkaGC3RvuZAxgAmaKCV1fdAmBbZNHr5zyw=","signature":"WgGcADIkZkjUOZQ6QP7WG1xIApGGumy6cAU1etD6TfiPqUuXJWBOR7NVc+d2fThbpW5EUW680G21YlCM4XBnDw=="},"untrusted_raw_value":"q2JpZFggAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkY29kZfZka2luZABnZ2VuZXNpc6Jqc3RhdGVfcm9vdFggxnK40e9W7Sirh8NiLFEUBpvdOte4+XN0mNDAHs7wlnpvc3RvcmFnZV9yZWNlaXB0omlzaWduYXR1cmVYQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABqcHVibGljX2tlefZsdGVlX2hhcmR3YXJlAHFyZWdpc3RyYXRpb25fdGltZRpcVC18cnJlcGxpY2FfZ3JvdXBfc2l6ZQFyc3RvcmFnZV9ncm91cF9zaXplAXgZcmVwbGljYV9ncm91cF9iYWNrdXBfc2l6ZQB4GnJlcGxpY2FfYWxsb3dlZF9zdHJhZ2dsZXJzAHggdHJhbnNhY3Rpb25fc2NoZWR1bGVyX2dyb3VwX3NpemUB"}]},"roothash":{"blocks":{}},"staking":{"ledger":null},"storage":{"state":null},"validators":[{"core_address":"127.0.0.1:26656","name":"single-node","power":10,"pub_key":"RPHEs6FhqInmh2upLCDD9j3R7PIEratspDZWZJewFig="}]}
{"extra_data":null,"genesis_time":"2019-06-13T09:40:50.990285733Z","registry":{"entities":[{"signature":{"public_key":"TqUyj5Q+9vZtqu10yw6Zw7HEX3Ywe0JQA9vHyzY47TU=","signature":"Yx7IvyWipXTNh1nGUGtukolAV3lJ2cy0F+cM6lkyKbMcYavviVEOKGyuLndxyc/o5QTuv3XUeooNeH+2OS7SDw=="},"untrusted_raw_value":"omJpZFggTqUyj5Q+9vZtqu10yw6Zw7HEX3Ywe0JQA9vHyzY47TVxcmVnaXN0cmF0aW9uX3RpbWUaXPHAAA=="}],"runtimes":[{"signature":{"public_key":"TqUyj5Q+9vZtqu10yw6Zw7HEX3Ywe0JQA9vHyzY47TU=","signature":"rQThUvx2oRHTXkbzm2itbzGkhJIaFJ70VeuY+UPY7PnmnaNnw6OKrJowC9QN0MsTTNYJ1qypcMNvJ9sUutsBCg=="},"untrusted_raw_value":"q2JpZFgg//////////////////////////////////////////9ka2luZAFnZ2VuZXNpc6Jqc3RhdGVfcm9vdFggxnK40e9W7Sirh8NiLFEUBpvdOte4+XN0mNDAHs7wlnpvc3RvcmFnZV9yZWNlaXB0omlzaWduYXR1cmVYQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABqcHVibGljX2tlefZra2V5X21hbmFnZXJYIP//////////////////////////////////////////bHRlZV9oYXJkd2FyZQBxcmVnaXN0cmF0aW9uX3RpbWUaXPHAAHJyZXBsaWNhX2dyb3VwX3NpemUBcnN0b3JhZ2VfZ3JvdXBfc2l6ZQF4GXJlcGxpY2FfZ3JvdXBfYmFja3VwX3NpemUAeBpyZXBsaWNhX2FsbG93ZWRfc3RyYWdnbGVycwB4IHRyYW5zYWN0aW9uX3NjaGVkdWxlcl9ncm91cF9zaXplAQ=="},{"signature":{"public_key":"TqUyj5Q+9vZtqu10yw6Zw7HEX3Ywe0JQA9vHyzY47TU=","signature":"meg8c+dRcpnlFHbs0+tuNziWpdOVa7TczkUy4Bkpgng0ju/WZM89YW1eK6rQEvPnXakiuwFbvJKc7eyRHbeqBg=="},"untrusted_raw_value":"q2JpZFggAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABka2luZABnZ2VuZXNpc6Jqc3RhdGVfcm9vdFggxnK40e9W7Sirh8NiLFEUBpvdOte4+XN0mNDAHs7wlnpvc3RvcmFnZV9yZWNlaXB0omlzaWduYXR1cmVYQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABqcHVibGljX2tlefZra2V5X21hbmFnZXJYIP//////////////////////////////////////////bHRlZV9oYXJkd2FyZQBxcmVnaXN0cmF0aW9uX3RpbWUaXPHAAHJyZXBsaWNhX2dyb3VwX3NpemUBcnN0b3JhZ2VfZ3JvdXBfc2l6ZQF4GXJlcGxpY2FfZ3JvdXBfYmFja3VwX3NpemUAeBpyZXBsaWNhX2FsbG93ZWRfc3RyYWdnbGVycwB4IHRyYW5zYWN0aW9uX3NjaGVkdWxlcl9ncm91cF9zaXplAQ=="}]},"roothash":{"blocks":{}},"staking":{"ledger":null},"storage":{"state":null},"validators":[{"core_address":"127.0.0.1:26656","name":"single-node","power":10,"pub_key":"RPHEs6FhqInmh2upLCDD9j3R7PIEratspDZWZJewFig="}]}
1 change: 0 additions & 1 deletion configs/single_node/runtime_genesis.json

This file was deleted.

13 changes: 13 additions & 0 deletions configs/single_node_sgx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
#
datadir: /tmp/ekiden-single-node-sgx

# Debug.
#
# Enable test keys, and the built in test entity to reduce config maintenance
# burden.
debug:
allow_test_keys: true
test_entity: true

# Logging.
# Per-module log levels are defined below. If you prefer just one unified log level, you can use:
# log:
Expand Down Expand Up @@ -55,6 +63,7 @@ worker:
keymanager:
enabled: true
tee_hardware: intel-sgx
may_generate: true
runtime:
id: "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
binary: target/x86_64-fortanix-unknown-sgx/debug/ekiden-keymanager-runtime.sgxs
Expand Down Expand Up @@ -100,6 +109,10 @@ tendermint:
consensus:
timeout_commit: 1s

# Key manager backend configuration.
keymanager:
backend: tendermint

# Client configuration.
client:
indexer:
Expand Down
1 change: 0 additions & 1 deletion configs/single_node_sgx/entity.json

This file was deleted.

4 changes: 0 additions & 4 deletions configs/single_node_sgx/entity.pem

This file was deleted.

1 change: 0 additions & 1 deletion configs/single_node_sgx/entity_genesis.json

This file was deleted.

2 changes: 1 addition & 1 deletion configs/single_node_sgx/genesis.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"extra_data":null,"genesis_time":"2019-05-16T10:20:24.920062503Z","registry":{"entities":[{"signature":{"public_key":"4Q+YiP/lflkaGC3RvuZAxgAmaKCV1fdAmBbZNHr5zyw=","signature":"nKNlW2YTlZJprL3V/2f4OTnehvljMgn0xzbdZDX+JFHqTJGDSQAYkr0QABXBxuhCclE/vxD+PfKKu0oLSvT+Bg=="},"untrusted_raw_value":"omJpZFgg4Q+YiP/lflkaGC3RvuZAxgAmaKCV1fdAmBbZNHr5zyxxcmVnaXN0cmF0aW9uX3RpbWUaXFQtfA=="}],"runtimes":[{"signature":{"public_key":"4Q+YiP/lflkaGC3RvuZAxgAmaKCV1fdAmBbZNHr5zyw=","signature":"1TNmA4pKxOKA58dO6m00iEyEHq6dUx0GZ9VqNiMfR1mjDfLNd/JLY0h0wsScd87DOoigIdkh/Fi7LV4GfsM6BQ=="},"untrusted_raw_value":"q2JpZFggAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkY29kZfZka2luZABnZ2VuZXNpc6Jqc3RhdGVfcm9vdFggxnK40e9W7Sirh8NiLFEUBpvdOte4+XN0mNDAHs7wlnpvc3RvcmFnZV9yZWNlaXB0omlzaWduYXR1cmVYQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABqcHVibGljX2tlefZsdGVlX2hhcmR3YXJlAXFyZWdpc3RyYXRpb25fdGltZRpcVC18cnJlcGxpY2FfZ3JvdXBfc2l6ZQFyc3RvcmFnZV9ncm91cF9zaXplAXgZcmVwbGljYV9ncm91cF9iYWNrdXBfc2l6ZQB4GnJlcGxpY2FfYWxsb3dlZF9zdHJhZ2dsZXJzAHggdHJhbnNhY3Rpb25fc2NoZWR1bGVyX2dyb3VwX3NpemUB"}]},"roothash":{"blocks":{}},"staking":{"ledger":null},"storage":{"state":null},"validators":[{"core_address":"127.0.0.1:26656","name":"single-node","power":10,"pub_key":"RPHEs6FhqInmh2upLCDD9j3R7PIEratspDZWZJewFig="}]}
{"extra_data":null,"genesis_time":"2019-06-13T09:40:51.108454277Z","registry":{"entities":[{"signature":{"public_key":"TqUyj5Q+9vZtqu10yw6Zw7HEX3Ywe0JQA9vHyzY47TU=","signature":"Yx7IvyWipXTNh1nGUGtukolAV3lJ2cy0F+cM6lkyKbMcYavviVEOKGyuLndxyc/o5QTuv3XUeooNeH+2OS7SDw=="},"untrusted_raw_value":"omJpZFggTqUyj5Q+9vZtqu10yw6Zw7HEX3Ywe0JQA9vHyzY47TVxcmVnaXN0cmF0aW9uX3RpbWUaXPHAAA=="}],"runtimes":[{"signature":{"public_key":"TqUyj5Q+9vZtqu10yw6Zw7HEX3Ywe0JQA9vHyzY47TU=","signature":"h87+YyWUvVIdwF66M8WAF2o2L+uAjqQqLpt4uqKiuqX5BI3EBmRdK4hiyrYycWBa2K3lAWYJJtFe5eovKLekBA=="},"untrusted_raw_value":"q2JpZFgg//////////////////////////////////////////9ka2luZAFnZ2VuZXNpc6Jqc3RhdGVfcm9vdFggxnK40e9W7Sirh8NiLFEUBpvdOte4+XN0mNDAHs7wlnpvc3RvcmFnZV9yZWNlaXB0omlzaWduYXR1cmVYQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABqcHVibGljX2tlefZra2V5X21hbmFnZXJYIP//////////////////////////////////////////bHRlZV9oYXJkd2FyZQFxcmVnaXN0cmF0aW9uX3RpbWUaXPHAAHJyZXBsaWNhX2dyb3VwX3NpemUBcnN0b3JhZ2VfZ3JvdXBfc2l6ZQF4GXJlcGxpY2FfZ3JvdXBfYmFja3VwX3NpemUAeBpyZXBsaWNhX2FsbG93ZWRfc3RyYWdnbGVycwB4IHRyYW5zYWN0aW9uX3NjaGVkdWxlcl9ncm91cF9zaXplAQ=="},{"signature":{"public_key":"TqUyj5Q+9vZtqu10yw6Zw7HEX3Ywe0JQA9vHyzY47TU=","signature":"KECsvSKJJLpLLYFthrihr4uFna2U5HE0KmFVMk3kjtv3NAFBpkqW/Rrk1QYP7G1nFW/lLwi34VLI46BdnamxCw=="},"untrusted_raw_value":"q2JpZFggAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABka2luZABnZ2VuZXNpc6Jqc3RhdGVfcm9vdFggxnK40e9W7Sirh8NiLFEUBpvdOte4+XN0mNDAHs7wlnpvc3RvcmFnZV9yZWNlaXB0omlzaWduYXR1cmVYQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABqcHVibGljX2tlefZra2V5X21hbmFnZXJYIP//////////////////////////////////////////bHRlZV9oYXJkd2FyZQFxcmVnaXN0cmF0aW9uX3RpbWUaXPHAAHJyZXBsaWNhX2dyb3VwX3NpemUBcnN0b3JhZ2VfZ3JvdXBfc2l6ZQF4GXJlcGxpY2FfZ3JvdXBfYmFja3VwX3NpemUAeBpyZXBsaWNhX2FsbG93ZWRfc3RyYWdnbGVycwB4IHRyYW5zYWN0aW9uX3NjaGVkdWxlcl9ncm91cF9zaXplAQ=="}]},"roothash":{"blocks":{}},"staking":{"ledger":null},"storage":{"state":null},"validators":[{"core_address":"127.0.0.1:26656","name":"single-node","power":10,"pub_key":"RPHEs6FhqInmh2upLCDD9j3R7PIEratspDZWZJewFig="}]}
1 change: 0 additions & 1 deletion configs/single_node_sgx/runtime_genesis.json

This file was deleted.

Loading

0 comments on commit c3eb172

Please sign in to comment.