-
Notifications
You must be signed in to change notification settings - Fork 3
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/ibc app ics20 ( develop ) #343
Conversation
Feat/ibc tao genesis ( main )
feat: add migration to add index time to block, tx
fix: update validator as UNRECOGNIZED when not found onchain
docs: cw20
docs: cw721
* feat: reindex cw20 service * test: test cw20 reindexing * fix: idiot * refactor: code * feat: api admin
* refactor: cw20 index and add relation * refactor: code
* feat: move statistic feature from v1 to v2 (not tested yet) * feat: change job params so it can aggregate data at a specific date * fix: query fields from exact table * fix: query exact fields * feat: add logger when done * feat: finish statistic jobs (not tested) * feat: create a separate interval job that gets the current date and create statistics jobs with date * feat: update logic using dayjs and lodash lib * feat: update cron jobs logic, move api actions to its service folder * fix: query event from db and group it based on event_id and tx_id * fix: just use a single job to query all daily data * fix: move all queries in daily_stats job into a single Promise all * fix: move dayjs.extend to after import statements * fix: remove _start * fix: only count native token in account_stats job * feat: add api to sync stats from prev dates * fix: support case when user just pass startDate to api * fix: fix whitelist graphql * fix: update column in account_statistic table, update bignum top_tx_sent * fix: remove drop index in modify account statistic table --------- Co-authored-by: AnDQK <doquockhanhan@gmail.com> Co-authored-by: Phan Anh Tuan <fibonacci998@gmail.com>
#322) * refactor: migrate cw721 activity missing smart contract event * feat: api * test: test params * test: test params * test: test params * test: test params * test: test params * test: test params * refactor: code * refactor: code * refactor: code * refactor: code * refactor: code * fix: ci
* fix: get use_feegrant_grantee if has, other get tx_fee_payer * fix: remove code not used
amount: '10000', | ||
denom: 'uatom', | ||
receiver: | ||
'{"autopilot":{"stakeibc":{"stride_address":"stride1e8288j8swfy7rwkyx0h3lz82fe58vz2medxndl","action":"LiquidStake"},"receiver":"stride1e8288j8swfy7rwkyx0h3lz82fe58vz2medxndl"}}', |
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.
lấy cái ví dụ kì quặc thế
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.
Em lấy ngẫu nhiên tx thực tế trên mintscan
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.
nhưng receiver ko phải địa chỉ? thật ko vậy
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.
đúng ạ
dstChannel: string | ||
) { | ||
if (isSource) { | ||
const tokens2 = denom.split('/').slice(2); |
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.
ở đâu nói nó là cái thứ 3?
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.
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.
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.
nếu như này thì với 1 channel sẽ chỉ ra 1 config nhất định?
lưu cái này lại rồi chỉ cần cắt hoặc ghép là xong, ko cần split gì
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.
${port_id}/${channel_id}/
Cái này ko phải hằng số ạ. Port_id là hằng số những channel_id ko phải.
Ví dụ: transfer/channel_1/uaura, transfer/channel_3/uaura, transfer/channel_6/uaura, ....
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.
Nó cần biết nó đi qua channel nào nên trong denom chứa channel_id ạ
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.
thì hiện tại trong model ibc_channel
em có cả channel_id
và port_id
rồi, thì cái giá trị kia chả cố định còn gì
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.
À em hiểu ý anh rồi. Nhưng có trường hợp như thế này:
transfer/channel-2/transfer/channel-5/transfer/channel-9/uaura
A->B->C->D
Em dùng split để cắt 2 cắt 2 cái đầu tiên khi trace từ D về C, xong tương trự trace từ C về B thì cắt tiếp 2 cái tiếp theo
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.
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.
} | ||
} | ||
|
||
parseDenom( |
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.
mục tiêu của hàm này là gì?
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.
parse denom ở receive chain
ibc_message_id: msg.id, | ||
receiver, | ||
amount, | ||
denom, |
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.
sao ko có status?
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.
Send và Timeout sẽ ko có status, Recv và Ack sẽ có status. Ta có thể nhóm cả cụm ( Send, Recv, Ack ) nhờ sequence key nên có thể trace được Send đầu
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.
Timeout rõ ràng là fail sao lại ko có status?
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.
Status kia em lưu là kết quả của ack bên receive chain:
- TRANSFER: ko có status vì transfer chưa có result của ack
- RECV: có status true/false là kết quả của xử lý logic của bên receive chain
- ACK: có status true/false là kết quả của xử lý logic của bên receive chain khi gửi về send chain
- TIMEOUT: ko có status vì nó ko phải ack
Anh đang hiểu status kiểu là trạng thái của ibc message. Anyway, nếu vậy em sẽ sửa lại đoạn này
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.
nếu timeout ko có status thì làm sao biết là nó timeout
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.
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.
Chain B ko có sự thay đổi, bên A sau khi nhận MsgTimeout sẽ refund về cho sender
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.
cái đó anh biết rồi, nhưng nếu ko lưu vào bảng này, thì xem bảng này sẽ ko biết được data nó đang như thế nào, như vậy là ko đúng với việc dùng cho app, vì app vẫn phải quan tâm xem package chạy đến đâu
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.
Tương tự 1 packet TCP/IP, 1 packet IBC có data ở 2 tầng được lưu ở 2 bảng ibc_message và ibc_app có foreign 1-1 với nhau. Sau muốn xử lý thì chắc chắn phải join 2 bảng với nhau để lấy đủ data, nếu anh muốn chỉ lấy từ 1 bảng thì phải move 1 phần data từ bảng kia lên hoặc duplicate
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.
đúng rồi, anh làm ở tầng app thì anh ko cần phải quan tâm packet nó chạy như nào, khi có data thì nó phải có đủ thông tin trong đó
…into feat/ibc_app_ics20_dev
có biết được version ics20 nào đang chạy ở 1 channel hoặc với các packet hay ko? |
…into feat/ibc_app_ics20_dev
* fix: display json on multiple lines * fix: update launch.json to debug jest in 1 file; use moleculer.config.ts when debug service
* feat: crawl ibc tao * feat: crawl genesis ibc tao * fix: code * fix: code * feat: ibc app * feat: ibc app * test: ibc app * fix: review
…into feat/ibc_app_ics20_dev
…into feat/ibc_app_ics20_dev
ref #340