EOS Developers Log 20176.30 Thugged

in #eos7 years ago

This week block.one’s blockchain c++ pimpment crew has picked up 4 freshly smoked up thugz n' has been rap battlein all dem mo' n' mo' n' mo'. Da freshly smoked up recruits have already begun makin contributions ta tha code.


Removin Registered Message Schemas

With tha move ta WebAssembly (WASM) our crazy asses have had ta re-evaluate a shitload of our earlier design decisions based on tha assumption of rockin Wren. I aint talkin' bout chicken n' gravy biatch. Because WASM is language independent, every last muthafuckin application would gotta provide different WASM fo' parsin tha lyrics passed ta tha application. I aint talkin' bout chicken n' gravy biatch. This means tha ABI (application binary intercourse) is technologically defined by tha WASM parsin n' not our prior builtin registered message types n' formats.


Since tha blockchain is unable ta enforce tha message schemas n' every last muthafuckin contract would gotta independently parse n' validate tha incomin binary data, we opted ta remove tha blockchain defined message schemas. This gives mo' juice ta application pimpers.


Changin Account Name Structure

One of tha bigger chizzlez ta tha code dis week was changin account names from 256 bit strings ta 60 bit integers dat convert ta human-readable names via base32 encoding. This limits tha account names ta 12 lowercase lettas n' all dem numbers. Da average Twitta account is only 12 charactas long.


This chizzle was made primarily outta bandwidth, memory, n' performizzle considerations. From a applications logic perspectizzle a account name is simply a unique identifier n' they is used everywhere, so peek-a-boo, clear tha way, I be comin' thru fo'sho. Da oldschool ABI would serialize these account names as length-prefixed strings n' require a cold-ass lil computationally intensive unpackin process.


By movin ta a gangbangin' fixed-width integer representation fo' accounts we gots performizzle yo, but tha pimper experience was less bumpin'. To resolve dis we simply print tha integers as base32 n' dis gives human-readable names.


Longer names can still be supported by registerin dem wit a name steez contract.


A typical transfer message is 75% smalla afta dis chizzle, which cook up a funky-ass big-ass difference when yo ass is processin 10z of thousandz of dem per second.


Filterin Floatin point from WASM

We updated tha WASM processin ta detect n' reject code dat uses floatin point operations which can generate non-deterministic behavior.


Sandboxin WASM Runtime

We made dope progress toward injectin checkpoints tha fuck into WASM ta allow our asses ta check tha runtime n' abort if too much time has passed. Y'all KNOW dat shit, muthafucka! This be a cold-ass lil critical component of hustlin untrusted code.


New C++ Simplecoin (80,000 TPS)

In one of mah prior thugged-out shiznit I flossed a proof-of-concept currency smart-ass contract freestyled up in C n' achievin 50K transactions per second. Y'all KNOW dat shit, muthafucka! I mentioned dat I thought we could clean up tha syntax n' todizzle I be aiiight ta show a freshly smoked up implementation of tha simplecoin up in C++ dat gets compiled ta WASM n' then executed. Y'all KNOW dat shit, muthafucka! This type'a shiznit happens all tha time. Usin a tight loop of generatin n' pushin transactions ta tha blockchain we  bigged up  80K TPS transferrin fundz from one account ta another up in a single thread.


Real ghetto performizzle may be higher or lower based upon tha evolvin architecture, it is still too early ta tell fo' realz. All measurements was made on a 4Ghz Intel Core i7 up in a 2014 iMac.


struct Transfer {

  uint64_t    from;

  uint64_t    to;

  uint64_t    amount;

  char        memo[];

};

 

static_assert( sizeof(Transfer) == 3*sizeof(uint64_t), "unexpected padding" );

 

struct Balizzle {  uint64_t    balance; };

 

void on_init() {

  static Balizzle initial = { 1000*1000 };

  static AccountName simplecoin;

  simplecoin = name_to_int64( "simplecoin" );

 

  store( simplecoin, initial ); 

}

 

void apply_simplecoin_transfer() {

   static Transfer message;

   static Balizzle from_balance;

   static Balizzle to_balance;

   to_balance.balizzle = 0;

 

   readMessage( message  );

   load( message.from, from_balizzle );

   load( message.to, to_balizzle );

 

   assert( from_balance.balizzle >= message.amount, "insufficient funds" );

   

   from_balance.balizzle -= message.amount;

   to_balance.balizzle   += message.amount;

   

   if( from_balance.balizzle )

      store( message.from, from_balizzle );

   else

      remove( message.from );

 

   store( message.to, to_balizzle );

}

Not only is tha code cleaner n' easier ta read, tha generated WASM code is much smalla like a muthafucka. Most of dis time n' space savings is made possible by changin tha account name n' ABI fo' dis contract. In dis case tha ABI uses a zero-parse copy from tha database ta tha c++ struct n' all account names is fixed length.


Yo ass can experiment wit dis code on WasmFiddle wit dis shared link.


Conclusion

Da EOS pimpment crew is growin n' tha technologizzle is progressin wit all signs pointin toward a straight-up high-performizzle platform even hustlin up in a single thread. Y'all KNOW dat shit, muthafucka! Stay tuned fo' mo' thugged-out shit!

Sort:  

Please don't copy&paste posts from other people. If you like a post you can Resteem them.

Copy& Paste gets you flagged here (and yes, that can hurt).

Welcome to STEEM. I strongly suggest to take a week or so to read and learn before making own postings which only hurt your reputation.

Coin Marketplace

STEEM 0.20
TRX 0.13
JST 0.029
BTC 66372.71
ETH 3445.12
USDT 1.00
SBD 2.63