-
Notifications
You must be signed in to change notification settings - Fork 6
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
Fix/create evm smart contract from internal tx main #824
Fix/create evm smart contract from internal tx main #824
Conversation
WalkthroughThe changes involve enhancements to the EVM transaction processing system, incorporating Changes
Sequence DiagramssequenceDiagram
participant Service as crawl_contract_evm.service.ts
participant EVM as EVMTransaction
participant InternalTx as EvmInternalTransaction
Service->>EVM: Fetch evm_internal_transactions
EVM->>InternalTx: Get all transactions
InternalTx-->>EVM: Return transactions
Service->>InternalTx: Filter for CREATE types
InternalTx-->>Service: Return filtered transactions
Service->>Service: Track creation of internal contracts
Service->>Service: Process addresses and enhanced logic
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range and nitpick comments (2)
src/models/evm_transaction.ts (1)
7-7
: Ensure proper handling of cyclic dependencies.The import of
EvmInternalTransaction
from withinevm_transaction.ts
could potentially lead to cyclic dependencies, especially since both models might cross-reference each other. Consider using TypeScript's dynamic imports or ensuring that the models are structured to prevent such cycles.src/services/evm/crawl_contract_evm.service.ts (1)
Line range hint
92-92
: Consider using optional chaining.Given the complexity of the data structures involved, using optional chaining for accessing properties would enhance the robustness of the code by safely handling cases where data might be undefined.
- isCreationInternalContracts[address] + isCreationInternalContracts?.[address]
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- src/models/evm_internal_transaction.ts (1 hunks)
- src/models/evm_transaction.ts (2 hunks)
- src/services/evm/crawl_contract_evm.service.ts (5 hunks)
Files skipped from review due to trivial changes (1)
- src/models/evm_internal_transaction.ts
Additional context used
Biome
src/services/evm/crawl_contract_evm.service.ts
[error] 92-92: Change to an optional chain. (lint/complexity/useOptionalChain)
Unsafe fix: Change to an optional chain.
Additional comments not posted (6)
src/models/evm_transaction.ts (1)
87-94
: Properly defined relation for internal transactions.The relation mapping for
evm_internal_transactions
is well-defined, adhering to the structure expected by Objection.js. This setup facilitates easy retrieval of related internal transactions directly from an EVM transaction instance, enhancing data accessibility.src/services/evm/crawl_contract_evm.service.ts (5)
4-6
: Review of new imports and configurations.The addition of
Dictionary
fromlodash
and the updated import paths reflect a move towards more structured data handling and configuration management. This change supports the dynamic needs of the service, especially in handling complex data types efficiently.
14-14
: Import ofEvmInternalTransaction
model.Importing
EvmInternalTransaction
is crucial for the service's functionality to process internal transactions. This aligns with the service's expanded role in handling more complex transaction types.
44-47
: Updated job handling constants.The constants related to job names are well-organized and reflect the service's operational requirements. This change likely supports better management and scalability of job processing within the service.
66-80
: Enhanced query logic for fetching EVM data.The modifications to the query logic, particularly the addition of
withGraphFetched
andmodifyGraph
, enhance the service's ability to fetch and process related data efficiently. This is crucial for handling complex relationships in blockchain data.
Line range hint
87-108
: Logic to track and process internal transactions.The logic to track creation of internal contracts and the handling of addresses is robust, facilitating detailed tracking and processing of blockchain data. This functionality is crucial for accurate data representation and further processing.
Summary by CodeRabbit
New Features
CREATE
,CALL
,DELEGATECALL
,CREATE2
).Improvements