Skip to content

Commit 0dcde07

Browse files
committed
[SDK] Fix bytecode caching (#6593)
<!-- ## title your PR with this format: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes" If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000): ## Notes for the reviewer Anything important to call out? Be sure to also clarify these in your comments. ## How to test Unit tests, playground, etc. --> <!-- start pr-codex --> --- ## PR-Codex overview This PR focuses on enhancing the bytecode caching mechanism in the `thirdweb` package by including additional metadata in the cache key, which improves cache differentiation and management. ### Detailed summary - Updated the `cacheKey` in `deploy-metadata.ts` to include `compilerMetadata.publisher` and `compilerMetadata.version` along with `compilerMetadata.name` and `chain.id`. - Removed the `version` and `publisher` fields from the deployment test case in `process-ref-deployments.test.ts`. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent 05a041f commit 0dcde07

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

.changeset/neat-wasps-count.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"thirdweb": patch
3+
---
4+
5+
Fix bytecode caching

packages/thirdweb/src/extensions/prebuilts/process-ref-deployments.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,7 @@ describe.runIf(process.env.TW_SECRET_KEY)(
7474
chain: ANVIL_CHAIN,
7575
account: TEST_ACCOUNT_A,
7676
contractId: "WETH9",
77-
version: "0.0.1",
7877
salt: "",
79-
publisher: "0x6453a486d52e0EB6E79Ec4491038E2522a926936",
8078
});
8179
forwarderAddress = await deployPublishedContract({
8280
client: TEST_CLIENT,

packages/thirdweb/src/utils/any-evm/deploy-metadata.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export async function fetchBytecodeFromCompilerMetadata(options: {
9696
return deployBytecode;
9797
},
9898
{
99-
cacheKey: `bytecode:${compilerMetadata.name}:${chain.id}`,
99+
cacheKey: `bytecode:${compilerMetadata.name}:${compilerMetadata.publisher}:${compilerMetadata.version}:${chain.id}`,
100100
cacheTime: 24 * 60 * 60 * 1000,
101101
},
102102
);

0 commit comments

Comments
 (0)