-
Notifications
You must be signed in to change notification settings - Fork 39
feat: Add FluidV1 #431
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
feat: Add FluidV1 #431
Conversation
src/evm/protocol/mod.rs
Outdated
| pub mod vm; | ||
|
|
||
| mod cpmm; | ||
| pub mod fluid; |
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.
sorry but OCD asks to put this on like 9 below uniswapV4 😅
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.
Moved it there, but it sorts it automatically to line 3
| .or_insert_with(HashSet::new) | ||
| .insert(id.clone()); | ||
| } | ||
| // Add DCI contracts so changes to these contracts trigger |
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.
oof good catch!
dianacarvalho1
left a comment
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.
Thank you @kayibal ! Gave it a quick review and it looks good! ✨
One question just for my understanding though.. Fluid is a native integration where we use the vm state to update the state right? 😵💫 I find this a bit strange.. What motivated this decision? It was too hard to track everything in substreams? (No need to give super detailed answers, just trying to understand the high level)
|
@dianacarvalho1 Yes it is very hard if not impossible to track all values required by Fluid pools with a subtreams.
Both of the above are resolved by doing a call against our local VM at decoding/delta transition time. This shouldn't take longer than 1-2ms and just happens once per block and only if there is an update to any of the underlying contracts. |
3f3e5c5 to
4070bcc
Compare
a436805 to
6192ba7
Compare
@kayibal Thank you for this answer! 🙏🏼 Are we "advertising" this way of integrating to external integrators? |
@dianacarvalho1 I think it is a valid approach but it is the first time we try it. So I would say yes but only after we observe how this integration goes. |
Most of this implementation of taken from the Kyberswap reference implementation.
This function is custom since it calls the VM to rebuild the full state, then update the internal state from that. To enable this to work correctly and catch all state changes, we need to call this method also if a DCI indexed contract had a change. Therefore the contracts_map in the Decoder was changed accordingly as well.
Updates tycho-execution locked version to include fluid encoder.
7dd954c to
d68858c
Compare
|
This PR is included in version 0.198.0 🎉 |
No description provided.