-
Notifications
You must be signed in to change notification settings - Fork 100
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
rename(state): do additional renaming for clarification purposes #6967
Conversation
``` git ls-tree --full-tree -r --name-only HEAD | \ grep -v 'book' | grep -v 'CHANGELOG.md' | \ xargs sed -i 's/CommitFinalized/CommitCheckpointVerified/g' git ls-tree --full-tree -r --name-only HEAD | \ grep -v 'book' | grep -v 'CHANGELOG.md' | \ xargs sed -i 's/commit_finalized_block/commit_checkpoint_verified/g' git ls-tree --full-tree -r --name-only HEAD | \ grep -v 'book' | grep -v 'CHANGELOG.md' | \ xargs sed -i 's/drain_queue_and_commit_finalized/drain_finalized_queue_and_commit/g' git ls-tree --full-tree -r --name-only HEAD | \ grep -v 'book' | grep -v 'CHANGELOG.md' | \ xargs sed -i 's/queue_and_commit_finalized/queue_and_commit_to_finalized_state/g' git ls-tree --full-tree -r --name-only HEAD | \ grep -v 'book' | grep -v 'CHANGELOG.md' | \ xargs sed -i 's/queued_finalized_blocks/finalized_state_queued_blocks/g' git ls-tree --full-tree -r --name-only HEAD | \ grep -v 'book' | grep -v 'CHANGELOG.md' | \ xargs sed -i 's/max_queued_finalized_height/max_finalized_queue_height/g' git ls-tree --full-tree -r --name-only HEAD | \ grep -v 'book' | grep -v 'CHANGELOG.md' | \ xargs sed -i 's/send_finalized_block_error/send_checkpoint_verified_block_error/g' git ls-tree --full-tree -r --name-only HEAD | \ grep -v 'book' | grep -v 'CHANGELOG.md' | \ xargs sed -i 's/QueuedFinalized/QueuedCheckpointVerified/g' git ls-tree --full-tree -r --name-only HEAD | \ grep -v 'book' | grep -v 'CHANGELOG.md' | \ xargs sed -i 's/queue_and_commit_non_finalized/queue_and_commit_to_non_finalized_state/g' git ls-tree --full-tree -r --name-only HEAD | \ grep -v 'book' | grep -v 'CHANGELOG.md' | \ xargs sed -i 's/queued_non_finalized_blocks/non_finalized_state_queued_blocks/g' git ls-tree --full-tree -r --name-only HEAD | \ grep -v 'book' | grep -v 'CHANGELOG.md' | \ xargs sed -i 's/send_non_finalized_block_error/send_semantically_verified_block_error/g' git ls-tree --full-tree -r --name-only HEAD | \ grep -v 'book' | grep -v 'CHANGELOG.md' | \ xargs sed -i 's/QueuedNonFinalized/QueuedSemanticallyVerified/g' git ls-tree --full-tree -r --name-only HEAD | \ grep -v 'book' | grep -v 'CHANGELOG.md' | \ xargs sed -i 's/last_sent_finalized_block_hash/finalized_block_write_last_sent_hash/g' git ls-tree --full-tree -r --name-only HEAD | \ grep -v 'book' | grep -v 'CHANGELOG.md' | \ xargs sed -i 's/sent_non_finalized_block_hashes/non_finalized_block_write_sent_hashes/g' git ls-tree --full-tree -r --name-only HEAD | \ grep -v 'book' | grep -v 'CHANGELOG.md' | \ xargs sed -i 's/invalid_block_reset_receiver/invalid_block_write_reset_receiver/g' cargo fmt --all ```
``` git ls-tree --full-tree -r --name-only HEAD | \ grep -v 'book' | grep -v 'CHANGELOG.md' | \ xargs sed -i 's/queued finalized block/finalized state queue block/g' git ls-tree --full-tree -r --name-only HEAD | \ grep -v 'book' | grep -v 'CHANGELOG.md' | \ xargs sed -i 's/queued non-finalized block/non-finalized state queue block/g' cargo fmt --all ```
Script:
|
Here's what I got following the review process in: Run scripts as above. Extra step: check which files are changed: $ git status
On branch main
Your branch is up to date with 'origin/main'.
Changes not staged for commit:
...
modified: zebra-consensus/src/checkpoint.rs
modified: zebra-state/src/service.rs
modified: zebra-state/src/service/finalized_state.rs
modified: zebra-state/src/service/queued_blocks.rs
modified: zebra-state/src/service/queued_blocks/tests/vectors.rs
modified: zebra-state/src/service/tests.rs
modified: zebra-state/src/service/write.rs Check if there are any differences: cd ..
git diff zebra-sed zebra-pr
diff --git a/zebra-sed/.git b/zebra-pr/.git
index 6bed672..6e4aec3 100644
--- a/zebra-sed/.git
+++ b/zebra-pr/.git
@@ -1 +1 @@
-gitdir: /home/dev/zebra/.git/worktrees/zebra-sed
+gitdir: /home/dev/zebra/.git/worktrees/zebra-pr
diff --git a/zebra-sed/docker/Dockerfile b/zebra-pr/docker/Dockerfile
index 4f21f9a..36c6751 100644
--- a/zebra-sed/docker/Dockerfile
+++ b/zebra-pr/docker/Dockerfile
@@ -107,11 +107,10 @@ COPY --from=us-docker.pkg.dev/zealous-zebra/zebra/lightwalletd /opt/lightwalletd
#
# This is the caching Docker layer for Rust!
#
-# TODO: add --locked when cargo-chef supports it
-RUN cargo chef cook --tests --release --features "${TEST_FEATURES} ${FEATURES}" --workspace --recipe-path recipe.json
+# TODO: is it faster to use --tests here?
+RUN cargo chef cook --release --features "${TEST_FEATURES} ${FEATURES}" --workspace --recipe-path recipe.json
COPY . .
-# Test Zebra
RUN cargo test --locked --release --features "${TEST_FEATURES} ${FEATURES}" --workspace --no-run
RUN cp /opt/zebrad/target/release/zebrad /usr/local/bin
RUN cp /opt/zebrad/target/release/zebra-checkpoints /usr/local/bin
@@ -128,12 +127,10 @@ ENTRYPOINT [ "/entrypoint.sh" ]
# `test` stage. This step is a dependency for the `runtime` stage, which uses the resulting
# zebrad binary from this step.
FROM deps AS release
-
-# TODO: add --locked when cargo-chef supports it
-RUN cargo chef cook --release --features "${FEATURES}" --package zebrad --bin zebrad --recipe-path recipe.json
+RUN cargo chef cook --release --features "${FEATURES}" --recipe-path recipe.json
COPY . .
-# Build zebrad
+# Build zebra
RUN cargo build --locked --release --features "${FEATURES}" --package zebrad --bin zebrad
COPY ./docker/runtime-entrypoint.sh / These differences are in the Dockerfile, which wasn't changed in this PR. (They're from PR #6933 which just merged.) So I'm going to approve this PR now, to avoid merge conflicts. |
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.
Thanks!
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #6967 +/- ##
==========================================
- Coverage 77.62% 77.54% -0.08%
==========================================
Files 310 310
Lines 41475 41521 +46
==========================================
+ Hits 32196 32199 +3
- Misses 9279 9322 +43 |
Motivation
We left out some renaming in #6762 that are now a tasklist in #6793
Close #6793
Solution
Rename following the https://github.com/ZcashFoundation/zebra/blob/main/book/src/dev/mass-renames.md#universal-renames-with-sed convention.
Command list at #6967 (comment)
Review
Anyone can review by following the instructions at https://github.com/ZcashFoundation/zebra/blob/main/book/src/dev/mass-renames.md#universal-renames-with-sed
If this pull requests conflicts, it can be recreated at a later time using the script. This PR is pure automatic, no manual changes were done.
Reviewer Checklist
Follow Up Work