Questions tagged [storage]

all questions regarding data and storage on the ethereum blockchain

85 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
7
votes
1answer
657 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
1k 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
40 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
441 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
1k 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
0answers
176 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 ...
3
votes
1answer
76 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
721 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
17 views

Running Geth full node + archiving on tiered storage possible?

I'm trying to run a geth full node with archiving for development\learning and custom analytics. I have a physical Windows server running HyperV where I carved out the following VM specs: 24 vCPUs ...
2
votes
0answers
25 views

Why `array[array.length] = elem;` fails for appending to a dynamic storage array in Solidity?

Consider the following contract: pragma solidity ^0.8.0; // SPDX-License-Identifier: WTFPL contract Demo { uint256[] public numbers; function append(uint256 num) public { ...
2
votes
1answer
34 views

Problem when accessing variables in Storage geth

I found some contract that looks like this: // SPDX-License-Identifier: MIT pragma solidity 0.8.2; contract IceCream { address a; address b; bool public c = false; uint256 public d; ...
2
votes
1answer
58 views

What prevents the blockchain from being poisoned by copyrighted or illegal data?

It's possible to store data in smart contracts, and with the recent explosion of NFTs this is happening a lot. A couple of hundred kB is more than enough to encode copyrighted material - e.g. the text ...
2
votes
0answers
43 views

How to initialize storage for smart contracts in the genesis block

I have a simple smart contract that will be added as part of genesis block. Need to initialize the field "message" with default value as constructor is not executed as part of genesis block ...
2
votes
0answers
30 views

How to store array parameter of a function to contract state?

I am trying to save an invoice to contract storage (see function addNewInvoice(..)) but I seem to be tripping over the data locations. // SPDX-License-Identifier: private pragma solidity >=0.7.0; ...
2
votes
1answer
289 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&...
2
votes
0answers
33 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
99 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
77 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
122 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
216 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
0answers
44 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 ...
2
votes
1answer
89 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
84 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
173 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
155 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
158 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
0answers
15 views

How to give an array in storage value from an array from a function's input parameters

Below is the code that I have: struct Cow{ uint age; uint name; } Cow[] cows; // this is the code I am trying below. function createCows(Cow[] memory _cows) public { cows =_cows; } When ...
1
vote
0answers
32 views

Saving String Memory Argument to Struct Array

I have the following Solidity code that compiles and tests okay, but the insurancePlan property of the Patient struct is not being saved. I've tried many variations and it is just blank (empty) when I ...
1
vote
0answers
12 views

What is the relationship between the size of the data saved by the smart contract and the size of the actual computer storage resource consumption?

I want to know, for example, I am passing 1KB of data to the function in the smart contract, and save the 1KB data in the smart contract through the storage variable. I want to know how much storage ...
1
vote
1answer
46 views

Storing name values off-chain in events and web3.js

Somewhere I read the advice to store name (title, geographical name, people name, etc.) value off-chain in events. But if a value is stored in an event, is there an efficient way to retrieve its ...
1
vote
1answer
26 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
12 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
51 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
52 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
65 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
35 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
31 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
59 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
151 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
34 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
1answer
534 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
90 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
291 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
109 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
83 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
189 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 ...