-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
feature/ implement substrate event parser #923
feature/ implement substrate event parser #923
Conversation
go.mod
Outdated
sigs.k8s.io/yaml v1.3.0 // indirect | ||
) | ||
|
||
require github.com/ComposableFi/go-substrate-rpc-client/v4 v4.0.1-0.20220815083349-ea2c4ccf9f2e |
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.
should be able to move this up into the top level require
block afaik
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.
This is a fork of centrifuge repo, I made it separate from other packages because we need to replace it with the upstream version after merging to their repo. however, i can move it next to the rest.
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.
Done
go.mod
Outdated
github.com/Microsoft/go-winio v0.5.2 // indirect | ||
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect | ||
github.com/Workiva/go-datastructures v1.0.53 // indirect | ||
github.com/ChainSafe/go-schnorrkel v1.0.0 // indirect |
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.
This version of go-schnorrkel
conflicts with the one used by tendermint, which is the cause of most of the errors in the CI. I'd suggest using this at the bottom of go.mod instead:
replace github.com/ChainSafe/go-schnorrkel/1 => github.com/ChainSafe/go-schnorrkel v1.0.0
Then you can use import "github.com/ChainSafe/go-schnorrkel/1"
anywhere go-schnorrkel is used. Since this is in go-substrate-rpc-client
, you would need to make the go mod change in that repo (or a fork that is used here) also.
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.
The go-supstrat-rpc-client
is using the go-subkey as a direct dependency so the github.com/ChainSafe/go-schnorrkel v1.0.0
is comming as indirect dependency to this repo. If we decide to modify the version, we need to modify the go-subkey
repo which is using the go-schnorrkel
.
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.
However, I will fork the sub-key and change it in the Composable organization
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.
It has been fixed and using
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d
|
||
switch eType { | ||
|
||
case "CreateClient": |
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.
It looks like a fallthrough
was intended here. In go, cases will not fall through by default.
These can be simplified to, for example:
case "CreateClient", "UpgradeClient", "ClientMisbehaviour":
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.
Done
Data: ce.data, | ||
TimeoutHeight: ce.timeoutHeight, | ||
TimeoutTimestamp: ce.timeoutTimestamp, | ||
// TODO: how to populate Ack |
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.
The Ack
bytes come from the WriteAcknowledgement
event, while the rest of the params come from the ReceivePacket
event. We use packetAccumulator
for combining the info from both events in the cosmos event parser.
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.
Does it mean
info = &packetInfo{Height: height}
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.
In cosmos, both the WriteAcknowledgement
and ReceivePacket
event will be included in a single IBC message. The packetInfo
should be constructed with the Height
property, as you have shown, if info is nil. If info is not nil, it should be casted to packetInfo
. The attributes should be parsed into the resulting packetInfo
. This will "accumulate" the properties from multiple events into a single packetInfo
. The case of the WriteAcknowledgement
/ReceivePacket
events in the same message is the only need for the accumulator, the rest of the message types do not need an accumulator.
if msg.info == nil { |
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.
In this context, where is msg
?
Given that the function signature is
func (scp *SubstrateChainProcessor) handleIBCMessagesFromEvents(ibcEvents rpcclienttypes.IBCEventsQueryResult, height uint64, c processor.IBCMessagesCache) error {
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.
Done, Please check the implementation.
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.
@agouin can you confirm, please?
// Ack: , | ||
|
||
} | ||
eventType = eType |
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.
The PathProcessor
depends on the eventType being in the format of ibc-go
. For example, instead of SendPacket
, it should be chantypes.EventTypeSendPacket
(which is send_packet
). A helper might be nice to translate from the substrate ibc event type to the ibc-go event type.
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.
Here's a consolidated place to find them in the cosmos event parser
switch event.Type { |
return nil | ||
} | ||
|
||
func (res *clientInfo) parseAttrs(log *zap.Logger, attributes interface{}) { |
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.
is there a reason for which this function does not return an error?
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.
Errors are being logged in parseAttr
, The IBC message is populated from the events, so there is no way to return the error to the source, So in these methods, the errors is being logged. @agouin can clarify it better.
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.
In the cosmos event parser, it makes a best effort attempt to parse all of the attributes that are present, but does not quit if there is an issue parsing a single attribute. This is consistent here also.
//TODO implement me | ||
panic("implement me") | ||
func (scp *SubstrateChainProcessor) ibcMessagesFromTransaction(ibcEvents rpcclienttypes.IBCEventsQueryResult, height uint64) (messages []ibcMessage) { | ||
packetAccumulator := make(map[uint64]*packetInfo) |
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.
Can we expect that all of the ibcEvents
are relative to a single channel? If not, I think the key here will need to change from uint64
to a type that has the sequence and the channel information, e.g.:
type ibcPacketKey struct {
sequence uint64
channelKey provider.ChannelKey
}
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.
Added
relayer/chains/substrate/utils.go
Outdated
case WriteAcknowledgement: | ||
return "not supported" //TOOD: confirm | ||
case AcknowledgePacket: | ||
return "not supported" //TOOD: confirm |
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.
chantypes.EventTypeAcknowledgePacket
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.
Done
relayer/chains/substrate/utils.go
Outdated
case ReceivePacket: | ||
return "not supported" //TOOD: confirm | ||
case WriteAcknowledgement: | ||
return "not supported" //TOOD: confirm |
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.
chantypes.EventTypeWriteAck
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.
Done
relayer/chains/substrate/utils.go
Outdated
case SendPacket: | ||
return chantypes.EventTypeSendPacket | ||
case ReceivePacket: | ||
return "not supported" //TOOD: confirm |
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.
chantypes.EventTypeRecvPacket
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.
Done
relayer/chains/substrate/utils.go
Outdated
case UpdateClient: | ||
return clienttypes.EventTypeUpdateClient | ||
case ClientMisbehaviour: | ||
return "not supported" //TOOD: confirm |
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.
clienttypes.EventTypeSubmitMisbehaviour
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.
Done
relayer/chains/substrate/utils.go
Outdated
case CloseConfirmChannel: | ||
return chantypes.EventTypeChannelCloseConfirm | ||
case OpenInitConnection: | ||
return chantypes.EventTypeChannelOpenInit |
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.
conntypes.EventTypeConnectionOpenInit
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.
Done
relayer/chains/substrate/utils.go
Outdated
case OpenInitConnection: | ||
return chantypes.EventTypeChannelOpenInit | ||
case OpenTryConnection: | ||
return chantypes.EventTypeChannelOpenTry |
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.
conntypes.EventTypeConnectionOpenTry
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.
Done
relayer/chains/substrate/utils.go
Outdated
case OpenTryConnection: | ||
return chantypes.EventTypeChannelOpenTry | ||
case OpenAckConnection: | ||
return "not supported" //TOOD: confirm |
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.
conntypes.EventTypeConnectionOpenAck
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.
Done
relayer/chains/substrate/utils.go
Outdated
case OpenAckConnection: | ||
return "not supported" //TOOD: confirm | ||
case OpenConfirmConnection: | ||
return "not supported" //TOOD: confirm |
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.
conntypes.EventTypeConnectionOpenConfirm
|
||
packetAccumulator[accumKey].parseAttrs(scp.log, data) | ||
|
||
info = packetAccumulator[accumKey] |
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.
rather than setting info
here, since the accumulation might not be done yet for the packetInfo, we can remove this line, then iterate over the packetAccumulator
map outside of the for loop (down on line 103) and append the final accumulated packetInfos to messages
there.
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.
In the substrate chain query here, we are able to get events of a certain height, this means that it is possible to rewrite the info
by other irrelevant event info in client, connection, and channel events as well. so I think we should store all of them in separate lists and loop through them after for loop finish. I think in the current approach we will lost most of events and create last event message in append to messages list.
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.
I think we should store all of them in separate lists
The packetAccumulator
map here is already used for this to store packetInfo for unique channel/sequence.
... and loop through them after for loop finish.
this can be iterating over the packetAccumulator
on line 103 to append to messages
, and removing line 81.
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.
I am talking about other types of events than packet -related events, what about them? There is no guarantee that exist one and only one of these types. For example events may be consist of multiple CreateClient, but this approach assumes that there is only one CreateClient which is set into ClientInfo.
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.
the only reason for the packetAccumulator in the cosmos implementation is to accumulate the ack bytes from the write_acknowledgement
event with recv_packet
event. Other than that, all other IBC messages can be considered as 1-1 with the event. This brings up a good point though, this switch case only needs to handle the ReceivePacket
and WriteAcknowledgement
. There can be another switch case added for SendPacket, AcknowledgePacket, TimeoutPacket, TimeoutOnClosePacket
which can do the single parseAttrs
and set info
like the other switch cases.
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.
Done
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.
For example events may be consist of multiple CreateClient, but this approach assumes that there is only one CreateClient which is set into ClientInfo.
Yes, var info ibcMessageInfo
should move to line 36 and the bracket on line 90 should move to line 101 so that the info
nil check and messages
append are on each event.
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.
I see that info is now scoped inside the events loop in the latest, that looks good.
|
||
packetAccumulator[accumKey].parseAttrs(scp.log, data) | ||
|
||
info = packetAccumulator[accumKey] |
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.
We don't want to set info for this case.
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.
Done
info: info, | ||
}) | ||
} | ||
|
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.
here we should iterate over packetAccumulator
and append to messages
for each with an ibcMessage
like:
ibcMessage {
eventType: chantypes.EventTypeRecvPacket,
info: pi,
}
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.
Done
con.parseAttrs(scp.log, data) | ||
info = con | ||
|
||
eventType = eType |
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.
eventType = intoIBCEventType(eType)
here
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.
Done
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.
🥳 lets go!
Looks like we just need a |
* feat: implement substrate event parser * fix: event parser switch fallthrough * fix: go-schnorrkel version fix * fix: go mod update for dcokertest * create helper functions between substrate <> ibc events * use intoIBCEventType * fix: event parser accumulation support * fix: spearate parsing and handling of ibc messages * feat: parachain header parse * fix: packet accumulator separate switch case * fix: go.mod docker issue * fix: ics11-beefy repo version fix * fix: accumulator events to messages * fix: add connection event type conversion * fix: ibctest go.mod fix Co-authored-by: Blas Rodriguez Irizar <rodrigblas@gmail.com>
* feat: implement substrate event parser * fix: event parser switch fallthrough * fix: go-schnorrkel version fix * fix: go mod update for dcokertest * create helper functions between substrate <> ibc events * use intoIBCEventType * fix: event parser accumulation support * fix: spearate parsing and handling of ibc messages * feat: parachain header parse * fix: packet accumulator separate switch case * fix: go.mod docker issue * fix: ics11-beefy repo version fix * fix: accumulator events to messages * fix: add connection event type conversion * fix: ibctest go.mod fix Co-authored-by: Blas Rodriguez Irizar <rodrigblas@gmail.com>
* Merge PR #919: Clean up and move scripts folder and dev-env * clean up scripts * clean up Makerfile * cleanup configs * fix shebang * update data folder path * move to examples dir * update build-gaia path for make * add-dir description * examples * examples readme * add killall note to readme * fix link * remove extra config dir * update path in demo.md * readme nit * Use self-hosted runner for ibctest integration tests (#943) * bugfix - intermittent channel handshake failure (#937) * bugfix for intermittent channel handshake failure * Add unit tests for connection and channel state caches * Log messages in failed txs * Tidy * Adding MinGasAmount (#940) * Adding MinGasAmount * go.mod updates * Updating ibctest/go.mod * Adding min-gas-amount to CHANGELOG and troubleshooting * Merge PR #953: cosmos - begin and end block event parsing * Add begin and end block events * tidy * Handle multiple ibc messages in begin block and end block * Fix logic with accumulator * tidy * Fix nil pointer for begin/end block events (#956) * Fix bug with tracking processing channel msgs (#970) * add debug output * add more debug output * NEEDS MOAR DEBUG OUTPUT * test purging MsgTimeout on src vs. counterparty * reverse channel close msg purging * don't delete channel close msgs until another iteration in getUnrelayedPacketsAndAcks * add debug output * add more debug output * NEEDS MOAR DEBUG OUTPUT * test purging MsgTimeout on src vs. counterparty * reverse channel close msg purging * don't delete channel close msgs until another iteration in getUnrelayedPacketsAndAcks * reverse channel close msg purging * don't delete channel close msgs until another iteration in getUnrelayedPacketsAndAcks * undo previous changes regarding purging cache on max retries * undo more changes made in shouldSendChannelMessage * more undo * add debug output on msg send and channel cache purge * add debug output * remove pointless log * add logs in process latest msgs * more logs * logs * remove all debug logs and implement fix for tracking processing packets correctly * Merge PR #974: Clarify demo * update demo * remove extra dev-env * Merge PR #963: Additional Metrics * Adding block height and wallet balance metrics * Fixing duplicate registration * Assigning metrics during NewCosmosChainProcessor * Fixing latest height to use ChainId * Metrics are optional... * Merge PR #981: Update IBCdata struct Update IBCdata struct based on recent changes made at the Cosmos Chain Registry * Fix flattening of events (#979) * Fix flattening of events * Parse events without flattened tx.Log * Add missing write ack to switch case * Fix unnecessary retention of irrelevant messages (#980) * Merge PR #987: Use config.lock file to guard access to config.yaml in the case of linking multiple paths concurrently * ignore recv packet with empty ack bytes (#985) Co-authored-by: Jack Zampolin <jack.zampolin@gmail.com> * Relay multiple paths from the same process (#988) * wip: add test for relaying on many paths This test instantiates a relayer with the event processor that relays on two paths across three chains. This was ported from previous WIP that attempted to add multi-path support to the legacy processor for the relayer; multi-path support in the legacy processor had some subtle bugs that caused the test to fail. Now with the new event processor, the test is failing in a different way that we need to further debug. * Multiple paths same process with test * go mod tidy * fix old tests * Update to ibctest with race fix * Fix legacy relayer Co-authored-by: Mark Rushakoff <mark.rushakoff@gmail.com> * Default to events processor (#989) * Default to events processor * events processor is now default * sort packet messages by sequence number (#992) only process 1 packet at a time on ordered channels * path processor race (#995) * fix path processor indexing * clone maps before passing to pathprocessor * Merge should Clone * pre-size maps * Use in process Relayer for race detection (#996) * clone maps before passing to pathprocessor * Add local relayer implementation to help catch race conditions in CI * use existing relayerfactory * Isolate mutex to totalFees * handle feedback * fix fatalf format * Merge PR #999: Add ability to run all paths in config easil * Add ability to run all paths in config easily * PR review fixes * Fix tests and patch readme * Merge PR #1005: Fix legacy race condition * fix counterparty path filter (#1000) * fix counterparty path filter * Filter fix test * Add denylist test and add makefile and gh action * Slim test for non-self-hosted runner * Update ibctest to latest main * Make better assertion for denylist acks. Constants for allowlist/denylist. Validate filterRule in CLI * Use isolated prometheus registry per relayer instance instead of prometheus default registry * run path filter tests in parallel * dockerfile: move TARGET* args for fast workflow & ... (#993) - Single COPY step for go mod and sum - Use ENV GOOS & GOARCH from TARGET* args Co-authored-by: pratikbin <pratikbin+010101@no-reply-git.luolix.top> * Respect the `override` flag upon client creation (#997) * respect the override flag * add test case for --override usage * add missing godoc comment for test * disable CountTotal (#1009) * Fix account sequence mismatch errors (#1007) * Use mutex for tx account sequence query through tx broadcast, track account sequence number on chain provider * Make updateNextAccountSequence private * Retry for account sequence mismatch errors * Allow decrementing account sequence if node says it is expected * Add test for handleAccountSequenceMismatchError * Keystore implementation for substrate chain (#922) * add substrate keystore implementation * implement key provider for substrate chain * clean up keystore code * run go mod tidy moving rename test to _test * remove verbs from error messages * correct interface method comments in Keyring and Info types * initialize log in NewProvider method * move type definitions to method implementation files * check if KeyDirectory is empty before overwriting it in the NewProvider method * remove comments in ExportPrivKeyArmor * bump substrate-rpc-client to latest master * change network type to uint16 * update go.mod in ibctest * feat: add chain processor implementation (#924) * feat: add chain processor implementation * fix: go-schnorrkel version fix * fix: go mod update dockertest * feature/ implement substrate event parser (#923) * feat: implement substrate event parser * fix: event parser switch fallthrough * fix: go-schnorrkel version fix * fix: go mod update for dcokertest * create helper functions between substrate <> ibc events * use intoIBCEventType * fix: event parser accumulation support * fix: spearate parsing and handling of ibc messages * feat: parachain header parse * fix: packet accumulator separate switch case * fix: go.mod docker issue * fix: ics11-beefy repo version fix * fix: accumulator events to messages * fix: add connection event type conversion * fix: ibctest go.mod fix Co-authored-by: Blas Rodriguez Irizar <rodrigblas@gmail.com> * fix: go.mod Co-authored-by: Dan Kanefsky <56059752+boojamya@users.noreply.github.com> Co-authored-by: Andrew Gouin <andrew@gouin.io> Co-authored-by: Joe Abbey <joe.abbey@gmail.com> Co-authored-by: Justin Tieri <37750742+jtieri@users.noreply.github.com> Co-authored-by: JeremyParish69 <95667791+JeremyParish69@users.noreply.github.com> Co-authored-by: Jack Zampolin <jack.zampolin@gmail.com> Co-authored-by: Mark Rushakoff <mark.rushakoff@gmail.com> Co-authored-by: pratikbin <68642400+pratikbin@users.noreply.github.com> Co-authored-by: pratikbin <pratikbin+010101@no-reply-git.luolix.top> Co-authored-by: Osho Emmanuel <oshoklinsmann@gmail.com> Co-authored-by: Blas Rodriguez Irizar <rodrigblas@gmail.com>
* feat: add SubstrateIBCHeader type and implementation * fix: ibctest go mod tidy * feature/ implement substrate event parser (#923) * feat: implement substrate event parser * fix: event parser switch fallthrough * fix: go-schnorrkel version fix * fix: go mod update for dcokertest * create helper functions between substrate <> ibc events * use intoIBCEventType * fix: event parser accumulation support * fix: spearate parsing and handling of ibc messages * feat: parachain header parse * fix: packet accumulator separate switch case * fix: go.mod docker issue * fix: ics11-beefy repo version fix * fix: accumulator events to messages * fix: add connection event type conversion * fix: ibctest go.mod fix Co-authored-by: Blas Rodriguez Irizar <rodrigblas@gmail.com> Co-authored-by: Blas Rodriguez Irizar <rodrigblas@gmail.com>
* feat: implement substrate event parser * fix: event parser switch fallthrough * fix: go-schnorrkel version fix * fix: go mod update for dcokertest * create helper functions between substrate <> ibc events * use intoIBCEventType * fix: event parser accumulation support * fix: spearate parsing and handling of ibc messages * feat: parachain header parse * fix: packet accumulator separate switch case * fix: go.mod docker issue * fix: ics11-beefy repo version fix * fix: accumulator events to messages * fix: add connection event type conversion * fix: ibctest go.mod fix Co-authored-by: Blas Rodriguez Irizar <rodrigblas@gmail.com>
* Merge PR cosmos#919: Clean up and move scripts folder and dev-env * clean up scripts * clean up Makerfile * cleanup configs * fix shebang * update data folder path * move to examples dir * update build-gaia path for make * add-dir description * examples * examples readme * add killall note to readme * fix link * remove extra config dir * update path in demo.md * readme nit * Use self-hosted runner for ibctest integration tests (cosmos#943) * bugfix - intermittent channel handshake failure (cosmos#937) * bugfix for intermittent channel handshake failure * Add unit tests for connection and channel state caches * Log messages in failed txs * Tidy * Adding MinGasAmount (cosmos#940) * Adding MinGasAmount * go.mod updates * Updating ibctest/go.mod * Adding min-gas-amount to CHANGELOG and troubleshooting * Merge PR cosmos#953: cosmos - begin and end block event parsing * Add begin and end block events * tidy * Handle multiple ibc messages in begin block and end block * Fix logic with accumulator * tidy * Fix nil pointer for begin/end block events (cosmos#956) * Fix bug with tracking processing channel msgs (cosmos#970) * add debug output * add more debug output * NEEDS MOAR DEBUG OUTPUT * test purging MsgTimeout on src vs. counterparty * reverse channel close msg purging * don't delete channel close msgs until another iteration in getUnrelayedPacketsAndAcks * add debug output * add more debug output * NEEDS MOAR DEBUG OUTPUT * test purging MsgTimeout on src vs. counterparty * reverse channel close msg purging * don't delete channel close msgs until another iteration in getUnrelayedPacketsAndAcks * reverse channel close msg purging * don't delete channel close msgs until another iteration in getUnrelayedPacketsAndAcks * undo previous changes regarding purging cache on max retries * undo more changes made in shouldSendChannelMessage * more undo * add debug output on msg send and channel cache purge * add debug output * remove pointless log * add logs in process latest msgs * more logs * logs * remove all debug logs and implement fix for tracking processing packets correctly * Merge PR cosmos#974: Clarify demo * update demo * remove extra dev-env * Merge PR cosmos#963: Additional Metrics * Adding block height and wallet balance metrics * Fixing duplicate registration * Assigning metrics during NewCosmosChainProcessor * Fixing latest height to use ChainId * Metrics are optional... * Merge PR cosmos#981: Update IBCdata struct Update IBCdata struct based on recent changes made at the Cosmos Chain Registry * Fix flattening of events (cosmos#979) * Fix flattening of events * Parse events without flattened tx.Log * Add missing write ack to switch case * Fix unnecessary retention of irrelevant messages (cosmos#980) * Merge PR cosmos#987: Use config.lock file to guard access to config.yaml in the case of linking multiple paths concurrently * ignore recv packet with empty ack bytes (cosmos#985) Co-authored-by: Jack Zampolin <jack.zampolin@gmail.com> * Relay multiple paths from the same process (cosmos#988) * wip: add test for relaying on many paths This test instantiates a relayer with the event processor that relays on two paths across three chains. This was ported from previous WIP that attempted to add multi-path support to the legacy processor for the relayer; multi-path support in the legacy processor had some subtle bugs that caused the test to fail. Now with the new event processor, the test is failing in a different way that we need to further debug. * Multiple paths same process with test * go mod tidy * fix old tests * Update to ibctest with race fix * Fix legacy relayer Co-authored-by: Mark Rushakoff <mark.rushakoff@gmail.com> * Default to events processor (cosmos#989) * Default to events processor * events processor is now default * sort packet messages by sequence number (cosmos#992) only process 1 packet at a time on ordered channels * path processor race (cosmos#995) * fix path processor indexing * clone maps before passing to pathprocessor * Merge should Clone * pre-size maps * Use in process Relayer for race detection (cosmos#996) * clone maps before passing to pathprocessor * Add local relayer implementation to help catch race conditions in CI * use existing relayerfactory * Isolate mutex to totalFees * handle feedback * fix fatalf format * Merge PR cosmos#999: Add ability to run all paths in config easil * Add ability to run all paths in config easily * PR review fixes * Fix tests and patch readme * Merge PR cosmos#1005: Fix legacy race condition * fix counterparty path filter (cosmos#1000) * fix counterparty path filter * Filter fix test * Add denylist test and add makefile and gh action * Slim test for non-self-hosted runner * Update ibctest to latest main * Make better assertion for denylist acks. Constants for allowlist/denylist. Validate filterRule in CLI * Use isolated prometheus registry per relayer instance instead of prometheus default registry * run path filter tests in parallel * dockerfile: move TARGET* args for fast workflow & ... (cosmos#993) - Single COPY step for go mod and sum - Use ENV GOOS & GOARCH from TARGET* args Co-authored-by: pratikbin <pratikbin+010101@no-reply-git.luolix.top> * Respect the `override` flag upon client creation (cosmos#997) * respect the override flag * add test case for --override usage * add missing godoc comment for test * disable CountTotal (cosmos#1009) * Fix account sequence mismatch errors (cosmos#1007) * Use mutex for tx account sequence query through tx broadcast, track account sequence number on chain provider * Make updateNextAccountSequence private * Retry for account sequence mismatch errors * Allow decrementing account sequence if node says it is expected * Add test for handleAccountSequenceMismatchError * Keystore implementation for substrate chain (cosmos#922) * add substrate keystore implementation * implement key provider for substrate chain * clean up keystore code * run go mod tidy moving rename test to _test * remove verbs from error messages * correct interface method comments in Keyring and Info types * initialize log in NewProvider method * move type definitions to method implementation files * check if KeyDirectory is empty before overwriting it in the NewProvider method * remove comments in ExportPrivKeyArmor * bump substrate-rpc-client to latest master * change network type to uint16 * update go.mod in ibctest * feat: add chain processor implementation (cosmos#924) * feat: add chain processor implementation * fix: go-schnorrkel version fix * fix: go mod update dockertest * feature/ implement substrate event parser (cosmos#923) * feat: implement substrate event parser * fix: event parser switch fallthrough * fix: go-schnorrkel version fix * fix: go mod update for dcokertest * create helper functions between substrate <> ibc events * use intoIBCEventType * fix: event parser accumulation support * fix: spearate parsing and handling of ibc messages * feat: parachain header parse * fix: packet accumulator separate switch case * fix: go.mod docker issue * fix: ics11-beefy repo version fix * fix: accumulator events to messages * fix: add connection event type conversion * fix: ibctest go.mod fix Co-authored-by: Blas Rodriguez Irizar <rodrigblas@gmail.com> * fix: go.mod Co-authored-by: Dan Kanefsky <56059752+boojamya@users.noreply.github.com> Co-authored-by: Andrew Gouin <andrew@gouin.io> Co-authored-by: Joe Abbey <joe.abbey@gmail.com> Co-authored-by: Justin Tieri <37750742+jtieri@users.noreply.github.com> Co-authored-by: JeremyParish69 <95667791+JeremyParish69@users.noreply.github.com> Co-authored-by: Jack Zampolin <jack.zampolin@gmail.com> Co-authored-by: Mark Rushakoff <mark.rushakoff@gmail.com> Co-authored-by: pratikbin <68642400+pratikbin@users.noreply.github.com> Co-authored-by: pratikbin <pratikbin+010101@no-reply-git.luolix.top> Co-authored-by: Osho Emmanuel <oshoklinsmann@gmail.com> Co-authored-by: Blas Rodriguez Irizar <rodrigblas@gmail.com>
* feat: add SubstrateIBCHeader type and implementation * fix: ibctest go mod tidy * feature/ implement substrate event parser (cosmos#923) * feat: implement substrate event parser * fix: event parser switch fallthrough * fix: go-schnorrkel version fix * fix: go mod update for dcokertest * create helper functions between substrate <> ibc events * use intoIBCEventType * fix: event parser accumulation support * fix: spearate parsing and handling of ibc messages * feat: parachain header parse * fix: packet accumulator separate switch case * fix: go.mod docker issue * fix: ics11-beefy repo version fix * fix: accumulator events to messages * fix: add connection event type conversion * fix: ibctest go.mod fix Co-authored-by: Blas Rodriguez Irizar <rodrigblas@gmail.com> Co-authored-by: Blas Rodriguez Irizar <rodrigblas@gmail.com>
* feat: implement substrate event parser * fix: event parser switch fallthrough * fix: go-schnorrkel version fix * fix: go mod update for dcokertest * create helper functions between substrate <> ibc events * use intoIBCEventType * fix: event parser accumulation support * fix: spearate parsing and handling of ibc messages * feat: parachain header parse * fix: packet accumulator separate switch case * fix: go.mod docker issue * fix: ics11-beefy repo version fix * fix: accumulator events to messages * fix: add connection event type conversion * fix: ibctest go.mod fix Co-authored-by: Blas Rodriguez Irizar <rodrigblas@gmail.com>
* Merge PR cosmos#919: Clean up and move scripts folder and dev-env * clean up scripts * clean up Makerfile * cleanup configs * fix shebang * update data folder path * move to examples dir * update build-gaia path for make * add-dir description * examples * examples readme * add killall note to readme * fix link * remove extra config dir * update path in demo.md * readme nit * Use self-hosted runner for ibctest integration tests (cosmos#943) * bugfix - intermittent channel handshake failure (cosmos#937) * bugfix for intermittent channel handshake failure * Add unit tests for connection and channel state caches * Log messages in failed txs * Tidy * Adding MinGasAmount (cosmos#940) * Adding MinGasAmount * go.mod updates * Updating ibctest/go.mod * Adding min-gas-amount to CHANGELOG and troubleshooting * Merge PR cosmos#953: cosmos - begin and end block event parsing * Add begin and end block events * tidy * Handle multiple ibc messages in begin block and end block * Fix logic with accumulator * tidy * Fix nil pointer for begin/end block events (cosmos#956) * Fix bug with tracking processing channel msgs (cosmos#970) * add debug output * add more debug output * NEEDS MOAR DEBUG OUTPUT * test purging MsgTimeout on src vs. counterparty * reverse channel close msg purging * don't delete channel close msgs until another iteration in getUnrelayedPacketsAndAcks * add debug output * add more debug output * NEEDS MOAR DEBUG OUTPUT * test purging MsgTimeout on src vs. counterparty * reverse channel close msg purging * don't delete channel close msgs until another iteration in getUnrelayedPacketsAndAcks * reverse channel close msg purging * don't delete channel close msgs until another iteration in getUnrelayedPacketsAndAcks * undo previous changes regarding purging cache on max retries * undo more changes made in shouldSendChannelMessage * more undo * add debug output on msg send and channel cache purge * add debug output * remove pointless log * add logs in process latest msgs * more logs * logs * remove all debug logs and implement fix for tracking processing packets correctly * Merge PR cosmos#974: Clarify demo * update demo * remove extra dev-env * Merge PR cosmos#963: Additional Metrics * Adding block height and wallet balance metrics * Fixing duplicate registration * Assigning metrics during NewCosmosChainProcessor * Fixing latest height to use ChainId * Metrics are optional... * Merge PR cosmos#981: Update IBCdata struct Update IBCdata struct based on recent changes made at the Cosmos Chain Registry * Fix flattening of events (cosmos#979) * Fix flattening of events * Parse events without flattened tx.Log * Add missing write ack to switch case * Fix unnecessary retention of irrelevant messages (cosmos#980) * Merge PR cosmos#987: Use config.lock file to guard access to config.yaml in the case of linking multiple paths concurrently * ignore recv packet with empty ack bytes (cosmos#985) Co-authored-by: Jack Zampolin <jack.zampolin@gmail.com> * Relay multiple paths from the same process (cosmos#988) * wip: add test for relaying on many paths This test instantiates a relayer with the event processor that relays on two paths across three chains. This was ported from previous WIP that attempted to add multi-path support to the legacy processor for the relayer; multi-path support in the legacy processor had some subtle bugs that caused the test to fail. Now with the new event processor, the test is failing in a different way that we need to further debug. * Multiple paths same process with test * go mod tidy * fix old tests * Update to ibctest with race fix * Fix legacy relayer Co-authored-by: Mark Rushakoff <mark.rushakoff@gmail.com> * Default to events processor (cosmos#989) * Default to events processor * events processor is now default * sort packet messages by sequence number (cosmos#992) only process 1 packet at a time on ordered channels * path processor race (cosmos#995) * fix path processor indexing * clone maps before passing to pathprocessor * Merge should Clone * pre-size maps * Use in process Relayer for race detection (cosmos#996) * clone maps before passing to pathprocessor * Add local relayer implementation to help catch race conditions in CI * use existing relayerfactory * Isolate mutex to totalFees * handle feedback * fix fatalf format * Merge PR cosmos#999: Add ability to run all paths in config easil * Add ability to run all paths in config easily * PR review fixes * Fix tests and patch readme * Merge PR cosmos#1005: Fix legacy race condition * fix counterparty path filter (cosmos#1000) * fix counterparty path filter * Filter fix test * Add denylist test and add makefile and gh action * Slim test for non-self-hosted runner * Update ibctest to latest main * Make better assertion for denylist acks. Constants for allowlist/denylist. Validate filterRule in CLI * Use isolated prometheus registry per relayer instance instead of prometheus default registry * run path filter tests in parallel * dockerfile: move TARGET* args for fast workflow & ... (cosmos#993) - Single COPY step for go mod and sum - Use ENV GOOS & GOARCH from TARGET* args Co-authored-by: pratikbin <pratikbin+010101@no-reply-git.luolix.top> * Respect the `override` flag upon client creation (cosmos#997) * respect the override flag * add test case for --override usage * add missing godoc comment for test * disable CountTotal (cosmos#1009) * Fix account sequence mismatch errors (cosmos#1007) * Use mutex for tx account sequence query through tx broadcast, track account sequence number on chain provider * Make updateNextAccountSequence private * Retry for account sequence mismatch errors * Allow decrementing account sequence if node says it is expected * Add test for handleAccountSequenceMismatchError * Keystore implementation for substrate chain (cosmos#922) * add substrate keystore implementation * implement key provider for substrate chain * clean up keystore code * run go mod tidy moving rename test to _test * remove verbs from error messages * correct interface method comments in Keyring and Info types * initialize log in NewProvider method * move type definitions to method implementation files * check if KeyDirectory is empty before overwriting it in the NewProvider method * remove comments in ExportPrivKeyArmor * bump substrate-rpc-client to latest master * change network type to uint16 * update go.mod in ibctest * feat: add chain processor implementation (cosmos#924) * feat: add chain processor implementation * fix: go-schnorrkel version fix * fix: go mod update dockertest * feature/ implement substrate event parser (cosmos#923) * feat: implement substrate event parser * fix: event parser switch fallthrough * fix: go-schnorrkel version fix * fix: go mod update for dcokertest * create helper functions between substrate <> ibc events * use intoIBCEventType * fix: event parser accumulation support * fix: spearate parsing and handling of ibc messages * feat: parachain header parse * fix: packet accumulator separate switch case * fix: go.mod docker issue * fix: ics11-beefy repo version fix * fix: accumulator events to messages * fix: add connection event type conversion * fix: ibctest go.mod fix Co-authored-by: Blas Rodriguez Irizar <rodrigblas@gmail.com> * fix: go.mod Co-authored-by: Dan Kanefsky <56059752+boojamya@users.noreply.github.com> Co-authored-by: Andrew Gouin <andrew@gouin.io> Co-authored-by: Joe Abbey <joe.abbey@gmail.com> Co-authored-by: Justin Tieri <37750742+jtieri@users.noreply.github.com> Co-authored-by: JeremyParish69 <95667791+JeremyParish69@users.noreply.github.com> Co-authored-by: Jack Zampolin <jack.zampolin@gmail.com> Co-authored-by: Mark Rushakoff <mark.rushakoff@gmail.com> Co-authored-by: pratikbin <68642400+pratikbin@users.noreply.github.com> Co-authored-by: pratikbin <pratikbin+010101@no-reply-git.luolix.top> Co-authored-by: Osho Emmanuel <oshoklinsmann@gmail.com> Co-authored-by: Blas Rodriguez Irizar <rodrigblas@gmail.com>
* feat: add SubstrateIBCHeader type and implementation * fix: ibctest go mod tidy * feature/ implement substrate event parser (cosmos#923) * feat: implement substrate event parser * fix: event parser switch fallthrough * fix: go-schnorrkel version fix * fix: go mod update for dcokertest * create helper functions between substrate <> ibc events * use intoIBCEventType * fix: event parser accumulation support * fix: spearate parsing and handling of ibc messages * feat: parachain header parse * fix: packet accumulator separate switch case * fix: go.mod docker issue * fix: ics11-beefy repo version fix * fix: accumulator events to messages * fix: add connection event type conversion * fix: ibctest go.mod fix Co-authored-by: Blas Rodriguez Irizar <rodrigblas@gmail.com> Co-authored-by: Blas Rodriguez Irizar <rodrigblas@gmail.com>
* Merge PR #919: Clean up and move scripts folder and dev-env * clean up scripts * clean up Makerfile * cleanup configs * fix shebang * update data folder path * move to examples dir * update build-gaia path for make * add-dir description * examples * examples readme * add killall note to readme * fix link * remove extra config dir * update path in demo.md * readme nit * Use self-hosted runner for ibctest integration tests (#943) * bugfix - intermittent channel handshake failure (#937) * bugfix for intermittent channel handshake failure * Add unit tests for connection and channel state caches * Log messages in failed txs * Tidy * Adding MinGasAmount (#940) * Adding MinGasAmount * go.mod updates * Updating ibctest/go.mod * Adding min-gas-amount to CHANGELOG and troubleshooting * Merge PR #953: cosmos - begin and end block event parsing * Add begin and end block events * tidy * Handle multiple ibc messages in begin block and end block * Fix logic with accumulator * tidy * Fix nil pointer for begin/end block events (#956) * Fix bug with tracking processing channel msgs (#970) * add debug output * add more debug output * NEEDS MOAR DEBUG OUTPUT * test purging MsgTimeout on src vs. counterparty * reverse channel close msg purging * don't delete channel close msgs until another iteration in getUnrelayedPacketsAndAcks * add debug output * add more debug output * NEEDS MOAR DEBUG OUTPUT * test purging MsgTimeout on src vs. counterparty * reverse channel close msg purging * don't delete channel close msgs until another iteration in getUnrelayedPacketsAndAcks * reverse channel close msg purging * don't delete channel close msgs until another iteration in getUnrelayedPacketsAndAcks * undo previous changes regarding purging cache on max retries * undo more changes made in shouldSendChannelMessage * more undo * add debug output on msg send and channel cache purge * add debug output * remove pointless log * add logs in process latest msgs * more logs * logs * remove all debug logs and implement fix for tracking processing packets correctly * Merge PR #974: Clarify demo * update demo * remove extra dev-env * Merge PR #963: Additional Metrics * Adding block height and wallet balance metrics * Fixing duplicate registration * Assigning metrics during NewCosmosChainProcessor * Fixing latest height to use ChainId * Metrics are optional... * Merge PR #981: Update IBCdata struct Update IBCdata struct based on recent changes made at the Cosmos Chain Registry * Fix flattening of events (#979) * Fix flattening of events * Parse events without flattened tx.Log * Add missing write ack to switch case * Fix unnecessary retention of irrelevant messages (#980) * Merge PR #987: Use config.lock file to guard access to config.yaml in the case of linking multiple paths concurrently * ignore recv packet with empty ack bytes (#985) Co-authored-by: Jack Zampolin <jack.zampolin@gmail.com> * Relay multiple paths from the same process (#988) * wip: add test for relaying on many paths This test instantiates a relayer with the event processor that relays on two paths across three chains. This was ported from previous WIP that attempted to add multi-path support to the legacy processor for the relayer; multi-path support in the legacy processor had some subtle bugs that caused the test to fail. Now with the new event processor, the test is failing in a different way that we need to further debug. * Multiple paths same process with test * go mod tidy * fix old tests * Update to ibctest with race fix * Fix legacy relayer Co-authored-by: Mark Rushakoff <mark.rushakoff@gmail.com> * Default to events processor (#989) * Default to events processor * events processor is now default * sort packet messages by sequence number (#992) only process 1 packet at a time on ordered channels * path processor race (#995) * fix path processor indexing * clone maps before passing to pathprocessor * Merge should Clone * pre-size maps * Use in process Relayer for race detection (#996) * clone maps before passing to pathprocessor * Add local relayer implementation to help catch race conditions in CI * use existing relayerfactory * Isolate mutex to totalFees * handle feedback * fix fatalf format * Merge PR #999: Add ability to run all paths in config easil * Add ability to run all paths in config easily * PR review fixes * Fix tests and patch readme * Merge PR #1005: Fix legacy race condition * fix counterparty path filter (#1000) * fix counterparty path filter * Filter fix test * Add denylist test and add makefile and gh action * Slim test for non-self-hosted runner * Update ibctest to latest main * Make better assertion for denylist acks. Constants for allowlist/denylist. Validate filterRule in CLI * Use isolated prometheus registry per relayer instance instead of prometheus default registry * run path filter tests in parallel * dockerfile: move TARGET* args for fast workflow & ... (#993) - Single COPY step for go mod and sum - Use ENV GOOS & GOARCH from TARGET* args Co-authored-by: pratikbin <pratikbin+010101@no-reply-git.luolix.top> * Respect the `override` flag upon client creation (#997) * respect the override flag * add test case for --override usage * add missing godoc comment for test * disable CountTotal (#1009) * Fix account sequence mismatch errors (#1007) * Use mutex for tx account sequence query through tx broadcast, track account sequence number on chain provider * Make updateNextAccountSequence private * Retry for account sequence mismatch errors * Allow decrementing account sequence if node says it is expected * Add test for handleAccountSequenceMismatchError * Bumps versions of some libs (#1010) * bumps * run cmds for go mod tidy Co-authored-by: Andrew Gouin <andrew@gouin.io> Co-authored-by: jtieri <justin@thetieris.com> * Add test case for multiple channels on one connection + remove integration tests in `_test` (#1021) * test: add multiple channels on one connection test case via ibctest * chore: remove old docker integration test make cmds * chore: remove github CI actions for old docker integration tests * chore: remove `_test` directory containing the old docker integration tests * Keystore implementation for substrate chain (#922) * add substrate keystore implementation * implement key provider for substrate chain * clean up keystore code * run go mod tidy moving rename test to _test * remove verbs from error messages * correct interface method comments in Keyring and Info types * initialize log in NewProvider method * move type definitions to method implementation files * check if KeyDirectory is empty before overwriting it in the NewProvider method * remove comments in ExportPrivKeyArmor * bump substrate-rpc-client to latest master * change network type to uint16 * update go.mod in ibctest * feat: add chain processor implementation (#924) * feat: add chain processor implementation * fix: go-schnorrkel version fix * fix: go mod update dockertest * feature/ implement substrate event parser (#923) * feat: implement substrate event parser * fix: event parser switch fallthrough * fix: go-schnorrkel version fix * fix: go mod update for dcokertest * create helper functions between substrate <> ibc events * use intoIBCEventType * fix: event parser accumulation support * fix: spearate parsing and handling of ibc messages * feat: parachain header parse * fix: packet accumulator separate switch case * fix: go.mod docker issue * fix: ics11-beefy repo version fix * fix: accumulator events to messages * fix: add connection event type conversion * fix: ibctest go.mod fix Co-authored-by: Blas Rodriguez Irizar <rodrigblas@gmail.com> * Sync/feat substrate main merge (#1016) * Merge PR #919: Clean up and move scripts folder and dev-env * clean up scripts * clean up Makerfile * cleanup configs * fix shebang * update data folder path * move to examples dir * update build-gaia path for make * add-dir description * examples * examples readme * add killall note to readme * fix link * remove extra config dir * update path in demo.md * readme nit * Use self-hosted runner for ibctest integration tests (#943) * bugfix - intermittent channel handshake failure (#937) * bugfix for intermittent channel handshake failure * Add unit tests for connection and channel state caches * Log messages in failed txs * Tidy * Adding MinGasAmount (#940) * Adding MinGasAmount * go.mod updates * Updating ibctest/go.mod * Adding min-gas-amount to CHANGELOG and troubleshooting * Merge PR #953: cosmos - begin and end block event parsing * Add begin and end block events * tidy * Handle multiple ibc messages in begin block and end block * Fix logic with accumulator * tidy * Fix nil pointer for begin/end block events (#956) * Fix bug with tracking processing channel msgs (#970) * add debug output * add more debug output * NEEDS MOAR DEBUG OUTPUT * test purging MsgTimeout on src vs. counterparty * reverse channel close msg purging * don't delete channel close msgs until another iteration in getUnrelayedPacketsAndAcks * add debug output * add more debug output * NEEDS MOAR DEBUG OUTPUT * test purging MsgTimeout on src vs. counterparty * reverse channel close msg purging * don't delete channel close msgs until another iteration in getUnrelayedPacketsAndAcks * reverse channel close msg purging * don't delete channel close msgs until another iteration in getUnrelayedPacketsAndAcks * undo previous changes regarding purging cache on max retries * undo more changes made in shouldSendChannelMessage * more undo * add debug output on msg send and channel cache purge * add debug output * remove pointless log * add logs in process latest msgs * more logs * logs * remove all debug logs and implement fix for tracking processing packets correctly * Merge PR #974: Clarify demo * update demo * remove extra dev-env * Merge PR #963: Additional Metrics * Adding block height and wallet balance metrics * Fixing duplicate registration * Assigning metrics during NewCosmosChainProcessor * Fixing latest height to use ChainId * Metrics are optional... * Merge PR #981: Update IBCdata struct Update IBCdata struct based on recent changes made at the Cosmos Chain Registry * Fix flattening of events (#979) * Fix flattening of events * Parse events without flattened tx.Log * Add missing write ack to switch case * Fix unnecessary retention of irrelevant messages (#980) * Merge PR #987: Use config.lock file to guard access to config.yaml in the case of linking multiple paths concurrently * ignore recv packet with empty ack bytes (#985) Co-authored-by: Jack Zampolin <jack.zampolin@gmail.com> * Relay multiple paths from the same process (#988) * wip: add test for relaying on many paths This test instantiates a relayer with the event processor that relays on two paths across three chains. This was ported from previous WIP that attempted to add multi-path support to the legacy processor for the relayer; multi-path support in the legacy processor had some subtle bugs that caused the test to fail. Now with the new event processor, the test is failing in a different way that we need to further debug. * Multiple paths same process with test * go mod tidy * fix old tests * Update to ibctest with race fix * Fix legacy relayer Co-authored-by: Mark Rushakoff <mark.rushakoff@gmail.com> * Default to events processor (#989) * Default to events processor * events processor is now default * sort packet messages by sequence number (#992) only process 1 packet at a time on ordered channels * path processor race (#995) * fix path processor indexing * clone maps before passing to pathprocessor * Merge should Clone * pre-size maps * Use in process Relayer for race detection (#996) * clone maps before passing to pathprocessor * Add local relayer implementation to help catch race conditions in CI * use existing relayerfactory * Isolate mutex to totalFees * handle feedback * fix fatalf format * Merge PR #999: Add ability to run all paths in config easil * Add ability to run all paths in config easily * PR review fixes * Fix tests and patch readme * Merge PR #1005: Fix legacy race condition * fix counterparty path filter (#1000) * fix counterparty path filter * Filter fix test * Add denylist test and add makefile and gh action * Slim test for non-self-hosted runner * Update ibctest to latest main * Make better assertion for denylist acks. Constants for allowlist/denylist. Validate filterRule in CLI * Use isolated prometheus registry per relayer instance instead of prometheus default registry * run path filter tests in parallel * dockerfile: move TARGET* args for fast workflow & ... (#993) - Single COPY step for go mod and sum - Use ENV GOOS & GOARCH from TARGET* args Co-authored-by: pratikbin <pratikbin+010101@no-reply-git.luolix.top> * Respect the `override` flag upon client creation (#997) * respect the override flag * add test case for --override usage * add missing godoc comment for test * disable CountTotal (#1009) * Fix account sequence mismatch errors (#1007) * Use mutex for tx account sequence query through tx broadcast, track account sequence number on chain provider * Make updateNextAccountSequence private * Retry for account sequence mismatch errors * Allow decrementing account sequence if node says it is expected * Add test for handleAccountSequenceMismatchError * Keystore implementation for substrate chain (#922) * add substrate keystore implementation * implement key provider for substrate chain * clean up keystore code * run go mod tidy moving rename test to _test * remove verbs from error messages * correct interface method comments in Keyring and Info types * initialize log in NewProvider method * move type definitions to method implementation files * check if KeyDirectory is empty before overwriting it in the NewProvider method * remove comments in ExportPrivKeyArmor * bump substrate-rpc-client to latest master * change network type to uint16 * update go.mod in ibctest * feat: add chain processor implementation (#924) * feat: add chain processor implementation * fix: go-schnorrkel version fix * fix: go mod update dockertest * feature/ implement substrate event parser (#923) * feat: implement substrate event parser * fix: event parser switch fallthrough * fix: go-schnorrkel version fix * fix: go mod update for dcokertest * create helper functions between substrate <> ibc events * use intoIBCEventType * fix: event parser accumulation support * fix: spearate parsing and handling of ibc messages * feat: parachain header parse * fix: packet accumulator separate switch case * fix: go.mod docker issue * fix: ics11-beefy repo version fix * fix: accumulator events to messages * fix: add connection event type conversion * fix: ibctest go.mod fix Co-authored-by: Blas Rodriguez Irizar <rodrigblas@gmail.com> * fix: go.mod Co-authored-by: Dan Kanefsky <56059752+boojamya@users.noreply.github.com> Co-authored-by: Andrew Gouin <andrew@gouin.io> Co-authored-by: Joe Abbey <joe.abbey@gmail.com> Co-authored-by: Justin Tieri <37750742+jtieri@users.noreply.github.com> Co-authored-by: JeremyParish69 <95667791+JeremyParish69@users.noreply.github.com> Co-authored-by: Jack Zampolin <jack.zampolin@gmail.com> Co-authored-by: Mark Rushakoff <mark.rushakoff@gmail.com> Co-authored-by: pratikbin <68642400+pratikbin@users.noreply.github.com> Co-authored-by: pratikbin <pratikbin+010101@no-reply-git.luolix.top> Co-authored-by: Osho Emmanuel <oshoklinsmann@gmail.com> Co-authored-by: Blas Rodriguez Irizar <rodrigblas@gmail.com> * Feature/ implement SubstrateIBCHeader (#986) * feat: add SubstrateIBCHeader type and implementation * fix: ibctest go mod tidy * feature/ implement substrate event parser (#923) * feat: implement substrate event parser * fix: event parser switch fallthrough * fix: go-schnorrkel version fix * fix: go mod update for dcokertest * create helper functions between substrate <> ibc events * use intoIBCEventType * fix: event parser accumulation support * fix: spearate parsing and handling of ibc messages * feat: parachain header parse * fix: packet accumulator separate switch case * fix: go.mod docker issue * fix: ics11-beefy repo version fix * fix: accumulator events to messages * fix: add connection event type conversion * fix: ibctest go.mod fix Co-authored-by: Blas Rodriguez Irizar <rodrigblas@gmail.com> Co-authored-by: Blas Rodriguez Irizar <rodrigblas@gmail.com> * feat: copy cosmos message handler and assign to substrate (#1017) * Feature/ Substrate TX methods (#1011) * fix: error fix and dependencies in tx * fix wrong value instead of reference * cleanup: remove unused types and functions * fix: fix go.mod * fix: add fslock to go.mod * fix: review code smells removal * fix: modify sendmessages * fix: review comments * feat: add events to messages * fix: unexported fields * fix: go mod tidy _test * Merge branch 'feat-substrate' into upstream_update * go mod ibctest module Co-authored-by: Dan Kanefsky <56059752+boojamya@users.noreply.github.com> Co-authored-by: Andrew Gouin <andrew@gouin.io> Co-authored-by: Joe Abbey <joe.abbey@gmail.com> Co-authored-by: Justin Tieri <37750742+jtieri@users.noreply.github.com> Co-authored-by: JeremyParish69 <95667791+JeremyParish69@users.noreply.github.com> Co-authored-by: Jack Zampolin <jack.zampolin@gmail.com> Co-authored-by: Mark Rushakoff <mark.rushakoff@gmail.com> Co-authored-by: pratikbin <68642400+pratikbin@users.noreply.github.com> Co-authored-by: pratikbin <pratikbin+010101@no-reply-git.luolix.top> Co-authored-by: Jacob Gadikian <jacobgadikian@gmail.com> Co-authored-by: jtieri <justin@thetieris.com> Co-authored-by: Mehdi Valinejad <6095314+vjdmhd@users.noreply.github.com> Co-authored-by: Blas Rodriguez Irizar <rodrigblas@gmail.com>
Description
The event parser is responsible for the translation of the IBC events received from the composable RPC endpoint to the IBC message types needed for processing client, channel, connection, and packet information of un-relayed packets.
Implementations
ibcMessage
definitionhandleIBCMessagesFromEvents
which is combination of functionalities ofibcMessagesFromTransaction
andhandleMessage
of the cosmos event parserclientInfo
clientUpdateInfo
packetInfo
channelInfo
connectionInfo
MarshalLogObject
between cosmos implementation and substrateConsiderations
The IBC events end-point of the Composable chain returns JSON of defined types of ibc-rs, So there is no need for parseAttr implementation, then it is removed from the
ibcMessageInfo
.