-
Notifications
You must be signed in to change notification settings - Fork 2
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
Adapt schemas to epochs and member exclusion #30
Conversation
Just ran into this
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Smells fine by me, but I'm not the JSON schema person
group/init/README.md
Outdated
|
||
Note the differences between the root msg (the "zero epoch") and epoch init messages: | ||
* The group tangle is not null and like normal, points at the group root and the latest messages. | ||
* The epoch tangle is not null and points at the root msg as well as the init for the last epoch. In this example this is the first new epoch so the `previous` is the group root msg. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* The epoch tangle is not null and points at the root msg as well as the init for the last epoch. In this example this is the first new epoch so the `previous` is the group root msg. | |
* The epoch tangle is not null and points at the root msg as well as the init for the last epoch. In this example this is the first new epoch so the `previous` is just `[groupRoot]`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just removed this sentence instead (was clarified in the code example anyway)
group/init/v2/schema.js
Outdated
properties: { | ||
group: { $ref: '#/definitions/tangle/root' }, | ||
group: { $ref: '#/definitions/tangle/any' }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔥 I feel like this is generalising in a way which is not helpful/ safe. I suggest we split out:
- group/init-root
- group/init-epoch
or something, because otherwise validators built on this will let you make an incorrect group root message with no errors raised
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both can still have the same type
(and should) but lets find some way to distinguish
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I split them out into initRoot and initEpoch now
wrongPrev.tangles.group.previous = ['%yip', '%yap'] | ||
t.false(isValid(wrongPrev), 'fails if wrong tangle.previous') | ||
wrongPrev.tangles.members.previous = ['%yip', '%yap'] | ||
t.false(isValid(wrongPrev), 'fails if wrong members.previous') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
were these the tests failing with the schema item/items definition as it was?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uuh idk, all tests were passing i think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My main request is that we seperate group/init and group/init (epoch) or whatever we call the two.
} | ||
}, | ||
validator: { | ||
group: { | ||
init: Validator(groupInitSchema), | ||
initRoot: Validator(groupInitRootSchema), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔥 this is a breaking change (the API is different). I think if we've not published this v2 init then it's fine, but otherwise we need to make this a major version change... or provide an init
which is the same as initRoot
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah none of the new group/tribes2 stuff has been in production yet so this repo is still essentially "groups 2.0-release candidate. when it is in production we'll have to move it to the sip repo to freeze it
published v6 now |
For ssbc/ssb-tribes2#73 and ssbc/ssb-tribes2#68