Skip to content

feat(STF): implement Gloas Fork - #462

Open
guha-rahul wants to merge 35 commits into
ChainSafe:mainfrom
guha-rahul:gloas
Open

feat(STF): implement Gloas Fork #462
guha-rahul wants to merge 35 commits into
ChainSafe:mainfrom
guha-rahul:gloas

Conversation

@guha-rahul

@guha-rahul guha-rahul commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

This pr implements

@guha-rahul
guha-rahul requested a review from a team as a code owner July 2, 2026 10:09
@guha-rahul
guha-rahul marked this pull request as draft July 5, 2026 10:35

@spiral-ladder spiral-ladder left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

first pass, mostly on utils/gloas.zig

Comment thread src/constants/root.zig Outdated
Comment thread src/state_transition/utils/gloas.zig
Comment thread src/state_transition/utils/gloas.zig Outdated
Comment thread src/state_transition/utils/gloas.zig Outdated
}

pub fn canBuilderCoverBid(allocator: Allocator, state: *BeaconState(.gloas), builder_index: u64, bid_amount: u64) !bool {
var builders = try state.inner.get("builders");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
var builders = try state.inner.get("builders");
var builders = try state.inner.getReadonly("builders");

Comment thread src/state_transition/utils/gloas.zig Outdated
Comment thread src/state_transition/utils/pending_deposits_lookup.zig Outdated
Comment thread src/state_transition/utils/pending_deposits_lookup.zig
Comment thread src/state_transition/cache/epoch_cache.zig Outdated
var data: PtcWindowEpochCacheData = undefined;

for (0..preset.SLOTS_PER_EPOCH) |i| {
try ptc_window.getValue(undefined, i, &data.previous[i]);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

out of scope of this PR, but would be nice if we had getReadonlyByRange for this usecase

Comment thread src/state_transition/cache/epoch_cache.zig Outdated
@spiral-ladder

Copy link
Copy Markdown
Member

One overarching thought that is out of scope of this PR is that I still kinda dislike the whole dumping of everything into utils/gloas.zig. We should probably separate the functions meaningfully by name. With that said that's not required here, in fact the current form makes it easier to review, but I'd like to have a followup PR to rearrange stuff eventually

@spiral-ladder

Copy link
Copy Markdown
Member

#464 might've broken nextValue for this PR - refactored it to make use of some comptime facts to be more explicit, see PR for details

@GrapeBaBa

Copy link
Copy Markdown
Contributor

I suggest to add some OOM/Double free fault injection test using the test_allocators and also run process_epoch/process_block bench before and after this change to see if any regression

@guha-rahul
guha-rahul marked this pull request as ready for review August 11, 2026 13:55
@guha-rahul

Copy link
Copy Markdown
Contributor Author

I suggest to add some OOM/Double free fault injection test using the test_allocators and also run process_epoch/process_block bench before and after this change to see if any regression

I did the benchmarking and found near to no regresssions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready

Development

Successfully merging this pull request may close these issues.

5 participants