hyperledger-labs / yui-ibc-solidity Goto Github PK
View Code? Open in Web Editor NEWIBC in Solidity
License: Apache License 2.0
IBC in Solidity
License: Apache License 2.0
This operation should be performed at the contract initialization.
https://github.com/hyperledger-labs/yui-ibc-solidity/blob/main/pkg/testing/chains.go#L248
cc: @toshihiko-okubo
This is required for compatibility with ICS and ibc-go implementation.
ref. https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transfer#data-structures
This may be convenient to perform the packet-relay test between two different implementations of IBC.
should use Height struct instead of uint64
This is where things go wrong:
blockNumber ===== 0x33af
address ===== e6d8ff7eddb380c99b898c04b78edda4a92cc966
hashes ===== []
blockNumber ===== 0x93130
chains_test.go:186: delay for ack@chainA 15.430340792s
chains_test.go:216:
Error Trace: /Users/binny/go/src/yui-ibc-solidity/tests/e2e/chains_test.go:216
Error: Received unexpected error:
All attempts fail:
#1: failed to execute a transaction: &{{[] 0 232807 [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] [] 0x09c8f5d14efcd2eb8ada8121154a872f8186ba458e0b081738f29c74f9d5f010 0x0000000000000000000000000000000000000000 232807 0xdeb835b13d51e2bbb3f2737eb7ffedbb81dc28eac41f10c2387c19c109ccc669 13273 0} []}
Test: TestChainTestSuite/TestChannel
--- FAIL: TestChainTestSuite/TestChannel (154.75s)
FAIL
Debugger finished with the exit code 0
Decoding is successful in using Solidity v0.6, but it fails in using Solidity v0.8.
The issue is related to "Checked arithmetic", which was introduced in v0.8?
You can reproduce this bug by using this branch.
Example here - this todo is pretty simple to do (and highly suggested). This can be a starting point, but todos as issues are easier to tackle. Can take it up.
This is blocked by datachainlab/solidity-protobuf#10
from @adlerjohn:
They encode to storage, not memory https://github.com/datachainlab/ibc-solidity/blob/e5c5e622877e1c6c5269b4238889007dd135be13/contracts/core/types/ProtoBufRuntime.sol#L21
i.e. it'll cost like a billion gas to do anything. If you know them, tell them to use and contribute to my library!
when i exec NO_GEN_CODE=1 ./scripts/setup.sh testtwochainz
:
> Compilation skipped because --compile-none option was passed.
/Users/binny/go/src/yui-ibc-solidity/node_modules/eth-block-tracker/src/polling.js:51
const newErr = new Error(`PollingBlockTracker - encountered an error while attempting to update latest block:\n${err.stack}`)
^
Error: PollingBlockTracker - encountered an error while attempting to update latest block:
undefined
at PollingBlockTracker._performSync (/Users/binny/go/src/yui-ibc-solidity/node_modules/eth-block-tracker/src/polling.js:51:24)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
This is because there is some IBC client spec that has side-effects in state verification functions.
e.g. https://github.com/cosmos/ibc/tree/master/spec/client/ics-006-solo-machine-client
We are preparing a tutorial for developing a sample IBC application using yui-ibc-solidity. The hyperlink of the tutorial will be added to README.
Stop warnings related to:
public
modifiers of constructorsthere should be a general entry point able to receive an Any
protobuf message to collect and dispatch all the messages sent to the IBC Handler by a relayer, as the cosmos client has.
Just to give a few references, looking at hermes, one of the most trending ibc relayer implementation:
https://docs.rs/ibc-relayer/0.8.0/ibc_relayer/chain/trait.ChainEndpoint.html#tymethod.send_messages_and_wait_commit
https://docs.rs/ibc-relayer/0.8.0/src/ibc_relayer/chain/cosmos.rs.html#874-928
ibc-solidity places a high priority on compatibility with ibc-go. By using a tool like submodule to check out proto files for IBC, we can clarify supported version and simplify operations when updating ibc version.
yui-ibc-solidity/pkg/testing/chains.go
Line 248 in ca90e73
Currently, we support only the IBFT2 client as IBC Client, so many features of IBC will only work on Besu. There is a concern that this will increase the cost of development. Therefore, we wanted to run our implementation except for the IBC Client on ganache, which is more suitable for contract development. This is expected to be achieved by supporting a mock IBC Client.
The following error message is reported:
❯ forge test
[⠒] Compiling...
[⠢] Unable to resolve imports:
"openzeppelin-solidity/contracts/utils/Context.sol" in "/home/ubuntu/electron/zk-ibc/ibc-solidity/contracts/app/ICS20Bank.sol"
"openzeppelin-solidity/contracts/utils/Address.sol" in "/home/ubuntu/electron/zk-ibc/ibc-solidity/contracts/app/ICS20Bank.sol"
"openzeppelin-solidity/contracts/utils/Context.sol" in "/home/ubuntu/electron/zk-ibc/ibc-solidity/tests/foundry/src/MockApp.sol"
"openzeppelin-solidity/contracts/token/ERC20/ERC20.sol" in "/home/ubuntu/electron/zk-ibc/ibc-solidity/contracts/app/SimpleToken.sol"
"openzeppelin-solidity/contracts/token/ERC20/IERC20.sol" in "/home/ubuntu/electron/zk-ibc/ibc-solidity/contracts/app/ICS20Bank.sol"
"openzeppelin-solidity/contracts/utils/Context.sol" in "/home/ubuntu/electron/zk-ibc/ibc-solidity/contracts/app/ICS20Transfer.sol"
"openzeppelin-solidity/contracts/access/AccessControl.sol" in "/home/ubuntu/electron/zk-ibc/ibc-solidity/contracts/app/ICS20Bank.sol"
with remappings:
ds-test/=/home/ubuntu/electron/zk-ibc/ibc-solidity/tests/foundry/lib/forge-std/lib/ds-test/src/
forge-std/=/home/ubuntu/electron/zk-ibc/ibc-solidity/tests/foundry/lib/forge-std/src/
[⠰] Compiling 41 files with 0.8.17
[⠔] Solc 0.8.17 finished in 76.26ms
Error:
Compiler run failed
error[6275]: ParserError: Source "openzeppelin-solidity/contracts/utils/Context.sol" not found: File not found. Searched the following locations: "/home/ubuntu/electron/zk-ibc/ibc-solidity".
--> contracts/app/ICS20Bank.sol:4:1:
|
4 | import "openzeppelin-solidity/contracts/utils/Context.sol";
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[6275]: ParserError: Source "openzeppelin-solidity/contracts/access/AccessControl.sol" not found: File not found. Searched the following locations: "/home/ubuntu/electron/zk-ibc/ibc-solidity".
--> contracts/app/ICS20Bank.sol:5:1:
|
5 | import "openzeppelin-solidity/contracts/access/AccessControl.sol";
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[6275]: ParserError: Source "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol" not found: File not found. Searched the following locations: "/home/ubuntu/electron/zk-ibc/ibc-solidity".
--> contracts/app/ICS20Bank.sol:6:1:
|
6 | import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[6275]: ParserError: Source "openzeppelin-solidity/contracts/utils/Address.sol" not found: File not found. Searched the following locations: "/home/ubuntu/electron/zk-ibc/ibc-solidity".
--> contracts/app/ICS20Bank.sol:7:1:
|
7 | import "openzeppelin-solidity/contracts/utils/Address.sol";
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[6275]: ParserError: Source "openzeppelin-solidity/contracts/utils/Context.sol" not found: File not found. Searched the following locations: "/home/ubuntu/electron/zk-ibc/ibc-solidity".
--> contracts/app/ICS20Transfer.sol:12:1:
|
12 | import "openzeppelin-solidity/contracts/utils/Context.sol";
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[6275]: ParserError: Source "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol" not found: File not found. Searched the following locations: "/home/ubuntu/electron/zk-ibc/ibc-solidity".
--> contracts/app/SimpleToken.sol:4:1:
|
4 | import "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol";
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[6275]: ParserError: Source "openzeppelin-solidity/contracts/utils/Context.sol" not found: File not found. Searched the following locations: "/home/ubuntu/electron/zk-ibc/ibc-solidity".
--> tests/foundry/src/MockApp.sol:11:1:
|
11 | import "openzeppelin-solidity/contracts/utils/Context.sol";
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Hi y'all. I have a few questions about this. It's very interesting.
Cheers! Let me know if these questions are best answered elsewhere as well. Feel free to tag any relevant parties.
Due to changes from #130, docs needs to be updated.
It's for ibc-go compatibility.
function createClient
should return a string with the clientID just created.
Identifiers that identify these states need to be generated by the host state machine, not given from an external input.
spec:
something like https://github.com/protofire/solhint
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.