Giter Club home page Giter Club logo

Comments (4)

hackergrrl avatar hackergrrl commented on June 18, 2024 1

Another option, I'm realizing, is to treat msg_type as a version. So a msg_type=1 message will ALWAYS look the way it's specified in the spec, as a data response, but of course that doesn't prevent us from specifying a data response v2 message type with a larger msg_type value that works differently. The same idea applies for post types.

This would prevent old nodes from breaking, and adds no extra data overhead. A downside is that a pair of peers will have no explicit knowledge that they're on different versions, but one side can infer they are when they receive a message of a type they aren't familiar with.

This logic also applies in the event that a message or post type has a security vulnerability discovered in it, where newer clients can choose to ignore older post and message types that are known to be deprecated and have newer replacement versions. Like the previous situation, here the newer client will detect there is a compatibility mismatch when they receive deprecated messages or posts.

from cable.

hackergrrl avatar hackergrrl commented on June 18, 2024

This is a good point. I think we need both of these: protocol versioning and post versioning. We're definitely not going to get everything right on the first try. 🙃

I like the idea of exchanging protocol version #s during handshake, primarily because even if we end up changing something very fundamental, like the shape of request headers, peers will know right away they aren't compatible with each other. This would mean us adding wire protocol for said initial handshake.

I think it would be reasonable to add one byte to the post header. Given the header's current size (129+ bytes), another byte only makes it 0.78% larger!

from cable.

hackergrrl avatar hackergrrl commented on June 18, 2024

If we treat each message type definition as immutable (i.e. msg_type=1 will ALWAYS have the given binary format), we don't need any other versioning across the protocol, right? Right now the cable protocol is made up exclusively from messages and posts, and if both are implicitly versioned, we're done, right?

I do think that, if we have a handshake specification, that ought to be versioned!

from cable.

cblgh avatar cblgh commented on June 18, 2024

we have a handshake with versioning now :) https://github.com/cabal-club/cable/blob/main/handshake.md

from cable.

Related Issues (14)

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.