Giter Club home page Giter Club logo

cs765-simulate-p2p-cryptocurrency-network's People

Contributors

dasarnab avatar fenilgmehta avatar pradhanaditya avatar

Watchers

 avatar

cs765-simulate-p2p-cryptocurrency-network's Issues

`T_k` / `Node.T_k_exp_block_mining_mean` formula

What is the problem

  • The below formula which is present at resources/T_k_Calculation.png and used in Node.__init__(...) seems to create problem with block mining power (i.e. Node.T_k_exp_block_mining_mean)
    image
  • The numerator (i.e. numpy.random.exponential() in the code) in the third formula, can make a node with low hashing power mine blocks very fast and a node with high hashing power mine blocks slowly.

Implement `__lt__` for `class Event`

What is the issue ?

The following error occurred during execution (ignore the line numbers as code was modified before execution)

Traceback (most recent call last):
  File "simulator.py", line 1644, in <module>
    Main(vars(args))
  File "simulator.py", line 1564, in Main
    status = mySimulator.execute_next_event()
  File "simulator.py", line 320, in execute_next_event
    event = self.event_queue.pop()
  File "simulator.py", line 1193, in pop
    return heapq.heappop(self.events)[1]
TypeError: '<' not supported between instances of 'Event' and 'Event'

When does it occur ?

  • The event queue is of type List[Tuple[float, Event]]
  • Mostly, the error occurs when float values are same for two entries of the event queue which are being compared. So, since first element of the Tuple are equal, Python automatically compares the elements at index 1 (i.e. the Event value will be compared using < operator)

Solution

  • Implement __lt__ for class Event and make the event queue as List[Event]
    • We can make event queue object from Tuple[float, Event] ---> Event because the float value is taken from the Event object itself

`Node.block_generation_count` needs to be decremented for blocks which are mined after the execution time limit

What is the problem ?

  • Node.block_generation_count is getting incorrectly calculated
  • Node.block_generation_count needs to be decremented for all occurrences of event.EVENT_BLOCK_CREATE_SUCCESS when mySimulator.global_time > simulatorParameters.execution_time

Where to look in the code for fixing ?

`config.json` file information

  • Create document describing each component of the config.json file
    • All decimal points are important in the config file because attributes with decimal mean that they are float and those without decimal point mean that they are integers

Update `__create_connected_graph` method to make use of `Zeta (ζ)`

What to do ?

  • __create_connected_graph method is to be updated to make use of Zeta (ζ) and number_of_individual_attacker_nodes
    • Zeta (ζ) = fraction of honest nodes an adversary/attacker is connected to

Where to do ?

Anything more ?

  • Also have to find a way to check if it is possible to make a graph with specific values of parameters n_total_nodes, number_of_individual_attacker_nodes and ζ, and print an appropriate message

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.