cosmos-sdk/docs/uml/svg/begin_redelegation_sequence...

106 lines
21 KiB
XML

<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentScriptType="application/ecmascript" contentStyleType="text/css" height="958px" preserveAspectRatio="none" style="width:1599px;height:958px;" version="1.1" viewBox="0 0 1599 958" width="1599px" zoomAndPan="magnify"><defs><filter height="300%" id="f1w2okko18ktw4" width="300%" x="-1" y="-1"><feGaussianBlur result="blurOut" stdDeviation="2.0"/><feColorMatrix in="blurOut" result="blurOut2" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .4 0"/><feOffset dx="4.0" dy="4.0" in="blurOut2" result="blurOut3"/><feBlend in="SourceGraphic" in2="blurOut3" mode="normal"/></filter></defs><g><text fill="#000000" font-family="sans-serif" font-size="18" lengthAdjust="spacing" textLength="120" x="737.75" y="28.708">Redelegation</text><rect fill="#FFFFFF" filter="url(#f1w2okko18ktw4)" height="46.2656" style="stroke:#000000;stroke-width:2.0;" width="562.5" x="467" y="244.7813"/><rect fill="#FFFFFF" filter="url(#f1w2okko18ktw4)" height="46.2656" style="stroke:#000000;stroke-width:2.0;" width="562.5" x="467" y="305.0469"/><rect fill="#FFFFFF" filter="url(#f1w2okko18ktw4)" height="71.3984" style="stroke:#000000;stroke-width:2.0;" width="1020.5" x="9" y="365.3125"/><rect fill="#FFFFFF" filter="url(#f1w2okko18ktw4)" height="46.2656" style="stroke:#000000;stroke-width:2.0;" width="562.5" x="467" y="520.8438"/><rect fill="#FFFFFF" filter="url(#f1w2okko18ktw4)" height="46.2656" style="stroke:#000000;stroke-width:2.0;" width="562.5" x="467" y="651.2422"/><rect fill="#FFFFFF" filter="url(#f1w2okko18ktw4)" height="75.3984" style="stroke:#000000;stroke-width:2.0;" width="646" x="939.5" y="711.5078"/><line style="stroke:#A80036;stroke-width:1.0;" x1="524" x2="524" y1="102.25" y2="485.8438"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:1.0,4.0;" x1="524" x2="524" y1="485.8438" y2="513.8438"/><line style="stroke:#A80036;stroke-width:1.0;" x1="524" x2="524" y1="513.8438" y2="616.2422"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:1.0,4.0;" x1="524" x2="524" y1="616.2422" y2="644.2422"/><line style="stroke:#A80036;stroke-width:1.0;" x1="524" x2="524" y1="644.2422" y2="890.3047"/><line style="stroke:#A80036;stroke-width:1.0;" x1="984.5" x2="984.5" y1="102.25" y2="485.8438"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:1.0,4.0;" x1="984.5" x2="984.5" y1="485.8438" y2="513.8438"/><line style="stroke:#A80036;stroke-width:1.0;" x1="984.5" x2="984.5" y1="513.8438" y2="616.2422"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:1.0,4.0;" x1="984.5" x2="984.5" y1="616.2422" y2="644.2422"/><line style="stroke:#A80036;stroke-width:1.0;" x1="984.5" x2="984.5" y1="644.2422" y2="890.3047"/><line style="stroke:#A80036;stroke-width:1.0;" x1="1553.5" x2="1553.5" y1="102.25" y2="485.8438"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:1.0,4.0;" x1="1553.5" x2="1553.5" y1="485.8438" y2="513.8438"/><line style="stroke:#A80036;stroke-width:1.0;" x1="1553.5" x2="1553.5" y1="513.8438" y2="616.2422"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:1.0,4.0;" x1="1553.5" x2="1553.5" y1="616.2422" y2="644.2422"/><line style="stroke:#A80036;stroke-width:1.0;" x1="1553.5" x2="1553.5" y1="644.2422" y2="890.3047"/><rect fill="#FEFECE" filter="url(#f1w2okko18ktw4)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="91" x="477" y="66.9531"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="77" x="484" y="86.9482">msgServer</text><rect fill="#FEFECE" filter="url(#f1w2okko18ktw4)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="91" x="477" y="889.3047"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="77" x="484" y="909.2998">msgServer</text><rect fill="#FEFECE" filter="url(#f1w2okko18ktw4)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="66" x="949.5" y="66.9531"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="52" x="956.5" y="86.9482">keeper</text><rect fill="#FEFECE" filter="url(#f1w2okko18ktw4)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="66" x="949.5" y="889.3047"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="52" x="956.5" y="909.2998">keeper</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="38" x="1531.5" y="98.9482">store</text><path d="M1535.5,49.9531 C1535.5,39.9531 1553.5,39.9531 1553.5,39.9531 C1553.5,39.9531 1571.5,39.9531 1571.5,49.9531 L1571.5,75.9531 C1571.5,85.9531 1553.5,85.9531 1553.5,85.9531 C1553.5,85.9531 1535.5,85.9531 1535.5,75.9531 L1535.5,49.9531 " fill="#FEFECE" filter="url(#f1w2okko18ktw4)" style="stroke:#000000;stroke-width:1.5;"/><path d="M1535.5,49.9531 C1535.5,59.9531 1553.5,59.9531 1553.5,59.9531 C1553.5,59.9531 1571.5,59.9531 1571.5,49.9531 " fill="none" style="stroke:#000000;stroke-width:1.5;"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="38" x="1531.5" y="902.2998">store</text><path d="M1535.5,915.6016 C1535.5,905.6016 1553.5,905.6016 1553.5,905.6016 C1553.5,905.6016 1571.5,905.6016 1571.5,915.6016 L1571.5,941.6016 C1571.5,951.6016 1553.5,951.6016 1553.5,951.6016 C1553.5,951.6016 1535.5,951.6016 1535.5,941.6016 L1535.5,915.6016 " fill="#FEFECE" filter="url(#f1w2okko18ktw4)" style="stroke:#000000;stroke-width:1.5;"/><path d="M1535.5,915.6016 C1535.5,925.6016 1553.5,925.6016 1553.5,925.6016 C1553.5,925.6016 1571.5,925.6016 1571.5,915.6016 " fill="none" style="stroke:#000000;stroke-width:1.5;"/><polygon fill="#A80036" points="972.5,129.3828,982.5,133.3828,972.5,137.3828,976.5,133.3828" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="524.5" x2="978.5" y1="133.3828" y2="133.3828"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="436" x="531.5" y="128.3169">BeginRedelegation(delAddr, valSrcAddr, valDstAddr, sharesAmount)</text><line style="stroke:#A80036;stroke-width:1.0;" x1="984.5" x2="1026.5" y1="168.582" y2="168.582"/><line style="stroke:#A80036;stroke-width:1.0;" x1="1026.5" x2="1026.5" y1="168.582" y2="181.582"/><line style="stroke:#A80036;stroke-width:1.0;" x1="985.5" x2="1026.5" y1="181.582" y2="181.582"/><polygon fill="#A80036" points="995.5,177.582,985.5,181.582,995.5,185.582,991.5,181.582" style="stroke:#A80036;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="143" x="991.5" y="163.5161">get number of sharew</text><path d="M494,146.3828 L494,186.3828 L975,186.3828 L975,156.3828 L965,146.3828 L494,146.3828 " fill="#FBFB77" filter="url(#f1w2okko18ktw4)" style="stroke:#A80036;stroke-width:1.0;"/><path d="M965,146.3828 L965,156.3828 L975,156.3828 L965,146.3828 " fill="#FBFB77" style="stroke:#A80036;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="448" x="500" y="163.4497">If the delegator has more shares than the total shares in the validator</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="460" x="500" y="178.5825">(due to rounding errors), then just withdraw the max number of shares.</text><line style="stroke:#A80036;stroke-width:1.0;" x1="984.5" x2="1026.5" y1="216.7813" y2="216.7813"/><line style="stroke:#A80036;stroke-width:1.0;" x1="1026.5" x2="1026.5" y1="216.7813" y2="229.7813"/><line style="stroke:#A80036;stroke-width:1.0;" x1="985.5" x2="1026.5" y1="229.7813" y2="229.7813"/><polygon fill="#A80036" points="995.5,225.7813,985.5,229.7813,995.5,233.7813,991.5,229.7813" style="stroke:#A80036;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="278" x="991.5" y="211.7153">check the redelegation uses correct denom</text><path d="M467,244.7813 L533,244.7813 L533,251.7813 L523,261.7813 L467,261.7813 L467,244.7813 " fill="#EEEEEE" style="stroke:#000000;stroke-width:1.0;"/><rect fill="none" height="46.2656" style="stroke:#000000;stroke-width:2.0;" width="562.5" x="467" y="244.7813"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacing" textLength="21" x="482" y="257.8481">alt</text><text fill="#000000" font-family="sans-serif" font-size="11" font-weight="bold" lengthAdjust="spacing" textLength="180" x="548" y="256.9917">[valSrcAddr == valDstAddr]</text><polygon fill="#A80036" points="535.5,279.0469,525.5,283.0469,535.5,287.0469,531.5,283.0469" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="529.5" x2="983.5" y1="283.0469" y2="283.0469"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="31" x="541.5" y="277.981">error</text><path d="M467,305.0469 L533,305.0469 L533,312.0469 L523,322.0469 L467,322.0469 L467,305.0469 " fill="#EEEEEE" style="stroke:#000000;stroke-width:1.0;"/><rect fill="none" height="46.2656" style="stroke:#000000;stroke-width:2.0;" width="562.5" x="467" y="305.0469"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacing" textLength="21" x="482" y="318.1138">alt</text><text fill="#000000" font-family="sans-serif" font-size="11" font-weight="bold" lengthAdjust="spacing" textLength="166" x="548" y="317.2573">[transitive redelegation]</text><polygon fill="#A80036" points="535.5,339.3125,525.5,343.3125,535.5,347.3125,531.5,343.3125" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="529.5" x2="983.5" y1="343.3125" y2="343.3125"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="31" x="541.5" y="338.2466">error</text><path d="M9,365.3125 L75,365.3125 L75,372.3125 L65,382.3125 L9,382.3125 L9,365.3125 " fill="#EEEEEE" style="stroke:#000000;stroke-width:1.0;"/><rect fill="none" height="71.3984" style="stroke:#000000;stroke-width:2.0;" width="1020.5" x="9" y="365.3125"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacing" textLength="21" x="24" y="378.3794">alt</text><text fill="#000000" font-family="sans-serif" font-size="11" font-weight="bold" lengthAdjust="spacing" textLength="214" x="90" y="377.5229">[already has max redelegations]</text><polygon fill="#A80036" points="535.5,412.1445,525.5,416.1445,535.5,420.1445,531.5,416.1445" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="529.5" x2="983.5" y1="416.1445" y2="416.1445"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="31" x="541.5" y="411.0786">error</text><path d="M19,387.4453 L19,427.4453 L515,427.4453 L515,397.4453 L505,387.4453 L19,387.4453 " fill="#FBFB77" filter="url(#f1w2okko18ktw4)" style="stroke:#A80036;stroke-width:1.0;"/><path d="M505,387.4453 L505,397.4453 L515,397.4453 L505,387.4453 " fill="#FBFB77" style="stroke:#A80036;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="475" x="25" y="404.5122">this is the number of redelegations for a specific (del, valSrc, valDst) triple</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="66" x="25" y="419.645">default : 7</text><line style="stroke:#A80036;stroke-width:1.0;" x1="984.5" x2="1026.5" y1="464.8438" y2="464.8438"/><line style="stroke:#A80036;stroke-width:1.0;" x1="1026.5" x2="1026.5" y1="464.8438" y2="477.8438"/><line style="stroke:#A80036;stroke-width:1.0;" x1="985.5" x2="1026.5" y1="477.8438" y2="477.8438"/><polygon fill="#A80036" points="995.5,473.8438,985.5,477.8438,995.5,481.8438,991.5,477.8438" style="stroke:#A80036;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="269" x="991.5" y="459.7778">Unbond(del, valSrc) returns returnAmount</text><path d="M802,450.2109 L802,475.2109 L975,475.2109 L975,460.2109 L965,450.2109 L802,450.2109 " fill="#FBFB77" filter="url(#f1w2okko18ktw4)" style="stroke:#A80036;stroke-width:1.0;"/><path d="M965,450.2109 L965,460.2109 L975,460.2109 L965,450.2109 " fill="#FBFB77" style="stroke:#A80036;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="152" x="808" y="467.2778">See unbonding diagram</text><path d="M467,520.8438 L533,520.8438 L533,527.8438 L523,537.8438 L467,537.8438 L467,520.8438 " fill="#EEEEEE" style="stroke:#000000;stroke-width:1.0;"/><rect fill="none" height="46.2656" style="stroke:#000000;stroke-width:2.0;" width="562.5" x="467" y="520.8438"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacing" textLength="21" x="482" y="533.9106">alt</text><text fill="#000000" font-family="sans-serif" font-size="11" font-weight="bold" lengthAdjust="spacing" textLength="155" x="548" y="533.0542">[returnAmount is zero]</text><polygon fill="#A80036" points="535.5,555.1094,525.5,559.1094,535.5,563.1094,531.5,559.1094" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="529.5" x2="983.5" y1="559.1094" y2="559.1094"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="31" x="541.5" y="554.0435">error</text><line style="stroke:#A80036;stroke-width:1.0;" x1="984.5" x2="1026.5" y1="595.2422" y2="595.2422"/><line style="stroke:#A80036;stroke-width:1.0;" x1="1026.5" x2="1026.5" y1="595.2422" y2="608.2422"/><line style="stroke:#A80036;stroke-width:1.0;" x1="985.5" x2="1026.5" y1="608.2422" y2="608.2422"/><polygon fill="#A80036" points="995.5,604.2422,985.5,608.2422,995.5,612.2422,991.5,608.2422" style="stroke:#A80036;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="555" x="991.5" y="590.1763">Delegate(del, returnAmount, status := valSrc.status, valDst, subtractAccount := false)</text><path d="M802,580.6094 L802,605.6094 L975,605.6094 L975,590.6094 L965,580.6094 L802,580.6094 " fill="#FBFB77" filter="url(#f1w2okko18ktw4)" style="stroke:#A80036;stroke-width:1.0;"/><path d="M965,580.6094 L965,590.6094 L975,590.6094 L965,580.6094 " fill="#FBFB77" style="stroke:#A80036;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="152" x="808" y="597.6763">See delegation diagram</text><path d="M467,651.2422 L533,651.2422 L533,658.2422 L523,668.2422 L467,668.2422 L467,651.2422 " fill="#EEEEEE" style="stroke:#000000;stroke-width:1.0;"/><rect fill="none" height="46.2656" style="stroke:#000000;stroke-width:2.0;" width="562.5" x="467" y="651.2422"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacing" textLength="21" x="482" y="664.3091">alt</text><text fill="#000000" font-family="sans-serif" font-size="11" font-weight="bold" lengthAdjust="spacing" textLength="155" x="548" y="663.4526">[validator is unbonded]</text><polygon fill="#A80036" points="535.5,685.5078,525.5,689.5078,535.5,693.5078,531.5,689.5078" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="529.5" x2="983.5" y1="689.5078" y2="689.5078"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="79" x="541.5" y="684.4419">current time</text><path d="M939.5,711.5078 L1005.5,711.5078 L1005.5,718.5078 L995.5,728.5078 L939.5,728.5078 L939.5,711.5078 " fill="#EEEEEE" style="stroke:#000000;stroke-width:1.0;"/><rect fill="none" height="75.3984" style="stroke:#000000;stroke-width:2.0;" width="646" x="939.5" y="711.5078"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacing" textLength="21" x="954.5" y="724.5747">alt</text><text fill="#000000" font-family="sans-serif" font-size="11" font-weight="bold" lengthAdjust="spacing" textLength="282" x="1020.5" y="723.7183">[unbonding not complete, or just started]</text><polygon fill="#A80036" points="1541.5,745.7734,1551.5,749.7734,1541.5,753.7734,1545.5,749.7734" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="984.5" x2="1547.5" y1="749.7734" y2="749.7734"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="168" x="991.5" y="744.7075">create redelegation object</text><polygon fill="#A80036" points="1541.5,774.9063,1551.5,778.9063,1541.5,782.9063,1545.5,778.9063" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="984.5" x2="1547.5" y1="778.9063" y2="778.9063"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="443" x="991.5" y="773.8403">insert redelegation in queue, to be processed at the appropriate time</text><polygon fill="#A80036" points="535.5,811.0391,525.5,815.0391,535.5,819.0391,531.5,815.0391" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="529.5" x2="983.5" y1="815.0391" y2="815.0391"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="230" x="541.5" y="809.9731">completion time of the redelegation</text><line style="stroke:#A80036;stroke-width:1.0;" x1="524.5" x2="566.5" y1="859.3047" y2="859.3047"/><line style="stroke:#A80036;stroke-width:1.0;" x1="566.5" x2="566.5" y1="859.3047" y2="872.3047"/><line style="stroke:#A80036;stroke-width:1.0;" x1="525.5" x2="566.5" y1="872.3047" y2="872.3047"/><polygon fill="#A80036" points="535.5,868.3047,525.5,872.3047,535.5,876.3047,531.5,872.3047" style="stroke:#A80036;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="238" x="531.5" y="839.106">emit event: delegator, valSrc, valSrc,</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="205" x="531.5" y="854.2388">sharesAmount, completionTime</text><!--MD5=[069c34f61c17fc1e4927dd6d1af52647]
@startuml
'https://plantuml.com/sequence-diagram
title: Redelegation
msgServer -> keeper : BeginRedelegation(delAddr, valSrcAddr, valDstAddr, sharesAmount)
participant "keeper (staking)" as keeper
keeper -> keeper : get number of sharew
note left: If the delegator has more shares than the total shares in the validator\n(due to rounding errors), then just withdraw the max number of shares.
keeper -> keeper : check the redelegation uses correct denom
alt valSrcAddr == valDstAddr
keeper - -> msgServer : error
end
alt transitive redelegation
keeper - -> msgServer : error
end
alt already has max redelegations
keeper - -> msgServer : error
note left : this is the number of redelegations for a specific (del, valSrc, valDst) triple\ndefault : 7
end
keeper -> keeper : Unbond(del, valSrc) returns returnAmount
...
note left : See unbonding diagram
alt returnAmount is zero
keeper -> msgServer : error
end
keeper -> keeper : Delegate(del, returnAmount, status := valSrc.status, valDst, subtractAccount := false)
note left : See delegation diagram
...
alt validator is unbonded
keeper -> msgServer : current time
end
alt unbonding not complete, or just started
database store
keeper -> store : create redelegation object
keeper -> store : insert redelegation in queue, to be processed at the appropriate time
end
msgServer <- - keeper : completion time of the redelegation
msgServer -> msgServer : emit event: delegator, valSrc, valSrc,\nsharesAmount, completionTime
@enduml
@startuml
title: Redelegation
msgServer -> keeper : BeginRedelegation(delAddr, valSrcAddr, valDstAddr, sharesAmount)
participant "keeper (staking)" as keeper
keeper -> keeper : get number of sharew
note left: If the delegator has more shares than the total shares in the validator\n(due to rounding errors), then just withdraw the max number of shares.
keeper -> keeper : check the redelegation uses correct denom
alt valSrcAddr == valDstAddr
keeper - -> msgServer : error
end
alt transitive redelegation
keeper - -> msgServer : error
end
alt already has max redelegations
keeper - -> msgServer : error
note left : this is the number of redelegations for a specific (del, valSrc, valDst) triple\ndefault : 7
end
keeper -> keeper : Unbond(del, valSrc) returns returnAmount
...
note left : See unbonding diagram
alt returnAmount is zero
keeper -> msgServer : error
end
keeper -> keeper : Delegate(del, returnAmount, status := valSrc.status, valDst, subtractAccount := false)
note left : See delegation diagram
...
alt validator is unbonded
keeper -> msgServer : current time
end
alt unbonding not complete, or just started
database store
keeper -> store : create redelegation object
keeper -> store : insert redelegation in queue, to be processed at the appropriate time
end
msgServer <- - keeper : completion time of the redelegation
msgServer -> msgServer : emit event: delegator, valSrc, valSrc,\nsharesAmount, completionTime
@enduml
PlantUML version 1.2021.5beta3(Unknown compile time)
(GPL source distribution)
Java Runtime: Java(TM) SE Runtime Environment
JVM: Java HotSpot(TM) 64-Bit Server VM
Default Encoding: UTF-8
Language: en
Country: US
--></g></svg>