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

remote: add AddToStoreNar operation #277

Merged
merged 2 commits into from
Dec 13, 2023
Merged

Conversation

squalus
Copy link
Contributor

@squalus squalus commented Dec 12, 2023

Some open items:

  • What type should be used for the reply? Nothing is sent over the wire. () is already taken by opSuccess which reads a boolean. Maybe opSuccess should use a new reply type, and this one should use ()
  • The client chooses the chunk size. What should that be?
  • Better errors for the RemoteStoreError_Fixme usages
  • Make an Arbitrary instance for SampleNar

Closes #265

@sorki
Copy link
Member

sorki commented Dec 12, 2023

Very nice (especially the framing!) and sorry for the conflicts! Wanted to merge earlier but didn't get to it sooner.

The CheckSignatures is also in core (I've realized it is actually CheckSignatures as well only couple days ago) - but don't worry about it, I'll deal with it.

You're right about opSuccess, most ops simply return True and indicate errors via logger so it seemed appropriate to just use () but this one makes it weird, I agree about the newtype.

No idea about the chunk size tbh.

if narBytes == 0 then writeFramedSource (const (pure Nothing)) soc 0
else throwError RemoteStoreError_NoDataSourceProvided
Just dataSource -> do
writeFramedSource dataSource soc narBytes
Copy link
Member

Choose a reason for hiding this comment

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

Now I kinda wonder what's the Logger_Read code path for.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I don't know if it's still used in the newer protocol versions.

Add SuccessCodeReply to replace instances of the () reply type.

The serialization behavior is more clear with the more explicit type.
@squalus
Copy link
Contributor Author

squalus commented Dec 13, 2023

  • Replaced the existing () reply type with a new SuccessCodeReply type
  • Added a NoReply type for this case
  • Added error types
  • Resolved conflicts

@sorki
Copy link
Member

sorki commented Dec 13, 2023

Nicely done, thank you!

@sorki sorki merged commit c1f7666 into haskell-nix:master Dec 13, 2023
@sorki
Copy link
Member

sorki commented Dec 13, 2023

Btw I'm pretty much done with most large-scale changes/refactors so things should settle down now, feel free to tackle what you see fit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement AddStoreToNar operation
2 participants