Questions tagged [storage]

all questions regarding data and storage on the ethereum blockchain

70 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
6
votes
1answer
256 views

What filesystem should I use for geth and leveldb?

I used old LGA775 machine for running geth node. Its mobo has older sata 3gb/s (benchmark showed that ssd bottlenecked there) and only 4gb of DDR2, with windows installed. So syncing is a real pain ...
4
votes
1answer
671 views

Reset all values in a mapping

I am trying to figure out how to have the balance of all players reset to (amount) when a certain condition happens. This is the function that will update a specific player balance. How do I make it ...
3
votes
2answers
26 views

Set and delete storage variable in same tx

I did some poking around and didn't see an answer... and I figure someone knows this off the top of their head. Question: what is the gas cost associated with setting and deleting a storage variable ...
3
votes
1answer
92 views

How to download the blockchain of a single ethereum contract’s address?

The blockchain required to run ethereum is several Terabytes large. This means more than 9 years would be required to download it with my connection speed. In my case, I just want to know if the ...
3
votes
3answers
845 views

How to handle dynamic size string array in solidity?

I have a shop owner and a shop owner can have multiple products. I want to keep the products id in an array. Also, A public method can return all the product id list of a shop owner. I tried the ...
3
votes
1answer
75 views

CALL always throws exception on SSTORE

this.call(bytes4(keccak256("setGBA(uint32)")), 12); How to call function by string name? I can't modify store in function. How to do this?
3
votes
1answer
708 views

Regarding external file storage

Let's say you have a private blockchain, a DApp with an workflow to store and retrieve data from that blockchain. Now there is a need to store binary files and access it in a permissible way. One way ...
2
votes
0answers
29 views

Most efficient way to get all non-zero storage locations for a smart contract?

I'm looking at a mainnet smart contract and want to figure out all storage positions/slots where the storage has a non-zero value. Is there a way to do this other than replaying and tracing all ...
2
votes
0answers
90 views

Can we use Ethereum Swarm to store normal data other than blockchain or dapp data.

I want some basic data to be stored like name and city phone no etc.So just want to ask can I use ethereum swarm just to store file and make several node to create decentralized storage.
2
votes
0answers
73 views

Plasma: how were the UTXO bitmaps conceptualised and how will they be stored?

From the white paper, page 5: We construct an interactive game whereby the exiting party attests to a bitmap of participants’ ledger outputs arranged in an UTXO model which requests a ...
2
votes
0answers
110 views

What is a cheap way to store mnemonic generator list of 1024 words in smart contract?

What is the cheapest way to store a list of 1024 words for a mnemonic generator, and why? These ideas had a gas cost of 165720 GAS for a string array, and 42300 GAS for storing all the words in a ...
2
votes
0answers
204 views

Decentralized File Storage on Ethereum white paper

I am reading white paper of Ethereum, and I am confused by this example of the Section. Decentralized File Storage, which is part of the Section. Applications: The key underpinning piece of such a ...
2
votes
1answer
84 views

Decentralized Data Storage for IoT using Sia

For my Master research I want to make a proof-of-concept of decentralized data storage for an IoT scenario. My idea is to receive measurement values from a raspberry pi and to store them using sia. I ...
2
votes
0answers
146 views

Getting complete storage of a contract using geth client

I found at here, that it is possible for a client to get the value from storage of a contract at a particular index using eth.getStorageAt(contract_address, index) interface. I wanted to ask Is it ...
2
votes
0answers
75 views

Is it possible for a mapping to run out of space?

Can storage mappings in a contract run out of space? Say that mapping was keyed to an address and the value as the following struct: User bytes32 name uint8 age Theoretically, if there was a ...
2
votes
2answers
149 views

Possible to search swarm or blockchain?

I'm getting my feet wet in this blockchain world and looking to build a dapp based on Ethereum for maintaining an inventory of products. About 400,000 items that can be updated, removed or added to by ...
2
votes
0answers
151 views

Extremely slow sync after moving to external drive (macOS; thunderbolt)

I was getting low on disk space so I decided to move the blockchain to an external drive with thunderbolt. I did it using Method 2 from this answer: In Mist browser how can I move the data (blockchain)...
2
votes
0answers
157 views

Global storage array - setting length on declaration vs inside a function

I have a global storage array of 64 entries, which I declare as follows: uint256[64] globalArr; However, its length really depends on a constant variable in my code: uint8 constant MAX_VAL = 63; ...
2
votes
0answers
182 views

In a private blockchain network, can we delete the first N blocks and reassign the N+1th block as the genesis block?

I am aware of the data loss caused by deleting the first N blocks. But I am curious to know whether such a task is possible or not. If so, how to practically implement it? ( I am using go-ethereum. ...
1
vote
3answers
120 views

Can the mapping storage change after contract deployment?

I am beginner in mapping.I work on Truffle and Ganache. I deploy the following contract: pragma solidity ^0.5.12; contract customerFinder{ mapping(uint256 => address payable) public ...
1
vote
1answer
24 views

arrays and structs for function arguments

A lot of contracts and libraries with functions that use arrays and structs for arguments. Structs can themselves include arrays, structs and mappings. For example: function doSomething(MyStruct ...
1
vote
0answers
11 views

What are the rules on persisting old transactions?

If a new node joins the network and attempts a full sync, it requires all transaction information from genesis to build up its chain state. To do this the transactions it receives must be the ...
1
vote
0answers
27 views

Why is an address changing when I add it to an array?

I'm encountering a memory / storage issue (I think) w/ an array of addresses where I want to swap out one address with another. Here's how I've initialized the array: address[] public maintainers; ...
1
vote
1answer
47 views

How the data management is done in Ethereum blockchain?

Anyone who have a good idea about ethereum blockchain storage can send me some docs to get a good idea for myself? i am in a full confused state.
1
vote
0answers
48 views

Gas cost of adding an item to a class-level (storage) array

I would like to make sure that the gas cost of adding an item to a (storage) array is constant, i.e., not dependent on the length of the array. To my understanding, the relevant EVM operation is ...
1
vote
0answers
60 views

How can I create array of array contains characters with solidity

I recently approached the Smart contract two days ago. I'm still learning about it, and I have a lot of difficulties. Can you help me to create a variable like this photo? It has a arrays of numbers ...
1
vote
0answers
34 views

How to check last block in which storage variable was modified?

I am looking for method to quick chceck in which block variable was modified last. Assuming I have geth database synced in archive mode, that means I have all previous world states tries and accounts ...
1
vote
0answers
30 views

Best way to restore historical storage state

What is the best way to get historical storage state, given db with current world state and blockchain data? Do I need to reverse assemby code or can I do this using receipt logs?
1
vote
0answers
53 views

Can Factory Contract Be Used As Parent/Child Function?

I am attempting to modify the contract below; the way it is set up at the moment is so that the contract can be deployed, and then anytime a user wants to create a campaign, they can do so without ...
1
vote
0answers
149 views

how distributed cloud storage works with ethereum blockchain?

Distributed Cloud storage is a great concept , I have been doing a lot of search on this topic but couldn't get the exact information i am looking for:- How the projects like Storj are using the ...
1
vote
0answers
32 views

Miss aligned state loading/storing gas costs

For a smart contract idea that spins around in my head, I have the situation where I have to conserve the old values of a variable (no storage refund or cheaper SSTORE updates). As the value I write ...
1
vote
0answers
42 views

Share private data and prevent data forwarding

Let's say A has some private medical records of patients and B is a pharmaceutical company who wants to view medical records from A to find out the effect of a particular drug on the patients (run a ...
1
vote
1answer
384 views

Where do you save the application data of a Dapp?

Let's say that I want to implement a Dapp similar to Facebook. Each user has its own profile, pictures and information. Usually you would use a database to store all this data. This guarantees that ...
1
vote
0answers
89 views

Uncle blocks and their Relationship to Chain Size

How much do uncle blocks affect the overall chain size? Is the amount of added security they provide for the chain comparable to how much extra data they add to the chain? If, for some reason, all ...
1
vote
2answers
235 views

How can I persist an assignment to a struct in a mapping?

The following is a simplification of the problem I'm facing; pragma solidity 0.4.18; contract ValueSetter { struct BasicValue { uint256 value; } address my_address; // Just for the ...
1
vote
0answers
106 views

EVM Assembly tags

Studying the Solidity optimizer, I found that the assembly code is divided into tags and the optimizer doesn't work between them: It splits the sequence of instructions into basic blocks at JUMPs ...
1
vote
0answers
61 views

Where in the compile process do storage indexes get assigned to variable names and where can I sniff that data?

I have found the articles explaining how storage works and I understand that if I have a mapping that I need to know the key. What I'm trying to do is figure out how given, solidity code, abi, and ...
1
vote
0answers
47 views

All variables in the Storage

I am a newbie at Ethereum, could you clarify one question. Is it possible to see all variables within Storage of the Contract? If I don't know how many variables it has and want to see the list of ...
1
vote
0answers
68 views

How do I verify the integrity of my local chainblock data?

If I suspect local data corruption, is there a way to verify that my blockchain data is valid and will not affect my Ethereum work and transactions? Example: I switched to a self-compiled version of ...
1
vote
1answer
188 views

Looking for help with designing a private Ethereum blockchain to store information

I would like to be able to store a history of an object on a private chain and have it update-able via a website.It needs to hold public information and some hashed links to an external database. Just ...
1
vote
0answers
298 views

Downloading Mist Chaindata to a New Storage Device

The computer I am working on has an SSD and HDD. The Chaindata was originally set to download to the SSD, but the SSD has run out of storage. The computer is running Mist; how can I either (1) move ...
0
votes
0answers
14 views

Clarification on how Calldata persists on the blockchain and how Optimistic Rollups use it

So I see that a lot of optimistic rollup solutions say that they store the chain's transaction data on Ethereum via "calldata" which is way cheaper in gas costs than contract storage (I ...
0
votes
0answers
16 views

Storing Struct inside an array. Help Please

I am designing an EHR System that will store patient records (with a unique ID) and separated by the date and Hospital entered. I am able to enter data in Hospital struct mapping to the Record struct, ...
0
votes
0answers
21 views

Making sure a string (input/output) is less then 64 characters

I'm working though some basic solidity tutorials using remix. I'm having trouble with the concept that there is no way to edit a string built into the language. In other programing languages I would ...
0
votes
0answers
15 views

Performance of Dapps when millions of records to be fetched

I am thinking of Dapp with react js and ethereum. Using IPFS for data storage. Let's assume that blockchain holds millions of hash addresses from IPFS. I need to show those millions of records and ...
0
votes
0answers
18 views

Type struct Mycontract.User memory is not implicitly convertible to expected type struct Mycontract.User storage pointer

pragma solidity >=0.5.0 <0.7.0; contract Mycontract{ uint256 a; struct User { string name; } User[] users; function foo() public{ **User storage user=User("hey&...
0
votes
1answer
21 views

When using mapping, why use an address over bytes32?

From an end user standpoint, they will never want to use the address for searching for mapped data when they could just submit a username for function parameters, so is there any specific reason why ...
0
votes
0answers
12 views

Data storage : mapping vs sub contract deployment

I read over few website, tutorials and answered question here on SE. There is a huge warning about deploying new contract just to store datas. i.e. : bad uint256 public amount; bool public isAdmin;...
0
votes
0answers
35 views

Storing data directly on chain

Im trying to store data directly on the blockchain, not on a smartcountract as they have a limit of what they can handle and it would slow down the chain to go above the limit. My initial plan is to ...
0
votes
0answers
33 views

ERC20 balance Storage Address key - how to tell which key belongs to which wallet address

I am trying to derive changes of account storage by mapping accounts (here, the accounts represent the key address in the ERC20 balances mapping mapping(address => uint256)) to their corresponding ...