This repository contains the data and the scripts used for the experimental evaluation described in the paper
M. Bartoletti, L. Galletta and M. Murgia. A theory of transaction parallelism in blockchains, Log. Methods Comput. Sci. 17(4), 2021.
- Go Ethereum v1.10.3-stable-991384a7
- Truffle v5.3.3
- Python 3
- Commandline dependency builder
Here is a high level description of the content of the repository.
.
├── contracts/
│ Source code of the Lottery contract.
│
├── migrations/
│ Truffle scripts for the migration and deployment of the contract on the blockchain.
│
├── scripts/
│ Scripts used for the generation and analysis of the experiment data
│
├── experiment-data
│ Data used for the evaluation
│
├── LICENSE
│
├── truffle-config.js
│ Truffle configuration.
│
└── README.md
Here is a high level description of scripts used for the evaluation.
scripts
├── create-account.js
│ Script for the geth console to create further two accounts to play the lottery
│
├── run-lottery.sh
│ Script bash that creates the required accounts, deploys the contract on the blockchain and plays 70 game of the lottery. It stores the hashes of the sent transactions into a file.
│
├── transactions-lottery.js
│ Truffle script that plays the lottery interacting with the contract on the blockchain.
│
├── analyze-result.py
│ Script python that extracts the time spent by each transaction from the geth log, that computes the sequential time and that generates the input for cldb tool
│
└── longest-path.py
Script python that given the dependency graph generated by cldb and the execution time of each transaction computes a parallel schedule as the longest and most expensive path (in terms of time) of the dependency graph.
Here is a high level description of data generated for the evaluation.
experiment-data
├── geth-run[1-10].log
│ Log generated by geth
│
├── lottery-run[1-10].log
│ Hashes of transaction generated during the game
│
├── lottery-info.json
│ Template used to generate the block to use as input of cldb
│
├── lottery-generated-block.json
│ The block of transactions used in our evaluation
│
├── lottery-transaction-cost.txt
│ The cost in term of time of each transaction in lottery-generated-block.json
│
├── lottery-transaction-graph.txt
│ The dependency graph generated by cldb for transactions in lottery-generated-block.json
│
└── cldb-time.txt
The average time spent by cldb to perform the analysis of transaction in lottery-generated-block.json
Note steps 1 and 2 below are repeated 10 times.
- Run
geth
creating a local development chain and storing the logs into a file
$ geth --dev --http --allow-insecure-unlock 2> geth_run.log
- Deploy the
Lottery
smart contract and play the game
$ bash scripts/run-lottery.sh lottery-run.log
where lottery-run.log
will store info about the called functions and their corresponding transactions.
The script will ask password for the new accounts, the empty password is just fine for our purposes.
- Extract the transaction execution time and generate the transaction block
$ python scripts/analyze-result.py lottery-run geth_run 10 lottery-info.json
where 10 is the number of repetitions of steps 1 and 2.
The above script generates the file transaction-cost.txt
and generated-block.json
.
- Generate the dependency graph
$ cldb generated-block.json
The script above will generate the file transaction-graph.txt
.
- Compute and longest and most expensive path in the dependency graph
$ python scripts/longest-path.py transaction-graph.txt transaction.cost.txt