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

Default cache paths to use FIL_PROOFS_CACHE_DIR if set. #1207

Merged
merged 1 commit into from
Jul 15, 2020

Conversation

porcuquine
Copy link
Collaborator

@porcuquine porcuquine commented Jul 10, 2020

Closes #1206.

NOTE: Do not merge until a decision is made. This PR was a proposal for @lanzafame's approval, but merging it may cause as much or more trouble as the originally reported problem.

UPDATE: We have settled on solution: separate actual cache usage from canonical parameter location.

In particular, we must ensure the location of the Groth parameter cache does not change for any user. (cc: @travisperson)

This is untested, but I wanted to push something quickly for @lanzafame to review, since this is high priority for him.

@lanzafame Please approve if this seems to satisfy your requirements. If so, we'll we might get this into the upcoming release after making sure it's solid.

TODO:

  • document this change in README.
  • document usage/policy for future cache settings in source.

lanzafame
lanzafame previously approved these changes Jul 10, 2020
Copy link

@lanzafame lanzafame left a comment

Choose a reason for hiding this comment

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

It appears to perform what I would like it to

lanzafame
lanzafame previously approved these changes Jul 10, 2020
@travisperson
Copy link

travisperson commented Jul 10, 2020

Just to clarify (and in preparation for change log) I believe this is how it works now:

If FIL_PROOFS_PARENT_CACHE is set cached parents trees will be stored under $FIL_PROOFS_PARENT_CACHE. Setting FIL_PROOFS_PARENT_CACHE FIL_PROOFS_CACHE_DIR has no effect.
If FIL_PROOFS_PARENT_CACHE is unset and FIL_PROOFS_CACHE_DIR is set, cached parents trees will be stored under $FIL_PROOFS_CACHE_DIR/filecoin-parents.
If If FIL_PROOFS_CACHE_DIR is unset and FIL_PROOFS_PARENT_CACHE is unset, the directory will be /var/tmp/filecoin-parents

The behaviour of the parameter cache is unchanged. Setting FIL_PROOFS_CACHE_DIR has no affect on their location.

travisperson
travisperson previously approved these changes Jul 10, 2020
@porcuquine
Copy link
Collaborator Author

@travisperson I think this looks right except for one thing:

If FIL_PROOFS_PARENT_CACHE is set cached parents trees will be stored under $FIL_PROOFS_PARENT_CACHE. Setting FIL_PROOFS_PARENT_CACHE has no affect.

Did you mean setting FIL_PROOFS_CACHE_DIR has no effect?

@travisperson
Copy link

Yes

cryptonemo
cryptonemo previously approved these changes Jul 10, 2020
@cryptonemo
Copy link
Collaborator

Approved, although no longer related to TMPDIR. Will that part cause confusion?

@porcuquine porcuquine changed the title Default temp paths to use TMPDIR if set. Default cache paths to use FIL_PROOFS_CACHE_DIR if set. Jul 13, 2020
@porcuquine
Copy link
Collaborator Author

@cryptonemo Fixed reference to TMPDIR. If you have bandwidth to propagate changes everywhere after #1211 merges (README, config sample, etc.) that would be helpful. If so, I consider this can merge and be incorporated in the next release when ready. (I will update the description to reflect this decision.)

@porcuquine porcuquine dismissed stale reviews from cryptonemo and travisperson via d92e42d July 13, 2020 16:47
@porcuquine
Copy link
Collaborator Author

@cryptonemo I pushed one more commit documenting usage in a comment. Please review before propagating, since it clarifies a wart: specifically, the new env var cannot be set by config file — just env var.

@porcuquine porcuquine merged commit d743f60 into master Jul 15, 2020
@porcuquine porcuquine deleted the fix/tmpdir branch August 12, 2020 18:48
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.

Respect TMPDIR environment variable
4 participants