Is it possible to append some data directly onto the state?


In the tutorial example, when adding a new address to MILLIONAIRES, get all the millionaires, append the new one to them, and override the current state. I think in the case that the data is large, it seems memory consuming. The best would be to be able to append directly to the state, rather than overriding the entire state. Does enigma protocol provide such a functionality? Or is it technically implausible?

fn add_millionaire(address: H160, net_worth: U256) {
        let mut millionaires = Self::get_millionaires();
        millionaires.push(Millionaire {
        write_state!(MILLIONAIRES => millionaires);

Good questions @KanaGold.

@taariq added it to our dev help issues to make sure you get some feedback on this from the team!

INFO: I just saw @ainsley’s comment in another post that the secret contract state is handled using RocksDB (embeddable persistent key/value store for fast storage environments): There’s also a rust crate for rocksdb (approx. 42kb). Perhaps that’s an option, using rocksdb’s get, put, delete operations … but maybe wait to hear from the team because I don’t know if this is advisable.


@laura thanks! I gonna wait for their comment!

1 Like

Hi @KanaGold!

@ainsley posted a response to a similar question here: Large scale data architecture?

I think you’ll find it interesting!