Programming Leftovers
-
Trail of Bits ☛ When try, try, try again leads to out-of-order execution bugs
Have you ever wondered how a rollup and its base chain—the chain that the rollup commits state checkpoints to—communicate and interact? How can a user with funds only on the base chain interact with contracts on the rollup?
In Arbitrum Nitro, one way to call a method on a contract deployed on the rollup from the base chain is by using retryable transactions (a.k.a. retryable tickets). While this feature enables these interactions, it does not come without its pitfalls. During our reviews of Arbitrum and contracts integrating with it, we identified footguns in the use of retryable tickets that are not widely known and should be considered when creating such transactions. In this post, we’ll share how using retryable tickets may allow unexpected race conditions and result in out-of-order execution bugs. What’s more, we’ve created a new Slither detector for this issue. Now you’ll be able to not only recognize these footguns in your code, but test for them too.
-
Rlang ☛ Filtering Rows in R Where Column Value is Between Two Values
Filtering data frames in R is a common task in data analysis. Often we want to subset a data frame to only keep rows that meet certain criteria. A useful filtering technique is keeping rows where a column value falls between two specified values.
In this post, we’ll walk through how to filter rows in R where a column value is between two values using base R syntax.
-
HaikuOS ☛ So you want to help with WebKit?
The Web moves fast these days. So we have to stay very up to date with upstream WebKit. Until we have a nice and shiny WebKit2 browser, and, anyways, even after that, we need to keep things up to date.
Currently I take care of this myself. The reason is, it involves merging changes from upstream with our branch, and that’s pretty much impossible to review as a Github pull request (it would show everything that’s changed in the upstream WebKit code, which is usually a lot).
Anyways, here’s how I do it:
-
Rachel ☛ Today's only half of the leap year fun
It's that time again, when code written in the past four years shows up in our lives and breaks something. Still, while you're enjoying the clown show of game companies telling people to manually set the clocks on their consoles and people not being able to fill up their cars, keep one thing in mind:
Only half of the fun of a leap year happens on February 29th.
-
Yoshua Wuyts ☛ Designing an Async Runtime for WASI 0.2
In 2019 Stjepan Glavina and I developed the async-std runtime. That was an off-shoot from the runtime project, which itself was an attempt to make it easier to abstract over different async runtimes. One of the things I'm most proud of in the work I did on async-std is the core IO abstraction which Stjepan later factored out into the polling and async-io libraries as part of the smol project, where he took them beyond my initial prototype code into robust building blocks which can work on their own.
Anyway, that little stroll down memory lane serves a purpose: I just finished building Yet Another Async runtime. Not to tell people to actually go and use this - but intended to be more like a working, minimal, but also correct implementation of an async runtime for WASI 0.2. The purpose of this post is to detail how I built it, so you can build your own (if you want to). I'm one of the first to write this code, and maybe even the first to write a dedicated runtime, which means that if Smol, Monoio, Glommio, or Tokio want to add support for WASI 0.2 they're going to have to implement what I already implemented. So I figured I might save folks some trouble, and document the work I just finished doing.
-
Caleb Hearth ☛ Drawing a Hex Grid in SwiftUI
Last time we put together a custom Hexagon Shape in SwiftUI. Now let’s see what it would take to make a grid filling the screen with these hexagons. This is useful for building a honeycomb or hexagonal tessellation pattern that’s visually interesting and useful for things like showing grids of photos or for overlaying on a TTRPG map.
The shape we built is a regular hexagon and has a flat top, meaning that the shape takes up less height than width. This informs the layout, but you can shift things around for a “pointy-topped” hexagon shape grid as well.
-
Rlang ☛ Knowing Something vs. Knowing the Name of Something: Some Points about Causal Analysis
The post is aimed at developing insight beyond “the name of something” in causal analysis (CA), a data science topic that is not new but has become much more prominent in recent years. As you will see, I am something of a skeptic on CA, and hope to dispel some common misunderstandings regarding it. Make no mistake–I do believe CA is a useful tool–but I hope here to demystify some of the ideas, and bring it down to Earth in terms of the extent of its value.
We will begin by dispelling a common myth about regression analysis (not solely about causal analysis, just ordinary stat, but strongly related). This is such a common myth that some readers will have trouble fully accepting it. How is that for a tantalizing lure?