-
Notifications
You must be signed in to change notification settings - Fork 28
Anchor simulator #195
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
Anchor simulator #195
Changes from 52 commits
a91e366
0e0bd34
58601e3
a855236
f34ad41
ced58b6
77d0dab
f40aec0
d32c93d
455e783
2e9219c
8b2e578
59ab224
5dc1fe1
ce6273a
20d198d
7fa0932
ff2d17d
23e561a
c5da0b8
ed23e52
2db08b4
74bc147
b41f292
30ed4ae
fdbabd3
c4eb22f
a79d1e9
781fa26
bf38e50
40fbc10
20fbb0a
1caae13
e16d2f3
60d4a9c
260481d
0fd36c4
67ddcfd
b21ba0d
b674043
be49b40
a85f2e0
7bf9028
1533167
a6a305c
5919adc
d69026a
54f764d
2a11eb5
2e2aceb
c87a1f5
155c632
29b4128
d40bd51
4890fc8
5e8fb78
92c8806
41fa97b
8541c4f
20fc6a6
4b5a5af
86cd26e
3697403
3028de6
8eb2976
2f5f07a
32d56d7
55a0dc3
d7944b5
ee94f13
e0a1bf2
3f1318c
985edef
f5ef334
db103b7
f290e1b
4839499
c89ecdb
a5b64da
8dcf2e1
884d191
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| [package] | ||
| name = "http_metrics" | ||
| name = "anchor_http_metrics" | ||
| version = "0.1.0" | ||
| edition = "2021" | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -214,7 +214,7 @@ impl SsvEventSyncer { | |
|
|
||
| #[instrument(skip(self))] | ||
| /// Try to perform both a historical and live sync from the chain | ||
| pub async fn sync(&mut self) -> Result<(), ExecutionError> { | ||
| pub async fn sync(&mut self, skip: bool) -> Result<(), ExecutionError> { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we split the
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe it's better to keep everything unified in the sync function, but I'd rename the param to
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thinking more about it, do we want to skip it, or should we do the historical_sync from a mock implementation or something like that?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will rename the param and I think we should keep it as a unified function as it was setup like this to handle errors and retry smoothly. Syncing from an mock contract was something I mentioned earlier but we decided against it as this is more of the purpose for ssv-mini in comparison to the simulator. It would be nice to have a fully simulated environment with all of the contracts to sync from but it would probably be another 1.5k lines of infra to setup.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know how valuable this would be, but having the simulator on CI testing this for each PR is different from having it on ssv-mini, isn't it?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes this is just an end to end integration test to make sure we dont have any unexpected behavior regressions while the simulator is a full devnet that tests interop with ssv nodes
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I mean, how valuable would it be to have
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I personally dont think it is important to include here. I think the core idea here is to test core behavior like attestations & block production. The syncing section of the codebase is pretty finalized imo and if there are modifications this should be caught by ssv-mini or testnet deployment |
||
| info!("Starting SSV event sync"); | ||
| // Get network specific contract information | ||
| let contract_address = self.network.ssv_contract; | ||
|
|
@@ -225,7 +225,10 @@ impl SsvEventSyncer { | |
| deployment_block, "Using contract configuration" | ||
| ); | ||
| loop { | ||
| match self.try_sync(contract_address, deployment_block).await { | ||
| match self | ||
| .try_sync(contract_address, deployment_block, skip) | ||
| .await | ||
| { | ||
| Ok(_) => unreachable!("Sync should never finish successfully"), | ||
| Err(e) => { | ||
| error!(?e, "Sync failed, attempting recovery"); | ||
|
|
@@ -304,10 +307,13 @@ impl SsvEventSyncer { | |
| &mut self, | ||
| contract_address: Address, | ||
| deployment_block: u64, | ||
| skip: bool, | ||
| ) -> Result<(), ExecutionError> { | ||
| info!("Starting historical sync"); | ||
| self.historical_sync(contract_address, deployment_block, SSV_EVENTS.clone()) | ||
| .await?; | ||
| if !skip { | ||
| self.historical_sync(contract_address, deployment_block, SSV_EVENTS.clone()) | ||
| .await?; | ||
| } | ||
|
|
||
| self.historic_finished_notify.take().map(|x| x.send(())); | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| mock-data/operator-*/network/enr.dat | ||
| mock-data/operator-*/slashing_protection.sqlite | ||
| mock-data/operator-*/slashing_protection.sqlite-journal |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| [package] | ||
| name = "integration" | ||
| version = "0.1.0" | ||
| edition = "2021" | ||
|
|
||
| [dependencies] | ||
|
|
||
| clap = { workspace = true } | ||
| client = { workspace = true } | ||
| discv5 = { workspace = true } | ||
| environment = { git = "https://github.com/sigp/lighthouse", rev = "22faccb" } | ||
| ethereum_serde_utils = { workspace = true } | ||
| execution_layer = { git = "https://github.com/sigp/lighthouse", rev = "22faccb" } | ||
| futures = { workspace = true } | ||
| futures-util = "0.3.31" | ||
| kzg = { git = "https://github.com/sigp/lighthouse", rev = "22faccb" } | ||
| lighthouse_network = { workspace = true } | ||
| logging = { git = "https://github.com/sigp/lighthouse", rev = "22faccb" } | ||
| network = { workspace = true } | ||
| node_test_rig = { git = "https://github.com/sigp/lighthouse", rev = "22faccb" } | ||
Zacholme7 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| parking_lot = { workspace = true } | ||
| sensitive_url = { workspace = true } | ||
| serde_json = { workspace = true } | ||
| ssv_network_config = { workspace = true } | ||
| task_executor = { workspace = true } | ||
| tokio = { workspace = true } | ||
| tokio-tungstenite = "0.26.2" | ||
| tracing = { workspace = true } | ||
| tracing-subscriber = { workspace = true } | ||
| types = { workspace = true } | ||
| warp = "0.3.7" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| -----BEGIN RSA PRIVATE KEY----- | ||
| MIIEpAIBAAKCAQEAhUFm5HcFcxYvJHiFS6QNFQFf4xWhvv3v+p14rgN9rIAwb4nE | ||
| nFsqcH8hzCAEFqOV8pzYRPQuE4CBAzyUI3QHuu3VT9B5U3NKZagXiNQKjlucLbq1 | ||
| I5vQFz3wt5gnsxqOj5+6vkywTKk5IbroMTHNSxsOt+96G7u0gYmmAYfp4F9BGN6Q | ||
| 0QLGkRiwgsoBLlcSoI4wJCbpE2k2iMu9nDD4DiJ3wyaLIUnOh0sl2hGGXgtUWL+m | ||
| q0vZO2bNM4/4dlClix8Fr1EBi03FxzqCR75tbR1o+LLRW9lIPLOQkZ/1ba2dbU2b | ||
| +5kZbW50W0GMSlo2ShEpHkWv1gskLq4x7jUNiQIDAQABAoIBAAJeML0iFVAf0TYk | ||
| HcrujxyeseIX6LrQtI0+852fVRd15AZzYQbzQsbi0h+tuPeLBXeHzHsLM29oHZgd | ||
| toyGZmXEDgHqqeFEVPUx/mW8I4o3PAhUVJ2ISl4Ysm3yGlB/NLsozY7N+jsJLclO | ||
| PYve6e+Upey5qMaUjbxYjRaNYFKlmsgsIRzv0Qf6voTyvRrLfgOSgc0ayCuE3RP8 | ||
| B/uWbAad3gCHLyLGFueP3SQLWtGZH1WZKU9dfk51kl2ZFO+shL/ll5ws/U/kzbON | ||
| YouE5r9JxJ2zXqnPDxw0czNSgF/GSGNB5yVXsIUPhdakRmjqxt1n0+vcxa+GOir8 | ||
| UUbRAQECgYEAuQnT3HXDwoUO8ge9Ry++1YxEgBnxSHkW0WM5dGpS8rgt6kkmONfk | ||
| fTSPAR0ZCS9Am9UHkjRLWXB9fRqoNgjDDHDtO+VJsgYsEz4y7Jjs/dhJz1QGD1zj | ||
| CSHzJIlgCzdteV5mg1/Qq71szciknrH0QHTZcBqAMw7Pvlyo9n09CoECgYEAuFvH | ||
| ZRP8EapzQiqJ2Rwxu+uPtc3QTX/OxjHNbMxLUf1owcfG6X8JnPHrAy5AtkX6RZwH | ||
| TximezkyXl3eD7+vP1xSd3+1BuUTkkDWB8El+MgF8SOR117030Jqh4X2Fckl7Ztl | ||
| Z5SL8/YoGtvJ2hShI90WwD7OSbuedUoQdW0iLwkCgYEAr56VNuOKtb9FzQ7tZXf6 | ||
| XoHvrclxiMBsmLTdHhGfwoBuC7P7k+3MDc1pgLwWO/JeFsjck7YQYcXzRF6dkhNE | ||
| 1DUF5FgdVtqm0GizOn12SQMUIrPzwHb/gHZ5Z47+2gZ0X8Hp9/xjd+ykLLenDnuF | ||
| f/unN8/fJxaCs4EMWE3LNoECgYADbpHzq7+RhJ7IqIoQZJn4aZYvSDmMd8idn+e3 | ||
| EsaELDd7BAEL77V6GnbJhF7oBb129kSckFTpDlOFtjGgEW1tvIY8e0AfdLw8iMBz | ||
| PIE8dFzH9GWOoNHmJhJdm3zNQwVVuwLUPsusKvTsKxNC4Adv53m48nJcpQV6IXrU | ||
| 9MciIQKBgQCFs5AT7Ebcyz55yAEskhFP6QN9TQTlJWxosadeaBXCupeAsTYfR5ch | ||
| shp0XqnV0hmVmAYmzqZCuw5idfxhB8YVxdES2lwAH4uMIObBSJe6lKNwF35sNUrl | ||
| wKBYDngF5SQlJAxUBV6inKsMRY+ry5qofUC9IuaxzgsW0+3GbkSuwQ== | ||
| -----END RSA PRIVATE KEY----- |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| �K& ]>��S&�.�Ƌ�-�47��05Ռk |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| -----BEGIN RSA PRIVATE KEY----- | ||
| MIIEowIBAAKCAQEAyZr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hd3ibJD3lVcYmj98T | ||
| GzysGHlzOGiY38sz24wTTMcyRqS1n53MdgeO2rkCgYAfgvxQWY8aC5PlWCa/Z7th | ||
| 2EsftMqVk7X7mlz2t7GHYCDOepNFbF84FL9ShfuCPrRYp8wh/DYDj8lAnJtQg/56 | ||
| Kt0Zrv/hNh4UEAiu2Ob7H1VrlpXu7UFFAFmjzvXhlvzy/73S6CHVREj9Z790PsgB | ||
| idkAcnpFt0SuVlTmKsrbFQKBgQC9LpLB/j5wa0Yzti9RaKD/WQa0dYaIMsQ8YNQ/ | ||
| Twss3HAUPJmzrFCrIqw8vwiEBke9NiY+5rPWqeI8CIdYLo1BzGs/x4luaPKUyVIq | ||
| oj7F3+V1SbrYpazy7VwKZpcTFCYI2Gkn1ION5tQAITVFxEo7yuTxv0J+R5XSaGGH | ||
| WuyesQKBgEqw+pAg8HchUqUEfRyTpwR3XY/3mxujnZCPcNiXaf61DgBPLsnqICRQ | ||
| 5xoQV5BnO9wV/hTfM32UT1g7mC/TEuLoKDPSlHfFW4JMpwfS1vTfHITQJxnVwT71 | ||
| qn1+dK5Zg0b0D6Vu2lPTu5rIcbkki44Pyd6k5y7HJpLiaWf8EAO2 | ||
| -----END RSA PRIVATE KEY----- |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ����G7p�h�����®�����53��g� |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| -----BEGIN RSA PRIVATE KEY----- | ||
| MIIEowIBAAKCAQEAieDAKjjoO40ifjHaO+eJKv8CVrNPagN+FKOPX3/RwDYxmMw8 | ||
| vjdlvlireS5zWPyFV7FeYL09HJfh0+KIf18aP7lEFf7TmmT1rORzJ+phqXksT46L | ||
| hk+k+OVpXJmu+Y92KONWyotnF1XooAPzQnjiWd9iRKTPiHLvVEyMyDYLsrUYxMYB | ||
| 1NadopONTYWzcV13lERlyT3yC9CxVVUVFoD9SSRqMz5xH+969yAqC5ruSmtfuZ5O | ||
| DmB01zRvMat9n49W0isCQkOrgwJo0To7U5hyI0PzH87DIAXB3T5AbpeEiV7MCObe | ||
| rbaUF0B+iZyNvOCahu9LPo09srAR3CeYMeFFKwIDAQABAoIBABURC5uH7Wfn9Ry+ | ||
| Bj+/7VPt+dAAfsJOfU2u/gGT+Jr7TNGxZxiTQ071omGWKNawYrlW5vo1/+fmBwHG | ||
| a5+2ir6w0off0zoUcfs0PqobJEfuNUiEmanwcl77QoF9E+CavG2b6s9wxFQq8qu8 | ||
| XsdJzB/6QzwEyJbrJMlHFv2iUGBCFPC155NTMs47FCvmCxHQTqLCWnFPz51EnGMQ | ||
| HelqRzi2VOdnBm+lvKtoEWKFT7Iy87EwebsHYRVcJnMlMNFMhwjyywxSgTy2OR2x | ||
| tYEDbvMAHu3ZjBh0sJGrU2Xt/JjPrL+Z24nGN9WWmw4unL00mGjMv4zIb3WqQW01 | ||
| MWxtjuECgYEAwjGyE2rrpx5y1W/VePiOCzCDoCj72gM6KsAoDJkNuJtOY3Zoq6BP | ||
| j0109prvRxe/Q9GbDMUfsn7Pff7KMCJmkQMLI4TCt8Oh5lEu2Hx5OUKDWPTLG8tu | ||
| UkFaV7yi5na8uximYGMK56eYDgeV9LwCNKf1AoErySlxH3c9f8hpWiECgYEAtcKY | ||
| ZD08MaahonskBzDy5ZTGbfhz3yyDt+TjlYv6uTg1N2iI3+c8t+baim/skjVaVzBl | ||
| qJvj/e6sz8bwYySkihn8ENHxJQ7PWnQ2TjQKlDmhBJKESavTlAFJIj/SRQH+6yID | ||
| LwkJler8xr7n23Ch63qagcNGHphcxEMgZ+efLcsCgYBc592kQJEBYSXbSye8Ol3q | ||
| qIkwhKsJQGYBsfD3JfpUiajVGP82rPmjO5FrsfAr+QZ+cbdWQrDJerXWN6GPqcWc | ||
| NvKLSabGuAeq4sggtlxgspuYYXUSlR7wp2eLdioRTFk6wa5HitravWmXvLVXYuND | ||
| Qd+MFTRXh0YhobCAg+czQQKBgG6XjKnRKIL9ZHO8gVtuyRwvvdzDw50TNMH7nw4r | ||
| Mc7pCFhCXqX9yNAMwwRgvYzosaNDa1eAIuUrCDMUVMe+T+9HiDujwhpOPJRJCZHj | ||
| 0FwIBJUHoT5CMmZnsdwJASPD5xuiglVoJlD1vgAfwGugyKTC4Kf77PpIsokoXttZ | ||
| 71ypAoGBAKn/JcxllgxFnSPi5/1w+wRyDbvku0bhgWXbneqe59umEKLdQ/hiHbfd | ||
| 6FyTvUmq6mp+B+0eNc6mtkG7soOTw7LvGtmh4t1ZfjmnToAWlv1+MLZXpuxQJbJ5 | ||
| gzZvNBY3CUwn72QVsbCh30IZutEv0WlO9afKzfKBc6tux8Rz+OnD | ||
| -----END RSA PRIVATE KEY----- |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| �b+��?�?j������x��+ތĻR۰~�HXH |
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.
Why is this necessary?