Git Product home page Git Product logo

Comments (2)

lukechampine avatar lukechampine commented on August 12, 2024

Bitcoin does it by providing a list of block hashes in the catch up request. The requester provides the last 10 hashes seen, and then increases the distance exponentially until reaching the genesis block. Seems pretty smart to me, and removes the need for any back-and-forth negotiation.

It'd be easy to limit requests to a few hundred blocks or so, but the client is going to need some way of catching up on a massive blockchain. Seems like it'd be easy to parallelize by downloading headers first and then asking a bunch of hosts to send a few blocks each.

from sia.

DavidVorick avatar DavidVorick commented on August 12, 2024

Not quite sure what the Bitcoin request looks like.

You provide a list of the last 10 blocks you've seen, and then a longer list of log(n) blocks that you've seen all the way back to the genesis block? And then the responder just starts at the first block it recognizes and dumps everything upon you?

If you want to avoid any sort of back-and-forth communication, that's probably a good way to go. It seems a bit odd to me that you couldn't do something like a back-and-forth binary search but I guess if the best you can do is RPC, then each message would need to contain the entire context of the exchange, which could be ugly to implement.

I like the idea of limiting request sizes because making one 2GB request doesn't seem like a great idea. Even if you just keep asking the same peer over and over, doing things 1MB at a time, or 20MB at a time seems a lot more sane.

from sia.

Related Issues (20)

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.