-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit defines CMF messages intended for use with SKVBC (i.e. simpleKVBC, implemented in tests/simpleKVBC) for communication between the SKVBC clients and replicas. The intention is to eventually move SKVBC clients and replicas (including those implemented in tests/simpleKVBC/TesterClient and tests/simpleKVBC/TesterReplica and also Apollo's usage of SKVBC implemented in tests/apollo/util/skvbc.py) to use these messages defined in CMF rather than their current ad-hoc message format rooted in manually packing C++ struct and object data. We hope the switch to CMF in this area will improve the code cleanliness, readability, and long-term maintainability. If this commit is accepted, it will be followed up at a later time with changes to actually switch the SKVBC clients and replicas (as outlined above) to use the messages newly defined in this commit.
- Loading branch information
1 parent
fec9243
commit dfbb9fb
Showing
9 changed files
with
89 additions
and
4 deletions.
There are no files selected for viewing
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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
cmf_generate_python(concord_msgs ../../../reconfiguration/cmf/concord.cmf) | ||
cmf_generate_python(concord_msgs ../../../reconfiguration/cmf/concord.cmf) | ||
cmf_generate_python(skvbc_messages ../../simpleKVBC/cmf/skvbc_messages.cmf) |
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
add_subdirectory(cmf) | ||
add_subdirectory(TesterClient) | ||
add_subdirectory(TesterReplica) | ||
add_custom_target(copy_blockchain_scripts2 ALL COMMENT "Copying scripts abcd") | ||
add_custom_command(TARGET copy_blockchain_scripts2 | ||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/scripts ${CMAKE_CURRENT_BINARY_DIR}/scripts) | ||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/scripts ${CMAKE_CURRENT_BINARY_DIR}/scripts) |
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,4 @@ | ||
cmf_generate_cpp(header cpp skvbc::messages skvbc_messages.cmf) | ||
add_library(skvbc_messages_cmf ${cpp}) | ||
set_target_properties(skvbc_messages_cmf PROPERTIES LINKER_LANGUAGE CXX) | ||
target_include_directories(skvbc_messages_cmf PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) |
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,62 @@ | ||
# Definition of client-server interface for the SimpleKVBC test application. | ||
# | ||
# Note SimpleKVBC effectively implements a versioned key-value store supporting | ||
# only keys and values that are byte strings. | ||
|
||
Msg SKVBCReadRequest 3 { | ||
|
||
# Note an SKVBCReadRequest with read version 0 indicates that the latest | ||
# version should be read. | ||
uint64 read_version | ||
|
||
list bytes keys | ||
} | ||
|
||
Msg SKVBCWriteRequest 4 { | ||
uint64 read_version | ||
|
||
# if set to true, the SimpleKVBC replica will waste some time when it works | ||
# on pre-processing this request, which may be useful for simulating certain | ||
# workloads in testing. | ||
bool long_exec | ||
|
||
list bytes readset | ||
list kvpair bytes bytes writeset | ||
} | ||
|
||
Msg SKVBCGetLastBlockRequest 5 { | ||
} | ||
|
||
Msg SKVBCGetBlockDataRequest 6 { | ||
uint64 block_id | ||
} | ||
|
||
Msg SKVBCReadReply 7 { | ||
list kvpair bytes bytes reads | ||
} | ||
|
||
Msg SKVBCWriteReply 8 { | ||
bool success | ||
uint64 latest_block | ||
} | ||
|
||
Msg SKVBCGetLastBlockReply 9 { | ||
uint64 latest_block | ||
} | ||
|
||
Msg SKVBCRequest 1 { | ||
oneof { | ||
SKVBCReadRequest | ||
SKVBCWriteRequest | ||
SKVBCGetLastBlockRequest | ||
SKVBCGetBlockDataRequest | ||
} request | ||
} | ||
|
||
Msg SKVBCReply 2 { | ||
oneof { | ||
SKVBCReadReply | ||
SKVBCWriteReply | ||
SKVBCGetLastBlockReply | ||
} reply | ||
} |