-
Notifications
You must be signed in to change notification settings - Fork 2
refactor: Extract TxAuthManager/TxManager logic via delegatecall to resolve contract size limit #26
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
Conversation
LCOV of commit
|
| OwnableIBCHandler as IBCHandler | ||
| } from "@hyperledger-labs/yui-ibc-solidity/contracts/core/25-handler/OwnableIBCHandler.sol"; | ||
|
|
||
| // === App === |
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.
Deploy sample
| function _runTxIfCompleted(bytes32 txID) internal virtual override { | ||
| CrossStore.TxStorage storage t = _getTxStorage(); | ||
| if (t.txStatus[txID] != MsgInitiateTxResponse.InitiateTxStatus.INITIATE_TX_STATUS_VERIFIED) return; | ||
| if (t.txStatus[txID] == MsgInitiateTxResponse.InitiateTxStatus.INITIATE_TX_STATUS_VERIFIED) return; |
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.
fix bug
…nd transaction state checks
mattsu6666
left a comment
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.
LGTM✅
Contract Size
via_ir = falsevia_ir = trueArchitecture
graph TD subgraph " " direction LR CrossSimpleModule end subgraph "Core Module (Execution Context)" direction TB CrossModule[(CrossModule)] Initiator DelegatedLogicHandler end subgraph "Logic Implementations (Separate Contracts)" direction TB style TxAuthManager fill:#e6ffed,stroke:#006400,stroke-width:2px style TxManager fill:#e6ffed,stroke:#006400,stroke-width:2px TxAuthManager TxManager end subgraph "Bases & Implementations (Internal)" direction TB style TxAuthManagerBase fill:#f0f0f0,stroke:#333,stroke-width:2px style TxManagerBase fill:#f0f0f0,stroke:#333,stroke-width:2px style TxRunnerBase fill:#f0f0f0,stroke:#333,stroke-width:2px style TxRunner fill:#f5f5f5,stroke:#555,stroke-width:1px TxAuthManagerBase(("TxAuthManagerBase")) TxManagerBase(("TxManagerBase")) TxRunnerBase(("TxRunnerBase")) TxRunner["TxRunner"] -- "implements" --> TxRunnerBase end subgraph "Interfaces (External APIs)" direction TB style ITxAuthManager fill:#e6f7ff,stroke:#0056b3,stroke-width:2px style ITxManager fill:#e6f7ff,stroke:#0056b3,stroke-width:2px style IInitiator fill:#e6f7ff,stroke:#0056b3,stroke-width:2px ITxAuthManager{{"ITxAuthManager"}} ITxManager{{"ITxManager"}} IInitiator{{"IInitiator"}} end subgraph "Storage (ERC-7201)" direction TB style CrossStore fill:#fffbe6,stroke:#d4a017,stroke-width:2px CrossStore end %% --- Links --- CrossSimpleModule -- "inherits" --> CrossModule %% Core Module Inheritance CrossModule -- "inherits" --> Initiator CrossModule -- "inherits" --> DelegatedLogicHandler CrossModule -- "inherits" --> CrossStore %% Logic Handler (Bridge) DelegatedLogicHandler -- "implements" --> TxAuthManagerBase DelegatedLogicHandler -- "implements" --> TxManagerBase DelegatedLogicHandler -. "uses" .-> ITxAuthManager DelegatedLogicHandler -. "uses" .-> ITxManager DelegatedLogicHandler -. "delegatecall<br>staticcall" .-> TxAuthManager DelegatedLogicHandler -. "delegatecall<br>staticcall" .-> TxManager %% Core Logic Components Initiator -- "implements" --> IInitiator Initiator -- "inherits" --> TxAuthManagerBase Initiator -- "inherits" --> TxManagerBase %% Logic Contract Inheritance TxAuthManager -- "implements" --> ITxAuthManager TxAuthManager -- "inherits" --> TxAuthManagerBase TxAuthManager -- "inherits" --> CrossStore TxManager -- "implements" --> ITxManager TxManager -- "inherits" --> TxManagerBase TxManager -- "inherits" --> TxRunner TxManager -- "inherits" --> CrossStore