Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] proto3 proposal #17

Closed
wants to merge 3 commits into from
Closed

[WIP] proto3 proposal #17

wants to merge 3 commits into from

Conversation

lyoshenka
Copy link
Member

@lyoshenka lyoshenka commented Jan 25, 2019

My proposed schema changes. this is very much WIP. I just wanted to see what it might look like and get your opinions on it.

Goals:

  • upgrade to proto3
  • drop Version from all protobuf definitions. One of the core ideas of protobufs is that versioning is not necessary
  • rename and rearrange some of the data to better match our current terminology and understanding of the protocol
  • add new fields that we know we need (releaseTime, file fields, tags, etc)

Keep in mind that in proto3, every field is optional. Also keep in mind that I'm trying to match this stuff to https://spec.lbry.io/#specification (e.g. Stream.hash vs Stream.sd_hash)

When you look at the field numbers, anything numbered 1-15 means we think that field will be set in most claims. Numbers 16+ means we think that field will not be set in most claims. There's no functional difference other than a small space savings if we predict it correctly.

I think the biggest questions are about the structure of the stream.proto file.

Closes #3, closes #16, closes #8, closes #13, closes #6, closes lbryio/internal-issues#205.

Copy link
Member

@kauffj kauffj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments, but I'm pretty much a protobuf idiot.

proto/stream.proto Show resolved Hide resolved

Fee fee = 16;
string license_url = 17;
string thumbnail = 18;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems very safe to include in the top 15, I think.

proto/stream.proto Outdated Show resolved Hide resolved
proto/stream.proto Outdated Show resolved Hide resolved
proto/claim.proto Outdated Show resolved Hide resolved
optional Certificate certificate = 4;
optional Signature publisherSignature = 5;

Type type = 1; // do we need this?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does seem like this could be inferred, though I could also see the metadata switching on type, which might be a reason to keep it?

@kauffj
Copy link
Member

kauffj commented Jan 25, 2019

Is there anything else I should do to test or run this? We also have a semi-long list of fields to add. Would it make sense to add those before merging in case some should go in the top 15?

@lyoshenka
Copy link
Member Author

putting this here so i don't forget: #8

@lyoshenka
Copy link
Member Author

related: #15

@lyoshenka
Copy link
Member Author

@kauffj yes, link any fields that need to be added here. i found a few PRs but not sure i got em all

@shyba
Copy link
Member

shyba commented Jan 29, 2019

great, maybe make a backup of the current one like /proto_legacy/? The current proto2 one is still needed for decoding claims.

@lyoshenka
Copy link
Member Author

Questions re: channel metadata

  • what does Name mean? don't channels already have a name? is this like the difference between username and display name?
  • should cover and thumbnail be web URLs or LBRY URLs or claim IDs?

@@ -4,4 +4,8 @@ package pb;

message Channel {
bytes public_key = 1;
string name = 2;
string description = 3;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we may want a short description, limited to a reasonable number of characters and no markup, as well as an unbounded (well, bounded by claim size) field that would be shown on the full profile view

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

regarding: #17 (comment) - I think Name could be the channels real name, or whatever they want to nickname their channel...i.e. my channel is @iloveLBRY, but the name would be "I Love LBRY!"

How does everyone feel about adding some of my other suggestions from #8 -at least Language (and/or Location? - that's what YT has) and Featured Video (lbry URL/claimid).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • should cover and thumbnail be web URLs or LBRY URLs or claim IDs? - I think this should be similar to our current thumbnail system, and if we decide to support LBRY urls/hashes there, then we should here too. For now, http urls / spee.ch links should work fine.

string name = 2;
string description = 3;
string thumbnail_url = 4; // url or claim ID?
string cover_url = 5; // url or claim ID?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whatever is determined by lbryio/lbry-sdk#1842

it may be better to have them directly as blob or stream hashes?

@lyoshenka
Copy link
Member Author

Question for reviewers:

  • are any fields still missing?
  • are any fields unnecessary?
  • should the fields be structured differently?

Fee fee = 16;
string license_url = 17;
string thumbnail_url = 18;
uint32 duration = 19;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

content height/length and orientation would be helpful for spee.ch and other apps too - see lbryio/spee.ch#435 / lbryio/spee.ch#527. We wouldn't have to run ffmpeg on new files anymore...

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

per @lyoshenka, we should add these under a dimensions subfield

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what are the possible values for orientation?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lyoshenka I would say horizontal/vertical, but we can expand that to 0/90/180/270 (https://stackoverflow.com/a/47676129/8308000). I asked Sean and he suggested a boolean for a Portrait setting.

string license_url = 17;
string thumbnail_url = 18;
uint32 duration = 19;
repeated string tags = 20;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can tags have a "type" property the way it's defined currently? i.e. Category/topic/genre/other/etc.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm not sure what you mean. can you give me some examples?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per the discussion this afternoon, this would pose UX challenges when users tagged content.

The idea was that a top level tag might be bound to some type, i.e. category, with predefined values. Then users could easily reference the category tag when searching/selecting based on tags, as opposed to more generic tags.

@neb-b
Copy link

neb-b commented Feb 18, 2019

What about a website/contact field? Most sites have something for you to add your email address or link to a website. I'm not sure if both would be valuable, or if you could just merge it into one field.

@kauffj
Copy link
Member

kauffj commented Feb 18, 2019

👍 on adding both a website and an email field to channels @lyoshenka

@eukreign
Copy link
Member

eukreign commented Feb 19, 2019

Question Responses:

  1. I think name is the display name. Slightly less ambigious (not sure by how much) might be to use title insead of name, but I think name is fine too.
  2. cover and thumbnail should be claim IDs

Feedback:

  • thumbnail_url -> thumbnail
  • cover_url -> cover
  • using float for the Fee is a bad idea. It should be an integer and then the precision is 2 decimals for fiat currencies (USD) and 8 decimals for crypto currencies (LBC/BTC). ($1USD would be 100 and 1LBC would be 100000000).

New Questions:

  • Does Channel make sense for certificates if we're planning to also use them for a users identity? I think the old Certificate is more generic when applying to both channels and identities.
  • Can they all go in one file? They are pretty short and it's easier to get the full picture with just one file open.
  • Stream vs. File is confusing. Are there Streams which aren't Files?
  • Insead of having Claim container type with Channel and Stream inside of it, can we just have Channel and Stream as root containers (and get rid of Claim)? (And perhaps add other root objects like Comment in the future?)

@tzarebczan
Copy link

I don't think I should have to download thumbnails/covers over DHT, unless the long term plan is to allow that for claim thumnails as well (lbryio/lbry-sdk#1842)

@neb-b
Copy link

neb-b commented Feb 19, 2019

I agree. I do not think thumbnail/cover should be a claim id.

I can see a case where it is a url or a claim id (or something else), but since thumbnail is already a url for a claim, this should follow the same behavior.

@kauffj
Copy link
Member

kauffj commented Feb 20, 2019

@seanyesmunt note that as long as we encourage usage of spee.ch for images, we are encouraging thumbnail/cover to be a claim id just with extra steps ;)

@kauffj
Copy link
Member

kauffj commented Feb 22, 2019

Another feature that just struck me as missing is creator identity verification (where verification equals proving I own a certain Twitter account, YouTube account, domain name, or ??). You would prove you own relevant property by issuing a tweet, publishing a video, adding a DNS entry / uploading a file, etc.

This is more complicated than basically everything else we're proposing to add, so I don't want to block on this, but if we can come up with a generic format or nail down a few of them specifically, it'd be good to include.


message Channel {
bytes public_key = 1;
string name = 2;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is different from the name used to make the claim? is this like a title?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

@kauffj
Copy link
Member

kauffj commented Feb 27, 2019

@lyoshenka is anything blocking this?

@lyoshenka
Copy link
Member Author

i'm dropping the ability to list payments in BTC. we're just keeping usd and lbc.

@lyoshenka lyoshenka mentioned this pull request Feb 27, 2019
@shyba shyba closed this in #21 Feb 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
7 participants