Skip to content

Commit

Permalink
Rename 3PC -> PArSEC
Browse files Browse the repository at this point in the history
Rename all instances of 3PC to PArSEC.

Signed-off-by: Michael Maurer <[email protected]>
Co-authored-by: Alexander Jung <[email protected]>
Co-authored-by: Anders Brownworth <[email protected]>
  • Loading branch information
3 people authored and HalosGhost committed Aug 1, 2023
1 parent 3fcc150 commit fc57b0d
Show file tree
Hide file tree
Showing 154 changed files with 1,482 additions and 1,538 deletions.
14 changes: 7 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -76,20 +76,20 @@ COPY --from=builder /opt/tx-processor/build/src/uhs/client/client-cli ./build/sr
# Copy atomizer config
COPY --from=builder /opt/tx-processor/atomizer-compose.cfg ./atomizer-compose.cfg

# Create 3PC Deployment Image
FROM $IMAGE_VERSION AS threepc
# Create PArSEC Deployment Image
FROM $IMAGE_VERSION AS parsec

# Set working directory
WORKDIR /opt/tx-processor

# Only copy essential binaries
COPY --from=builder /opt/tx-processor/build/src/3pc/agent/agentd ./build/src/3pc/agent/agentd
COPY --from=builder /opt/tx-processor/build/src/3pc/runtime_locking_shard/runtime_locking_shardd ./build/src/3pc/runtime_locking_shard/runtime_locking_shardd
COPY --from=builder /opt/tx-processor/build/src/3pc/ticket_machine/ticket_machined ./build/src/3pc/ticket_machine/ticket_machined
COPY --from=builder /opt/tx-processor/build/src/parsec/agent/agentd ./build/src/parsec/agent/agentd
COPY --from=builder /opt/tx-processor/build/src/parsec/runtime_locking_shard/runtime_locking_shardd ./build/src/parsec/runtime_locking_shard/runtime_locking_shardd
COPY --from=builder /opt/tx-processor/build/src/parsec/ticket_machine/ticket_machined ./build/src/parsec/ticket_machine/ticket_machined

# Copy load generators
COPY --from=builder /opt/tx-processor/build/tools/bench/3pc/evm/evm_bench ./build/tools/bench/3pc/evm/evm_bench
COPY --from=builder /opt/tx-processor/build/tools/bench/3pc/lua/lua_bench ./build/tools/bench/3pc/lua/lua_bench
COPY --from=builder /opt/tx-processor/build/tools/bench/parsec/evm/evm_bench ./build/tools/bench/parsec/evm/evm_bench
COPY --from=builder /opt/tx-processor/build/tools/bench/parsec/lua/lua_bench ./build/tools/bench/parsec/lua/lua_bench

# Copy wait script
COPY --from=builder /opt/tx-processor/scripts/wait-for-it.sh ./scripts/wait-for-it.sh
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,20 @@ There are two UHS-based architectures as follows:

Read the [2PC & Atomizer architecture guide](docs/uhs-architectures.md) for a detailed description of the system components and implementation of each architecture.

## Generic Smart Contract Platform ("3PC")
We built a system that is capable of performing parallel executions of generic smart contracts.
## Parallel Architecture for Scalably Executing smart Contracts ("PArSEC")
We built a system with a generic virtual machine layer that is capable of performing parallel executions of smart contracts.

The architecture is composed of two layers:
1. A distributed key-value data store with [ACID](https://en.wikipedia.org/wiki/ACID) database properties
- This back-end data store is not constrained to any type of data and is agnostic to the execution later.
1. A generic computation layer that executes programs (i.e. smart contracts) and uses the back-end database to store state
1. A generic virtual machine layer that executes programs (i.e. smart contracts) and uses the distributed key-value data store to record state
- This computation layer defines the data models and transaction semantics.
- We have implemented EVM and Lua as two working examples.
- We have implemented the Ethereum Virtual Machine EVM and a Lua based virtual machine as two working examples.

This architecture enables parallel execution of smart contracts (where keys are independent).
Therefore throughput is horizontally scalable with additional servers.
- This architecture enables parallel execution of smart contracts which can be scaled horizontally where keys are independent.
- Unmodified smart contracts from the Ethereum ecosystem can be deployed directly onto our EVM implementation.

Read the [Programmability Architecture Guide](docs/programmability_architecture.md) for more details.
Read the [PArSEC Architecture Guide](docs/parsec_architecture.md) for more details.
# Contributing

You can [sign up](https://dci.mit.edu/opencbdc-interest) to receive updates from technical working groups and to learn more about our work.
Expand Down Expand Up @@ -93,8 +93,8 @@ Note that if you have not already installed the xcode cli tools you will need to

## UHS-based Architectures (2PC & Atomizer)
See the [2PC & Atomizer User Guide](docs/2pc_atomizer_user_guide.md)
## Programmability Architecture
See the [Programmability User Guide](docs/programmability_user_guide.md)
## PArSEC Architecture
See the [PArSEC User Guide](docs/parsec_user_guide.md)
# Testing

Running Unit & Integration Tests
Expand Down
57 changes: 0 additions & 57 deletions docker-compose-3pc.yml

This file was deleted.

10 changes: 5 additions & 5 deletions docker-compose-3pc-test.yml → docker-compose-parsec-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ services:
loadgen0:
build:
context: .
target: threepc
target: parsec
image: opencbdc-tx
tty: true
command: ./scripts/wait-for-it.sh -s agent0:8080 -t 60 -- ./build/tools/bench/3pc/evm/evm_bench --shard_count=1 --shard0_count=1 --shard00_endpoint=shard0:5556 --node_id=0 --component_id=0 --agent_count=1 --agent0_endpoint=agent0:8080 --ticket_machine_count=1 --ticket_machine0_endpoint=ticket0:7777 --loadgen_accounts=8192 --loadgen_txtype=erc20 --telemetry=1
command: ./scripts/wait-for-it.sh -s agent0:8080 -t 60 -- ./build/tools/bench/parsec/evm/evm_bench --shard_count=1 --shard0_count=1 --shard00_endpoint=shard0:5556 --node_id=0 --component_id=0 --agent_count=1 --agent0_endpoint=agent0:8080 --ticket_machine_count=1 --ticket_machine0_endpoint=ticket0:7777 --loadgen_accounts=8192 --loadgen_txtype=erc20 --telemetry=1
networks:
- 3pc-network
- parsec-network
healthcheck:
test: ["CMD-SHELL", "netstat -ltn | grep -c 5556"]
interval: 30s
Expand All @@ -21,6 +21,6 @@ services:
stop_grace_period: 30s

networks:
3pc-network:
name: 3pc-network
parsec-network:
name: parsec-network
driver: bridge
57 changes: 57 additions & 0 deletions docker-compose-parsec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
version: '3'

services:

agent0:
build:
context: .
target: parsec
image: opencbdc-tx-parsec
tty: true
restart: always
command: ./scripts/wait-for-it.sh -s ticket0:7777 -t 60 -- ./scripts/wait-for-it.sh -s shard0:5556 -t 60 -- ./build/src/parsec/agent/agentd --shard_count=1 --shard0_count=1 --shard00_endpoint=shard0:5556 --node_id=0 --component_id=0 --agent_count=1 --agent0_endpoint=agent0:8080 --ticket_machine_count=1 --ticket_machine0_endpoint=ticket0:7777 --loglevel=WARN --runner_type="evm"
ports:
- 8080:8080
networks:
- parsec-network
healthcheck:
test: ["CMD-SHELL", "netstat -ltn | grep -c 6666"]
interval: 30s
timeout: 10s
retries: 5

ticket0:
build:
context: .
target: parsec
image: opencbdc-tx-parsec
tty: true
command: ./scripts/wait-for-it.sh -s shard0:5556 -t 60 -- ./build/src/parsec/ticket_machine/ticket_machined --shard_count=1 --shard0_count=1 --shard00_endpoint=shard0:5556 --node_id=0 --component_id=0 --agent_count=1 --agent0_endpoint=agent0:6666 --ticket_machine_count=1 --ticket_machine0_endpoint=ticket0:7777 --loglevel=WARN
networks:
- parsec-network
healthcheck:
test: ["CMD-SHELL", "netstat -ltn | grep -c 7777"]
interval: 30s
timeout: 10s
retries: 5
restart: always

shard0:
build:
context: .
target: parsec
image: opencbdc-tx-parsec
tty: true
command: ./build/src/parsec/runtime_locking_shard/runtime_locking_shardd --shard_count=1 --shard0_count=1 --shard00_endpoint=shard0:5556 --node_id=0 --component_id=0 --agent_count=1 --agent0_endpoint=agent0:6666 --ticket_machine_count=1 --ticket_machine0_endpoint=ticket0:7777 --loglevel=WARN
networks:
- parsec-network
healthcheck:
test: ["CMD-SHELL", "netstat -ltn | grep -c 5556"]
interval: 30s
timeout: 10s
retries: 5
restart: always

networks:
parsec-network:
name: parsec-network
2 changes: 1 addition & 1 deletion docs/lifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The [Working Groups](contributing.md#The-Hub-and-Spoke-Model) each guide one of
If you're interested in contributing to an area guided by one of the Working Groups, you should attend their next meeting and propose some work you are interested in conducting.

The [Leaders](contributing.md#Leader) and other Participants will discuss with you some ideas and whether or not your contribution should be pursued right now (e.g., perhaps there is other work that needs to be finished before your contribution is possible; this is an excellent opportunity to try and contribute to that effort first!).
E.g., if you're interested in implementing contingent payments (e.g., only paying someone when they've completed a bit of work for you, but cryptographically ensuring they get paid for their labor upon completion), that would most likely be under the purview of the Programmability Working Group.
E.g., if you're interested in implementing contingent payments (e.g., only paying someone when they've completed a bit of work for you, but cryptographically ensuring they get paid for their labor upon completion), that would most likely be under the purview of the PArSEC Working Group.

If your contribution wouldn't fall under the purview of any of the active Working Groups, you can open a [proposal](https://github.com/mit-dci/opencbdc-tx/labels/feedback%2Fproposal) on the main repository for the [Maintainers](contributing.md#Maintainer) to review.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Programmability Architecture Overview
# PArSEC Architecture Overview

At a high conceptual level, the architecture consists of two layers.

Expand All @@ -25,7 +25,7 @@ Therefore transaction throughput is horizontally scalable with additional server
For example, in contrast to the Ethereum blockchain, this system executes native value transfers and smart contract transactions (e.g. [ERC20 token](https://ethereum.org/en/developers/docs/standards/tokens/erc-20/) transfers) in parallel for independent addresses.

# Architecture Diagram
![Architecture Diagram](programmability_architecture_diagram.svg)
![Architecture Diagram](PArSEC_architecture_diagram.svg)

# System Components
### Agent (Transaction Coordinator)
Expand Down
File renamed without changes
File renamed without changes
18 changes: 9 additions & 9 deletions docs/programmability_user_guide.md → docs/parsec_user_guide.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Programmability User Guide
# PArSEC User Guide

This guide runs through setting up the 3PC system with the EVM runner, and then interacting with it using Hardhat and MetaMask. This assumes that the system has been set up as described in the [README](https://github.com/mit-dci/opencbdc-tx#readme).
This guide runs through setting up the PArSEC system with the EVM runner, and then interacting with it using Hardhat and MetaMask. This assumes that the system has been set up as described in the [README](https://github.com/mit-dci/opencbdc-tx#readme).

## Prerequisites

Expand All @@ -11,11 +11,11 @@ We also provide a [.nvmrc](https://github.com/mit-dci/opencbdc-tx/blob/trunk/.nv
### Run with Docker

Spawns an agent running the EVM runner by default.
Lua runner may be used by modifying the --runner_type flag in the command keyed by agent0, in the file [`docker-compose-3pc.yml`](https://github.com/mit-dci/opencbdc-tx/blob/trunk/docker-compose-3pc.yml).
Lua runner may be used by modifying the --runner_type flag in the command keyed by agent0, in the file [`docker-compose-PArSEC.yml`](https://github.com/mit-dci/opencbdc-tx/blob/trunk/docker-compose-PArSEC.yml).

### Start it up
```console
# docker compose -f docker-compose-3pc.yml up -d
# docker compose -f docker-compose-PArSEC.yml up -d
```

The agent is now available on `http://localhost:8080/`.
Expand All @@ -27,7 +27,7 @@ If you are using MacOS or an Ubuntu-like distribution, you can run the system wi
Build and run the system:
```console
$ ./scripts/build.sh
$ ./scripts/3pc-run-local.sh [OPTIONS] # use --help flag for help
$ ./scripts/PArSEC-run-local.sh [OPTIONS] # use --help flag for help
```
The agent is now available on the specified IP address and port (defaults to localhost:8888).

Expand All @@ -40,7 +40,7 @@ Follow below for a demo.
Go to a new separate directory and run `npm init` and `npm install --save-dev hardhat @nomiclabs/hardhat-waffle`:

```console
$ mkdir 3pc-playground && cd 3pc-playground
$ mkdir PArSEC-playground && cd PArSEC-playground
$ npm init # all fields may be left as defaults (or blank)
$ npm install --save-dev hardhat @nomiclabs/hardhat-waffle
```
Expand All @@ -61,9 +61,9 @@ However, to use the Hardhat compiler, all Solidity files should be stored in the
Copy the example [hardhat.config.js](https://github.com/mit-dci/opencbdc-tx/blob/trunk/scripts/hardhat.config.js) into this directory.

Edit the `url:` value in the `hardhat.config.js` file to correspond with the url of the agent RPC server.
Using Docker this will be `http://localhost:8080/`. If running outside of Docker, use the IP and port specified when running `./scripts/3pc-run-local.sh` (default is `http://localhost:8888/`).
Using Docker this will be `http://localhost:8080/`. If running outside of Docker, use the IP and port specified when running `./scripts/PArSEC-run-local.sh` (default is `http://localhost:8888/`).

Note: the value in the `accounts` array is the private key of one of the hard-coded, pre-minted accounts in 3PC/EVM.
Note: the value in the `accounts` array is the private key of one of the hard-coded, pre-minted accounts in PArSEC/EVM.

You should now be able to use the Hardhat console.

Expand Down Expand Up @@ -118,7 +118,7 @@ Note: To compile the example contract, `@openzeppelin/contracts` is a required i
```console
$ npm install @openzeppelin/contracts
```
Create a deploy script for the token. An example is provided in [opencbdc-tx/scripts/deploy.js](https://github.com/mit-dci/opencbdc-tx/blob/trunk/docs/programmability_user_guide.md).
Create a deploy script for the token. An example is provided in [opencbdc-tx/scripts/deploy.js](https://github.com/mit-dci/opencbdc-tx/blob/trunk/docs/PArSEC_user_guide.md).
As written, this script requires the name of the ERC20 token to be changed to match the name of the token which is to be deployed.

Note: When the Hardhat project was initialized, a `scripts/deploy.js` file was created.
Expand Down
2 changes: 1 addition & 1 deletion scripts/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ $SUDO make install
cd ..

if [[ "$OSTYPE" != "darwin"* ]]; then
# <NOTE> For Mac Silicon: this curl install creates problems for building tools/bench/3pc/evm/
# <NOTE> For Mac Silicon: this curl install creates problems for building tools/bench/parsec/evm/
CURL_VERSION="7.83.1"
wget https://curl.se/download/curl-${CURL_VERSION}.tar.gz
rm -rf curl-${CURL_VERSION}
Expand Down
8 changes: 4 additions & 4 deletions scripts/3pc-run-local.sh → scripts/parsec-run-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ RUNNER_TYPE="evm"
LOGLEVEL="WARN"

function print_help() {
echo "Usage: 3pc-run-local.sh [OPTIONS]"
echo "Usage: parsec-run-local.sh [OPTIONS]"
echo ""
echo "OPTIONS:"
echo " --ip The IP address to use. Default is localhost."
Expand Down Expand Up @@ -41,22 +41,22 @@ echo Running agent on $IP:$PORT
echo Log level = $LOGLEVEL
echo Runner type = $RUNNER_TYPE

./build/src/3pc/runtime_locking_shard/runtime_locking_shardd --shard_count=1 \
./build/src/parsec/runtime_locking_shard/runtime_locking_shardd --shard_count=1 \
--shard0_count=1 --shard00_endpoint=$IP:5556 \
--shard00_raft_endpoint=$IP:5557 --node_id=0 --component_id=0 \
--agent_count=1 --agent0_endpoint=$IP:6666 --ticket_machine_count=1 \
--ticket_machine0_endpoint=$IP:7777 --loglevel=$LOGLEVEL \
> logs/shardd.log &
sleep 1
./scripts/wait-for-it.sh -s $IP:5556 -t 60 -- \
./build/src/3pc/ticket_machine/ticket_machined --shard_count=1 \
./build/src/parsec/ticket_machine/ticket_machined --shard_count=1 \
--shard0_count=1 --shard00_endpoint=$IP:5556 --node_id=0 \
--component_id=0 --agent_count=1 --agent0_endpoint=$IP:6666 \
--ticket_machine_count=1 --ticket_machine0_endpoint=$IP:7777 \
--loglevel=$LOGLEVEL > logs/ticket_machined.log &
sleep 1
./scripts/wait-for-it.sh -s $IP:7777 -t 60 -- ./scripts/wait-for-it.sh -s \
$IP:5556 -t 60 -- ./build/src/3pc/agent/agentd --shard_count=1 \
$IP:5556 -t 60 -- ./build/src/parsec/agent/agentd --shard_count=1 \
--shard0_count=1 --shard00_endpoint=$IP:5556 --node_id=0 --component_id=0 \
--agent_count=1 --agent0_endpoint=$IP:$PORT --ticket_machine_count=1 \
--ticket_machine0_endpoint=$IP:7777 --loglevel=$LOGLEVEL \
Expand Down
Loading

0 comments on commit fc57b0d

Please sign in to comment.