Conversation
bobbinth
left a comment
There was a problem hiding this comment.
Looks great! Thank you! I left some questions/comments inline - but most of these can be addressed in follow-up PRs.
Overall, in terms of follow-ups, I think we have:
- Remove the
SMT_PEEK_EVENTfrom asset vault (we have an issue for this). - Change
hpermandhmergetorpo256::permuteandrpo256::mergeeverywhere. - Rename RpoFalcon512 to Falcon512Rpo everywhere.
- Figure out if we can still search for procedures by name in account components.
- Export/import constants directly (instead of having wrapper functions) - I think we might have an issue for this as well.
There was a problem hiding this comment.
Probably not for this PR, but we should rename RpoFalcon512 to Falcon512rpo to be consistent with naming everywhere.
| proc_name: impl TryInto<QualifiedProcedureName>, | ||
| ) -> Option<Word> { | ||
| self.code.as_library().get_procedure_root_by_name(proc_name) | ||
| pub fn get_procedure_root_by_name(&self, proc_name: impl AsRef<Path>) -> Option<Word> { |
There was a problem hiding this comment.
I think we should probably rename this to keep things consistent.
Ideally, we'd actually be able to find procedures by name, but for this we'd need to make sure all procedures in a component are uniquely named - and this will probably require some re-work. Let's create an issue for this.
| const DISTRIBUTE_PROC_NAME: &str = "network_fungible_faucet::distribute"; | ||
| const BURN_PROC_NAME: &str = "network_fungible_faucet::burn"; |
There was a problem hiding this comment.
Question: could we assemble things differently so that these remain just as names rather than pats (or maybe a path with a single component)?
There was a problem hiding this comment.
This is potentially possible, but will make creating procedure digests with procedure_digest! macro a bit less convenient (because AFAICS this is the only place where we use there constants).
To load a proc digest from some library we need to have a full path of this procedure. So we can change the names back to have just a procedure name, but we will have to additionally supply the library name to the macro to build an absolute path of this procedure.
This problem is actually the same to being able to search for the procedure in the account component using just the proc name.
PhilippGackstatter
left a comment
There was a problem hiding this comment.
Looks good to me!
crates/miden-lib/build.rs
Outdated
| // add the shared util modules to the kernel lib under the ::$kernel::util namespace | ||
| assembler.compile_and_statically_link_from_dir( | ||
| &shared_utils_path, | ||
| miden_assembly::Path::kernel_path(), |
There was a problem hiding this comment.
Nit: I would import Path directly. Applies to more occurrences in this file.
|
Note: as discussed in the client sync: not to be merged until @igamigo's follow-up to storage slots refactoring is in; the reason is that we'd like to migrate |
This also means that PRs which are likely to contain significant changes should be built on top of this PR. |
|
@huitseeker Do you have a suggestion for resolving this https://github.com/0xMiden/miden-base/actions/runs/20288516906/job/58267639301#step:4:21 It seems like most things in the dependency tree use But also, since this is a build dependency, I think we can just allow duplicate versions. Edit: Even when allowing |
huitseeker
left a comment
There was a problem hiding this comment.
This LGTM. @PhilippGackstatter I pushed the setting that allows syn duplicates as the last commit of this PR. It seems to have fixed CI.
This PR updates the code to work with
miden-vmv0.20.0 andmiden-cryptov0.19.2.Specifically these changes were applied:
call.::rpo_falcon_512_multisig::update_signers_and_threshold)miden-lib/asm/account_componentswere updated.stdlibwere changed tocore lib.in_debug_modeparameter was removed from theCodeBuilderandbuild_send_notes_scriptmethod of theAccountInterface.Open questions and follow ups:
AccountComponent::get_procedure_root_by_namemethod be renamed toget_procedure_root_by_path, followingLibraryrefactoring?SMT_PEEK_EVENTfromasset_valut: Remove theSMT_PEEK_EVENTevent #2115.Migration guide
MASM syntax
Stdlib
Standard library was renamed, so instead ofStdLibrarynow theCoreLibraryshould be used. It has the same API, so just simple renaming should work. Its MASM usage also changes, so now instead ofstd::themiden::core::should be used.Debug mode
in_debug_modeparameter was removed fromCodeBuilderand related methods. Simple removing the parameter or method call will work.LibraryPath
LibraryPathwas removed, now you can usePathinstead (notice that now there are two paths: fromstdand frommiden_assembly).compile_and_statically_link_from_dirassembler method was updated to work with paths, so to get the same final library you can provide relevant Path or even just a the static string. For example:Account Components
get_procedure_root_by_name()method was renamed toget_procedure_root_by_path()to match theLibraryAPI. In most cases no further changes are required, but notice that the procedure path should include the module name, i.e."basic_fungible_faucet::distribute".