Skip to content

Commit

Permalink
Work around xDAI eth_getProof implementation bugs.
Browse files Browse the repository at this point in the history
  • Loading branch information
saurik committed Jul 30, 2024
1 parent ae93241 commit 46032fa
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions eth-sender/source/scan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,20 @@ task<void> Scan(const Brick<32> &root, Code_ &&code, Each_ &&each) {
auto check(root);

const auto proofs(co_await code(preimage));
for (size_t i(0); i != proofs.size(); ++i) {
for (size_t e(proofs.size()), i(0); i != e; ++i) {
const auto data(Bless(Str(proofs[i])));

// XXX: xDAI returns a... "terminating" 0x?!
if (data.done()) {
orc_assert(i == e - 1);
break;
}

const auto here(hash.substr(0, offset));
done.emplace(here);
todo.erase(here);

const auto data(Bless(Str(proofs[i])));
orc_assert(HashK(data) == check);

const auto proof(Explode(data));
switch (proof.size()) {
case 2: {
Expand Down

0 comments on commit 46032fa

Please sign in to comment.