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

feat: PXE db contract store #10867

Merged
merged 28 commits into from
Jan 8, 2025
Merged

feat: PXE db contract store #10867

merged 28 commits into from
Jan 8, 2025

Conversation

benesjan
Copy link
Contributor

@benesjan benesjan commented Dec 18, 2024

Fixes #10730

+ adds support for non-flat return values in oracle.ts (TXE supported this but PXE did not)

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@benesjan benesjan force-pushed the 12-18-feat_pxe_db_contract_store branch 3 times, most recently from f1828dc to 1468edf Compare December 19, 2024 18:43
@benesjan benesjan marked this pull request as ready for review December 19, 2024 18:44
@benesjan benesjan requested a review from Thunkar December 19, 2024 19:58
@benesjan benesjan removed the request for review from Thunkar December 20, 2024 01:22
@benesjan benesjan marked this pull request as draft December 20, 2024 01:25
@benesjan benesjan force-pushed the 12-18-feat_pxe_db_contract_store branch 4 times, most recently from 238247f to 127f26d Compare December 20, 2024 22:46
@benesjan benesjan marked this pull request as ready for review December 20, 2024 22:49
@benesjan benesjan requested review from nventuro and removed request for nventuro December 21, 2024 01:55
@benesjan benesjan marked this pull request as draft December 23, 2024 15:35
@benesjan benesjan force-pushed the 12-18-feat_pxe_db_contract_store branch 4 times, most recently from 111fea9 to 1d2256b Compare January 7, 2025 14:55
@benesjan benesjan force-pushed the 12-18-feat_pxe_db_contract_store branch from ed04629 to c96105e Compare January 7, 2025 16:29
@benesjan benesjan marked this pull request as ready for review January 7, 2025 16:30
Copy link
Contributor

@nventuro nventuro left a comment

Choose a reason for hiding this comment

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

Very very nice. Thanks a lot for your work on this!

Comment on lines +20 to +28
/// Load data from local PXE database. We pass in `t_size` as a parameter to have the information of how many fields
/// we need to pad if the key does not exist (note that the actual response size is `t_size + 1` as the Option prefixes
/// the response with a boolean indicating if the data exists).
///
/// Note that we need to return an Option<[Field; N]> as we cannot return an Option<T> directly. This is because then
/// the shape of T would affect the expected oracle response (e.g. if we were returning a struct of 3 u32 values
/// then the expected response shape would be 3 single items. If instead we had a struct containing
/// `u32, [Field;10], u32`, then the expected shape would be single, array, single.).
#[oracle(load)]
Copy link
Contributor

Choose a reason for hiding this comment

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

This is very clear, thanks for the writeup.

yarn-project/txe/src/txe_service/txe_service.ts Outdated Show resolved Hide resolved
@benesjan benesjan enabled auto-merge (squash) January 8, 2025 15:02
Copy link
Contributor

github-actions bot commented Jan 8, 2025

Changes to circuit sizes

Generated at commit: afdb017933eb31bbd1744af9e3b5e102709098ec, compared to commit: 8105d37660d56da4c48c765351f6d4ed13a76f24

🧾 Summary (100% most significant diffs)

Program ACIR opcodes (+/-) % Circuit size (+/-) %
rollup_base_private +60,705 ❌ +10.90% +132,875 ❌ +5.98%
private_kernel_tail +225 ❌ +4.39% +225 ❌ +0.82%
private_kernel_empty +177 ❌ +22.41% +177 ❌ +0.02%
rollup_base_public +71 ❌ +0.01% +57 ❌ +0.00%

Full diff report 👇
Program ACIR opcodes (+/-) % Circuit size (+/-) %
rollup_base_private 617,798 (+60,705) +10.90% 2,355,616 (+132,875) +5.98%
private_kernel_tail 5,348 (+225) +4.39% 27,501 (+225) +0.82%
private_kernel_empty 967 (+177) +22.41% 865,308 (+177) +0.02%
rollup_base_public 849,484 (+71) +0.01% 3,749,059 (+57) +0.00%

@benesjan benesjan merged commit b5d51eb into master Jan 8, 2025
49 checks passed
@benesjan benesjan deleted the 12-18-feat_pxe_db_contract_store branch January 8, 2025 15:30
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.

Add contract-db capabilities to PXE
2 participants