Summer of bitcoin coding challenge
Checkout resources/
folder for task info.
knapsack problem
to me. The only thing is that, the transaction should appear in a block iff all of its parents appear and they need to retain their original order.mempool
.
sudo apt-get install python3
sudo python3 -m pip install pipenv
Install dependencies
pipenv shell # activates the virtualenv
pipenv install # installs dependencies from Pipfile.lock
Edit and run python file
python3 file.py # inside the virtualenv
Block generation
```bash
python3 main.py [Optional block weight]
python3 main.py 40000
- Check `main.py` for basic usage.
- All the generated blocks are saved in `blocks/` directory in the format `block_{sum_of_fees_of_transactions_in_that_block}.txt`
### Observations
- Let `f(transaction)` be a the sum of fees generated by the knapsack algorithm for a given total_weight.
```python
f(all_transactions_in_mempool) > f(transactions_without_parents) > f(transactions_with_parents_combined)
all_transactions_in_mempool
are not valid most of the time as they do not obey Note-1
.max fee of 4094954
, with a total weight of 2100000.
Block analysis:
Transactions of block ./blocks/block_4094954.0.txt:
No. of txs: 1614
Total Fees: 4094954
Total weights: 2100000
is_valid_block: True
Segmentation Fault
upon execution of the program with total_block_weight > 2100000
. Any system with RAM > 16GB should do better than this.Block
to handle methods related to blocks.numba reflected list
error.