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: replace ics20-1 with ics20-2 #244

Closed
wants to merge 45 commits into from
Closed
Show file tree
Hide file tree
Changes from 44 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
510c8ac
initial setup
gjermundgaraba Jan 25, 2025
dc9deb7
Merge branch 'main' into gjermund/114-include-support-for-ics20-v2
gjermundgaraba Jan 26, 2025
102bba0
ICS20Transfer unit tests running
gjermundgaraba Jan 27, 2025
e28f715
updated abi and abigen with v2 format
gjermundgaraba Jan 27, 2025
73d35ab
Addded solidity encoded hex unit test to abigen
gjermundgaraba Jan 27, 2025
fac0270
Fix wrong destination memo
gjermundgaraba Jan 27, 2025
bff3b83
SendTransferMsg with address + fix trace order
gjermundgaraba Jan 27, 2025
cbdcf64
integration tests running
gjermundgaraba Jan 27, 2025
995defa
temporary ICS24 tests
gjermundgaraba Jan 27, 2025
693ab7c
Merge branch 'main' into gjermund/114-include-support-for-ics20-v2
gjermundgaraba Jan 27, 2025
0eeb656
disable some tests for now
gjermundgaraba Jan 27, 2025
6cf4203
Merge branch 'main' into gjermund/114-include-support-for-ics20-v2
gjermundgaraba Jan 27, 2025
13eb51c
Add packet commitment test with V2 format
gjermundgaraba Jan 28, 2025
3f449b2
update e2e tests with ICS20v2
gjermundgaraba Jan 28, 2025
2103122
Merge branch 'main' into gjermund/114-include-support-for-ics20-v2
gjermundgaraba Jan 28, 2025
fb758fb
fixed some failing tests
gjermundgaraba Jan 29, 2025
81aff02
generated fixtures and fixed benchmark tests
gjermundgaraba Jan 29, 2025
59666f5
Merge branch 'main' into gjermund/114-include-support-for-ics20-v2
gjermundgaraba Jan 29, 2025
5546b5f
fix compiler warning
gjermundgaraba Jan 29, 2025
b68558f
lint
gjermundgaraba Jan 29, 2025
4dc5561
fix coverage
gjermundgaraba Jan 29, 2025
ebb37e4
abigen
gjermundgaraba Jan 29, 2025
888484e
update abigen
gjermundgaraba Jan 30, 2025
4e1bee3
rename IICS20TransferMsgs Token to ERC20Token
gjermundgaraba Jan 30, 2025
85d4b19
Add denom identifier tests
gjermundgaraba Jan 30, 2025
4925560
unit testing
gjermundgaraba Jan 30, 2025
ed62351
Merge branch 'main' into gjermund/114-include-support-for-ics20-v2
gjermundgaraba Jan 30, 2025
1cbe989
remove circular dependency
gjermundgaraba Jan 30, 2025
2f0aa2d
lint
gjermundgaraba Jan 30, 2025
a0390e7
fix test
gjermundgaraba Jan 30, 2025
9a75968
move types to IICS20TransferMsgs
gjermundgaraba Jan 31, 2025
c03fefc
added more validation and testing
gjermundgaraba Jan 31, 2025
1a560b4
add forwarding hop validation
gjermundgaraba Jan 31, 2025
e476eac
lint
gjermundgaraba Jan 31, 2025
7ae8912
refactored integration tests
gjermundgaraba Feb 1, 2025
872be33
lint
gjermundgaraba Feb 1, 2025
333f1fb
cover last cases
gjermundgaraba Feb 1, 2025
41d9fd9
remove old tests
gjermundgaraba Feb 1, 2025
d0138f4
test middle chain scenarios
gjermundgaraba Feb 1, 2025
08d7c34
lint
gjermundgaraba Feb 1, 2025
dd474c8
update readme
gjermundgaraba Feb 1, 2025
0c9d54b
update abigen
gjermundgaraba Feb 1, 2025
7833490
update ibc-go version in e2e
gjermundgaraba Feb 1, 2025
25d2cf4
update fixtures
gjermundgaraba Feb 1, 2025
22c85bf
remove unecessary validation
gjermundgaraba Feb 3, 2025
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
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,11 @@ The following benchmarks are for a single packet transfer without aggregation.

| **Contract** | **Method** | **Description** | **Gas (groth16)** | **Gas (plonk)** |
|:---:|:---:|:---:|:---:|:---:|
| `ICS26Router.sol` | `sendPacket` | Initiating an IBC transfer with an `ERC20`. | ~160,500 | ~160,500 |
| `ICS26Router.sol` | `recvPacket` | Receiving _back_ an `ERC20` token. | ~514,404 | ~598,268 |
| `ICS26Router.sol` | `recvPacket` | Receiving a _new_ Cosmos token for the first time. (Deploying an `ERC20` contract) | ~1,364,844 | ~1,448,420 |
| `ICS26Router.sol` | `ackPacket` | Acknowledging an ICS20 packet. | ~395,625 | ~479,390 |
| `ICS26Router.sol` | `timeoutPacket` | Timing out an ICS20 packet | ~452,966 | ~536,673 |
| `ICS26Router.sol` | `sendPacket` | Initiating an IBC transfer with an `ERC20`. | ~156,150 | ~156,150 |
| `ICS26Router.sol` | `recvPacket` | Receiving _back_ an `ERC20` token. | ~434,621 | ~508,755 |
| `ICS26Router.sol` | `recvPacket` | Receiving a _new_ Cosmos token for the first time. (Deploying an `ERC20` contract) | ~1,429,785 | ~1,503,717 |
| `ICS26Router.sol` | `ackPacket` | Acknowledging an ICS20 packet. | ~308,692 | ~382,757 |
| `ICS26Router.sol` | `timeoutPacket` | Timing out an ICS20 packet | ~365,355 | ~439,550 |

### Aggregated Packet Benchmarks

Expand All @@ -174,8 +174,8 @@ Since there is no meaningful difference in gas costs between plonk and groth16 i

| **ICS26Router Method** | **Description** | **Avg Gas (25 packets)** | **Avg Gas (50 packets)** |
|:---:|:---:|:---:|:---:|
| `multicall/recvPacket` | Receiving _back_ an `ERC20` token. | ~185,876 | ~179,615 |
| `multicall/ackPacket` | Acknowledging an ICS20 packet. | ~96,436 | ~90,776 |
| `multicall/recvPacket` | Receiving _back_ an `ERC20` token. | ~185,811 | ~181,461 |
| `multicall/ackPacket` | Acknowledging an ICS20 packet. | ~82,914 | ~78,926 |
Comment on lines -177 to +178
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why recv packet hasn't changed much but single packet benchmarks improved a lot


Note: These gas benchmarks are with Groth16.

Expand Down
105 changes: 89 additions & 16 deletions abi/IBCERC20.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,33 @@
"internalType": "contract IEscrow"
},
{
"name": "ibcDenom_",
"type": "string",
"internalType": "string"
},
{
"name": "baseDenom_",
"type": "string",
"internalType": "string"
},
{
"name": "fullDenomPath_",
"type": "string",
"internalType": "string"
"name": "denom_",
"type": "tuple",
"internalType": "struct IICS20TransferMsgs.Denom",
"components": [
{
"name": "base",
"type": "string",
"internalType": "string"
},
{
"name": "trace",
"type": "tuple[]",
"internalType": "struct IICS20TransferMsgs.Hop[]",
"components": [
{
"name": "portId",
"type": "string",
"internalType": "string"
},
{
"name": "clientId",
"type": "string",
"internalType": "string"
}
]
}
]
}
],
"stateMutability": "nonpayable"
Expand Down Expand Up @@ -151,13 +165,37 @@
},
{
"type": "function",
"name": "fullDenomPath",
"name": "fullDenom",
"inputs": [],
"outputs": [
{
"name": "",
"type": "string",
"internalType": "string"
"type": "tuple",
"internalType": "struct IICS20TransferMsgs.Denom",
"components": [
{
"name": "base",
"type": "string",
"internalType": "string"
},
{
"name": "trace",
"type": "tuple[]",
"internalType": "struct IICS20TransferMsgs.Hop[]",
"components": [
{
"name": "portId",
"type": "string",
"internalType": "string"
},
{
"name": "clientId",
"type": "string",
"internalType": "string"
}
]
}
]
}
],
"stateMutability": "view"
Expand Down Expand Up @@ -403,6 +441,41 @@
}
]
},
{
"type": "error",
"name": "IBCERC20InvalidDenom",
"inputs": [
{
"name": "denom",
"type": "tuple",
"internalType": "struct IICS20TransferMsgs.Denom",
"components": [
{
"name": "base",
"type": "string",
"internalType": "string"
},
{
"name": "trace",
"type": "tuple[]",
"internalType": "struct IICS20TransferMsgs.Hop[]",
"components": [
{
"name": "portId",
"type": "string",
"internalType": "string"
},
{
"name": "clientId",
"type": "string",
"internalType": "string"
}
]
}
]
}
]
},
{
"type": "error",
"name": "IBCERC20Unauthorized",
Expand Down
Loading
Loading