From 066339e18652e3b157b14f3c02b7abe0d5e5a91a Mon Sep 17 00:00:00 2001 From: David Palm Date: Mon, 13 Aug 2018 14:16:43 +0200 Subject: [PATCH 1/3] WIP Use uint --- compiled/creator.wasm | Bin 6226 -> 6325 bytes compiled/events.wasm | Bin 6551 -> 6575 bytes compiled/keccak.wasm | Bin 5428 -> 5425 bytes compiled/math.wasm | Bin 7087 -> 7084 bytes compiled/setter.wasm | Bin 3688 -> 3624 bytes gen/main.rs | 7 +++++-- src/creator.rs | 7 +++++-- src/externs.rs | 6 ++++-- src/logger.rs | 6 ++++-- src/math.rs | 11 ++++++++--- 10 files changed, 26 insertions(+), 11 deletions(-) diff --git a/compiled/creator.wasm b/compiled/creator.wasm index 9c09f372439174a79919b7edc6b9df55cba8e04c..af234e650cf3e2c2477d06fae396be7938c9281b 100644 GIT binary patch delta 985 zcmY*XJxmlq6n<}JcG+Y1xZ&>fIR0+-?jT1Y91SGKLwRz^$T97n`v-@b3YdGCGSo6qIl!HthfgPhuctA~kB7PBL6P`R{;C$A5b ziJ~FoY=o0jieDoAv}F=XpECewfijIz$OG_wWfqeC{I&0!t>l=44(J{8J=vG|vLgKP zfr+J=#ifDi{zgcm4rAbi&~;LrSnp delta 832 zcmah`J8Tm{5S`iGyX@uel8w*ghwZFCK~9r6O)NeVEW`o{s6c5#ffa$01LP<{{2Duf zB1)BH5u&FH2m}^VpmvcWAcW{BXecPsP*5O6f<0TYfQDw@%)S}Tn|ZItKNi+@QmLek z+;(hcbIvSggN+0%+qTgrz}I(kerhP4N%jv6%Fg@Qq)y^-e|wpQ87TQ6Q8n}&4juct z#DpVFo+sV}0S{e6L7p_0*#z-S%tG^cq1s(#YA-5Q`^632z)P6WX)-(b+{TV-7Ssp4 zmVq2dP&`zi@*-D%LdJ1egp%e7mC>OZCIm}Nvg-Kph~6H)=>zJ z$_$hCze);{wB_R8LJLLu7}d)fQ(1wnUH-S5Y2oIss%DykK4C80Qp}s}qPxCry+Efo zjpT$RqPJe_c*+K1;7X#H_yg6BIe(v?^hzxsS;@zykB_{R75NzGH(qYI=^U3-MWk_I z-?$)6Th{Rj($K^&IHEZNMO+{C-=@tZCpvgu*x*_qdZJuCTQ)PBc~%#?5_nLb?>c4P z^{#uEt@n0w#6*2aB#0Bud1$HwJsF$k4q{b;IH2FhM(HcJQ~!#U^ts?r>{E@oQ)9E0 z8&}2_D+}}G@}gb}&f=ziXGpW5duJ2S=m5BAa7tV83v${*=rKQM3{D6_2l tfY+DedsMH*9ip~%wSOS_d6l_6Gv)d6%-qepvU2On!qw}Q+YsHth2P(epR51? diff --git a/compiled/events.wasm b/compiled/events.wasm index 5307ea05b581ee0b95921b717a10632e6f314ac2..03e2da927eae88ae1f0c4fa65b2996b4df247f0e 100644 GIT binary patch delta 835 zcmZWn&1(}u6rVRUyV%F{$0O*sR z2Yv?LeA0YpXa`c7x@9d~9cne?1P_oQkSj3yU|Z^==TapJXo?!dL<2WvDc-W$#Kjuv^h0RP152RgWF(my(PV z!%09OVmfluL4yHiI#keAm99vj3+yz29{Q?>0y_S(yBttOm%c=F`6x`{Q|M)*@*SbS zfgz$2kz*kZ()I1ij{;Fmxy3{{p&Sg&6J@u4K&+F$1Cmokdp3RwdAl2*huD6Ohq45$ z-*W=7hjA6kwxGU3U-O5$4u7`Kn~DUn+_Hl`Ggms>H$Z05&@u3L{i<%d^Z;7Eh776u zF4^`&PaEFajozOyYiEo1vuzJpfibpko5fqx8VZcMN z9~O&&`QoFb2f<5tnw<1mTPlZTxB{>Af=u;CCI3u<1J=|DJ(tY zyf#HXjprE+Y%DH}s1!%u(-G(Dr*jMo9M?-_5suoiZEdFbv^wWL0Ioi`i%9(4T}XIX z^p5H(lLz3bll%)5MhE;n94{c-i|A&tS6MvTexN6cig5RRW}_TE zRmvUpDg6!Js8^XEu&&zK8;RW*kQ5O%tF3}g!Ccgk3A&lDq diff --git a/compiled/keccak.wasm b/compiled/keccak.wasm index ea9a67c26b14c97c8bec21aae7e8c6800a92609d..19c0802441a174717d79e8d4cd182c5ecd1df98a 100644 GIT binary patch delta 169 zcmdm@wNYzBJSXp-W|k}^7FS+I1xCjmlXE!TRd+PAm@#oEFgt>TII{vH1pPBn#t%$wqvS8D~uvS z!}UXpQ;UlAQ_4~%FB0%)0~*cU!m*iA@Hg{h0YNS%$32t(iAc(x?`Gi^OinCFOwKH+ TRLCz&ElSJDFJ}PR%*_A*;+Qf; delta 162 zcmdm}wMA<~JSXpgW|k}^7FS+I1xCj`lXE!TRrfTrm@#oEFgt>TII{v-t*RBn#t{$wqvS8Rt$GZ$$fUM+Z007(#F{l6l diff --git a/compiled/math.wasm b/compiled/math.wasm index 4cc50c5ac1a8ed48fee7cc288a969bfd902e3331..a075ec38e7687330f0ba8f16ef75754af7a13b92 100644 GIT binary patch delta 151 zcmZ2)zQ%mRJ|@PF&HI^{gn-l`5d}u>6Wp8(jtvbg+$|iNKZ-K4OcG<6{7Ew1R+*KN zL5+cd;Q|XILokp&$;`mO2&6rM;<8x8(}3a%F!9OLq@1~f^+StOi;DGA%2Fmjm-1#@ bJlR-Uhw)7+d4jtvbg+$|iNKZ-K4OcG<6{7Ew1R*jXB zL5+cd;Q|XILl}@g$;`mO2&8?0;<8x8GlAj?F!9OLq@4M}^fU5vQ}v7UiwY7Gizh#k e@@8B%*+5!{@yz5{X=TQjlN+VgSbMrzxETOPYb8Gb diff --git a/compiled/setter.wasm b/compiled/setter.wasm index 17a79eb4ea84fc4bdb52e2c03f02cf9a5a687f57..a8f36f7256bbb47b526063d42f5bc381178ebfac 100644 GIT binary patch delta 542 zcmZ8eEl&eM5S{((U5|!^Qu+y*J4(_zT63J|PO$cIV_D$x^%$xb{Jaz6Kt4!;XP?~WlDW#a=pzdegsL^b9>f6I23l!8+h^;F7Sw-i=l~)E50a zYbP2NY7sPE^;EfM^^AN>j_O)bU|0))6YwMwii%1Xz;6f)Vs%Y>Hq^{-y%DYyP3HxuhmX P*=^X&CSg5)37_RJtE*Kn delta 536 zcmXw0J#Q015S{(JJueo6ZNT<9c<$oDrbQ@%>J~&IL}T#_(nVVLXr|{n~>!fc(8yB3&Ls_zQ~yCO{A{VvArZ`@vr3B5WX+0dgfvS*ns$ zbteZ)8Olg9oX0|=t&3f5So#BE4IUIW5b^syD{KtF55ooTj6Y=fY"] [dependencies] pwasm-std = "0.10.0" -pwasm-ethereum = {} -bigint = {{ version = "4", default-features = false }} +#pwasm-ethereum = {} +pwasm-ethereum = {{ path = "/Users/dvd/dev/parity/pwasm-ethereum" }} +# bigint = {{ version = "4", default-features = false }} +# uint = {{ version = "0.3", git = "https://github.com/paritytech/parity-common", branch = "chore/pick-changes-from-bigint", default-features = false }} +uint = {{ version = "0.3", git = "https://github.com/paritytech/parity-common", rev = "97ecf175c", default-features = false }} parity-hash = {{ version = "1", default-features = false }} [lib] diff --git a/src/creator.rs b/src/creator.rs index 1e7c9cc..9669348 100644 --- a/src/creator.rs +++ b/src/creator.rs @@ -2,12 +2,15 @@ extern crate pwasm_std; extern crate pwasm_ethereum; -extern crate bigint; +extern crate uint; + extern crate parity_hash as hash; use pwasm_std::logger; use pwasm_ethereum::{input, ret, create, create2, value}; -use bigint::U256; +// use bigint::U256; + +use uint::U256; use hash::H256; #[no_mangle] diff --git a/src/externs.rs b/src/externs.rs index 058f95b..f9223c2 100644 --- a/src/externs.rs +++ b/src/externs.rs @@ -2,11 +2,13 @@ extern crate pwasm_std; extern crate pwasm_ethereum; -extern crate bigint; +// extern crate bigint; +extern crate uint; use pwasm_std::{Vec, write_u64}; use pwasm_ethereum::{self as ext}; -use bigint::U256; +// use bigint::U256; +use uint::U256; fn push_u64(buf: &mut Vec, val: u64) { let mut slc = [0u8; 8]; diff --git a/src/logger.rs b/src/logger.rs index fd981a5..c1f9ebf 100644 --- a/src/logger.rs +++ b/src/logger.rs @@ -2,11 +2,13 @@ extern crate pwasm_std; extern crate pwasm_ethereum as ext; -extern crate bigint; +// extern crate bigint; +extern crate uint; use pwasm_std::write_u32; use pwasm_std::hash::H256; -use bigint::U256; +// use bigint::U256; +use uint::U256; fn set_key_from_addr(key: u32, val: &[u8]) { let mut full_key = [0u8; 32]; diff --git a/src/math.rs b/src/math.rs index ebe3329..9b34da0 100644 --- a/src/math.rs +++ b/src/math.rs @@ -1,9 +1,12 @@ #![no_std] -extern crate bigint; +// extern crate bigint; +extern crate uint; + extern crate pwasm_ethereum; use pwasm_ethereum::{ret, input}; +use uint::U256; #[no_mangle] pub fn call() { @@ -12,8 +15,10 @@ pub fn call() { ret(&{ let code = input[0]; - let a_param: bigint::U256 = (&input[1..33]).into(); - let b_param: bigint::U256 = (&input[33..65]).into(); + // let a_param: bigint::U256 = (&input[1..33]).into(); + // let b_param: bigint::U256 = (&input[33..65]).into(); + let a_param: U256 = (&input[1..33]).into(); + let b_param: U256 = (&input[33..65]).into(); let result = match code { 0 => { a_param + b_param }, From e6e70911c9863f4d5cba2ddd8a8a51aebf68506b Mon Sep 17 00:00:00 2001 From: David Palm Date: Mon, 13 Aug 2018 15:52:18 +0200 Subject: [PATCH 2/3] Use uint --- compiled/creator.wasm | Bin 6325 -> 6724 bytes compiled/math.wasm | Bin 7084 -> 7465 bytes gen/main.rs | 13 +++++-------- src/creator.rs | 1 - src/externs.rs | 2 -- src/logger.rs | 2 -- src/math.rs | 3 --- 7 files changed, 5 insertions(+), 16 deletions(-) diff --git a/compiled/creator.wasm b/compiled/creator.wasm index af234e650cf3e2c2477d06fae396be7938c9281b..c4e30251a1ccb3f49289aae1b4a22b54b8dcb110 100644 GIT binary patch delta 2316 zcmb_dO-v+36t1fNnI3w2rh(yCSYG$S3J1kC2p8kh7)&-BT@OM`Ruc#yGPtk;f+oxM zf`kzDz@`&V9*CM~VmOgKxiNd#lQEt=d6C3DdNp25@O#zW151o2XOga}SM~nB_r0q7 zmmdx7|5OdgmX2MtO=&xhX_>aL#l7DydqLRSM^ANiUu^jC5+&X8iuZWitc7CS6C|VK zWI^`4_+ZQQi-dK*Dh(@9k}kGHzdGJFhgAu4vxZNp7VUj%M!)dkC_j9hJd$t8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J3<${22-lV33{)pRq+_|~YN4U&|@$_d%7u?aK^;w1HKk5Lb zcYd6&=dcbwH69STv+wu2tGLj&5jymasg9BCKyj}b_*M=Lk$ccE)#0B#9rR!pg5k?u z0?DAD0!kZaK^%|=r^X}fnan!@zYqup?V#LPQ!FzC`dO}A&3e1#fFyzX?Ha# zK~=~oQ3(MC?l__f1z~&W@Kh2qUYSh_Q?rVpOl8ogc9lvnhy&oYL@y>8aAlr=G8(@} z0TZ@)wXxiN!EaRP&$XlW!zrkUjD;fdO zsAjkEfdOTTOH^1*f*+$+`s9JNV;l#}GyqfA9izSmDR!E|@O~@d{+pk38?cc3rNn;m zSjCd_i!cQ1e81!HhAxC zblGP7wR4a0solfw)%l~|z$;1G0$yRGn=tVZj}^#)GnVCH{XX6{IyQVq4Z|2U$p>CoUtYX||MILfrrHbd zU0QE8PPf-o`Z-oc8w|Hd;7}i#>$OT-)lA+(=WdK^3^LZHydYP{QlIH#p{bVJEvYc z{nF_(f_xiOk@)MMd*Sm7Yv9~jT)9ct78aMAS6`u*=mk1UKYW$emKPh%)A$$I15W1nNe*+GEli{6}+wDtN7CUPcze;EDuZa)6Q2h(+i~ETH diff --git a/gen/main.rs b/gen/main.rs index ddb4b11..1e4b6e5 100644 --- a/gen/main.rs +++ b/gen/main.rs @@ -4,8 +4,8 @@ use std::path::PathBuf; fn main() { let args = env::args().collect::>(); let (file_name, pwasm_ethereum_version) = match args.len() { - 2 => (&args[1], r#""0.6.1""#.to_string()), - 3 => (&args[1], format!(r#"{{ git = "https://github.com/paritytech/pwasm-ethereum", features = [{}] }}"#, args[2].split(",").map(|s| format!(r#""{}""#, s)).collect::>().join(", "))), + 2 => (&args[1], r#""0.6.2""#.to_string()), + 3 => (&args[1], format!(r#"{{ version = "0.6.2", features = [{}] }}"#, args[2].split(",").map(|s| format!(r#""{}""#, s)).collect::>().join(", "))), _ => { println!("Usage: {} gen ", args[0]); return; @@ -20,12 +20,9 @@ authors = ["NikVolf "] [dependencies] pwasm-std = "0.10.0" -#pwasm-ethereum = {} -pwasm-ethereum = {{ path = "/Users/dvd/dev/parity/pwasm-ethereum" }} -# bigint = {{ version = "4", default-features = false }} -# uint = {{ version = "0.3", git = "https://github.com/paritytech/parity-common", branch = "chore/pick-changes-from-bigint", default-features = false }} -uint = {{ version = "0.3", git = "https://github.com/paritytech/parity-common", rev = "97ecf175c", default-features = false }} -parity-hash = {{ version = "1", default-features = false }} +pwasm-ethereum = {} +uint = {{ version = "0.3", default-features = false }} +parity-hash = {{ version = "1.2.2", default-features = false }} [lib] name = "$file_name" diff --git a/src/creator.rs b/src/creator.rs index 9669348..0895ebf 100644 --- a/src/creator.rs +++ b/src/creator.rs @@ -8,7 +8,6 @@ extern crate parity_hash as hash; use pwasm_std::logger; use pwasm_ethereum::{input, ret, create, create2, value}; -// use bigint::U256; use uint::U256; use hash::H256; diff --git a/src/externs.rs b/src/externs.rs index f9223c2..87f9b53 100644 --- a/src/externs.rs +++ b/src/externs.rs @@ -2,12 +2,10 @@ extern crate pwasm_std; extern crate pwasm_ethereum; -// extern crate bigint; extern crate uint; use pwasm_std::{Vec, write_u64}; use pwasm_ethereum::{self as ext}; -// use bigint::U256; use uint::U256; fn push_u64(buf: &mut Vec, val: u64) { diff --git a/src/logger.rs b/src/logger.rs index c1f9ebf..001470d 100644 --- a/src/logger.rs +++ b/src/logger.rs @@ -2,12 +2,10 @@ extern crate pwasm_std; extern crate pwasm_ethereum as ext; -// extern crate bigint; extern crate uint; use pwasm_std::write_u32; use pwasm_std::hash::H256; -// use bigint::U256; use uint::U256; fn set_key_from_addr(key: u32, val: &[u8]) { diff --git a/src/math.rs b/src/math.rs index 9b34da0..204715a 100644 --- a/src/math.rs +++ b/src/math.rs @@ -1,6 +1,5 @@ #![no_std] -// extern crate bigint; extern crate uint; extern crate pwasm_ethereum; @@ -15,8 +14,6 @@ pub fn call() { ret(&{ let code = input[0]; - // let a_param: bigint::U256 = (&input[1..33]).into(); - // let b_param: bigint::U256 = (&input[33..65]).into(); let a_param: U256 = (&input[1..33]).into(); let b_param: U256 = (&input[33..65]).into(); From 7fbde16e7ffba50035ba4fa45fb35029c3ec844b Mon Sep 17 00:00:00 2001 From: David Palm Date: Mon, 20 Aug 2018 20:02:54 +0200 Subject: [PATCH 3/3] Need pwasm-ethereum 0.6.3 --- gen/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gen/main.rs b/gen/main.rs index 1e4b6e5..4bf6fe2 100644 --- a/gen/main.rs +++ b/gen/main.rs @@ -4,8 +4,8 @@ use std::path::PathBuf; fn main() { let args = env::args().collect::>(); let (file_name, pwasm_ethereum_version) = match args.len() { - 2 => (&args[1], r#""0.6.2""#.to_string()), - 3 => (&args[1], format!(r#"{{ version = "0.6.2", features = [{}] }}"#, args[2].split(",").map(|s| format!(r#""{}""#, s)).collect::>().join(", "))), + 2 => (&args[1], r#""0.6.3""#.to_string()), + 3 => (&args[1], format!(r#"{{ version = "0.6.3", features = [{}] }}"#, args[2].split(",").map(|s| format!(r#""{}""#, s)).collect::>().join(", "))), _ => { println!("Usage: {} gen ", args[0]); return;