|
| 1 | +# 1/4 - Remove Optimism package. |
| 2 | + |
| 3 | +- This is part of a series of 4 Pull Requests that all aim to refactor our old |
| 4 | + chainsync mechanism. The reason to split this up is to provide more digestible |
| 5 | + and grouped parts of the refactoring effort. I am aware this is a big change, |
| 6 | + but especially for refactoring an integral part of the system, and designing |
| 7 | + it at the same time, at least for me it is impossible to provide smaller |
| 8 | + increments of work that don't leave the code in an uncompilable, |
| 9 | + non-functional state. \* |
| 10 | + |
| 11 | +We currently don't use the optimism package and for the following PRs I did not |
| 12 | +have the time to adapt the new chainsync mechanism and sync-handlers to the |
| 13 | +optimism package. If this package is chosen to continue working on, it can be |
| 14 | +re-integratated and the old state of the package can be retrieved from the git |
| 15 | +history and then adapted to the changes. Inspiration on how to integrate the new |
| 16 | +chainsync mechanism can be taken from the follow up PRs. |
| 17 | + |
| 18 | +# 2/4 - Add new chainsync package |
| 19 | + |
| 20 | +- This is part of a series of 4 Pull Requests that all aim to refactor our old |
| 21 | + chainsync mechanism. The reason to split this up is to provide more digestible |
| 22 | + and grouped parts of the refactoring effort. I am aware this is a big change, |
| 23 | + but especially for refactoring an integral part of the system, and designing |
| 24 | + it at the same time, at least for me it is impossible to provide smaller |
| 25 | + increments of work that don't leave the code in an uncompilable, |
| 26 | + non-functional state. \* |
| 27 | + |
| 28 | +This adds a new `chainsync` package that receives new latest-block updates from |
| 29 | +an Ethereum JSON RPC server and backtracks a locally cached chain-segment of |
| 30 | +previous blocks in comparison with the updated header information. It does this |
| 31 | +in order to recognize reorgs and being able to invalidate all chain-state that |
| 32 | +was inserted for a reorged-away chain-segment. The information of the difference |
| 33 | +of old chain and new chain in case of reorgs is omitted by Ethereum JSON RPC |
| 34 | +servers, since it is possible that only the new latest header is received by the |
| 35 | +client, and intermediary sections of the new reorg chain are not passively |
| 36 | +received. Therefore the client itself has to keep track of the most recent chain |
| 37 | +and what gaps between the last common block of a potential new chain segment and |
| 38 | +it's old chain-state's segment have to be filled. |
| 39 | + |
| 40 | +In addition to this active syncing mechanism, the `chainsync` package provides |
| 41 | +an easy way to register handler implementations that retrieve specific |
| 42 | +contract-event updates for the newly received chain-segments and the context of |
| 43 | +newly "reorged away" chain-segments are available in the same handler. That way, |
| 44 | +each handler can define behavior on how to remove old state-updates due to newly |
| 45 | +removed events and how to insert new state updates due to newly emitted events. |
| 46 | + |
| 47 | +There is also the possibility to define and execute "chain-update" handler. |
| 48 | +Those will not only receive updates for when the newly synced to chain-segment |
| 49 | +contains a certain contract event, but they will be executed for every new chain |
| 50 | +update and will provide the same chain-update context as the contract-event |
| 51 | +handler. |
| 52 | + |
| 53 | +# 3/4 - Implement event-handler |
| 54 | + |
| 55 | +- This is part of a series of 4 Pull Requests that all aim to refactor our old |
| 56 | + chainsync mechanism. The reason to split this up is to provide more digestible |
| 57 | + and grouped parts of the refactoring effort. I am aware this is a big change, |
| 58 | + but especially for refactoring an integral part of the system, and designing |
| 59 | + it at the same time, at least for me it is impossible to provide smaller |
| 60 | + increments of work that don't leave the code in an uncompilable, |
| 61 | + non-functional state. \* |
| 62 | + |
| 63 | +This will re-implement the event handling logic of the keyper and |
| 64 | +keyperimpl/gnosis packages for the new chainsync mechanism. |
| 65 | + |
| 66 | +# 4/4 - Integrate the new chainsync handlers in the keyper packages |
| 67 | + |
| 68 | +- This is part of a series of 4 Pull Requests that all aim to refactor our old |
| 69 | + chainsync mechanism. The reason to split this up is to provide more digestible |
| 70 | + and grouped parts of the refactoring effort. I am aware this is a big change, |
| 71 | + but especially for refactoring an integral part of the system, and designing |
| 72 | + it at the same time, at least for me it is impossible to provide smaller |
| 73 | + increments of work that don't leave the code in an uncompilable, |
| 74 | + non-functional state. \* |
| 75 | + |
| 76 | +This will remove the old blockchain handling in the keyper and keyperimpl/gnosis |
| 77 | +packages and use the newly added re-implementation of this blockchain handling |
| 78 | +in the keyper packages. |
0 commit comments