Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kadcast functional implementation #141

Merged
merged 126 commits into from
Dec 11, 2019
Merged

Kadcast functional implementation #141

merged 126 commits into from
Dec 11, 2019

Commits on Nov 6, 2019

  1. Basic first commit.

    Add message.go, peer.go and bucket.go files to
    kadcast implementation.
    CPerezz committed Nov 6, 2019
    Configuration menu
    Copy the full SHA
    c3dace5 View commit details
    Browse the repository at this point in the history

Commits on Nov 8, 2019

  1. Add gotest.tools to go.mod and go.sum

    CPerezz committed Nov 8, 2019
    Configuration menu
    Copy the full SHA
    a05dd7a View commit details
    Browse the repository at this point in the history
  2. Implement peer basic managing functions

    Includes:
    - makePeer
    - addIp
    - addPort
    - addID
    - computePeerDistance
    CPerezz committed Nov 8, 2019
    Configuration menu
    Copy the full SHA
    da3770f View commit details
    Browse the repository at this point in the history
  3. Refactor Bucket structure and define Tree

    `Bucket` has now a dynamic array of peers instead of a fixed-
    length one.
    
    Implemented `Tree` struct which holds the routing info containing
    the L `Bucket` structures.
    
    Implemented for `Tree`:
    - makeTree
    - addPeer
    CPerezz committed Nov 8, 2019
    Configuration menu
    Copy the full SHA
    79663a0 View commit details
    Browse the repository at this point in the history
  4. Implement XOR distance computation utility functions

    Implemented:
    `idXor` which computes the XOR between to `Peer` ID's.
    `collapseDistance` which allows to classify the
    XOR distance in one of the L `Bucket` that the `Peer`
    holds into the ROUTING `Tree`.
    
    Implemented tests for `idXor` function.
    CPerezz committed Nov 8, 2019
    Configuration menu
    Copy the full SHA
    756fa3d View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    85dc560 View commit details
    Browse the repository at this point in the history
  6. Refactor idXor and collapseDistance

    - `Peer` distance is expressed now as `uint16` to hold the
    max range value `128` unsoported on the `byte` type.
    - Instead of using math logarithms, we work with bitwise ops.
    
    - `collapseDistance` has been ranamed as `classifyDistance` and
    optimized since now only counts the ammount of `1` of a byte that
    comes from an XOR op.
    - `idXor` just performs the XOR between the two `Peer-ID` arrays
    and computes the number of different bits on the result, using this
    counter as the result for the distance classification value.
    NOTE that this value has the range (0 - 128] to match the `L-buckets`.
    CPerezz committed Nov 8, 2019
    Configuration menu
    Copy the full SHA
    d7eeee1 View commit details
    Browse the repository at this point in the history
  7. Refactor tests according to the uint16 impl.

    CPerezz committed Nov 8, 2019
    Configuration menu
    Copy the full SHA
    d938a79 View commit details
    Browse the repository at this point in the history

Commits on Nov 10, 2019

  1. Implement ID generation from Wallet Pk

    The ID matches the 16 first bytes of the output that
    comes from applying the sha3-256 to the Wallet's Pk
    as a 32-byte array input.
    CPerezz committed Nov 10, 2019
    Configuration menu
    Copy the full SHA
    df7f831 View commit details
    Browse the repository at this point in the history

Commits on Nov 11, 2019

  1. Finnish Peer ID generation functions

    CPerezz committed Nov 11, 2019
    Configuration menu
    Copy the full SHA
    b7524c1 View commit details
    Browse the repository at this point in the history
  2. Refactor ip field type of Peer

    In order to implement LRU for Bucket managing,
    we need to use arrays whoose key is a Peer and
    since one of it's fields was a Slice (IP field)
    we will now represent it as a 4-byte array.
    CPerezz committed Nov 11, 2019
    Configuration menu
    Copy the full SHA
    80e5138 View commit details
    Browse the repository at this point in the history
  3. Implement LRU policy on Node storage

    Implemented almost all of the LRU-continuous
    policy with optimizations done to avoid array
    looping by using maps.
    CPerezz committed Nov 11, 2019
    Configuration menu
    Copy the full SHA
    7cb8dbb View commit details
    Browse the repository at this point in the history
  4. Finnish Least Recently Used policy impl

    Finnished the implementation for `Bucket`.
    Everytime we need to add a Peer, now it is done
    under this policy which is specified on the Kadcast
    paper.
    CPerezz committed Nov 11, 2019
    Configuration menu
    Copy the full SHA
    8b4a3c9 View commit details
    Browse the repository at this point in the history
  5. Split storage into Bucket and Tree files

    CPerezz committed Nov 11, 2019
    Configuration menu
    Copy the full SHA
    f1b9a55 View commit details
    Browse the repository at this point in the history
  6. Implement makeTree and addPeer for Tree

    - makeTree allocates space for a new routing tree
    and sets it's own Peer info on the lowest order
    bucket.
    - addPeer computes the distance between it's own
    peer info and the other peer to be included.
    Then it adds the peer to its corresponding bucket
    
    If the peer it's the same as our peer, the function
    simply doesn't do anything.
    CPerezz committed Nov 11, 2019
    Configuration menu
    Copy the full SHA
    6179dea View commit details
    Browse the repository at this point in the history

Commits on Nov 12, 2019

  1. Implement peer network info translation functions

    This functions allow us to move from UDP packet style
    to Peer network info style/types.
    CPerezz committed Nov 12, 2019
    Configuration menu
    Copy the full SHA
    3d755a5 View commit details
    Browse the repository at this point in the history
  2. Implement UDP server and Client for kadcast

    CPerezz committed Nov 12, 2019
    Configuration menu
    Copy the full SHA
    9173784 View commit details
    Browse the repository at this point in the history
  3. Create packet.go file and add processPacket

    This function should be responsible of getting
    a received UDP packet, parse it and also
    call the needed processes according to the packet.
    CPerezz committed Nov 12, 2019
    Configuration menu
    Copy the full SHA
    c79568a View commit details
    Browse the repository at this point in the history
  4. Implement a way for a peer to get its own UDPAddr

    This function takes a tree and gets the UDPAddr data
    of the peer that is running the node.
    CPerezz committed Nov 12, 2019
    Configuration menu
    Copy the full SHA
    c9241d6 View commit details
    Browse the repository at this point in the history

Commits on Nov 13, 2019

  1. Pass pointers and references intead of values

    Refactored all of the functions to return and get
    inputs and outputs as references or pointers in
    order to save memory and to not copy thoose values
    everytime on the stack on each function call.
    CPerezz committed Nov 13, 2019
    Configuration menu
    Copy the full SHA
    f680ade View commit details
    Browse the repository at this point in the history
  2. Implement Enc/Dec for uint32 <-> bytes

    This is needed in order to compute the IdNonce of
    each Peer.
    CPerezz committed Nov 13, 2019
    Configuration menu
    Copy the full SHA
    5b4308e View commit details
    Browse the repository at this point in the history

Commits on Nov 14, 2019

  1. Refactor Tree routing struct and makeTree

    Now the tree holds the k-buckets and also:
    - Peer info in `Peer` fmt.
    - Peer UDP info as `UDPAddr`
    - Peer Id Nonce.
    
    Refactored the makeTree function to build the
    propper `Tree` with our personal Peer info.
    CPerezz committed Nov 14, 2019
    Configuration menu
    Copy the full SHA
    304c6e8 View commit details
    Browse the repository at this point in the history
  2. Router creation and Ping impl

    CPerezz committed Nov 14, 2019
    Configuration menu
    Copy the full SHA
    6529e3d View commit details
    Browse the repository at this point in the history
  3. Implement PING & PONG messages

    This two messages are used to test if a peer
    is actually connected or not to the network.
    CPerezz committed Nov 14, 2019
    Configuration menu
    Copy the full SHA
    f1e99a1 View commit details
    Browse the repository at this point in the history
  4. Refactor IDNonce generation

    The function that converts uint32 to bytes was using
    references, so it setted the nonce to 0 everytime.
    This has been solved and everything works now.
    
    With this setup, it takes aprox 1min to compute the ID
    on an Intel Core i5-7x series.
    CPerezz committed Nov 14, 2019
    Configuration menu
    Copy the full SHA
    839d9f0 View commit details
    Browse the repository at this point in the history
  5. Refactor Peer constructor

    Now the Peer constructor gets the externalIP
    address of the peer and a port and computes
    the ID returning the whole Peer struct.
    CPerezz committed Nov 14, 2019
    Configuration menu
    Copy the full SHA
    b790f81 View commit details
    Browse the repository at this point in the history

Commits on Nov 15, 2019

  1. Get Local UDP Addr from func instead of param

    Since we can get the local UDP Addr quickly, there's
    no need to pass it as a parameter.
    
    - Now sendUDPPacket gets the parameters per value instead
    of by-reference.
    CPerezz committed Nov 15, 2019
    Configuration menu
    Copy the full SHA
    46e62bc View commit details
    Browse the repository at this point in the history
  2. Implement Packet type and processPacket

    processPacket now it's just a debugging tool to catch
    the packets recieved and print the content.
    CPerezz committed Nov 15, 2019
    Configuration menu
    Copy the full SHA
    ad0d5e5 View commit details
    Browse the repository at this point in the history
  3. Refactor peer module to work by-value

    Refactored function arguments to be used by value
    and not by reference.
    Moved UDPAddr<->PeerInfo transformations.
    CPerezz committed Nov 15, 2019
    Configuration menu
    Copy the full SHA
    e5c274f View commit details
    Browse the repository at this point in the history
  4. Create router module

    `Router` holds the Routing tree data structure and
    also quick access to the owner `Peer` info.
    
    Added `sendPing` and `sendPong` methods passing and
    recieving arguments by-value
    CPerezz committed Nov 15, 2019
    Configuration menu
    Copy the full SHA
    b746a00 View commit details
    Browse the repository at this point in the history
  5. Refactor argument passing

    CPerezz committed Nov 15, 2019
    Configuration menu
    Copy the full SHA
    8a2a001 View commit details
    Browse the repository at this point in the history
  6. Implement tests for PoW, byteConv and Ping-Pong

    Most of the tests are actually used just with
    debugging and networking testing.
    CPerezz committed Nov 15, 2019
    Configuration menu
    Copy the full SHA
    68b7f0d View commit details
    Browse the repository at this point in the history
  7. Add a router as a StartUDPListener proc variable

    CPerezz committed Nov 15, 2019
    Configuration menu
    Copy the full SHA
    109a6e0 View commit details
    Browse the repository at this point in the history
  8. Fix uint length error

    CPerezz committed Nov 15, 2019
    Configuration menu
    Copy the full SHA
    0d27a94 View commit details
    Browse the repository at this point in the history
  9. Implement small test to see Go's behaviour w/ UDP

    CPerezz committed Nov 15, 2019
    Configuration menu
    Copy the full SHA
    2f6a2e5 View commit details
    Browse the repository at this point in the history

Commits on Nov 17, 2019

  1. Implement Nonce & ID verification

    When a Peer recieves a packet, it can veriofy that
    the nonce attached to it really corresponds to the
    PoW process that a Peer has to accomplish before it
    can join the network.
    CPerezz committed Nov 17, 2019
    Configuration menu
    Copy the full SHA
    d464bb7 View commit details
    Browse the repository at this point in the history

Commits on Nov 18, 2019

  1. Refactor verifyIdNonce function for Peer

    The function now verifies that the Nonce has been
    computed correctly and then returns:
    - Peer if the Nonce is correct
    - Error if not.
    CPerezz committed Nov 18, 2019
    Configuration menu
    Copy the full SHA
    f5fc0f7 View commit details
    Browse the repository at this point in the history
  2. Implement basic Packet processing functions

    Implements basic functions to work with
    packets as:
    - getHeadersInfo => Returns the headers sliced
    in the 3 different elements.
    - processPacket => gets a Packet and processes
    it according to it's type.
    - getPacketFromStream => Gets a stream of bytes
    and returns a Packet struct from it.
    CPerezz committed Nov 18, 2019
    Configuration menu
    Copy the full SHA
    e3fdb65 View commit details
    Browse the repository at this point in the history
  3. Small receiving changes

    CPerezz committed Nov 18, 2019
    Configuration menu
    Copy the full SHA
    b8c49fd View commit details
    Browse the repository at this point in the history
  4. Refactor Bytes-Uint32 pointer returns

    CPerezz committed Nov 18, 2019
    Configuration menu
    Copy the full SHA
    0074a15 View commit details
    Browse the repository at this point in the history
  5. Add destPort to Packet headers in the protocol

    Since the node that receives a ping, only knows the port
    where the packet was sent, it does not know on which port
    the sender is listening for the UDP response. And since it
    is not possible to writte to a port that you are listening,
    we need to send the listeningPort in the headers.
    
    This also allows to update it.
    CPerezz committed Nov 18, 2019
    Configuration menu
    Copy the full SHA
    74d0c45 View commit details
    Browse the repository at this point in the history
  6. Add listenPort on packet headers creation

    CPerezz committed Nov 18, 2019
    Configuration menu
    Copy the full SHA
    dc1fffa View commit details
    Browse the repository at this point in the history

Commits on Nov 19, 2019

  1. Add methods for packet construction

    CPerezz committed Nov 19, 2019
    Configuration menu
    Copy the full SHA
    6393abd View commit details
    Browse the repository at this point in the history
  2. Unexport testUDP for Ping/Pong tests

    CPerezz committed Nov 19, 2019
    Configuration menu
    Copy the full SHA
    db65189 View commit details
    Browse the repository at this point in the history
  3. Implement PeerSort struct

    PeerSort struct aims to be a helper data
    structure that allows the implementation
    to order the PeerList of a Node in terms of
    XOR-distance in respect to a certain Peer.
    
    The struct has the same fields as the `Peer`
    struct plus a `xorMyPeer` field which represents
    the XOR-distance of this specific `Peer` in respect
    to another.
    CPerezz committed Nov 19, 2019
    Configuration menu
    Copy the full SHA
    7822428 View commit details
    Browse the repository at this point in the history
  4. Refactor pointer params and impl xorIsBigger

    Refactored some Distance functions to use values
    instead of references.
    
    Also implemented `xoirIsBigger` in order to be
    able to order XOR-distances between two peers
    represented with [16]byte.
    CPerezz committed Nov 19, 2019
    Configuration menu
    Copy the full SHA
    9064686 View commit details
    Browse the repository at this point in the history
  5. Implement methods for FIND_NODES usage.

    - Implemented sort.Interface for `ByXORDist`
    that allows to sort slices of Peers by it's
    XOR-distance.
    - getPeerSortDist allows to get a list of
    `PeerSort` items ready to be sorted by it's
    XOR-distance in respect to some `Peer`.
    - `getXClosestPeersTo` allows to get the selected
    number of peers that is closer to the specified Peer.
    
    Also implemented `FIND_NODES` message sender
    function. Which gets the `alpha` closest nodes
    to the Peer that runs the node and sends them
    a `FIND_NODES` packet.
    CPerezz committed Nov 19, 2019
    Configuration menu
    Copy the full SHA
    7d2199f View commit details
    Browse the repository at this point in the history

Commits on Nov 20, 2019

  1. Solve array access errors in getXClosestPeersTo fn

    The function was accessing an invalid position.
    
    Now it's solved and the `FIND_NODES` messages are
    tested and working propperly.
    CPerezz committed Nov 20, 2019
    Configuration menu
    Copy the full SHA
    a0d585e View commit details
    Browse the repository at this point in the history
  2. Implement function for NODES payload creation

    `setNodesPayload` allows to create the payload
    of a `NODES` message filled with the number of
    peers sent and the peers themselfs on a serialized
    format
    CPerezz committed Nov 20, 2019
    Configuration menu
    Copy the full SHA
    8bcfe5b View commit details
    Browse the repository at this point in the history
  3. Implement serialization for Peer

    Allows to serialize a Peer in bytes in order to
    be sent inside a packet.
    CPerezz committed Nov 20, 2019
    Configuration menu
    Copy the full SHA
    1b47847 View commit details
    Browse the repository at this point in the history
  4. Implement methods for send NODES messages

    The method automatically gets `K` nodes from it's
    buckets that are closer to the selected target Peer,
    constructs a `NODES` packet and sends it over the
    network.
    CPerezz committed Nov 20, 2019
    Configuration menu
    Copy the full SHA
    af519a9 View commit details
    Browse the repository at this point in the history
  5. Implement Se/Deserialization for Peer struct

    We can translate a Peer to bytes to send in wire
    format and viceversa.
    CPerezz committed Nov 20, 2019
    Configuration menu
    Copy the full SHA
    12ee7e1 View commit details
    Browse the repository at this point in the history
  6. Implement NODES message support functions

    - `checkNodesPayloadConsistency` allows to
    verify if a `NODES` message is consistent
    in terms of `numPeersAnounced * bytesPerPeer <=> len
    of the payload`.
    - `getNodesPayloadInfo` returns a slice of Peers
    collected from a `NODES` message payload.
    CPerezz committed Nov 20, 2019
    Configuration menu
    Copy the full SHA
    c98fc73 View commit details
    Browse the repository at this point in the history
  7. Implement NODES and FIND_NODES cases.

    CPerezz committed Nov 20, 2019
    Configuration menu
    Copy the full SHA
    432d508 View commit details
    Browse the repository at this point in the history

Commits on Nov 21, 2019

  1. Limit the num of Peers sent on NODES message

    The peers sent on the `getXClosestPeersTo` was
    higher than the number of peers specified in the
    function's arguments.
    It has been corrected.
    CPerezz committed Nov 21, 2019
    Configuration menu
    Copy the full SHA
    7ff2da0 View commit details
    Browse the repository at this point in the history

Commits on Nov 22, 2019

  1. Remove requester peer from Nodes payload

    CPerezz committed Nov 22, 2019
    Configuration menu
    Copy the full SHA
    8953210 View commit details
    Browse the repository at this point in the history

Commits on Nov 23, 2019

  1. Refactor FINDNODES to not send requester ID

    CPerezz committed Nov 23, 2019
    Configuration menu
    Copy the full SHA
    12df9c3 View commit details
    Browse the repository at this point in the history
  2. Refactor getTotalPeers function

    Now it iterates through the range and gets the peercount
    of each bucket.
    CPerezz committed Nov 23, 2019
    Configuration menu
    Copy the full SHA
    0d5f1b0 View commit details
    Browse the repository at this point in the history
  3. Implement bootstrapping process triggerer.

    CPerezz committed Nov 23, 2019
    Configuration menu
    Copy the full SHA
    eef1bb8 View commit details
    Browse the repository at this point in the history

Commits on Nov 24, 2019

  1. Implement Network Discovery process.

    Attempts to get closest nodes on each round until
    it does not get a closest to the previous round.
    
    Then we consider the process has finnished.
    CPerezz committed Nov 24, 2019
    Configuration menu
    Copy the full SHA
    a26a5ed View commit details
    Browse the repository at this point in the history
  2. Add retries in Bootstrapping process.

    Now the process does 3 attempts trying to
    bootstrap the network and add the network
    bootstrapping nodes to it's buckets if they
    respond with a `PONG`.
    CPerezz committed Nov 24, 2019
    Configuration menu
    Copy the full SHA
    8c4b7c8 View commit details
    Browse the repository at this point in the history
  3. Add tests for Bootstrap and Netw Discovery

    CPerezz committed Nov 24, 2019
    Configuration menu
    Copy the full SHA
    2613d5a View commit details
    Browse the repository at this point in the history
  4. Add Dest IP^on message sending logs

    CPerezz committed Nov 24, 2019
    Configuration menu
    Copy the full SHA
    5a59e68 View commit details
    Browse the repository at this point in the history

Commits on Nov 25, 2019

  1. Fix LRU policy implementation adding peers to map

    CPerezz committed Nov 25, 2019
    Configuration menu
    Copy the full SHA
    37c4174 View commit details
    Browse the repository at this point in the history
  2. Refactor the totalPeers computation

    CPerezz committed Nov 25, 2019
    Configuration menu
    Copy the full SHA
    5c7bc86 View commit details
    Browse the repository at this point in the history
  3. Add logs for debugging

    CPerezz committed Nov 25, 2019
    Configuration menu
    Copy the full SHA
    92c3918 View commit details
    Browse the repository at this point in the history
  4. Solve InitBootstrap logic.

    CPerezz committed Nov 25, 2019
    Configuration menu
    Copy the full SHA
    5fbe5d6 View commit details
    Browse the repository at this point in the history
  5. Refactor validityCheck of NODES message

    CPerezz committed Nov 25, 2019
    Configuration menu
    Copy the full SHA
    6e4b695 View commit details
    Browse the repository at this point in the history

Commits on Nov 26, 2019

  1. Solve some bugs on NODES messages

    - `CheckNodesConsistency` now uses BigEndian for
    decoding.
    
    - `getNodesPayloadInfo` is now adjusted to get the
    Peers propperly from the payload.
    CPerezz committed Nov 26, 2019
    Configuration menu
    Copy the full SHA
    0e32783 View commit details
    Browse the repository at this point in the history
  2. Add logs to protocol processes.

    CPerezz committed Nov 26, 2019
    Configuration menu
    Copy the full SHA
    9f739da View commit details
    Browse the repository at this point in the history
  3. Refactor tests to send a reference of the Router

    CPerezz committed Nov 26, 2019
    Configuration menu
    Copy the full SHA
    0376ec2 View commit details
    Browse the repository at this point in the history

Commits on Nov 27, 2019

  1. Don't send NODES message if PeersAnnounced = 0

    CPerezz committed Nov 27, 2019
    Configuration menu
    Copy the full SHA
    d6dcd4a View commit details
    Browse the repository at this point in the history
  2. Set actualClosest node to null at Discovery start

    CPerezz committed Nov 27, 2019
    Configuration menu
    Copy the full SHA
    80e6f2b View commit details
    Browse the repository at this point in the history
  3. Make getNodesPayloadInfo to return announcedPeers

    Now the parser just gets the ammount of peers that
    it's announced instead of consuming the whole
    slice of bytes of the packet (1024B)
    CPerezz committed Nov 27, 2019
    Configuration menu
    Copy the full SHA
    cfbb81b View commit details
    Browse the repository at this point in the history
  4. Fix network discovery logic

    CPerezz committed Nov 27, 2019
    Configuration menu
    Copy the full SHA
    d199773 View commit details
    Browse the repository at this point in the history
  5. Parse numPeers as BigEndian

    CPerezz committed Nov 27, 2019
    Configuration menu
    Copy the full SHA
    9a54a72 View commit details
    Browse the repository at this point in the history
  6. Hardcode Bootstrapp node IP on tests

    CPerezz committed Nov 27, 2019
    Configuration menu
    Copy the full SHA
    9bbfd64 View commit details
    Browse the repository at this point in the history
  7. Removing or modifying logs

    CPerezz committed Nov 27, 2019
    Configuration menu
    Copy the full SHA
    d21d243 View commit details
    Browse the repository at this point in the history
  8. Dont export infinit-looping tests

    CPerezz committed Nov 27, 2019
    Configuration menu
    Copy the full SHA
    d4fa817 View commit details
    Browse the repository at this point in the history
  9. Hold Deadline Hangs recreating the connection.

    CPerezz committed Nov 27, 2019
    Configuration menu
    Copy the full SHA
    5866fac View commit details
    Browse the repository at this point in the history
  10. Remove i condition on getNodesPayloadInfo

    CPerezz committed Nov 27, 2019
    Configuration menu
    Copy the full SHA
    a0e3ea0 View commit details
    Browse the repository at this point in the history
  11. Close connection before goto using a new one.

    CPerezz committed Nov 27, 2019
    Configuration menu
    Copy the full SHA
    42a6cab View commit details
    Browse the repository at this point in the history
  12. Add mutex on bucket-changing functions

    CPerezz committed Nov 27, 2019
    Configuration menu
    Copy the full SHA
    1e6b6a3 View commit details
    Browse the repository at this point in the history

Commits on Nov 28, 2019

  1. Return error on Bootstrap failure

    CPerezz committed Nov 28, 2019
    Configuration menu
    Copy the full SHA
    03c0242 View commit details
    Browse the repository at this point in the history
  2. Remove unnecessary loops

    CPerezz committed Nov 28, 2019
    Configuration menu
    Copy the full SHA
    0fcbc9b View commit details
    Browse the repository at this point in the history
  3. Implement Serde for CircularQueue (ring) packets

    This allows to se/derialize the red packets from the
    listener gorutine and the packetConsumer gorutine.
    
    Packet <-> ByteSlice
    CPerezz committed Nov 28, 2019
    Configuration menu
    Copy the full SHA
    d2c791a View commit details
    Browse the repository at this point in the history
  4. Refactor packetProcessing methodology.

    Instead of spawning gorutines for each new
    connection, we just add the received packet
    to the circularqueue and the consumer will
    take care of them.
    
    The `Put` method sends a signal to the consumer
    to awake and start consumming and processing
    packets from the queue so we are not constantly
    waiting.
    CPerezz committed Nov 28, 2019
    Configuration menu
    Copy the full SHA
    420ed5d View commit details
    Browse the repository at this point in the history
  5. Refactor PacketProcessing methodology

    Now processPacket is a gorutine that consumes
    packets received for the UDPListener and then
    processes them as is needed.
    
    This saves us to spawn a gorutine for every single
    packet the node receives.
    CPerezz committed Nov 28, 2019
    Configuration menu
    Copy the full SHA
    89c8b7b View commit details
    Browse the repository at this point in the history
  6. Remove Router pointer from UDPList params

    CPerezz committed Nov 28, 2019
    Configuration menu
    Copy the full SHA
    27a95c8 View commit details
    Browse the repository at this point in the history
  7. Addapt tests to the sync refactor.

    CPerezz committed Nov 28, 2019
    Configuration menu
    Copy the full SHA
    1ce244a View commit details
    Browse the repository at this point in the history
  8. Remove mutex from Bucket

    Now that the application works on a syncronous
    way, we don't need to protect the buckets with a
    mutex since onli `processPacket` will acces to them
    and will do it syncronously since the refactor has been
    finnished.
    CPerezz committed Nov 28, 2019
    Configuration menu
    Copy the full SHA
    219b7cc View commit details
    Browse the repository at this point in the history

Commits on Nov 29, 2019

  1. Send PeerInfo instead of Router to UDPListener

    Since there's no reason to pass the whole router to the
    UDPListener, we just send our peerInfo.
    CPerezz committed Nov 29, 2019
    Configuration menu
    Copy the full SHA
    3c44128 View commit details
    Browse the repository at this point in the history
  2. Add bootstrapping node to Protocol test.

    CPerezz committed Nov 29, 2019
    Configuration menu
    Copy the full SHA
    7c40ab0 View commit details
    Browse the repository at this point in the history
  3. Use LittleEndian for number deserialization

    CPerezz committed Nov 29, 2019
    Configuration menu
    Copy the full SHA
    2fe502d View commit details
    Browse the repository at this point in the history
  4. Hold deserialization errors

    Now if deserialization from the queue fails,
    we will just break and go for the next iteration
    of the packetQueue.
    CPerezz committed Nov 29, 2019
    Configuration menu
    Copy the full SHA
    f7949d2 View commit details
    Browse the repository at this point in the history
  5. Unexport function tests

    CPerezz committed Nov 29, 2019
    Configuration menu
    Copy the full SHA
    ef344c2 View commit details
    Browse the repository at this point in the history
  6. Fix decoding issues. PacketProcessor finnished.

    CPerezz committed Nov 29, 2019
    Configuration menu
    Copy the full SHA
    68da553 View commit details
    Browse the repository at this point in the history

Commits on Dec 3, 2019

  1. Implement TCP connection tools for broadcast

    CPerezz committed Dec 3, 2019
    Configuration menu
    Copy the full SHA
    298a773 View commit details
    Browse the repository at this point in the history
  2. Export functions to use them in main.go

    CPerezz committed Dec 3, 2019
    Configuration menu
    Copy the full SHA
    9d8eb06 View commit details
    Browse the repository at this point in the history
  3. Remove cmd folder

    CPerezz committed Dec 3, 2019
    Configuration menu
    Copy the full SHA
    295eb37 View commit details
    Browse the repository at this point in the history
  4. Add main.go file and export peerInf

    CPerezz committed Dec 3, 2019
    Configuration menu
    Copy the full SHA
    7e3f180 View commit details
    Browse the repository at this point in the history
  5. Unexport tests and run main.go now

    CPerezz committed Dec 3, 2019
    Configuration menu
    Copy the full SHA
    22c3cc1 View commit details
    Browse the repository at this point in the history
  6. Add doc comments and clear unused logs.

    This cleans the entire implementation in order to be
    merged.
    CPerezz committed Dec 3, 2019
    Configuration menu
    Copy the full SHA
    208538c View commit details
    Browse the repository at this point in the history

Commits on Dec 5, 2019

  1. Implement #141 minor issues changes

    Modified the code according to the changes
    suggested by @autholykos in the review of
     #141.
    CPerezz committed Dec 5, 2019
    Configuration menu
    Copy the full SHA
    f66abb3 View commit details
    Browse the repository at this point in the history
  2. Update log to logrus log system

    CPerezz committed Dec 5, 2019
    Configuration menu
    Copy the full SHA
    b84854c View commit details
    Browse the repository at this point in the history
  3. Reduce Nonce computation complexity

    Instead of asking for 3 bytes of 0s we will
    just ask for 1 since will be faster for testing
    purposes.
    
    Also refactored logs to use `logrus`.
    CPerezz committed Dec 5, 2019
    Configuration menu
    Copy the full SHA
    ae0308d View commit details
    Browse the repository at this point in the history
  4. Refactor bootstrapping to catch the trials err

    Refactored the code to allow the code to panic
    when we exceeded the maximum ammount of tries
    of bootstrapping.
    
    Also refactored logs to work with `logrus`.
    CPerezz committed Dec 5, 2019
    Configuration menu
    Copy the full SHA
    3c12db1 View commit details
    Browse the repository at this point in the history
  5. Refactor logs for logrus use

    CPerezz committed Dec 5, 2019
    Configuration menu
    Copy the full SHA
    ecafdad View commit details
    Browse the repository at this point in the history

Commits on Dec 6, 2019

  1. Implement basic skeleton for WaitGroups

    Since `Sleep` was not an option as discussed in
     #141, the waitGroup has been implemented in order to
    make the program itself trigger the protocol methods
    once a packet type in concrete is received.
    
    Also, added state-vars in order to force the
    `packetProcessor` gorutine to just activate the
    waitGroup if a bootstrapping or network discovery
    process is in progress.
    
    Now we need to add timeouts in order to prevent the
    app to get stucked at any protocol method execution.
    CPerezz committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    be2218d View commit details
    Browse the repository at this point in the history
  2. Addapt main.go gorutines to wG

    CPerezz committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    608cbf1 View commit details
    Browse the repository at this point in the history
  3. Fix typo

    CPerezz committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    e0753c4 View commit details
    Browse the repository at this point in the history
  4. Replace append for copy in setHeadersINFO

    On this way, we speed up the app by copying directly in the stack.
    CPerezz committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    1a2c626 View commit details
    Browse the repository at this point in the history
  5. Fix wrong byte length for ID

    CPerezz committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    368aff4 View commit details
    Browse the repository at this point in the history
  6. Remove formatting from INFO logs

    CPerezz committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    6d52a44 View commit details
    Browse the repository at this point in the history
  7. Fix ID verification of refactoring.

    CPerezz committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    f9f166b View commit details
    Browse the repository at this point in the history
  8. Hold watigroup in Pong arrivals

    CPerezz committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    f8dec50 View commit details
    Browse the repository at this point in the history

Commits on Dec 8, 2019

  1. Remove global state conditions on PONG handler

    Now that we are using a different aproach with
    waitgroups, we can get rid of this state variables.
    CPerezz committed Dec 8, 2019
    Configuration menu
    Copy the full SHA
    a9032c7 View commit details
    Browse the repository at this point in the history
  2. Implement poll functions for Router

    Now the `Router` provides blocking methods to
    poll Bootstrapp node and closestPeers (FIND_NODES)
    to allow a better and more logical library construction
    also featuring waitGroups and removing the timeouts.
    CPerezz committed Dec 8, 2019
    Configuration menu
    Copy the full SHA
    69d1911 View commit details
    Browse the repository at this point in the history
  3. Refactor protocol methods to work with poll methds

    Now that the `Router` offers blocking methods to
    search for the closest `alpha` peers and for polling
    the bootstrapping nodes, the logic can be leaved there
    and the protocol functions just take car of the logic of
    the algorithms itself.
    CPerezz committed Dec 8, 2019
    Configuration menu
    Copy the full SHA
    00cbaca View commit details
    Browse the repository at this point in the history
  4. Remove WG from main and protocol params

    CPerezz committed Dec 8, 2019
    Configuration menu
    Copy the full SHA
    b3df49a View commit details
    Browse the repository at this point in the history
  5. Refactor contiune loop statements

    CPerezz committed Dec 8, 2019
    Configuration menu
    Copy the full SHA
    e3661a2 View commit details
    Browse the repository at this point in the history
  6. Fix setHeaders bug

    CPerezz committed Dec 8, 2019
    Configuration menu
    Copy the full SHA
    bcbbedd View commit details
    Browse the repository at this point in the history
  7. Modify time.Afterfunc structure

    We should not send the poll messages inside of the
    afterFunc, instead, we should send the messages on
    polling methods and wait on the afterFunc to execute
    the getters to our tree.
    CPerezz committed Dec 8, 2019
    Configuration menu
    Copy the full SHA
    8a8d57c View commit details
    Browse the repository at this point in the history
  8. Reduce waitGroup times to speed up polling

    With lower timings we should be able to get all
    of the info we are expecting on the polling methods.
    CPerezz committed Dec 8, 2019
    Configuration menu
    Copy the full SHA
    2f74a69 View commit details
    Browse the repository at this point in the history

Commits on Dec 10, 2019

  1. Merge pull request #182 from dusk-network/protocol_sync

    Protocol methods refactoring.
    autholykos committed Dec 10, 2019
    Configuration menu
    Copy the full SHA
    bdd07a7 View commit details
    Browse the repository at this point in the history
  2. Fix err formating errors

    CPerezz committed Dec 10, 2019
    Configuration menu
    Copy the full SHA
    5593b62 View commit details
    Browse the repository at this point in the history