Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(BEDS-536): implement misc fix-internal-txs-from-node cmd with batch processing from Erigon node #2967

Conversation

Monika-Bitfly
Copy link
Collaborator

@Monika-Bitfly Monika-Bitfly commented Oct 18, 2024

Changes:

  • introduce fix-internal-txs-from-node command for reindexing internal txs within a specified block range
  • utilise batch calls to Erigon node for improved speed during data retrieval:
    • execute three RPC calls for each block:
      • eth_getBlockByNumber
      • eth_getBlockReceipts
      • trace_block

@Monika-Bitfly Monika-Bitfly changed the title feat(BEDS-536): implement misc fix-internal-txs cmd with batch processing from Erigon node feat(BEDS-536): implement misc fix-internal-txs-from-node cmd with batch processing from Erigon node Oct 18, 2024
db/bigtable_eth1.go Outdated Show resolved Hide resolved
rpc/erigon.go Outdated Show resolved Hide resolved
rpc/erigon.go Outdated Show resolved Hide resolved
rpc/interfaces.go Outdated Show resolved Hide resolved
rpc/erigon.go Outdated Show resolved Hide resolved
rpc/erigon.go Outdated Show resolved Hide resolved
@Monika-Bitfly Monika-Bitfly merged commit 20a211e into BEDS-536/fix-internal-transfer-merge Oct 23, 2024
@Monika-Bitfly Monika-Bitfly deleted the BEDS-536/fix-internal-transfer-v2 branch October 23, 2024 16:50
Tangui-Bitfly pushed a commit that referenced this pull request Jan 22, 2025
…batch processing from Erigon node (#2967)

* wip: move itx status parsing logic to transformers func

* wip: implementing fix-internal-txs misc cmd

* wip: updated geth client initialisation

* wip: moved blocks by batch logic to erigon.go

* wip: updated block by number batch call

* updated blocks batch processing

* feat: added transformers for bulk mutations

* fix: save current block height in local variable when performing mutation of the block data

* fix: add check for start and end block flags

* fix: updated erigon client

* fix: add check for batchcall size and return if it's empty

* cleanup unused code

* cleanup

* updated cmd name to fix-internal-txs-from-node

* fix: uncles, blobGasUsed & excessBlobGas parsing

* rm timings, update GetBlocksByBatch func

* fix: revised ReindexITxsFromNode func logic

* fix: update the logic for parsing uncles, BlobGasUsed and ExcessBlobGas
guybrush added a commit that referenced this pull request Jan 22, 2025
…tatus (#2965)

* fix(internal transaction): recursively revert traces

* fix: SQLReaderDb interface missing methods

* fix(eth1tx): remove transfers if reverted

* fix(internal tx): only save the highest root revert

* ci lint

* feat: updated eth1 proto file

* feat: updated Eth1InternalTransaction in eth1.proto file

* feat: added Reverted value to Eth1InternalTransactionIndexed

* feat: add check for internal txs while querying the block from erigon node and set the status to 2 if tx has failed partially

* feat: updated reverted internal txs check logic

* feat(types): add status enum and add status partially executed

* refactor(client/erigon): simplify transaction indexing flow

* feat(client/erigon): rework geth traces

* fix: lint

* feat: add status to Eth1TransactionIndexed msg and update hash formatting

* fix: updated internal tx handling in GetBlock func

* fix: updated internal txs parsing in GetBlock

* fix: optimise the memory of internla tx parsing

* lint

* fix(internal): remove revert + status logic from client to transformers

* test(internal): test for revert transformer on tx and itx

* feat(cmd): add re-index-blocks cmd

* chore(proto): clean proto Eth1Transaction and Eth1TransactionIndexed

* fix(TransformItx): empty revertSource + error before skipping

* feat(BEDS-536): implement misc `fix-internal-txs-from-node` cmd with batch processing from Erigon node (#2967)

* wip: move itx status parsing logic to transformers func

* wip: implementing fix-internal-txs misc cmd

* wip: updated geth client initialisation

* wip: moved blocks by batch logic to erigon.go

* wip: updated block by number batch call

* updated blocks batch processing

* feat: added transformers for bulk mutations

* fix: save current block height in local variable when performing mutation of the block data

* fix: add check for start and end block flags

* fix: updated erigon client

* fix: add check for batchcall size and return if it's empty

* cleanup unused code

* cleanup

* updated cmd name to fix-internal-txs-from-node

* fix: uncles, blobGasUsed & excessBlobGas parsing

* rm timings, update GetBlocksByBatch func

* fix: revised ReindexITxsFromNode func logic

* fix: update the logic for parsing uncles, BlobGasUsed and ExcessBlobGas

* (BEDS-536) Use raw db for resync (#2972)

* rpc/erigon: use raw bigtable
* rpc/erigon: use cache raw db
* rpc/erigon: correct path for geth traces
* cmd/reindex: improve performance + fix raw store cache
* rpc/erigon: fix sender address
* db2/store: add remote server + client

* fix ci

* store/bigtable: fix range limits

go mod

* store/bigtable: fix grpc error on close

* updated Receipts len check

* updated traceMode to geth

* fix ci

* clenup

* rpc/erigon: parse traces geth handle CALLCODE

* fix(transform itx): allow internal index == ITX_PER_TX_LIMIT

* fix(bigtable): retry on grpc internal err

* fix(re index): log error rather than returning error and panicking

* feat(re index): re print read error at the end

* fix(TransformEnsNameRegistered): return none nil if ignored chainID

* fix(db2/WithFallback): fallback on syscall.ECONNRESET

* fix(blockHash): prevent wrong calculated hash

* fix: return error if mismatch between receipts and transactions length

* fix: blockhash read from node response

* fix: merge go mod

---------

Co-authored-by: Monika-Bitfly <[email protected]>
Co-authored-by: Patrick Pfeiffer <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants