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

BackendApi improvements #1985

Merged
merged 4 commits into from
Jan 9, 2024
Merged

BackendApi improvements #1985

merged 4 commits into from
Jan 9, 2024

Conversation

webmaster128
Copy link
Member

addr_validate can be implemented in Go directly such that we do not need to get the canonical address through cgo into Rust and send it back to get the humanized address again.

@webmaster128 webmaster128 requested a review from chipshort January 9, 2024 00:37
@webmaster128 webmaster128 added this to the 2.0.0 milestone Jan 9, 2024
Copy link
Collaborator

@chipshort chipshort left a comment

Choose a reason for hiding this comment

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

Good stuff. Only thing I am unsure is the Send bound. To me the blanket impl of Send and Sync we have for Environment seems more at fault here though.

Comment on lines 171 to 168
pub trait BackendApi: Copy + Clone + Send {
fn canonical_address(&self, human: &str) -> BackendResult<Vec<u8>>;
fn human_address(&self, canonical: &[u8]) -> BackendResult<String>;
pub trait BackendApi: Clone {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't this continue to require Send?
Or maybe it would be better to add the bound to the Send impl of Environment?

@webmaster128
Copy link
Member Author

Only thing I am unsure is the Send bound. To me the blanket impl of Send and Sync we have for Environment seems more at fault here though.

Very good point. This is probably all a leftover from trying to get everything to compile during the Wasmer 3 upgrade. Will revert the Send change in here and only drop the Copy requirement, which is overly strict IMO.

Could you have a look into those Send and Sync implementations of Environment and how to make this code more solid?

@webmaster128 webmaster128 force-pushed the BackendApi-improvements branch from ba31f2c to df69d76 Compare January 9, 2024 19:30
@webmaster128 webmaster128 merged commit b94f6f3 into main Jan 9, 2024
29 checks passed
@webmaster128 webmaster128 deleted the BackendApi-improvements branch January 9, 2024 20:06
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.

2 participants