Skip to content

Conversation

@jaoleal
Copy link
Collaborator

@jaoleal jaoleal commented Apr 2, 2025

What is the purpose of this pull request?

  • Bug fix
  • Documentation update
  • New feature
  • Test
  • Other:

Which crates are being modified?

  • floresta-chain
  • floresta-cli
  • floresta-common
  • floresta-compact-filters
  • floresta-electrum
  • floresta-watch-only
  • floresta-wire
  • floresta
  • florestad
  • Other: Nix

Description

This PR tries to introduce new checks, a utils library for reduce the reuse of code.

Notes to the reviewers

Ready for Review update.
what ended up being changed in this PR:

utils.nix, more nix flake checks and separate checks.

Add:
        New checks (python-sanity-check, rust-sanity-check and nix-sanity-check)
        The hook that creates Environment Variables are now inside `utils.nix`.
        CI workflow for nix-related commands.
Edit:
        Packages are now offered separatelly (all, florestad, libfloresta and floresta-cli are alternatives)

removed:
        utreexod now is consumed via another flake for sake of organization.
        overlay removed

This PR introduces a need of changes on nix documentation (more context on: #429 (comment) )
but it would raise a big conflict with #429.

Ill be opening a issue to track a followup to update the documentation: #443

Checklist

  • I've signed all my commits (I sign after the ACK.)
  • I ran just lint
  • I ran cargo test
  • I've checked the integration tests
  • I've followed the contribution guidelines
  • I'm linking the issue being fixed by this PR (if any)

@jaoleal jaoleal force-pushed the more-flake-checks branch 5 times, most recently from ea628ed to d579178 Compare April 8, 2025 18:59
@jaoleal
Copy link
Collaborator Author

jaoleal commented Apr 8, 2025

I was able to do some checks(cargo fmt) with bare nix and bash calls but looks like that im unnable to make the same with clippy. I get a strange error about internet connection even if im setting the --frozen flag when i run clippy.

Im seeing that https://github.com/cachix/git-hooks.nix?tab=readme-ov-file has managed to do clippy checks, im about to study its code and consider 2 things:

1.use git hooks itself since they have the marjority of sanity checks.
2. understand how they made clippy work inside nix checks in pure mode.

@jaoleal jaoleal force-pushed the more-flake-checks branch from d579178 to 30e326b Compare April 9, 2025 19:18
@jaoleal
Copy link
Collaborator Author

jaoleal commented Apr 9, 2025

30e326b accomplished to add clippy and rustfmt to checks with git-hooks

@jaoleal jaoleal force-pushed the more-flake-checks branch 4 times, most recently from 5a76399 to fd0fe1c Compare April 11, 2025 18:58
Copy link
Collaborator Author

@jaoleal jaoleal left a comment

Choose a reason for hiding this comment

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

Theres somethings that i need help to decide:

Also, Documentation is a thing... I know that most of the contributors of this project doesnt know nix and i want to make everything clear, atleast to make one have a little superficial feeling to understand whats going on here so, feel free to ask more documentation...

@jaoleal jaoleal force-pushed the more-flake-checks branch 5 times, most recently from de53fab to 0b9252d Compare April 14, 2025 18:12
@jaoleal jaoleal marked this pull request as ready for review April 14, 2025 19:08
@jaoleal jaoleal force-pushed the more-flake-checks branch 2 times, most recently from d63f077 to f3f0af8 Compare April 15, 2025 16:57
jaoleal added a commit to jaoleal/Floresta that referenced this pull request Apr 16, 2025
jaoleal added a commit to jaoleal/Floresta that referenced this pull request Apr 16, 2025
@jaoleal jaoleal mentioned this pull request Apr 16, 2025
21 tasks
@jaoleal jaoleal force-pushed the more-flake-checks branch from f3f0af8 to 655cb64 Compare April 16, 2025 14:10
@Davidson-Souza
Copy link
Member

After running nix develop I still need to run rustup install {stable,nightly} before using just or cargo. Is it hard to get stable and nightly installed too?

@jaoleal jaoleal force-pushed the more-flake-checks branch from 655cb64 to 2bd18d6 Compare April 16, 2025 22:43
@jaoleal
Copy link
Collaborator Author

jaoleal commented Apr 16, 2025

2bd18d6 fixes that

@Davidson-Souza
Copy link
Member

Running `nix develop .#func-tests-env

error: builder for '/nix/store/7nyry4avfbjqz3dgln4mb8hxmfap465d-utreexod-0.4.1.drv' failed with exit code 1;
       last 25 log lines:
       > ok        github.com/utreexo/utreexod/btcutil     0.045s
       > ok       github.com/utreexo/utreexod/btcutil/base58      0.594s
       > ok       github.com/utreexo/utreexod/btcutil/bech32      0.004s
       > ok       github.com/utreexo/utreexod/btcutil/bloom       0.021s
       > ok       github.com/utreexo/utreexod/btcutil/coinset     0.006s
       > ok       github.com/utreexo/utreexod/btcutil/gcs 1.551s
       > ok       github.com/utreexo/utreexod/btcutil/gcs/builder 0.007s
       > ok       github.com/utreexo/utreexod/btcutil/txsort      0.004s
       > ok       github.com/utreexo/utreexod/chaincfg    0.004s
       > ok       github.com/utreexo/utreexod/chaincfg/chainhash  0.004s
       > ok       github.com/utreexo/utreexod/connmgr     0.139s
       > ok       github.com/utreexo/utreexod/database    2.561s
       > ok       github.com/utreexo/utreexod/database/ffldb      5.133s
       > ok       github.com/utreexo/utreexod/database/internal/treap     0.012s
       > --- FAIL: TestGetChainTips (11.24s)
       >     getchaintips_test.go:175: TestGetChainTips fail. Unable to setup test chain: connection timeout
       > --- FAIL: TestGetUtreexoRoots (9.53s)
       >     getutreexoroots_test.go:74: TestGetUtreexoRoots fail. Unable to setup test chain: connection timeout
       > --- FAIL: TestInvalidateAndReconsiderBlock (9.53s)
       >     invalidate_reconsider_block_test.go:17: TestInvalidateAndReconsiderBlock fail. Unable to setup test chain: connection timeout
       > --- FAIL: TestUtreexoCSN (9.53s)
       >     utreexocompactstatenode_test.go:99: TestUtreexoCSN fail. Unable to setup test chain: connection timeout
       > FAIL
       > FAIL       github.com/utreexo/utreexod/integration 39.845s
       > FAIL
       For full logs, run:
         nix log /nix/store/7nyry4avfbjqz3dgln4mb8hxmfap465d-utreexod-0.4.1.drv

@jaoleal jaoleal force-pushed the more-flake-checks branch from 2bd18d6 to 5fbcdb3 Compare April 17, 2025 14:34
@jaoleal
Copy link
Collaborator Author

jaoleal commented Apr 17, 2025

Just updated flake.lock.

@Davidson-Souza Davidson-Souza added code quality Generally improves code readability and maintainability functional tests nix This change relates to the nix integration for floresta labels Apr 17, 2025
@jaoleal jaoleal force-pushed the more-flake-checks branch 3 times, most recently from 8b235f1 to 346ca3a Compare April 17, 2025 16:53
@Davidson-Souza
Copy link
Member

CI is failing with:

/Users/runner/work/_temp/5d164fe5-b5c1-46cb-a45c-6efb117830b3.sh: line 2: uv: command not found

jaoleal added a commit to jaoleal/Floresta that referenced this pull request Apr 29, 2025
jaoleal added a commit to jaoleal/Floresta that referenced this pull request Apr 29, 2025
@jaoleal jaoleal force-pushed the more-flake-checks branch 2 times, most recently from 82789a3 to 247add6 Compare April 30, 2025 13:22
Add:
	New checks (python-sanity-check, rust-sanity-check and nix-sanity-check)
	The hook that creates Environment Variables are now inside `utils.nix`.
	CI workflow for nix-related commands.
Edit:
	Packages are now offered separatelly (all, florestad, libfloresta and floresta-cli are alternatives)

removed:
	utreexod now is consumed via another flake for sake of organization.
	overlay removed
@jaoleal jaoleal force-pushed the more-flake-checks branch from 247add6 to 39ed1c9 Compare April 30, 2025 13:30
@jaoleal
Copy link
Collaborator Author

jaoleal commented Apr 30, 2025

Applied @Davidson-Souza suggestions and gpg signing

jaoleal added a commit to jaoleal/Floresta that referenced this pull request Apr 30, 2025
Copy link
Member

@Davidson-Souza Davidson-Souza left a comment

Choose a reason for hiding this comment

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

ACK 39ed1c9

@Davidson-Souza Davidson-Souza merged commit f36874d into vinteumorg:master Apr 30, 2025
10 checks passed
jaoleal added a commit to jaoleal/Floresta that referenced this pull request Apr 30, 2025
jaoleal added a commit to jaoleal/Floresta that referenced this pull request Apr 30, 2025
jaoleal added a commit to jaoleal/Floresta that referenced this pull request Apr 30, 2025
Davidson-Souza pushed a commit that referenced this pull request May 1, 2025
This updates the documentation related to nix in this project.

fix #443
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code quality Generally improves code readability and maintainability functional tests nix This change relates to the nix integration for floresta

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants