Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Separate path for ext code size #2251

Merged
merged 3 commits into from
Sep 22, 2016
Merged

Separate path for ext code size #2251

merged 3 commits into from
Sep 22, 2016

Conversation

tomusdrw
Copy link
Collaborator

No description provided.

@tomusdrw tomusdrw added the A0-pleasereview 🤓 Pull request needs code review. label Sep 22, 2016
@tomusdrw tomusdrw added the M4-core ⛓ Core client code / Rust. label Sep 22, 2016
pub fn code(&self, a: &Address) -> Option<Bytes> {
self.ensure_cached(a, true,
|a| a.as_ref().map_or(None, |a|a.code().map(|x|x.to_vec())))
|a| a.as_ref().map_or(None, |a| a.code().map(|x| x.to_vec())))
Copy link
Contributor

Choose a reason for hiding this comment

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

tiny optimization here would be to save an allocation by having this return an Option<&[u8]> instead of reallocating.

Copy link
Contributor

Choose a reason for hiding this comment

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

obviously doesn't help with the current network attack as no code actually gets loaded, but can't hurt.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.01%) to 85.187% when pulling 7b48484 on extcodesize into 15488b3 on master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.01%) to 85.183% when pulling 7b48484 on extcodesize into 15488b3 on master.

@gavofyork gavofyork added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Sep 22, 2016
@gavofyork
Copy link
Contributor

tests fail.

@gavofyork gavofyork added A7-looksgoodtestsfail 🤖 Pull request is reviewed well, but cannot be merged due to tests failing. and removed A8-looksgood 🦄 Pull request is reviewed well. labels Sep 22, 2016
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.01%) to 85.186% when pulling 37d07c0 on extcodesize into 15488b3 on master.

@gavofyork gavofyork merged commit aae6d19 into master Sep 22, 2016
@gavofyork gavofyork deleted the extcodesize branch September 22, 2016 17:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A7-looksgoodtestsfail 🤖 Pull request is reviewed well, but cannot be merged due to tests failing. M4-core ⛓ Core client code / Rust.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants