p2p-today / p2p-project Goto Github PK
View Code? Open in Web Editor NEWA peer-to-peer networking framework to work across languages
Home Page: https://dev-docs.p2p.today/
License: GNU Lesser General Public License v3.0
A peer-to-peer networking framework to work across languages
Home Page: https://dev-docs.p2p.today/
License: GNU Lesser General Public License v3.0
Things should not be used before they are defined
Currently if you connect to someone with a different protocol it will silently fail. This is a rather large flaw.
Currently it's sending things like ["localhost", 44444] or ["0.0.0.0", 44444].
Neither of these are valid outward facing addresses.
Question is, why is it so inconsistent?
Issue started as of 01dd164
Currently I'm leaning towards AppVeyor, as it allows me to reset the count on each version change.
That might be a bad thing, though, as it means the build number will not be unique. It may be better to go for a unique, constantly increasing build number, so that people can more easily track API changes.
Of the two remaining, Shippable will be the best at keeping build numbers unique, as it will always be higher than Travis. This breaks if you pull from an active branch, but does not if releases are done properly.
Warnings already added to develop branch. Deprecation scheduled for two releases from now.
As in, the next release will contain warnings, the release after will remove.
Looks like I left the doc string from an old version
One thing to make sure of would be that a copy is kept on my account in case base58 disappears from pypi. It would be good to see if conditional installations can work with setup.py before proceeding.
The following code should help out:
import struct
def key_to_bin(key):
arr = []
while key:
arr = [key % 256] + arr
key //= 256
return struct.pack("!" + "B" * len(arr), *arr)
def key_from_bin(key):
arr = struct.unpack("!" + "B" * len(key), key)
i = 0
for n in arr:
i *= 256
i += n
return i
def predict_len(keysize):
length = (keysize + 7) // 8
return length
def test(iters):
for i in range(1, iters + 1):
test = 2**i - 1
assert test == key_from_bin(key_to_bin(test))
assert len(key_to_bin(test)) == predict_len(i)
Using Q
instead of B
may improve CPU time, at the cost of ~8 bytes average. This effect should be minimal, however, depending on how struct
works internally. If it works in the naive way I think it does, then this just reduces its workload proportional to this method's increased workload.
This will allow arbitrary complication without forcing net.py to get longer
Is this possible to fix?
This is probably not feasible to fix, but a perfect example of this race condition can be found in the test_conn_error_recovery_SSL()
method, on develop branch
Build:
As of this issue's creation, Windows has not yet completed its run. If it also fails, this issue will receive an additional label.
This error appears to not be the key-storage bug that was affecting python 3.3+, so this will need to be debugged on a local system. My best guess is that it's a timing issue, since there will almost certainly be thread clutter. Figuring out how to clean these up better will help, though it may not solve the problem.
In reference to #52
This will allow the network to repair itself over time
Drawback: it means testing poorly connected scenarios becomes harder
Step 1: figure out how to generate a self signed certificate with the fewest dependencies possible (and a range of them, where any are needed)
Current candidates: PyOpenSSL, cryptography, PyCrypto?
Step 2: figure out a way to guarantee the removal of certificate files after exit, or find a way to feed it as an object instead
This will help segregate deconstructor features
Pursuant to the completion of #38
Note that this is likely not a concurrency limitation, as the bug also occurs when testing via multiprocessing.
Steps to reproduce:
What's going on here? It looks as if python2b is closing the socket first, but I can't see an explanation why. Furthermore, if you reverse the order of connection, the bug doesn't seem to occur. When it does occur, no exceptions are added to the queue.
There needs to be testing for the various network functions. Unfortunately, the CIs don't seem to like this very much.
Bonus goal: Figure out how to do this while maintaining a private API
Keeps throwing attribute errors for seemingly no reason. Explanations are in order.
Looks like they just don't have bz2. If that's all it is, I'm happy to add a try-catch to fix that.
Proposal: add 1 byte to size header which describes the length of the size header and packet header. New structure would be roughly:
For automated messages this saves ~11 bytes each. It also expands the possible message size/packet length from 2564-1 to 256255-1.
The question is, does this render a sufficiently large increase in complexity that it's not worth it? For instance, this means that struct
will no longer work for the purpose. This will have lots of effects on how fast/slow the program becomes, and it may not be worth it.
Strangely, this may make the Javascript side easier, as it forces me to remove a dependency.
Plaintext:
SSL
Write from the perspective of constructing a node. This will help ensure the best comprehension.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.