Questions tagged [memory]

Questions related to memory use in Solidity or by nodes

29 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4
votes
3answers
407 views

convert bytes to uint8[8] using mstore()

I know how to convert bytes to uint8[8] using mload but mstore seemed like it could be more gas efficient. Is something like this possible? function bytesToUintArray(bytes input) returns (uint8[8])) ...
4
votes
1answer
375 views

personal.newAccount(“mypassword”) stops the server when i create two accounts consecutively in local privatenet

personal.newAccount("mypassword") stops the server when i try to create two accounts one after the another. personal.unlockAccount(eth.accounts[0],"mypassword"); same happens when I try unlock ...
3
votes
0answers
180 views

Quorum failure - Failed to decode message from payload

We use in our project -JP Morgan Quorum (Ethereum based) bloackchain - with istanbul voting mode. We have 4 nodes (3 of them are validators - hard coded, nonchangable) And from time to time (...
2
votes
0answers
31 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
367 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
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
0answers
78 views

Assembly operations throw warnings during compiling

Leveraging the following common string utility has been quite helpful, but would like to get rid of a warning: function stringToBytes32(string memory source) returns (bytes32 result) { assembly ...
2
votes
0answers
59 views

How does a plot “Gas price to call / memory allocated” looks like?

Pretty simple question: i.e. I have a dummy contract like this one: contract simple { uint[] dataArray; function push_one_more() { dataArray.push(1); } } How does the cost of ...
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
57 views

Private Ethereum PoA error: “out of memory”

I'm working with multi node setup on Ethereum private chain PoA. We have all three validator nodes. blockchain ├── genesis.json ├── node1 │ ├── geth │ ├── keystore │ ├── ...
1
vote
0answers
114 views

What is the default cache value of Geth?

According to the help page of Geth, --cache value defines Megabytes of memory allocated to internal caching (default = 4096 mainnet full node, 128 light mode) (default: 1024) I don't quite get it, is ...
1
vote
0answers
21 views

Calling private function from external - where are referenced type parameters stored in the end?

Let's assume we have something like: contract C { function externalFunction(uint256[] calldata data) external { privateFunction(data); } function privateFunction(uint256[] memory data)...
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
0answers
41 views

How to get live mempool transactions whitout full blokchain

I just want to analyse all mempool txs in realtime. I cant use an api because after several requests my ip gets blocked for some minutes, so I dont get the txs in this time. Thank you for help.
1
vote
0answers
42 views

getLogs RPC makes filters?

I am stuggling with memory explosion issue of Parity on my EC2 instance. The memory usage of it keeps increasing gradually. I suspect that getLogs API call makes some garbage on the node. But I ...
1
vote
1answer
10k views

GPU'S Failed cannot create DAG

Last night everything is fine and then this morning I check my mining its's closed I think it was restarted or close accidentally then when I open my pool I have this error. ETH: 5 pools are ...
1
vote
0answers
52 views

Solidity VM memory management

I'm trying to do an external function call in assembly. So I have to prepare a memory area that store the input args. But where's the address that I should start with mstore? I mean, there are some ...
1
vote
0answers
27 views

How load out data from blockchain when it occupies too much space?

If the blockchain working long enough it fills the memory of the mining device, how to load out the data and then rerun the system? and why does my mining device has different miner address every time ...
1
vote
1answer
3k views

Memory usage and limits for go-ethereum

geth (and swarm) seem to require a lot of memory, and there are also reports that they tend to an all you can eat approach to system limits. 1) What are the actual memory requirements for geth? 2) ...
1
vote
0answers
287 views

For what data does Ethereum use Memory Database, and for what does it use Level Database

Ethereum uses two databases Memory database and Level Database. Is data stored in MemoryDatabase different than LevelDb? In what cases is one database used over other? The question is different from -...
1
vote
0answers
566 views

Extreme memory consumption by geth

I'm using geth's traceTransaction() API to index certain opcodes that are used in transactions. When I request traces from some transactions (e.g. ...
0
votes
0answers
10 views

Is it possible to get HMM (Heterogeneous Memory Management) to work with GPU's mining Ethereum? Trying to use low memory cards

Many GPU's are capable of doing the computing for Eth, but they lack the GPU memory to actually hold the DAG file. It seems like HMM (Heterogeneous Memory Management) may be able to resolve this issue,...
0
votes
0answers
25 views

How store memory array in storage

In this code, I want to send an array of bytes32 and store them in the struct but I get the error which is TypeError: Type string memory[8] memory is not implicitly convertible to expected type ...
0
votes
0answers
24 views

Storage vs Memory in the context of Gas Cost

I have two snippets -- one using memory, the other referencing storage: function winnerName() public view returns (string memory winnerName_) { string memory winnerName_ = ...
0
votes
1answer
121 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
46 views

Memory Arrays Should Have Push() And Pop()

Dynamic memory arrays currently cannot be resized. This is true for Solang and solc solidity. However, Solang uses a heap, and has a realloc() function. Thus it is is possible for Solang to support ...
0
votes
0answers
16 views

How to save/read mappings within struct?

I am trying to create a mapping inside struct and then create a mapping of the struct. Take a look at below example: // ------------------------------------------------------------------------ ...
0
votes
0answers
1k views

FATAL ERROR: Rebalance Allocation failed - process out of memory

So while running truffle compile for my contracts on AWS Ubuntu server I got the following error: <--- Last few GCs ---> [17055:0x3985730] 11958 ms: Scavenge 511.7 (553.4) -> 506.9 (553.4) ...