Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
227 commits
Select commit Hold shift + click to select a range
67093af
feat: definition IInitiator
YukiTsuchida Nov 5, 2025
5732fae
refactor: update contract transaction structure and related decoding …
YukiTsuchida Nov 5, 2025
f323f24
feat: IAuthenticator
YukiTsuchida Nov 5, 2025
f2fc4c3
refactor: remove redundant comments from Auth.proto for clarity
YukiTsuchida Nov 5, 2025
d0d2f79
refactor: remove outdated comments from MsgSignTx for clarity
YukiTsuchida Nov 5, 2025
f1c7a4c
Refactor MsgIBCSignTx library to MsgExtSignTx with updated struct and…
YukiTsuchida Nov 5, 2025
fd752a0
refactor: remove IBC signing references from IAuthenticator interface
YukiTsuchida Nov 5, 2025
9e71b20
feat: ICoordinator
YukiTsuchida Nov 5, 2025
f784749
fix: update lint-staged configuration to use npm for Solidity formatting
YukiTsuchida Nov 6, 2025
cc98902
fix: update lint:sol script to enforce no warnings and improve code q…
YukiTsuchida Nov 6, 2025
cf6d29e
Merge branch 'def-interface-initiator' into def-interface-authenticator
YukiTsuchida Nov 6, 2025
30ff557
refactor: update TxSigned event to use AuthType.AuthMode and remove S…
YukiTsuchida Nov 6, 2025
3c2fb43
Merge pull request #17 from datachainlab/def-interface-initiator
YukiTsuchida Nov 6, 2025
8ea082a
Merge pull request #18 from datachainlab/def-interface-authenticator
YukiTsuchida Nov 6, 2025
34e4f72
Merge branch 'feature/coordinator' into def-interface-coordinator
YukiTsuchida Nov 6, 2025
7c2f67f
refactor: remove inheritance from IInitiator and IAuthenticator in IC…
YukiTsuchida Nov 6, 2025
e4eac14
refactor: remove unused imports of IInitiator and IAuthenticator in I…
YukiTsuchida Nov 6, 2025
5ac4183
Merge pull request #19 from datachainlab/def-interface-coordinator
YukiTsuchida Nov 6, 2025
d9c283d
impl-initiator
YukiTsuchida Nov 7, 2025
7884e54
refactor: simplify constructor parameters and improve storage managem…
YukiTsuchida Nov 7, 2025
f7cb80e
refactor: clean up comments and improve code readability in CoreStore…
YukiTsuchida Nov 7, 2025
84388bf
refactor: improve error handling and streamline coordinator state ret…
YukiTsuchida Nov 7, 2025
cf15314
fix: solhint
YukiTsuchida Nov 7, 2025
6dfcdfb
refactor: rename hasTx to isTxRecorded for clarity and consistency in…
YukiTsuchida Nov 7, 2025
09e0275
fix: optimize loop logic for checking existing keys in account collec…
YukiTsuchida Nov 7, 2025
de38af0
refactor: rename _collectRequiredAccounts to _getRequiredAccounts for…
YukiTsuchida Nov 7, 2025
d4abb8b
fix: remove unnecessary inline assembly for trimming output in _getRe…
YukiTsuchida Nov 7, 2025
bbea7c7
fix bugs
YukiTsuchida Nov 7, 2025
da8cc0a
feat: add TxRunner and TxRunnerBase contracts for transaction management
YukiTsuchida Nov 10, 2025
7890f97
refactor: update _runTx to include a ToDo for transaction execution l…
YukiTsuchida Nov 10, 2025
96e4c0d
refactor: remove unused import of CoreStore from TxRunner
YukiTsuchida Nov 10, 2025
10743ca
fix: implement error handling for unimplemented transaction execution
YukiTsuchida Nov 11, 2025
63ec485
refactor: replace CoreStore with CrossStore in transaction management…
YukiTsuchida Nov 12, 2025
94d20d9
refactor: standardize error naming from IDNotFound to IdNotFound acro…
YukiTsuchida Nov 12, 2025
5179f8f
fix: rename fields in Height message for clarity
YukiTsuchida Nov 12, 2025
59d15d3
fix: simplify timeout height check by removing unused revision_number
YukiTsuchida Nov 12, 2025
890fb43
fix: correct variable name for timeout height check in initiateTx fun…
YukiTsuchida Nov 12, 2025
cb5d6cb
refactor: clarify comment for txId generation in initiateTx function
YukiTsuchida Nov 12, 2025
2dfd723
fix: reorder transaction status update and execution in runTxIfComple…
YukiTsuchida Nov 12, 2025
58aced5
fix: adjust formatting of comments for AUTH_STORAGE_LOCATION and TX_S…
YukiTsuchida Nov 12, 2025
1a07484
fix: standardize variable naming from txId to txID across multiple co…
YukiTsuchida Nov 12, 2025
9603c02
fix: remove unused txExists mapping and update transaction status che…
YukiTsuchida Nov 12, 2025
062b35a
Merge pull request #21 from datachainlab/impl-initiator
YukiTsuchida Nov 13, 2025
783732c
feat: split contracts
YukiTsuchida Nov 13, 2025
4814cc4
fix: solhint
YukiTsuchida Nov 13, 2025
e64ef59
fix: update TxRunner import and adjust TxManager contract implementation
YukiTsuchida Nov 14, 2025
c72ecd1
feat: add reentrancy guard to Initiator contract
YukiTsuchida Nov 14, 2025
b60a14b
fix: correct condition in _runTxIfCompleted to verify transaction status
YukiTsuchida Nov 14, 2025
2a52e64
fix: remove unused TxRunnerBase import from TxManager and update cont…
YukiTsuchida Nov 14, 2025
41459e0
feat: add InitiateTx e2e
YukiTsuchida Nov 14, 2025
14ed477
refactor: change function visibility from view to non-view for auth a…
YukiTsuchida Nov 14, 2025
411101b
chore: update solc_version to 0.8.30 and enable via_ir in foundry.toml
YukiTsuchida Nov 14, 2025
6e84296
refactor: streamline delegatecall error handling and consolidate erro…
YukiTsuchida Nov 14, 2025
8878dce
refactor: introduce ICrossError interface and replace error handling …
YukiTsuchida Nov 14, 2025
7891a91
feat: implement selfXCC function to return ChannelInfo in QuerySelfXC…
YukiTsuchida Nov 14, 2025
ebfc6b4
refactor: remove SelfXCCNotImplemented error from ICrossError interface
YukiTsuchida Nov 14, 2025
9caf95d
Merge pull request #26 from datachainlab/split-contract
YukiTsuchida Nov 14, 2025
9d6cc5b
Merge pull request #27 from datachainlab/impl-initiator-self-xcc2
YukiTsuchida Nov 16, 2025
b0fa827
test: Add unit tests for DelegatedLogicHandler, Initiator, TxAuthMana…
YukiTsuchida Nov 17, 2025
5c642f7
fix: adjust minimum coverage requirement to 98% in coverage report
YukiTsuchida Nov 17, 2025
ef2a5ca
fix: update LCOV filter to include additional source files for covera…
YukiTsuchida Nov 17, 2025
c1dc67f
fix: adjust minimum coverage requirement to 97% in coverage report
YukiTsuchida Nov 17, 2025
e135500
feat: implement Authenticator contract with transaction signing funct…
YukiTsuchida Nov 17, 2025
bcfa22b
feat: implement extension verification mechanism in TxAuthManager and…
YukiTsuchida Nov 17, 2025
27094e3
fix: refactor variable names for clarity in SampleExtensionVerifier a…
YukiTsuchida Nov 17, 2025
2bd2cc0
feat: enhance documentation for verify function in SampleExtensionVer…
YukiTsuchida Nov 17, 2025
912b79e
feat: implement transaction authorization state retrieval in Authenti…
YukiTsuchida Nov 17, 2025
de9d17c
fix: remove unnecessary '@' from parameter documentation in SampleExt…
YukiTsuchida Nov 17, 2025
a47ed73
Merge branch 'impl-authenticator-extsigntx' into impl-authenticator-t…
YukiTsuchida Nov 17, 2025
b9d4748
Merge pull request #28 from datachainlab/impl-initiator-add-tests
YukiTsuchida Nov 18, 2025
9e993a2
impl-txrunner
YukiTsuchida Nov 19, 2025
51d14af
fix: remove unused import of TxRunner from TxManager and TxManager.t.sol
YukiTsuchida Nov 19, 2025
668c77a
feat: add validation for signers in signTx function and corresponding…
YukiTsuchida Nov 19, 2025
bd28bce
Merge
YukiTsuchida Nov 19, 2025
04e11ae
fix: rename VerifierStaticCallFailed to VerifierCallFailed for consis…
YukiTsuchida Nov 19, 2025
db3ee19
fix: simplify verification logic by removing unnecessary zero address…
YukiTsuchida Nov 19, 2025
799509f
fix: simplify event emission expectations in AuthenticatorTest
YukiTsuchida Nov 19, 2025
32dd5a9
Merge branch 'impl-authenticator-extsigntx' into impl-authenticator-t…
YukiTsuchida Nov 19, 2025
0453a25
feat: integrate CrossStore into Authenticator and enhance txAuthState…
YukiTsuchida Nov 19, 2025
a95857a
Merge pull request #29 from datachainlab/impl-authenticator-signtx
YukiTsuchida Nov 19, 2025
5c004d9
fix: remove VerifierCallFailed error and simplify verification logic …
YukiTsuchida Nov 19, 2025
f1a384e
feat: add transaction ID length validation and error handling in Auth…
YukiTsuchida Nov 20, 2025
da01501
feat: refactor transaction ID handling by introducing _decodeTxID fun…
YukiTsuchida Nov 20, 2025
8fbd7fc
Merge pull request #30 from datachainlab/impl-authenticator-extsigntx
YukiTsuchida Nov 20, 2025
172623f
Revert "feat: integrate CrossStore into Authenticator and enhance txA…
YukiTsuchida Nov 20, 2025
41b1538
feat: implement staticcall wrapper to support view delegatecalls
YukiTsuchida Nov 20, 2025
1771465
feat: add UnauthorizedCaller error and enforce caller restrictions in…
YukiTsuchida Nov 20, 2025
f8891e1
Merge branch 'impl-authenticator-txauthstate' into check-tx-id
YukiTsuchida Nov 24, 2025
d0bca74
Merge pull request #34 from datachainlab/check-tx-id
YukiTsuchida Nov 24, 2025
f2efc22
Merge branch 'impl-authenticator-txauthstate' into impl-txrunner
YukiTsuchida Nov 24, 2025
3be12d6
wip
YukiTsuchida Nov 25, 2025
38ef163
wip
YukiTsuchida Nov 25, 2025
dbe392a
feat: add documentation for staticcall functions and clarify msg.send…
YukiTsuchida Nov 25, 2025
1641734
feat: enforce caller restrictions using onlySelf modifier in Delegate…
YukiTsuchida Nov 25, 2025
84be55d
Merge pull request #31 from datachainlab/impl-authenticator-txauthstate
YukiTsuchida Nov 25, 2025
5d2c00d
wip
YukiTsuchida Nov 25, 2025
ddbbc09
fix slither warnings
YukiTsuchida Nov 25, 2025
4fff0c9
fix solhint warings
YukiTsuchida Nov 25, 2025
9f17337
refactor: improve formatting of function signatures in contract modules
YukiTsuchida Nov 25, 2025
a520ff6
fix: suppress slither warnings for unused return values in channel va…
YukiTsuchida Nov 25, 2025
26addd4
feat: add new error types and improve error handling in TxAtomicSimple
YukiTsuchida Nov 25, 2025
5702b51
refactor: simplify CoordStorage structure and update related function…
YukiTsuchida Nov 26, 2025
e962c69
fix: update TODO comments to clarify assumptions about ContractModule…
YukiTsuchida Nov 26, 2025
7170477
refactor: remove SimpleContractRegistry and related imports from core…
YukiTsuchida Nov 26, 2025
1612772
refactor: rename onContractCall to onContractCommitImmediately for cl…
YukiTsuchida Nov 26, 2025
7bf6299
refactor: improve comments for clarity in IContractModule interface
YukiTsuchida Nov 26, 2025
e3f16fd
fix: update _handlePacket to return appropriate acknowledgements on p…
YukiTsuchida Nov 26, 2025
b83b81c
fix: remove unnecessary whitespace in _handlePacket function
YukiTsuchida Nov 26, 2025
c828eab
revert 7170477
YukiTsuchida Nov 26, 2025
f85bdf7
Merge pull request #32 from datachainlab/impl-txrunner
YukiTsuchida Nov 26, 2025
f56858d
refactor: storage based architecture
YukiTsuchida Nov 27, 2025
cc88a6b
fix: add ReentrancyGuard to TxManager for enhanced security
YukiTsuchida Nov 27, 2025
3ac6091
fix: update CrossSimpleModuleAddress and mock_client in deployments.t…
YukiTsuchida Nov 27, 2025
22ee73e
refactor: rename initialization functions for clarity in CrossModule …
YukiTsuchida Nov 27, 2025
26fe988
Merge pull request #37 from datachainlab/refine-storage-based-archite…
YukiTsuchida Nov 27, 2025
0331cac
feat: Integrate TxManager into the chain and update related tests and…
YukiTsuchida Nov 28, 2025
7ecccf0
fix: update authentication mode for signers in TestInitiateTx to use …
YukiTsuchida Nov 28, 2025
1258d45
feat: add event retrieval for TxInitiated in chain tests and update r…
YukiTsuchida Nov 28, 2025
f990408
refactor: remove unused ABI initialization for CrossSimpleModule in c…
YukiTsuchida Nov 28, 2025
1e0672f
feat: add exposed_initIBCKeeper function to IBCKeeperHarness and upda…
YukiTsuchida Nov 28, 2025
8fc8d55
fix: update exposed_registerModule to use initializer and correct rev…
YukiTsuchida Nov 28, 2025
06c574b
test: add revert test for second initialization in IBCKeeperHarness
YukiTsuchida Nov 28, 2025
33968e4
feat: update TxAuthManagerTest to use initialize function and rename …
YukiTsuchida Nov 28, 2025
dd3bd3a
fix: update solhint-disable comments to include function-max-lines rule
YukiTsuchida Nov 28, 2025
e3cb2da
fix: update solhint-disable comments and improve test assertions for …
YukiTsuchida Nov 28, 2025
9110502
test: add tests for onCommit, onAbort, and onContractPrepare function…
YukiTsuchida Nov 28, 2025
397f486
feat: enhance MockTxManager with packet handling and expose functions…
YukiTsuchida Nov 28, 2025
8be3a10
fix: optimize packet handling increment operations in MockTxManager
YukiTsuchida Nov 28, 2025
1b42d0d
feat: enhance TxAtomicSimple initialization and add mock handlers for…
YukiTsuchida Nov 28, 2025
3d1cbca
feat: enhance MockModule and MockIBCHandler for improved testing capa…
YukiTsuchida Nov 28, 2025
e7286f7
test: add test for unexpected return value in runTx function of TxAto…
YukiTsuchida Nov 28, 2025
15473fe
Revert "test: add test for unexpected return value in runTx function …
YukiTsuchida Nov 30, 2025
7e5b47e
Revert "feat: enhance MockModule and MockIBCHandler for improved test…
YukiTsuchida Nov 30, 2025
c334f00
refactor: replace MockIBCHandler and MockContractModule with Dummy im…
YukiTsuchida Nov 30, 2025
7f59717
test: rename test functions for clarity and consistency
YukiTsuchida Nov 30, 2025
ab2ecc1
chore: remove unused import for PacketAcknowledgementCall in TxManager
YukiTsuchida Nov 30, 2025
d54790b
tests: imporve TxAtomixSimple
YukiTsuchida Nov 30, 2025
7b70e3b
refactor: enhance MockModule with additional revert handling and call…
YukiTsuchida Dec 1, 2025
36b86fe
feat: implement Coordinator contract and integrate with TxManager for…
YukiTsuchida Dec 1, 2025
9b0f297
chore: update optimizer_runs to improve compilation efficiency
YukiTsuchida Dec 1, 2025
874b2b9
Merge pull request #38 from datachainlab/fix-go-test
YukiTsuchida Dec 1, 2025
759bbe9
test: rename test functions for consistency in TxAtomicSimpleTest
YukiTsuchida Dec 1, 2025
c871a45
Merge pull request #39 from datachainlab/fix-unit-tests
YukiTsuchida Dec 1, 2025
3fcc3ab
Merge branch 'fix-unit-tests2' into impl-coordinator3
YukiTsuchida Dec 1, 2025
dce87e5
feat: update event names in TxAtomicSimple and tests for clarity
YukiTsuchida Dec 1, 2025
2233de7
test: rename acknowledgment test functions for clarity
YukiTsuchida Dec 1, 2025
eaee81b
feat: add ICrossEvent interface and integrate events into Authenticat…
YukiTsuchida Dec 1, 2025
f7a196b
fix: go tests
YukiTsuchida Dec 1, 2025
4c40f06
feat: implement ERC20Module with commit and abort functionality, incl…
YukiTsuchida Dec 2, 2025
1ec16ea
Merge pull request #40 from datachainlab/fix-unit-tests2
YukiTsuchida Dec 2, 2025
04f2987
Merge pull request #41 from datachainlab/impl-coordinator3
YukiTsuchida Dec 2, 2025
56b12f1
feat: add pending transaction check in onContractPrepare function and…
YukiTsuchida Dec 2, 2025
fdce243
feat: implement authorization checks in ERC20Module for cross module …
YukiTsuchida Dec 2, 2025
207a602
feat: add ContractModuleBase harness and tests for commit and prepare…
YukiTsuchida Dec 2, 2025
f523a60
fix: mark crossModule as immutable for improved gas efficiency
YukiTsuchida Dec 2, 2025
b09e2bf
fix: standardize naming of crossModule to CROSS_MODULE for consistency
YukiTsuchida Dec 2, 2025
e83e86b
Merge pull request #42 from datachainlab/fix-events
YukiTsuchida Dec 2, 2025
1e8d619
refactor: update PendingTx structure and related functions for clarit…
YukiTsuchida Dec 2, 2025
19d88d8
refactor: simplify ERC20Module by removing ERC20 inheritance and usin…
YukiTsuchida Dec 3, 2025
f2e0515
fix: add important comments to ensure proper authorization in token t…
YukiTsuchida Dec 3, 2025
502f924
refactor: rename ERC20Module -> ERC20TransferModule
YukiTsuchida Dec 3, 2025
eb763c7
fix: update Go setup action to version 6 for improved compatibility
YukiTsuchida Dec 3, 2025
e578b4a
Merge pull request #43 from datachainlab/impl-erc20-module
YukiTsuchida Dec 3, 2025
23c40ac
refactor: implement initialization pattern for ERC20TransferModule an…
YukiTsuchida Dec 4, 2025
451e97a
fix: change visibility of initialize function to external
YukiTsuchida Dec 4, 2025
fd40ece
fix: add validation to initialize function to prevent zero address in…
YukiTsuchida Dec 4, 2025
ebcec6c
feat: enhance _accountKey function to handle AUTH_MODE_EXTENSION case
YukiTsuchida Dec 9, 2025
cd171a6
feat: implement Ownable functionality in ERC20TransferModule and add …
YukiTsuchida Dec 10, 2025
6d9a51e
feat: add initialization event for ERC20TransferModule and update tests
YukiTsuchida Dec 10, 2025
af0268e
Merge branch 'initializable-erc20transfermodule' into enhance-accountKey
YukiTsuchida Dec 10, 2025
987bd8f
feat: add test for accountKey function to validate AUTH_MODE_EXTENSIO…
YukiTsuchida Dec 10, 2025
8f9934f
Merge pull request #44 from datachainlab/initializable-erc20transferm…
YukiTsuchida Dec 10, 2025
7218492
Merge pull request #45 from datachainlab/enhance-accountKey
YukiTsuchida Dec 10, 2025
a7f3a4a
fix: correct import paths for AtomicSimple.sol in CrossStore and ICoo…
YukiTsuchida Dec 12, 2025
e67f3db
Merge pull request #46 from datachainlab/fix-import-proto
YukiTsuchida Dec 12, 2025
c99876f
Merge pull request #20 from datachainlab/feature/coordinator
YukiTsuchida Dec 12, 2025
311c255
feat: add gas snapshot for contract tests
YukiTsuchida Dec 15, 2025
874b219
feat: add gas snapshot workflow and update package.json scripts
YukiTsuchida Dec 16, 2025
bef092e
chore: remove gas snapshot workflow file
YukiTsuchida Dec 16, 2025
cc6f704
feat: add gas snapshot diff report workflow
YukiTsuchida Dec 16, 2025
f4b4358
feat: update gas snapshot workflow to trigger on merge
YukiTsuchida Dec 16, 2025
fab94ef
Merge pull request #47 from datachainlab/add-gas-snapshot
YukiTsuchida Dec 16, 2025
83b69c2
fix: correct optimizer_runs value in foundry.toml to 199
YukiTsuchida Dec 16, 2025
6b3b21f
fix: workflow
YukiTsuchida Dec 16, 2025
baa6b4b
fix: workflow
YukiTsuchida Dec 16, 2025
83a1f2e
fix: update gas snapshot diff filtering and optimizer_runs value
YukiTsuchida Dec 16, 2025
48a752d
fix: update optimizer_runs value in foundry.toml to 400
YukiTsuchida Dec 16, 2025
43073a2
fix: update optimizer_runs value to 401 and enhance snapshot diff com…
YukiTsuchida Dec 16, 2025
2c50862
fix: revert optimizer_runs value to 200 in foundry.toml
YukiTsuchida Dec 16, 2025
af89de5
Merge pull request #48 from datachainlab/add-gas-snapshot-workflow
YukiTsuchida Dec 16, 2025
a15395d
refactor: rename test contract and update workflow steps; remove unus…
YukiTsuchida Dec 24, 2025
76a061b
Revert "refactor: rename test contract and update workflow steps; rem…
YukiTsuchida Dec 24, 2025
7c82933
refactor: rename test contract and update workflow steps; remove unus…
YukiTsuchida Dec 24, 2025
1a89ba3
chore(gas): update .gas-snapshot [skip ci]
YukiTsuchida Dec 24, 2025
e766a3b
Merge pull request #49 from datachainlab/refactor
YukiTsuchida Dec 25, 2025
6d8978d
chore(gas): update .gas-snapshot [skip ci]
YukiTsuchida Dec 25, 2025
65a46f6
docs: update README to clarify features and demo section
YukiTsuchida Jan 5, 2026
689d83a
docs: update README to clarify contract module interface and features
YukiTsuchida Jan 5, 2026
81788bb
docs: update README to specify participant features for commit protocols
YukiTsuchida Jan 5, 2026
bc65a1b
docs: remove participant labels for clarity in simple-commit flow des…
YukiTsuchida Jan 5, 2026
06346be
Merge pull request #50 from datachainlab/update-README
YukiTsuchida Jan 5, 2026
a76e726
delete-txMsg
YukiTsuchida Jan 6, 2026
dbecb55
fix solhint
YukiTsuchida Jan 6, 2026
84839f0
fix tests
YukiTsuchida Jan 6, 2026
9b9ad84
refactor: improve error handling and variable scope in _runTx function
YukiTsuchida Jan 6, 2026
af1127a
refactor: move dummy packet initialization for getModule into a block…
YukiTsuchida Jan 6, 2026
49b108c
refactor: enhance transaction management and testing in Coordinator c…
YukiTsuchida Jan 6, 2026
432ba85
refactor: update TxInitiated event to include MsgInitiateTx data
YukiTsuchida Jan 6, 2026
6620000
feat: Update Txmanager contract ABI and methods for transaction handling
YukiTsuchida Jan 6, 2026
7739c8f
refactor: update runTxIfCompleted method to include transaction ID pa…
YukiTsuchida Jan 6, 2026
7e81b0b
refactor: remove unused parameter from runTxIfCompleted function
YukiTsuchida Jan 6, 2026
e134954
refactor: streamline coordinator state management by introducing comp…
YukiTsuchida Jan 13, 2026
fc38bb3
test: CrossStore.sol
YukiTsuchida Jan 13, 2026
4aa872e
refactor: simplify _loadCoordinatorState function by removing redunda…
YukiTsuchida Jan 13, 2026
51af452
refactor: lower minimum coverage requirement from 97 to 96
YukiTsuchida Jan 13, 2026
a266604
feat: add TxAuthCompleted event emission in Authenticator contract
YukiTsuchida Jan 13, 2026
2a03e4a
refactor: optimize gas usage by cleaning up txCoordSigners storage on…
YukiTsuchida Jan 13, 2026
60055ec
feat: implement TxIdUtils library for transaction ID computation and …
YukiTsuchida Jan 13, 2026
1333d5b
refactor: rename TxIdUtils to TxIDUtils for consistency
YukiTsuchida Jan 14, 2026
140262a
Merge pull request #51 from datachainlab/delete-txMsg
YukiTsuchida Jan 14, 2026
d69c643
chore(gas): update .gas-snapshot [skip ci]
YukiTsuchida Jan 14, 2026
fe25d6b
Merge branch 'develop' into improve-gas-CoordStateCompact2
YukiTsuchida Jan 14, 2026
469776d
refactor: remove unused participant confirmation and protocol complet…
YukiTsuchida Jan 15, 2026
172cdee
refactor: optimize loop increment in _runSimpleProtocol function
YukiTsuchida Jan 15, 2026
8c538ed
comment: add CoordStateCompact struct for optimized storage in COMMIT…
YukiTsuchida Jan 16, 2026
e7581b1
Merge pull request #54 from datachainlab/improve-gas-CoordStateCompact2
YukiTsuchida Jan 16, 2026
61c581a
chore(gas): update .gas-snapshot [skip ci]
YukiTsuchida Jan 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
257 changes: 257 additions & 0 deletions .gas-snapshot

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion .github/workflows/coverage-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,16 @@ jobs:
'src/proto/**' \
'src/core/PacketHandler.sol' \
'src/core/ContractRegistry.sol' \
'src/core/TxAuthManagerBase.sol' \
'src/core/TxManagerBase.sol' \
'src/core/TxRunnerBase.sol' \
-o lcov.filtered.info

- name: Report code coverage
uses: zgosalvez/github-actions-report-lcov@v5
with:
coverage-files: lcov.filtered.info
minimum-coverage: 100
minimum-coverage: 96
artifact-name: code-coverage-report
github-token: ${{ secrets.GITHUB_TOKEN }}
update-comment: true
109 changes: 109 additions & 0 deletions .github/workflows/gas-snapshot-diff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: Gas Snapshot Diff Report

on:
pull_request:
paths:
- 'src/**'
- 'test/**'
- 'foundry.toml'

permissions:
contents: read
pull-requests: write

jobs:
gas-diff:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '25'

- name: Install dependencies
run: npm ci

- name: Fetch .gas-snapshot from Base Branch
run: |
BASE_BRANCH="origin/${{ github.base_ref }}"
echo "Fetching snapshot from $BASE_BRANCH..."

if git show "$BASE_BRANCH:.gas-snapshot" > .gas-snapshot 2>/dev/null; then
echo "Successfully fetched .gas-snapshot from base branch."
else
echo "⚠️ .gas-snapshot not found in base branch."
exit 0
fi

- name: Run Snapshot Diff
id: run_diff
shell: bash
run: |
npm run snapshot:diff | \
sed 's/\x1b\[[0-9;]*m//g' | \
grep -v "^>" | \
grep -vE "^\[PASS\]|^Ran |^Suite result" | \
grep -v "gas: 0 (0.000%)" | \
grep -v "compilation skipped" | \
sed '/^$/d' | \
sed -E 's/\(gas: ([0-9])/(gas: +\1/g' > gas_diff.txt

cat gas_diff.txt

- name: Comment Gas Diff on PR
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const fs = require('fs');
const diffOutput = fs.readFileSync('gas_diff.txt', 'utf8');

if (diffOutput.trim() === '') {
console.log("No gas changes detected.");
return;
}

const body = `### ⛽ Gas Usage Changes

Comparison against \`${{ github.base_ref }}\` branch:

<details>
<summary>Click to view gas diff</summary>

\`\`\`diff
${diffOutput}
\`\`\`

</details>

*Calculated by Foundry Gas Snapshot Action*`;

const { owner, repo, number } = context.issue;
const comments = await github.rest.issues.listComments({
owner,
repo,
issue_number: number,
});

const botComment = comments.data.find(c => c.body.includes('### ⛽ Gas Usage Changes'));

if (botComment) {
await github.rest.issues.updateComment({
owner,
repo,
comment_id: botComment.id,
body: body
});
} else {
await github.rest.issues.createComment({
owner,
repo,
issue_number: number,
body: body
});
}
40 changes: 40 additions & 0 deletions .github/workflows/gas-snapshot-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Update Gas Snapshot on Merge

on:
push:
branches:
- develop # ToDo: change develop to main when main branch is ready
paths:
- 'src/**'
- 'test/**'
- 'foundry.toml'

permissions:
contents: write

jobs:
update-snapshot:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '25'

- name: Install dependencies
run: npm ci

- name: Generate Snapshot
run: npm run snapshot

- name: Commit and Push changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "chore(gas): update .gas-snapshot [skip ci]"
file_pattern: .gas-snapshot
branch: ${{ github.ref }}
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
steps:

- name: Set up Go 1.24
uses: actions/setup-go@v1
uses: actions/setup-go@v6
with:
go-version: 1.24
id: go
Expand All @@ -22,7 +22,7 @@ jobs:
- name: Resolve dependencies
run: npm install

- name: Setup ganache-cli
- name: Setup chain & Deploy contracts
run: NO_GEN_CODE=1 ./script/setup.sh development

- name: Test
Expand Down
4 changes: 1 addition & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@

set -e

npm run fmt:sol

git add -A
npx lint-staged
3 changes: 3 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"*.sol": ["npm run fmt:sol"]
}
39 changes: 29 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,47 @@ This is a solidity implementation of [Cross Framework](https://github.com/datach

Currently, it provides the following features:
- the registry feature that allows developers to register their contracts
- the participant feature of the simple commit protocol
- the coordinator feature of the simple commit protocol
- the participant features for the simple-commit and two-phase commit protocols
- it's implemented on top of [yui-ibc-solidity](https://github.com/hyperledger-labs/yui-ibc-solidity)

A coordinator feature of the simple commit and two-phase commit will be provided in the future.
The coordinator feature of the two-phase commit will be provided in the future.

## Contract module development
## Demo

A developer who develops contract using Cross Framework need to implement IContractModule, which is defined in [IContractModule.sol](./src/core/IContractModule.sol).
For an ERC20 atomic swap demo, please refer to [ethereum-cross-demo](https://github.com/datachainlab/ethereum-cross-demo)

## Contract module development

```
// IContractModule defines the expected interface of a contract module on Cross Framework
```solidity
interface IContractModule {
// onContractCall is a callback function that is called at the commit(simple-commit) phase
function onContractCall(CrossContext calldata context, bytes calldata callInfo) external returns (bytes memory);
// onContractCommitImmediately is a callback function that is called on the participant chain to execute the transaction logic immediately
// This function is intended to be used only in the simple-commit protocol
function onContractCommitImmediately(CrossContext calldata context, bytes calldata callInfo)
external
returns (bytes memory);

// onContractPrepare is a callback function that is called at the prepare(2pc) phase
function onContractPrepare(CrossContext calldata context, bytes calldata callInfo) external returns (bytes memory);

// onCommit is a callback function that is called at the commit(2pc) phase
// It is expected that it commits the changes in the contract module
// IMPORTANT: This function MUST NOT revert.
function onCommit(CrossContext calldata context) external;

// onAbort is a callback function that is called at the commit(2pc) phase
// It is expected that it aborts the changes in the contract module
// IMPORTANT: This function MUST NOT revert.
function onAbort(CrossContext calldata context) external;
}
```

- Currently, only one function `onContractCall` is defined, which implements the process of a transaction called via the cross-chain transaction.
- For the current simple-commit coordinator flow, the coordinator-side participant uses `onContractPrepare` to execute and lock state changes, and later finalizes them with `onCommit` or `onAbort` based on the acknowledgement from the counterparty.

- The return value of `onContractCall` is emitted as an Event `OnContractCall` with the transaction info.
- The counterparty participant executes the incoming call and finalizes immediately via `onContractCommitImmediately`.

- If it gets an unexpected call, the developer need to perform `revert` in the contract. This will request the coordinator to abort the transaction.
- IMPORTANT: `onCommit` and `onAbort` MUST NOT revert.

## How to deploy a contract module

Expand Down
5 changes: 0 additions & 5 deletions chains/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,3 @@ services:
interval: 2s
timeout: 1s
retries: 30
geth:
build: ./geth
ports:
- 8545:8545
- 8546:8546
15 changes: 0 additions & 15 deletions chains/geth/Dockerfile

This file was deleted.

Loading