refactor: Remove code from components/stacks-codec#2360
Open
jbencin-stacks wants to merge 2 commits intostx-labs:mainfrom
Open
refactor: Remove code from components/stacks-codec#2360jbencin-stacks wants to merge 2 commits intostx-labs:mainfrom
components/stacks-codec#2360jbencin-stacks wants to merge 2 commits intostx-labs:mainfrom
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
c19d2de to
416f02e
Compare
There was a problem hiding this comment.
Pull request overview
This PR reduces reliance on the duplicated components/stacks-codec implementations by switching multiple crates to use transaction types from stackslib (stacks-core) and relocating the contract-call transaction builder into stacks-rpc-client.
Changes:
- Replace
stacks_codec::codec::*transaction type usage withstackslib::chainstate::stacks::*in rpc-client and observer. - Move
build_contract_call_transactionout ofstacks-codecand intostacks-rpc-client::crypto, updating call sites. - Remove/trim duplicated code from
components/stacks-codec, and adjust crate dependencies/features accordingly.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| components/stacks-rpc-client/src/rpc_client.rs | Switches transaction imports from stacks-codec to stackslib. |
| components/stacks-rpc-client/src/crypto.rs | Replaces codec imports with stackslib types and adds build_contract_call_transaction. |
| components/stacks-rpc-client/Cargo.toml | Drops stacks-codec dependency and adds stackslib. |
| components/stacks-network/src/chains_coordinator.rs | Updates contract-call tx builder call sites to use stacks-rpc-client. |
| components/stacks-network/Cargo.toml | Removes stacks-codec dependency. |
| components/stacks-codec/src/codec.rs | Deletes substantial duplicated functionality/types, keeping only what’s still needed. |
| components/observer/src/indexer/stacks/mod.rs | Switches transaction imports from stacks-codec to stackslib. |
| components/observer/Cargo.toml | Makes stacks-codec optional and ties it to the stacks-signers feature; adds stackslib. |
| components/clarinet-deployments/src/onchain/mod.rs | Switches transaction/string types from stacks-codec to stackslib. |
| components/clarinet-deployments/Cargo.toml | Drops stacks-codec dependency and adds stackslib. |
| Cargo.lock | Lockfile updates reflecting dependency graph changes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
brady-stacks
approved these changes
Apr 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
I'm working towards removing as much of
components/stacks-codecas possible. Most of it is code duplicated from stacks-network/stacks-core.This PR removes some of that code, but additional refactoring of stacks-core will be needed to remove more of it
Breaking change?
No
Example
Removes a lot of code
