blocksim icon indicating copy to clipboard operation
blocksim copied to clipboard

parameter interval in transaction_factory.broadcast function does not work

Open Jiali-Xing opened this issue 4 years ago • 7 comments

Hi Carlos Faria,

I like this simulator a lot and is going to use/modify it for my research. I have a question about your implementation of transaction_factory.broadcast after run/read your code (I'm using the config.json in your current github repo):

It seems that the increase of interval parameter (interval in seconds between each batch) doesn't change the simulation results? Isn't it supposed to have less transactions done if I set the interval sufficiently large relative to duration?

Best,

Jiali-Xing avatar Apr 26 '20 18:04 Jiali-Xing

Hi @Jiali-Xing

Thanks for your interest in my work.

Yes, it is supposed to have less transactions inserted in blocks if we increase interval with a smaller duration.

Can you send me the config.json you setup?

I will check this - it's been a long time since I don't touch on this :)

carlosfaria94 avatar May 14 '20 11:05 carlosfaria94

Thanks for replying. I am using the config.json provided in your repo, i.e.

{
  "blockchain": "ethereum",
  "locations": ["Tokyo", "Ohio", "Ireland"],
  "bitcoin": {
    "block_size_limit_mb": 1,
    "number_transactions_per_block": {
      "name": "beta",
      "parameters": "(3.4538110963361333, 4.240939683805738, 705.4815204696233, 2159.387403502942)"
    },
    "orphan_blocks_probability": 0.0174,
    "message_size_kB": {
      "header": 0.024,
      "version": 0.095,
      "verack": 0,
      "inv_vector": 0.036,
      "tx": 0.44,
      "block_base": 0.082
    }
  },
  "ethereum": {
    "block_gas_limit": 2100000,
    "tx_gas_limit": 21000,
    "orphan_blocks_probability": 0.0174,
    "message_size_kB": {
      "status": 0.2,
      "hash_size": 0.042,
      "tx": 0.2,
      "get_headers": 0.054,
      "header": 0.09,
      "block_bodies": 0.045
    }
  }
}

And the output/report.json doesn't change anyhow I increase the interval: Even when interval is set to be incredibly large, e.g., transaction_factory.broadcast(100, 400, 1e10, nodes_list), and we expect less transactions generated/queued, created_transactions (as well as number_of_transactions_queue) are still almost full (full meaning = #batch times #tx_per_batch).

Thanks for looking into it, I have been trying to fix it for a long time but still didn't find any bugs.

Jiali-Xing avatar May 14 '20 15:05 Jiali-Xing

Is there any progress w.r.t. the transactions? :smiley: I have been working on BlockSim for a while now, and really appreciate its great customizability. I feel like the BlockSim is not processing transactions and blocks synchronously. Blocks start to be broadcast after all tx have been broadcast, which seems weird for me. I wonder if it is by design or a bug?

Jiali-Xing avatar Jul 11 '20 17:07 Jiali-Xing

Sorry for the delay on the response, I changed jobs and had some vacations.

It's ok for blocks to be broadcasted without transactions, it is the "heartbeat" of most of PoW blockchain networks. That's simulation design that we choose.

Let me know if it answer your question, or I misunderstood the issue

It seems that the increase of interval parameter (interval in seconds between each batch) doesn't change the simulation results? Isn't it supposed to have less transactions done if I set the interval sufficiently large relative to duration?

With regards this issue, have you figured out some bug or fix, the issue still persist?

carlosfaria94 avatar Oct 01 '20 19:10 carlosfaria94

It seems that the increase of interval parameter (interval in seconds between each batch) doesn't change the simulation results? Isn't it supposed to have less transactions done if I set the interval sufficiently large relative to duration?

With regards this issue, have you figured out some bug or fix, the issue still persist?

Yes, I think it is a bug in transaction_factory. When we debug it, it turns out that all transactions of all nodes are broadcast at the very beginning of any simulation: the interval parameter is thus void.

We fixed it by modifying the transaction_factory, and we plan to release our code (BlockSim for a permissioned blockchain) later.

Jiali-Xing avatar Oct 03 '20 18:10 Jiali-Xing

@Jiali-Xing I noticed the same issue, it seems like the transaction_validation parameter in the delays.json file does not seem to be used anywhere (used in Consensus.validate_transaction() but this is not called anywhere). Has your code been released?

m0bi5 avatar Jan 14 '22 14:01 m0bi5

@m0bi5 I think your observation is correct. We fixed it to some extent and implemented Talaria, a permissioned blockchain simulation based on this repo.

Jiali-Xing avatar Feb 03 '22 01:02 Jiali-Xing