-
Notifications
You must be signed in to change notification settings - Fork 0
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
BPF to WASM #52
BPF to WASM #52
Conversation
7c11948
to
54ec3c3
Compare
…y for development
…s. Result is saved to blockchain
f235a11
to
fd641ad
Compare
cli/src/spend_utils.rs
Outdated
lamports_to_sol(fee), | ||
*from_pubkey, | ||
)); | ||
// TODO(Dev): this is only for speed up development. |
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.
Should we resolve this TODO?
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.
Reverted this part
cli/src/checks.rs
Outdated
*account_pubkey, | ||
)); | ||
} | ||
// TODO(Dev): this is only for speed up development. |
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.
Should we resolve this TODO?
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.
Reverted this part
program-test/src/lib.rs
Outdated
pre_warp_slot, | ||
todo!(), | ||
)) | ||
todo!(); |
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.
TODO?
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.
Reverted this part
@@ -129,4 +129,4 @@ fn bench_serialize_aligned(bencher: &mut Bencher) { | |||
bencher.iter(|| { | |||
let _ = serialize_parameters_aligned(&transaction_context, instruction_context).unwrap(); | |||
}); | |||
} | |||
} |
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.
Looks odd, should we revert this change?
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.
Reverted
programs/bpf_loader/src/lib.rs
Outdated
@@ -258,13 +259,13 @@ fn write_program_data( | |||
invoke_context: &mut InvokeContext, | |||
) -> Result<(), InstructionError> { | |||
let transaction_context = &invoke_context.transaction_context; | |||
let instruction_context = transaction_context.get_current_instruction_context()?; | |||
let instruction_context = transaction_context.get_current_instruction_context().inspect_err(|x| { dbg!(x); })?; |
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.
Question whether we need to add all these inspect_err
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.
Deleted all inspect_err
programs/bpf_loader/src/syscalls.rs
Outdated
@@ -155,7 +155,12 @@ pub fn register_syscalls( | |||
)?; | |||
|
|||
// Logging | |||
syscall_registry.register_syscall_by_name(b"sol_log_", SyscallLog::init, SyscallLog::call)?; |
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.
Can we revert it if it's only about formating?
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.
Reverted
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.
If possible, could you add some description to help others understand this PR? For example, what is the goal of this PR? What are the main data structures and interfaces of this PR? Thanks
@@ -963,7 +981,8 @@ impl<'a> InvokeContext<'a> { | |||
err | |||
}); | |||
} else { | |||
return (entry.process_instruction)(first_instruction_account, self); | |||
return (entry.process_instruction)(first_instruction_account, self) | |||
.inspect_err(|x| { dbg!(x, entry); }); |
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.
error[E0658]: use of unstable library feature 'result_option_inspect'
--> program-runtime/src/invoke_context.rs:985:26
|
985 | .inspect_err(|x| { dbg!(x, entry); });
| ^^^^^^^^^^^
|
= note: see issue #91345 rust-lang/rust#91345 for more information
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.
Deleted all inspect_err
return (entry.process_instruction)(first_instruction_account, self) | ||
.inspect_err(|x| { dbg!(x, &entry, &first_instruction_account); }) |
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.
error[E0658]: use of unstable library feature 'result_option_inspect'
--> program-runtime/src/invoke_context.rs:975:26
|
975 | ... .inspect_err(|x| { dbg!(x, &entry, &first_instruction_account); })
| ^^^^^^^^^^^
|
= note: see issue #91345 rust-lang/rust#91345 for more information
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.
Deleted all inspect_err
f4f8dc4
to
71acecb
Compare
@fishseabowl Here is a description for this PR: |
Hi sviatoslav-alekseev, I got some warnings when I compiled your PR 52, I don't think it's because of this PR, but can you fix it?
|
Rebased on the I will try to fix current discussions there. |
Solana has BPF smart contracts allowing write programs in Rust and C. We need to add WASM support for smart contracts. With this change, we could write smart contracts in any language that supports WASM.
What is being done:
BPFLoader
program add an identicalWASMLoader