Get the Monday email →
Loading player…

EIP-7805 (FOCIL) Implementation in Erigon

DevconThu, Nov 5, 2026, 12:00 AM

Speaker

Sagar Rana

Transcript

[music]

Thanks so much for being here today, man. And the stage is yours. So, hello everyone. So, this Erigon info fossil in Erigon is basically my second project in Erigon because the first one, which was SSZ query language, was declined for inclusion from the next fork. So, I took this up during early October under my mentor, Milan.

And so, let's start. So, till now, there are four PRs in Erigon. The first one was for implementing the fork Hegota fork time utils. Like, for example, we have some block timestamp checks for checking whether the current fork is the current timestamp is from Hegota or not. And that is already merged.

The second one was of for implementing the first engine API method, which is basically the get inclusion list V1 for building an inclusion list below 8 kilobytes. And the third PR was for the new payload V6. Now, this is a very huge PR, and it has 33 files, which is currently under review, but it has been approved with some knit suggestions, which I will be fixing. And then, there's a fourth draft PR for the fork choice of beta V5, which is just still in draft, and I'm waiting on the new payload V6 because some of the work depends on that. So, yeah.

So, the three engine API methods. The first one, the engine get inclusion list V1, builds an inclusion list from the public mempool. And the size of this list is capped at 8 kilobytes, and this has already been merged to main and is part of Erigon 3.8.0.

And what the engine new payload V6 does is it takes a new parameter the inclusion list transactions and checks the block for the whether those inclusion list transactions are validly included or not and simply just uh returns a flag in the payload status which is returned whether the block satisfied that that inclusion list or not. And as for the payload for sorry for choice updated V5, it starts a payload builds with the IL transactions and it would also close another issue which is basically to increase the limit for increasing the IL inclusion list cache. And yeah, one more thing I mentioned that the fork choice updated V5 depends on the new payload. That's because the fork choice updated V5 needs a type of payload status the new basically um the new field in the payload status which is the inclusion list. So that is something that we need in the fork choice.

So I'm waiting for it to be for the new payload to be merged first. Yeah, and apart from that I have also implemented the rest SSG compatibility for every every method that is that I have implemented it for fossil. So that includes the inclusion list which basically returns an SSG list of transactions and this is also mentioned in the exchange capability so that engines like uh layers can uh see that this is available and use this. And as for the payload V6 also I have an introduced a new SSG codec so that the inclusion list satisfied is included in the SSG specs. And as for the fork choice V5, it is still in draft and have not built the SSG equivalent for that yet.

Yeah, so how does get inclusion list V1 actually work? So it basically reuses the the transaction pools provide TXNs parameters which is in present in the Erigon client itself and it is in the block builder path actually. And so, what it does is basically uses 8192 bytes of RLP space and there's no gas cap and it just takes the transactions and skips block transactions and any transactions like oversized transaction that go over the 8 kilobyte limits and just returns that simply. And empty ILs are basically never null, but it's just an empty array. And as you can see encode and the type that we return for the traditional engine API V1 method is basically hex util.

bytes. And as for the rest of the CC, it's just an SSZ encoded array. Yeah. So, how do are we actually checking that check in clue inclusion list in the new payload function? So, what happens is we are not really checking whether the in a transactions could have include been included in a time before the while during the block building.

What the check does is it basically tries to append the transactions which are not there at the end of the block. But, if it if it is possible to append that, then that it just returns with a value of false in the inclusion list satisfied. If not, then for every transaction in the inclusion list, it will return true. So, yeah. If what are [snorts] the checks that actually happen in the inclusion list?

So, if a transaction in the inclusion list is already in the block, we just skip that transaction. If the transaction has not been included in the block, but it does not have enough glo gas to append to the block, it just skips that transaction too. And if it's a block transaction, then it then also it is excluded. And it also does a pre a pre-checks on the transaction like the nonce and the balance checks. If those balance checks failed, then the transaction was invalid anyways, so it is skipped.

And if all these checks pass and the it is deemed that the transaction could have been safely included in the block, but it has been skipped. So, it is like the flag is set to false for the inclusion list satisfied and it is returned. And yeah, how the work landed. So, I mentioned that this project started in early October, right? So, from October 7th to 8th the four key details for a block Herota and the inclusion list V1 engine API method were merged.

From October 17th to 22nd the new payload V6 was uh the PR was opened and reviews were being made from Alex, Domiway, and Copilot. And there were a lot of reviews and it is still like not approved by everyone. It is just approved by one maintainer right now. And right now what I'm working on is basically the fork choice updated. I'm going through the specs and writing the tests.

Yeah, so challenges and how we solved them. So, the first challenge was how the IL is not part of the block, right? So, how are we storing it? Because if we wanted to store it in a database, it would change the format and like when with a release of a new version, like every node would need to need to update it. So, after speaking with my mentor, with the solution I came up with is that the inclusion list is for a block is stored in a cache.

And as for the a block can have multiple inclusion lists, right? So, what happens is for a inclusion list that we are receiving, we are hashing that and storing that as a key value pair for that hash. So, for a block, we can have multiple inclusion list with each of them key keyed by its hash. And yeah. The checks on on list whether the it could have been included in a block or not is checked on both the serial and parallel execution paths, which is present in Erigon.

Like, for a parallel paths, it tries to basically use uh executes uh transactions in parallel for building the block, and on serial, it does not use parallel execution. And yeah, so there was a bug here initially that all the inclusion list satisfied uh flags were revert defaulting to true for blocks that are already known. So, this was something that me my mentor and I had decided to for first go with, but then later after reviews, it was decided that we would just re- recheck the inclusion list for every block, whether it was known or not known. So, let's see what the path is. So, for example, if the current block it's a new block that we are receiving on a new payload, so we are just going through the normal process of checking the inclusion list, and just return the do the checks and return what it is actually.

And if we are receiving a block that is canonical and has been already received before, then we check whether the inclusion list that we received with it is in the memory. So, if it is in the memory, then we can just simply return the uh result that we did that earlier when we had a received that inclusion list. If the inclusion list is not in the block, then we just read the history of the state the post block, and check it recheck the inclusion list with that state to check if that inclusion list is satisfied or not. And if it is still undecided, then we just return sinking. Yeah.

So, another bug that was uncovered during the reviews was that, for example, if a inclusion list is sent in the new payload V6. So, one invalid and undecodable transaction means that the entire call fails with an error, and that was something that completely missed my review. So, I fixed that by just when one transaction fails to decode, what we're doing is we just skip it instead of returning with an error. And yeah, blobs are also skipped and now that the as for the logs are missing line TX move from uh deep warning to debugs. So, like printing in the terminal.

Yeah. So, rechecking a block we have already executed. So, as we know that the header only keeps the maximum of execution and the state gas, right? So, we can have actually three splits for a gas. So, first of all is that suppose we have the header has kept the gas G, let's suppose.

So, the combination can be either both the execution and state gas is G, and the second split is the execution gas is G and the state gas is zero, and the third is that execution gas is zero and the state gas is G. So, in either way, the limit for the gas for each of these dimensions is that gas limit minus G. So, for when the execution, for example, suppose the execution is zero, we are the gas limit is just GL and the gas limit for the state is uh gas gas limit minus the gas that we have stored. Yeah. So, when a transaction is there, for checking these transactions, the transaction has to agree on both the dimensions.

For example, when the execution and state gas both are at, let's suppose, G. So, the gas limit minus a G, the amount of tran- gas that is left, the transaction has to be part of that gas. If that is let the transaction does not fit fit into either one, then we return false as because the inclusion list is invalid. Yeah. So, how were the reviews actually undertaken?

So, when we uncovered some bugs in the PR reviews, so what the Midway did was uh we just I added a test for each of the bugs that we uncovered specifically for that bug. And after that, while testing, he just used to revert the commit and use the new test that I have introduced with both the new commit and without that commit and check if that uh test was returning false earlier in the earlier commit and returns true in the current commit. So, that's how And he also checked the test manually. So, yeah, that's how we verified that the bugs that we were uncovering was fixed. Yeah.

So, the learnings. So, first of all is that one of the bugs that I mentioned was that for quick status return, like for blocks that we have already known, the inclusion list satisfied was defaulting to true. So, actually our the spec does not leave any room for short shortcuts. So, the specs is that all blocks need to be checked for So, we are just checking each and every block whether it is known or not known. And yeah, the inclusion list content should should be treated as hostile input because any client can just send them and even if it is a malicious client, it can send it.

So, we are not sure what we are just treating the IL contents as hostile input and checking the validity of that before actually checking if the it could have been included in the block or not. And as for the implementation itself, the work landed so quickly and on further due to two engineer PM methods because we uh like Nethermind is currently the most developed client in terms of fossil. So, I went through Nethermind's code to see how they have implemented stuff and what they're doing different. So, that helped a lot. And yeah.

So, what's next? So, the next immediate task is to get new payload V6 merged. And it is I think it is really close to merging like now. And after that comes a finish finish the four choice updated V5 PR. And then the next task is testing.

So, run uh fossil devnets against the other fossil ready clients and the hive hive suites. And then I will just document the new engine API method that I have implemented in the Erigon's documentation website. So, thank you uh thank you to Mario for conducting the fellowship and GG to all the fellows. And yeah, huge thank you to Erigon team too for reviewing the PRs and being patient.

Thank you so much, Sagar. I appreciate all the work all the projects, but especially this one. And thanks for being here. Yeah, do we have any thoughts, questions for Sagar? Anyone?

Anything? Yeah, Pavel, go ahead.

Yeah, um I have question if you have any feedback to the spec itself after all the work you've done. Um and yeah, do you think like the spec is like what is the quality of the spec and if you would change anything there? Uh from your implementation learnings.

Um as for the spec, I would like I think it's pretty good right now, but if anything changes, I would just make a PR later on and if it is anything I would like to change, no, I don't think so. Like if that was your original question.

Yeah, yeah, because so like my My kind of question was that I think the the people who write this back also look for some feedback from the implementers about yeah, how easy it was to understand it and how Like resilient is in in the implementation later.

Okay, so The bug as I said The first bug that we caught initially that The div Inclusion list satisfied was defaulting to true for known blocks. So I think that was something Uh It was more about reading between the lines rather than explicit explicit specs. And yeah, one more thing actually it's a good question because On the get inclusion list V1, we are specifying that we cannot include block transactions. But on the new payload V6 where we are Checking the inclusion list, it is nowhere mentioned that mentioned that we don't we can't include the block transactions in the Block. So yeah, I think that would have it would have been good to include that in the spec as well.

I have got a Question which is You what you've implemented is spec. Have you thought about the RPC interface at all? Cuz I'm assuming one of the advantages of having this in Aragon is going to be if you've if you've included stuff You can do things like run a query to find out What the what the inclusion performance was.

Uh no, I haven't really checked the performance because I wasn't going to do that after implementing the three engine API methods.

Yeah, yeah, no, I'm more thinking the decision to not put stuff in the database Is going to mean that we're going to lose a history. So It's going to make it Difficult To implement RPCs that effectively monitor the IL performance.

Uh like the power decision to not include it in the database was from a power performance perspective because if we just change the database structure, what happened is in a new version like the database people would need the clients would need to change their databases too.

Yeah, yeah, but that's the tricky thing about writing a client though, right? It's I am if you just implement the machine spec, you make one set of decisions. Once you start thinking about the RPC requirements, you get a whole additional set of constraints that quite often compete.

Yeah, so I am haven't really thought about it this way, so that is something I would have to look into.

Okay, thank you.

[music]

Automatic transcript — names and jargon may be misspelled.