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

ICS28: Cross-Chain Validation V1 #666

Merged
merged 34 commits into from
Aug 9, 2022
Merged
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
79becaf
ICS 28 CCV draft w/ init and validator set update (#640)
mpoke Feb 10, 2022
e548e72
merge CODEOWNERS from master
mpoke Feb 24, 2022
f637f0c
ICS28: CCV draft w/ complete unbonding (#646)
mpoke Feb 28, 2022
0f132dc
ICS28: Extend consumer InitGenesis (#659)
mpoke Feb 28, 2022
5292796
ICS28: Consumer Initiated Slashing (aka Evidence) (#663)
mpoke Mar 23, 2022
723af4d
ICS28: Remove CCV channel state (#678)
mpoke Mar 23, 2022
c626454
Update technical_specification.md
mpoke Mar 28, 2022
28d46ee
ICS28: Replace "Initiator" w/ "Caller" and “Trigger Event” (#696)
mpoke Apr 4, 2022
51dd64d
ICS28: Handle pending proposals to spawn consumer chains (#697)
mpoke Apr 4, 2022
2322702
ICS28: Remove genesisHash from specification (#699)
mpoke Apr 4, 2022
a6c9861
ICS28: CCV Reward Distribution subprotocol (#704)
mpoke Apr 20, 2022
6a04566
ICS28: Set initH in onChanOpenConfirm (#705)
mpoke Apr 20, 2022
dfc0398
ICS28: Enable the removal of a consumer chain from the provider (#707)
mpoke May 10, 2022
484b02c
ICS28: Remove BeforeUnbondingOpCompleted (#711)
mpoke May 10, 2022
9bdba66
ICS28: Update SlashPacketData (#728)
mpoke May 10, 2022
a6bc8d1
ICS28: Remove dependency on Tendermint and ABCI (#730)
mpoke May 11, 2022
0b3c84a
call UnbondMaturePackets() earlier (#747)
mpoke May 20, 2022
b7611ae
fix edge case enabled by aggregation (#746)
mpoke May 20, 2022
a635623
Use `h < hp'` instead of `h <= hp'` in Bond-Based Consumer Voting Pow…
danwt May 20, 2022
fe3c111
replace slashRequests w/ downtimeSlashRequests (#745)
mpoke May 20, 2022
76f2577
ics28 update sendPacket (#756)
mpoke May 23, 2022
3842922
ICS28: Restructure technical spec (#760)
mpoke Jun 9, 2022
ad30596
ICS28: Unbonding ops are put on hold even w/o consumer chains (#763)
mpoke Jun 9, 2022
5be51c0
Use currentTimestamp() >= p.stopTime in StopConsumerChainProposalHand…
danwt Jun 20, 2022
3713192
adding consumerUnbondingPeriod (#771)
mpoke Jun 23, 2022
6187e04
fix sendFungibleTokens signature
mpoke Jun 23, 2022
f1b1040
Merge branch 'master' into marius/ccv
mpoke Jun 23, 2022
7ea1ce6
Merge branch 'marius/ccv' of github.com:cosmos/ibc into marius/ccv
mpoke Jun 23, 2022
6ebbd60
add authors
mpoke Jun 24, 2022
5265e0b
ICS28: Removing the only consumer chain (#770)
mpoke Jun 27, 2022
b967c18
add conditions for CreateConsumerClient and StopConsumerChain (#775)
mpoke Jun 27, 2022
5ea9021
update created date
mpoke Jun 27, 2022
5d3b778
Merge branch 'main' into marius/ccv
mpoke Aug 1, 2022
195c36c
ICS28: Account for slashing in Bond-Based Consumer Voting Power prope…
mpoke Aug 3, 2022
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
Prev Previous commit
Next Next commit
ics28 update sendPacket (#756)
  • Loading branch information
mpoke authored May 23, 2022
commit 76f25771b42f5c54415b310632751d58501f9584
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ The *initialization* sub-protocol enables a provider chain and a consumer chain
// implements the AppModule interface
function InitGenesis(state: ProviderGenesisState): [ValidatorUpdate] {
// bind to ProviderPortId port
err = portKeeper.BindPort(ProviderPortId)
err = portKeeper.bindPort(ProviderPortId)
// check whether the capability for the port can be claimed
abortSystemUnless(err == nil)

Expand Down Expand Up @@ -796,7 +796,7 @@ function InitGenesis(gs: ConsumerGenesisState): [ValidatorUpdate] {
abortSystemUnless(gs.initialValSet == gs.providerConsensusState.validatorSet)

// bind to ConsumerPortId port
err = portKeeper.BindPort(ConsumerPortId)
err = portKeeper.bindPort(ConsumerPortId)
// check whether the capability for the port can be claimed
abortSystemUnless(err == nil)

Expand Down Expand Up @@ -1361,14 +1361,15 @@ function EndBlock(): [ValidatorUpdate] {
channelId = chainToChannel[chainId]

foreach data IN pendingVSCPackets[chainId] {
// create packet and send it using the interface exposed by ICS-4
packet = Packet{
timeoutHeight: zeroTimeoutHeight,
timeoutTimestamp: ccvTimeoutTimestamp,
destChannel: channelId,
data: data,
}
channelKeeper.SendPacket(packet)
// send data using the interface exposed by ICS-4
channelKeeper.sendPacket(
portKeeper.getCapability(portKeeper.portPath(ProviderPortId)),
ProviderPortId, // source port ID
channelId, // source channel ID
zeroTimeoutHeight,
ccvTimeoutTimestamp,
data
)
}

// remove pending VSCPackets
Expand Down Expand Up @@ -1835,14 +1836,15 @@ function UnbondMaturePackets() {
// create VSCMaturedPacketData
packetData = VSCMaturedPacketData{id: id}

// create packet and send it using the interface exposed by ICS-4
packet = Packet{
timeoutHeight: zeroTimeoutHeight,
timeoutTimestamp: ccvTimeoutTimestamp,
destChannel: providerChannel,
data: packetData,
}
channelKeeper.SendPacket(packet)
// send VSCMaturedPacketData using the interface exposed by ICS-4
channelKeeper.sendPacket(
portKeeper.getCapability(portKeeper.portPath(ConsumerPortId)),
ConsumerPortId, // source port ID
providerChannel, // source channel ID
zeroTimeoutHeight,
ccvTimeoutTimestamp,
packetData
)

// remove entry from the list
maturingVSCs.Remove(id, ts)
Expand Down Expand Up @@ -2004,14 +2006,15 @@ function SendSlashRequest(

// check whether the CCV channel to the provider chain is established
if providerChannel != "" {
// create packet and send it using the interface exposed by ICS-4
packet = Packet{
timeoutHeight: zeroTimeoutHeight,
timeoutTimestamp: ccvTimeoutTimestamp,
destChannel: providerChannel,
data: packetData,
}
channelKeeper.SendPacket(packet)
// send SlashPacket data using the interface exposed by ICS-4
channelKeeper.sendPacket(
portKeeper.getCapability(portKeeper.portPath(ConsumerPortId)),
ConsumerPortId, // source port ID
providerChannel, // source channel ID
zeroTimeoutHeight,
ccvTimeoutTimestamp,
packetData
)

if downtime {
// set outstandingDowntime for this validator
Expand Down Expand Up @@ -2067,14 +2070,15 @@ function SendPendingSlashRequests() {
// iterate over every pending SlashRequest in reverse order
foreach req IN pendingSlashRequests.Reverse() {
if !req.downtime OR !outstandingDowntime[req.data.valAddress] {
// create packet and send it using the interface exposed by ICS-4
packet = Packet{
timeoutHeight: zeroTimeoutHeight,
timeoutTimestamp: ccvTimeoutTimestamp,
destChannel: providerChannel,
data: req.data,
}
channelKeeper.SendPacket(packet)
// send req.data using the interface exposed by ICS-4
channelKeeper.sendPacket(
portKeeper.getCapability(portKeeper.portPath(ConsumerPortId)),
ConsumerPortId, // source port ID
providerChannel, // source channel ID
zeroTimeoutHeight,
ccvTimeoutTimestamp,
req.data
)

if req.downtime {
// set outstandingDowntime for this validator
Expand Down