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

Panic if the server does not use TBs #111

Merged
merged 4 commits into from
Oct 30, 2016
Merged

Panic if the server does not use TBs #111

merged 4 commits into from
Oct 30, 2016

Conversation

vqhuy
Copy link
Member

@vqhuy vqhuy commented Oct 25, 2016

Workaround for #110

Copy link
Member

@masomel masomel left a comment

Choose a reason for hiding this comment

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

LGTM. Just to make sure, the keyserver has useTBs set to true everywhere?

@masomel masomel added this to the 0.1.0 milestone Oct 25, 2016
@masomel
Copy link
Member

masomel commented Oct 25, 2016

Merge this after #108 is merged?

@vqhuy
Copy link
Member Author

vqhuy commented Oct 25, 2016

LGTM. Just to make sure, the keyserver has useTBs set to true everywhere?

Yes (https://github.com/coniks-sys/coniks-go/blob/master/keyserver/server.go#L112).

Merge this after #108 is merged?

Yes, I think so.

@masomel
Copy link
Member

masomel commented Oct 26, 2016

Should we merge this? @arlolra @liamsi any thoughts before this is merged?

@liamsi
Copy link
Member

liamsi commented Oct 26, 2016

Should we merge this? @arlolra @liamsi any thoughts before this is merged?

First, the merge conflicts need to be resolved.

@@ -80,6 +80,13 @@ func TestRegisterExistedUserWithTB(t *testing.T) {
}

func TestRegisterWithoutTB(t *testing.T) {
// workaround for #110
Copy link
Member

Choose a reason for hiding this comment

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

I'm wondering how quickly these WithoutTB tests are going to rot?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry, I didn't really understand your question. These tests should panic and rot right after directory initialization. Should we remove these tests?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

I mean that since we're panicking early, the rest of the code won't be executed and will likely accumulate bugs or otherwise be unuseful over time.

Copy link
Member Author

@vqhuy vqhuy Oct 27, 2016

Choose a reason for hiding this comment

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

Yeah, thanks for teaching me this jargon. So what would you say about this?
/cc @masomel @liamsi

From my side, I think we would never run a key server without signed promises, so do other developers. Thus, removing these tests and keeping useTBs until we address #89 seem fine to me.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, thanks for teaching me this jargon.

Sorry, I should be more careful with idioms.

From my side, I think we would never run a key server without signed promises, so do other developers. Thus, removing these tests and keeping useTBs until we address #89 seem fine to me.

I'm ok with this reasoning.

Copy link
Member

Choose a reason for hiding this comment

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

Another option might be to truncate everything after where the test is expected to panic. We probably want to keep tests around that assert the panic so that doesn't regress.

Copy link
Member

Choose a reason for hiding this comment

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

From my side, I think we would never run a key server without signed promises, so do other developers. Thus, removing these tests and keeping useTBs until we address #89 seem fine to me.

I agree, at least for now, we won't be running a key server that doesn't use TBs (and should recommend the same to developers), but I think this would mean removing useTBs instead.

Another option might be to truncate everything after where the test is expected to panic. We probably want to keep tests around that assert the panic so that doesn't regress.

I agree with this, as long as we have useTBs, we should keep the tests that are expected to panic, but we can truncate the rest of the tests.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sounds fine to me :)

@@ -17,6 +17,12 @@ type ConiksDirectory struct {

func NewDirectory(epDeadline merkletree.TimeStamp, vrfKey vrf.PrivateKey,
signKey sign.PrivateKey, dirSize uint64, useTBs bool) *ConiksDirectory {

// Fix me: see #110
Copy link
Member

Choose a reason for hiding this comment

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

Can you use the canonical FIXME? Makes it a bit easier to grep.

@liamsi
Copy link
Member

liamsi commented Oct 26, 2016

This might be a little to late, but wouldn't it be more consequent to make TBs non-optional (and completely remove useTBs instead of panicking until they are really optional)?

@arlolra
Copy link
Member

arlolra commented Oct 26, 2016

Probably, but TBs were a good candidate to flesh out #89

@arlolra
Copy link
Member

arlolra commented Oct 28, 2016

LGTM

@vqhuy
Copy link
Member Author

vqhuy commented Oct 29, 2016

@liamsi What do you think about this pull?

@masomel
Copy link
Member

masomel commented Oct 29, 2016

LGTM with the truncated test.

@vqhuy vqhuy merged commit ad4be34 into master Oct 30, 2016
@vqhuy vqhuy deleted the force-tb branch October 30, 2016 07:50
vqhuy added a commit that referenced this pull request Nov 4, 2016
vqhuy added a commit that referenced this pull request Nov 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants