# Week 19 ## Recap This week was very much just a continuation of the work that I had started last week. The layering issues I had been concerned about were solved by a code refactor and so I was able to directly get in to both finishing the outbound communication, as well as inbound communication. At least to the point where they interact and use the logic of abstracted interfaces. Though once implementations exist for these interfaces they should function identically. From there I moved into creating tests for FINDCONTENT, CONTENT, OFFER and ACCEPT packets for both inbound/outbound communication. I am still working on developing these tests as I ran into a challenge when testing anything to do with database interaction. Because there is not a current implemented database it is more difficult to test proper functioning of packet communication that interacts with a database. For the time being my solution will be to create a form of mock database just to persist basic values, but to go more in-depth on the testing a dedicated database implementation would be best. This is something I am looking to turn my focus towards in addition to continuing to designing tests as outside of uTP it is the last sizeable implementation piece for proper History Network function. ## Learning Much the same as last week my learning primarily consisted of general reference to the Portal Wire Specifications and general design. I also took some time to get familiar with the new refactored hanlding design to ensure that my implementation work would be in line with the new refactoring. ### Concepts #### Portal Wire Specifications When looking at the specs my focus was shifted towards inbound packet behavior. This was useful for ensuring correct implementation on my side, but also catching a specification mismatch in the refactored design. I also used the values from the wire vector tests to start designing some inbound and outbound content communication tests. ##### Resources 1. https://github.com/ethereum/portal-network-specs/blob/master/portal-wire-protocol.md 2. https://github.com/ethereum/portal-network-specs/blob/master/portal-wire-test-vectors.md ## Tasks This week I continued working on implementing the inbound and outbound commication for content related packets. I finished up on the outbound logic that I was working on in the previous week and all outbound messages should now use the appropriate interface calls. From there I began on the inbound packet handling. I started the creation of a very basic uTP interface just to have an idea on how the client might handle that form of communication. From there I implemented the handling of incoming FINDCONTENT and OFFER packets according to Meldsun's newly refactored handler design. I had also noticed that the Discv5 usage from the refactor wasn't behaving according to specification but was able to fix it by modifying return type logic in the handling process. From there I moved on to creating tests for both inbound and outbound content communication. The challenge with this is that we currently don't have a functional database as we are just abstracting it into an interface temporarily. So I worked on some temporary testing solutions, but ideally getting a dedicated database would work best. Fortunately for the sake of just basic tests it shouldn't matter as my main concern is ensuring that inbound and outbound communication is working as intended. https://github.com/meldsun0/samba/pull/22 https://github.com/meldsun0/samba/pull/23 https://github.com/meldsun0/samba/commit/7df787b0a615b05dee9e6b6882a70b291dcfcec8 ## Week 20 Plan Going into Week 20 my goal is largely to focus on testing the clients packet interactions for both inbound and outbound communication. This is then in line with getting the client ready to start integrating with the official Portal Hive tests to demonstrate some capabilities of interoperability. My final concern outside of this testing for the scope of the EPF timeline is to get a functioning database solution for the History Network to store content on. In general my goals for this week are: - Continue designing tests for the inbound and outbound content related packets of the client. This includes setting up a mock database for basic useability as well as various tests to check edge cases. - Expand on the uTP interface design I started this week to enable the proper design of all interaction logic, even if uTP itself is not implemented. - Start focusing on a database solution to enable the client to persist data outside of runtime, as well as to organize all and work on any history data it may need. The client will also have to be properly dockerized in order to work with the Portal Hive tests, though this is likely something to focus on after internal tests are completed. I intend to continue to closely collaborate with Meldsun when working on inbound and outbound packet communication. I also hope to spend some time going over a database solution in a meeting.