1

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

1

I found it myself:

template <class DB> void GenericTrieDB<DB>::insert(bytesConstRef _key, 
bytesConstRef _value)
{
std::string rootValue = node(m_root);
assert(rootValue.size());
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)
    forceKillNode(m_root);
m_root = forceInsertNode(&b);
}

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.