-
Notifications
You must be signed in to change notification settings - Fork 293
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(vm): reading kernel state opcodes #5739
Merged
Maddiaa0
merged 55 commits into
master
from
md/04-12-feat_example_caller_and_address_opcode
May 11, 2024
Merged
Changes from all commits
Commits
Show all changes
55 commits
Select commit
Hold shift + click to select a range
8853132
avm_logderivative
Maddiaa0 abc3cba
temp: chall line up
Maddiaa0 8b88dcd
fix: degree too low for lookup relations
Maddiaa0 c8d9601
chore: rename validate trace proof to check circuit, make another met…
Maddiaa0 c695905
chore: remove dangling code
Maddiaa0 40eeb8f
Merge branch 'master' into md/04-03-avm_logderivative
Maddiaa0 619175b
chore: further cleanup
Maddiaa0 65c3159
chore: from powdr codegen
Maddiaa0 61d10f6
temp
Maddiaa0 7e84550
feat: bb support for public input columns
Maddiaa0 c054aca
Merge branch 'master' into md/04-11-feat_bb_support_for_public_input_…
Maddiaa0 f38773f
merge fixy
Maddiaa0 a4262dc
chore: test structure
Maddiaa0 cf4bb86
🧹
Maddiaa0 12a9789
use pilgen
Maddiaa0 14d15cc
Merge branch 'master' into md/04-11-feat_bb_support_for_public_input_…
Maddiaa0 b0f8041
feat: example caller and address opcode
Maddiaa0 d5813a2
feat: generalise builder, move after review
Maddiaa0 6265c61
Merge branch 'master' into md/04-12-feat_example_caller_and_address_o…
Maddiaa0 59b221c
fix: add tests for all call context opcodes
Maddiaa0 b613cf5
Merge branch 'master' into md/04-11-feat_bb_support_for_public_input_…
Maddiaa0 81a2500
Merge branch 'md/04-11-feat_bb_support_for_public_input_columns' into…
Maddiaa0 c934c61
chore: update pil comments
Maddiaa0 a8ceaf8
fix: remove redundant comment
Maddiaa0 af343db
fix: some negative tests
Maddiaa0 9388ecc
temp
Maddiaa0 9e7aad0
Merge branch 'master' into md/04-12-feat_example_caller_and_address_o…
Maddiaa0 859a3df
chore: remove l1 gas - no longer exists
Maddiaa0 b4a47b3
chore: rearrange where relations live, based on review
Maddiaa0 79cf849
Merge branch 'master' into md/04-11-feat_bb_support_for_public_input_…
Maddiaa0 faac5b1
chore: update codegen
Maddiaa0 7e70e7d
Merge branch 'md/04-11-feat_bb_support_for_public_input_columns' into…
Maddiaa0 4bb42b8
feat: add cpp constants gen to calculate kernel offsets
Maddiaa0 bccfd67
feat: add global variable opcodes
Maddiaa0 2a74110
fix: transaction fee selector test
Maddiaa0 1285ccf
fix: update tags to line up with kernel
Maddiaa0 60836ca
Merge branch 'master' into md/04-12-feat_example_caller_and_address_o…
Maddiaa0 e2bcca8
feat: parallelise check circuit relations
Maddiaa0 7bff191
fix: forge fmt after constant gen
Maddiaa0 115f17c
fix: no futures for wasm builds
Maddiaa0 de663f1
feat: fix segfaults in parallel circuit checking
Maddiaa0 c910000
fix: missed log
Maddiaa0 fd728c7
fix: incorrect kernel tests
Maddiaa0 66f958e
Merge branch 'master' into md/04-11-feat_bb_support_for_public_input_…
Maddiaa0 ecdf742
🧹
Maddiaa0 3f31357
Merge branch 'md/04-11-feat_bb_support_for_public_input_columns' into…
Maddiaa0 d6aeda8
feat: use codegen, vector public inputs - pubs now misaligned
Maddiaa0 ea48aca
fix: update codegen
Maddiaa0 e1e2cb8
fix: remove legacy codegen files
Maddiaa0 3be1242
Merge branch 'master' into md/04-12-feat_example_caller_and_address_o…
Maddiaa0 bee84aa
fix: relation tags + removal of function opcode
Maddiaa0 449f3da
fmt fix
Maddiaa0 700c9a1
Merge branch 'master' into md/04-12-feat_example_caller_and_address_o…
Maddiaa0 3cf29f3
fix: remove template brackets limit:
Maddiaa0 19fab2e
Merge branch 'master' into md/04-12-feat_example_caller_and_address_o…
Maddiaa0 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
include "avm_main.pil"; | ||
include "constants.pil"; | ||
|
||
namespace avm_kernel(256); | ||
pol public kernel_inputs; | ||
pol commit kernel_sel; | ||
|
||
// Note: in the future, with some codegen adjustments, this column will not be needed | ||
// as we can just add every entry in the public kernel_inputs to the lookup table | ||
pol commit q_public_input_kernel_add_to_table; |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
|
||
// NOTE: the constants in this file line up to the indexes of values in the | ||
// `PublicKernelInputs.nr` object | ||
namespace constants(256); | ||
// From Public Context Inputs | ||
pol SENDER_SELECTOR = 0; | ||
pol ADDRESS_SELECTOR = 1; | ||
pol PORTAL_SELECTOR = 2; | ||
|
||
// NOTE: constant expression evaluation does not seem to be supported yet in pil | ||
// pol START_GLOBAL_VARIABLES = CALL_CONTEXT_LENGTH + HEADER_LENGTH = 6 + 22 = 28 | ||
|
||
// Global Variables | ||
pol CHAIN_ID_SELECTOR = 28; | ||
pol VERSION_SELECTOR = 29; | ||
pol BLOCK_NUMBER_SELECTOR = 30; | ||
pol TIMESTAMP_SELECTOR = 31; | ||
pol COINBASE_SELECTOR = 32; | ||
|
||
pol END_GLOBAL_VARIABLES = 28 + 8; // We only use the first 5 of 8 global variables for now | ||
|
||
pol START_SIDE_EFFECT_COUNTER = 36; | ||
|
||
// Gas | ||
pol FEE_PER_DA_GAS_SELECTOR = 37; | ||
pol FEE_PER_L2_GAS_SELECTOR = 38; | ||
|
||
pol TRANSACTION_FEE_SELECTOR = 39; | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
use_zsh_alias() { | ||
# Run Zsh command, source .zshrc, and then execute the alias | ||
zsh -i -c "$1" | ||
} | ||
|
||
# Compile | ||
use_zsh_alias "bb_pil pil/avm/avm_main.pil --name Avm" | ||
|
||
# Format generated folders | ||
root_dir="src" | ||
|
||
# Find all directories named 'generate' under the specified root directory | ||
find "$root_dir" -type d -name 'generate' | while read dir_path; do | ||
echo "Processing directory: $dir_path" | ||
|
||
# Find all C/C++ source files in these directories and format them | ||
find "$dir_path" -type f \( -iname '*.hpp' -o -iname '*.cpp' \) -exec clang-format -i {} + | ||
done | ||
|
||
|
||
# Build vm tests | ||
cmake --build --preset clang16 --target vm_tests |
Oops, something went wrong.
Oops, something went wrong.
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.
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.
Very welcome script! Thx.