Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Lichtso
Copy link
Collaborator

@Lichtso Lichtso commented Jan 30, 2025

No description provided.

@Lichtso Lichtso force-pushed the refactor/removes_dense_function_registry branch 2 times, most recently from 75135da to 3f9244d Compare January 30, 2025 09:12
@Lichtso Lichtso requested a review from LucasSte January 30, 2025 09:39
src/program.rs Outdated
pub fn get_function_registry(
&self,
sbpf_version: SBPFVersion,
_sbpf_version: SBPFVersion,
Copy link
Collaborator

Choose a reason for hiding this comment

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

What about removing the unused parameter?

$function_registry
.register_function_hashed($location.as_bytes(), $syscall_function)
.unwrap();
(register, $loader:expr, $location:expr => $syscall_function:expr) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

What about calling name instead of location?

$loader.register_function($location, $syscall_function).unwrap();
};
($source:tt, $config:tt, $mem:tt, ($($location:expr => $syscall_function:expr),* $(,)?), $context_object:expr, $expected_result:expr $(,)?) => {
($source:expr, $config:expr, $mem:expr, ($($location:expr => $syscall_function:expr),* $(,)?), $context_object:expr, $expected_result:expr $(,)?) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Name instead of location?

}
};
($source:tt, $mem:tt, ($($location:expr => $syscall_function:expr),* $(,)?), $context_object:expr, $expected_result:expr $(,)?) => {
($source:expr, $mem:expr, ($($location:expr => $syscall_function:expr),* $(,)?), $context_object:expr, $expected_result:expr $(,)?) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Here as well

@Lichtso Lichtso force-pushed the refactor/removes_dense_function_registry branch from 3f9244d to 7fd164c Compare January 30, 2025 15:21
Comment on lines +13 to 15
use solana_sbpf::program::SBPFVersion;
use solana_sbpf::vm::Config;
use solana_sbpf::{assembler::assemble, ebpf, program::BuiltinProgram};
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not for this PR, but we could configure cargo fmt to group imports as we do in the Agave repo.

@Lichtso Lichtso merged commit ac6ba8d into main Jan 30, 2025
11 checks passed
@Lichtso Lichtso deleted the refactor/removes_dense_function_registry branch January 30, 2025 15:45
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.

3 participants