Skip to content
This repository has been archived by the owner on May 22, 2023. It is now read-only.

Filter past events related to tbtc specific actions #608

Merged
merged 11 commits into from
Nov 18, 2020

Conversation

dimpar
Copy link
Contributor

@dimpar dimpar commented Nov 13, 2020

Ref: #574

Depends on: keep-network/keep-common#58

This PR replaces temp solutions for retrieving past events:

  • SignatureSubmitted
  • DepositRedemptionRequested

Past events retrieval can be done by calling generated functions Past* by keep-common project.

@dimpar dimpar changed the title Filter past events Filter past SignatureSubmitted events Nov 16, 2020
@dimpar dimpar changed the title Filter past SignatureSubmitted events Filter past events related to tbtc specific actions Nov 16, 2020
@dimpar dimpar marked this pull request as ready for review November 16, 2020 11:34
@pdyraga
Copy link
Member

pdyraga commented Nov 16, 2020

Two notes:

  • Let's update go.mod keep-common reference to point to d9f6bd5e51e8bcd103c1def3082afa331a3b33fe temporarily.
  • Let's regenerate contracts in pkg/chain/gen/contract push the updated code in this PR - those files are included in version control.

pkg/chain/chain.go Outdated Show resolved Hide resolved
go.sum Outdated Show resolved Hide resolved
pkg/chain/ethereum/ethereum.go Outdated Show resolved Hide resolved
@pdyraga pdyraga added this to the v1.5.0 milestone Nov 16, 2020
Copy link
Member

@pdyraga pdyraga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Four small comments and I am good assuming all jobs turn green. I'll leave the final review and testing to @lukasz-zimnoch.

go.mod Outdated Show resolved Hide resolved
go.mod Outdated Show resolved Hide resolved
pkg/chain/ethereum/ethereum.go Outdated Show resolved Hide resolved
pkg/chain/ethereum/ethereum.go Outdated Show resolved Hide resolved
@dimpar
Copy link
Contributor Author

dimpar commented Nov 17, 2020

Simple test to see if we can retrieve events and that it contains data:

  • DepositRedemptionRequested:
2020-11-17T12:41:49.003+0100	INFO	tbtc-extension	starting [provide redemption proof] monitoring for deposit [0x5967B93dFeEEE73087A92A199821Dd5a79dda6c2]
PastDepositRedemptionRequestedEvents: [&{[89 103 185 61 254 238 231 48 135 169 42 25 152 33 221 90 121 221 166 194] [214 176 161 202 143 6 65 185 126 254 192 241 237 115 215 46 88 179 143 165] [176 151 244 225 43 180 134 29 34 222 113 166 174 94 126 38 80 49 188 75 236 13 112 45 144 50 241 21 21 251 34 174] 1000000 [22 0 20 173 173 49 96 135 116 89 59 18 196 92 12 143 226 99 138 184 186 167 246] 2700 [170 26 41 4 238 46 38 181 203 14 215 165 31 233 11 69 186 5 210 128 14 87 184 209 188 250 113 122 9 70 255 207 0 0 0 0] {[249 228 186 180 251 67 10 113 32 74 144 62 243 47 74 43 36 222 47 199] [[121 89 195 128 23 64 97 162 26 59 168 2 67 160 50 186 156 209 13 200 189 23 54 215 232 53 201 78 151 163 90 152] [0 0 0 0 0 0 0 0 0 0 0 0 89 103 185 61 254 238 231 48 135 169 42 25 152 33 221 90 121 221 166 194] [0 0 0 0 0 0 0 0 0 0 0 0 214 176 161 202 143 6 65 185 126 254 192 241 237 115 215 46 88 179 143 165] [176 151 244 225 43 180 134 29 34 222 113 166 174 94 126 38 80 49 188 75 236 13 112 45 144 50 241 21 21 251 34 174]] [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 15 66 64 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 128 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 10 140 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 192 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 23 22 0 20 173 173 49 96 135 116 89 59 18 196 92 12 143 226 99 138 184 186 167 246 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 36 170 26 41 4 238 46 38 181 203 14 215 165 31 233 11 69 186 5 210 128 14 87 184 209 188 250 113 122 9 70 255 207 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] 2697 [79 123 163 28 191 29 152 20 17 196 132 189 29 50 159 176 113 240 207 254 35 173 188 190 159 22 26 226 229 151 31 151] 0 [141 232 11 73 178 72 229 40 73 210 249 80 126 96 99 164 184 202 30 20 223 99 86 151 174 92 231 26 246 121 65 246] 5 false}}]
  • SignatureSubmitted

For this event I had to do 2 things:

  • start monitorProvideRedemptionSignature almost the same time as 2 hour on-chain timeout. (changed to 119min before the timeout)
  • run the 3 ecdsa nodes, but 1 node with a modified code which won't send a signature.

The logs below were added just locally for testing purposes just before this for loop

Number of sig submitted events...[1]:
SignatureSubmittedEvent: [&{[47 228 215 69 161 193 85 167 202 75 85 167 184 82 142 245 18 58 10 157 11 166 248 143 108 31 137 64 249 39 217 176] [210 79 53 73 91 198 142 176 204 140 223 251 133 114 35 57 122 16 209 160 61 86 105 38 49 148 242 53 59 108 235 167] [57 26 210 235 199 113 79 180 248 47 182 16 115 169 73 18 46 44 138 93 23 64 14 69 171 255 231 201 172 24 141 125] 1 {[157 129 56 214 172 197 116 213 32 1 76 234 13 2 72 58 160 177 160 179] [[177 149 70 233 224 181 3 209 3 221 74 226 149 244 213 38 233 17 90 223 124 144 46 173 50 155 31 36 4 239 211 95] [47 228 215 69 161 193 85 167 202 75 85 167 184 82 142 245 18 58 10 157 11 166 248 143 108 31 137 64 249 39 217 176]] [210 79 53 73 91 198 142 176 204 140 223 251 133 114 35 57 122 16 209 160 61 86 105 38 49 148 242 53 59 108 235 167 57 26 210 235 199 113 79 180 248 47 182 16 115 169 73 18 46 44 138 93 23 64 14 69 171 255 231 201 172 24 141 125 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1] 5929 [139 237 13 57 96 34 168 56 177 109 152 137 77 38 0 10 219 14 229 207 164 131 81 73 36 174 34 222 30 164 20 124] 0 [52 121 46 47 63 135 233 231 39 254 232 115 228 85 61 140 62 19 81 120 163 251 136 158 151 47 164 64 7 27 167 110] 0 false}}]

@lukasz-zimnoch
Copy link
Member

lukasz-zimnoch commented Nov 17, 2020

LGTM! I'll test these changes locally to make sure everything works.

lukasz-zimnoch
lukasz-zimnoch previously approved these changes Nov 17, 2020
@lukasz-zimnoch lukasz-zimnoch merged commit 07ea075 into master Nov 18, 2020
@lukasz-zimnoch lukasz-zimnoch deleted the filter-past-events branch November 18, 2020 15:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants