feat: Implement synchronous cross-contract calls and robust state#128
feat: Implement synchronous cross-contract calls and robust state#128SIDDHANTCOOKIE wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (2)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| Returns a dict: {"success": bool, "gas_used": int, "error": str} | ||
| """ | ||
|
|
||
| if depth > 10: |
There was a problem hiding this comment.
Magic constant here. Move it to the configuration file.
| sender['nonce'] += 1 | ||
|
|
||
| import copy | ||
| state_snapshot = copy.deepcopy(self.accounts) |
There was a problem hiding this comment.
This will be extremely inefficient. Won't it?
If so, could you create an issue to address this in the future?
| state_snapshot = copy.deepcopy(self.accounts) | ||
|
|
||
| def rollback_and_refund(error_message, gas_used): | ||
| self.accounts = copy.deepcopy(state_snapshot) |
There was a problem hiding this comment.
Does the state snapshot include the storage? Or only the account balances?
If it is the latter, might we be forgetting to roll back the storage?
This PR introduces cross-contract interoperability, allowing smart contracts to securely invoke functions on other contracts synchronously during execution, while maintaining perfect global state atomicity.
Screenshots/Recordings:
TODO: If applicable, add screenshots or recordings that demonstrate the interface before and after the changes.
Additional Notes:
AI Usage Disclosure:
We encourage contributors to use AI tools responsibly when creating Pull Requests. While AI can be a valuable aid, it is essential to ensure that your contributions meet the task requirements, build successfully, include relevant tests, and pass all linters. Submissions that do not meet these standards may be closed without warning to maintain the quality and integrity of the project. Please take the time to understand the changes you are proposing and their impact. AI slop is strongly discouraged and may lead to banning and blocking. Do not spam our repos with AI slop.
Check one of the checkboxes below:
I have used the following AI models and tools: TODO
Checklist