Can someone point me to where the state root is updated after each transaction is executed in the block? This is for Aleth


I found it myself:

template <class DB> void GenericTrieDB<DB>::insert(bytesConstRef _key, 
bytesConstRef _value)
std::string rootValue = node(m_root);
bytes b = mergeAt(RLP(rootValue), m_root, NibbleSlice(_key), _value);

// mergeAt won't attempt to delete the node if it's less than 32 bytes
// However, we know it's the root node and thus always hashed.
// So, if it's less than 32 (and thus should have been deleted but wasn't) 
then we delete it here.
if (rootValue.size() < 32)
m_root = forceInsertNode(&b);
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.