DAG subgraphs

35 views
Skip to first unread message

Daniel Norman

unread,
Feb 17, 2020, 4:19:17 PM2/17/20
to Cap'n Proto
Hello!

I'm attempting to use Cap'n proto for a Rust project which requires sending DAG subgraphs via network packets.

I didn't see anything on this topic in the docs or examples. I am curious whether there exists a best practice, or perhaps some examples of others using Cap'n proto for this purpose.

Perhaps I am missing something, but as far as I can tell, I'd need to implement this as an overlay using offsets managed outside of Cap'n proto. Is this a correct understanding?

Cheers,
Daniel-

Ian Denhardt

unread,
Feb 17, 2020, 4:57:38 PM2/17/20
to Cap'n Proto, Daniel Norman
Yes, the capnproto spec officially forbids sharing inside a message
Different implementations may have varying levels of tolerance for
this, but it's probably best not to bend the spec here.

Have a look at schema.capnp, in particular the way the `Node` type is
managed by id, for some inspiration.

-Ian

Quoting Daniel Norman (2020-02-17 16:19:17)
> --
> You received this message because you are subscribed to the Google
> Groups "Cap'n Proto" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to [1]capnproto+...@googlegroups.com.
> To view this discussion on the web visit
> [2]https://groups.google.com/d/msgid/capnproto/ebc81a61-ebfc-4346-a599-
> a971a8db3c79%40googlegroups.com.
>
> Verweise
>
> 1. mailto:capnproto+...@googlegroups.com
> 2. https://groups.google.com/d/msgid/capnproto/ebc81a61-ebfc-4346-a599-a971a8db3c79%40googlegroups.com?utm_medium=email&utm_source=footer

Daniel Norman

unread,
Feb 17, 2020, 5:53:25 PM2/17/20
to Cap'n Proto
I see. I don't see where the spec explicitly forbids shared pointers, but the encoding section talks about the traversal limit in case of cyclic pointers, which makes sense to guard against attacks.
The lack of ability to express them in the schema guards against the creation of footguns I guess.

I'll move forward with manual indexing into a list of nodes. It's probably about the same in terms of efficiency anyway.
Just good to know I'm not going against the grain.

Thanks Ian!
Daniel-

Reply all
Reply to author
Forward
0 new messages